diff options
author | William Wilgus <wilgus.william@gmail.com> | 2023-10-05 22:07:03 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2023-10-05 22:07:03 -0400 |
commit | f671c3339e753bf2a03099b749772129580ba81d (patch) | |
tree | ffd202cece2e53ccb22671815e72431f34bd4914 /apps/plugins/tagcache | |
parent | 1ed640da24eb97255328c4498035ba524f6265fc (diff) | |
download | rockbox-f671c3339e753bf2a03099b749772129580ba81d.tar.gz rockbox-f671c3339e753bf2a03099b749772129580ba81d.zip |
[FixRed] db_commit plugin
Fix Hosted and Touchscreen targets
Change-Id: I3c7ef3ca6ebc0703e0455f3405b683dff1384864
Diffstat (limited to 'apps/plugins/tagcache')
-rw-r--r-- | apps/plugins/tagcache/tagcache.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/apps/plugins/tagcache/tagcache.c b/apps/plugins/tagcache/tagcache.c index 25ba9bc301..f86c10d3dd 100644 --- a/apps/plugins/tagcache/tagcache.c +++ b/apps/plugins/tagcache/tagcache.c | |||
@@ -62,7 +62,8 @@ static void _log(const char *fmt, ...); | |||
62 | #define crc_32(x,y,z) rb->crc_32(x,y,z) | 62 | #define crc_32(x,y,z) rb->crc_32(x,y,z) |
63 | 63 | ||
64 | 64 | ||
65 | #ifndef SIMULATOR | 65 | #if !defined(SIMULATOR) && !defined(APPLICATION) |
66 | |||
66 | #define errno (*rb->__errno()) | 67 | #define errno (*rb->__errno()) |
67 | #endif | 68 | #endif |
68 | #define ENOENT 2 /* No such file or directory */ | 69 | #define ENOENT 2 /* No such file or directory */ |
@@ -160,6 +161,7 @@ bool user_check_tag(int index_type, char* build_idx_buf) | |||
160 | 161 | ||
161 | static bool logdump(bool append); | 162 | static bool logdump(bool append); |
162 | static unsigned char logbuffer[MAX_LOG_SIZE + 1]; | 163 | static unsigned char logbuffer[MAX_LOG_SIZE + 1]; |
164 | static int log_font_h = -1; | ||
163 | static int logindex; | 165 | static int logindex; |
164 | static bool logwrap; | 166 | static bool logwrap; |
165 | static bool logenabled = true; | 167 | static bool logenabled = true; |
@@ -269,7 +271,6 @@ static bool logdisplay(void) | |||
269 | 271 | ||
270 | int w, h, i, index; | 272 | int w, h, i, index; |
271 | int fontnr; | 273 | int fontnr; |
272 | static int delta_y = -1; | ||
273 | int cur_x, cur_y, delta_x; | 274 | int cur_x, cur_y, delta_x; |
274 | struct font* font; | 275 | struct font* font; |
275 | 276 | ||
@@ -281,11 +282,11 @@ static bool logdisplay(void) | |||
281 | w = LCD_WIDTH; | 282 | w = LCD_WIDTH; |
282 | h = LCD_HEIGHT; | 283 | h = LCD_HEIGHT; |
283 | 284 | ||
284 | if (delta_y < 0) /* init, get the horizontal size of each line */ | 285 | if (log_font_h < 0) /* init, get the horizontal size of each line */ |
285 | { | 286 | { |
286 | rb->font_getstringsize("A", NULL, &delta_y, fontnr); | 287 | rb->font_getstringsize("A", NULL, &log_font_h, fontnr); |
287 | /* start at the end of the log */ | 288 | /* start at the end of the log */ |
288 | gThread.user_index = compute_nb_lines(w, font) - h/delta_y -1; | 289 | gThread.user_index = compute_nb_lines(w, font) - h/log_font_h -1; |
289 | /* user_index will be number of the first line to display (warning: line!=log entry) */ | 290 | /* user_index will be number of the first line to display (warning: line!=log entry) */ |
290 | /* if negative, will be set 0 to zero later */ | 291 | /* if negative, will be set 0 to zero later */ |
291 | } | 292 | } |
@@ -315,7 +316,7 @@ static bool logdisplay(void) | |||
315 | { | 316 | { |
316 | /* should be display a newline ? */ | 317 | /* should be display a newline ? */ |
317 | if(index >= gThread.user_index) | 318 | if(index >= gThread.user_index) |
318 | cur_y += delta_y; | 319 | cur_y += log_font_h; |
319 | cur_x = 0; | 320 | cur_x = 0; |
320 | index++; | 321 | index++; |
321 | } | 322 | } |
@@ -328,7 +329,7 @@ static bool logdisplay(void) | |||
328 | { | 329 | { |
329 | /* should be display a newline ? */ | 330 | /* should be display a newline ? */ |
330 | if(index >= gThread.user_index) | 331 | if(index >= gThread.user_index) |
331 | cur_y += delta_y; | 332 | cur_y += log_font_h; |
332 | cur_x = 0; | 333 | cur_x = 0; |
333 | index++; | 334 | index++; |
334 | } | 335 | } |
@@ -345,7 +346,7 @@ static bool logdisplay(void) | |||
345 | } | 346 | } |
346 | i++; | 347 | i++; |
347 | /* did we fill the screen ? */ | 348 | /* did we fill the screen ? */ |
348 | if(cur_y > h - delta_y) | 349 | if(cur_y > h - log_font_h) |
349 | { | 350 | { |
350 | if (TIME_AFTER(current_tick, gThread.last_useraction_tick + HZ)) | 351 | if (TIME_AFTER(current_tick, gThread.last_useraction_tick + HZ)) |
351 | gThread.user_index++; | 352 | gThread.user_index++; |
@@ -551,7 +552,7 @@ static void thread(void) | |||
551 | else | 552 | else |
552 | { | 553 | { |
553 | if(prev_y != 0) | 554 | if(prev_y != 0) |
554 | gThread.user_index += (prev_y - y) / delta_y; | 555 | gThread.user_index += (prev_y - y) / log_font_h; |
555 | 556 | ||
556 | prev_y = y; | 557 | prev_y = y; |
557 | } | 558 | } |