diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-11-06 20:17:22 -0500 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-11-06 20:18:45 -0500 |
commit | c3d06d21df64aaab5dafcc367f40b12ade0e1dc3 (patch) | |
tree | d27a4ec785ef0d1732ec45d34b12567797745616 | |
parent | 10abb34e54a3a54545e4563b5c8614a61837a146 (diff) | |
download | rockbox-c3d06d21df.tar.gz rockbox-c3d06d21df.zip |
mikmod: Properly render with fonts larger than 6x8 pixels.
Change-Id: Ib3f8c2cf84e7b6565bb8a00b74e8a662b9980824
-rw-r--r-- | apps/plugins/mikmod/mikmod.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/apps/plugins/mikmod/mikmod.c b/apps/plugins/mikmod/mikmod.c index e689e0c6bc..86911de64e 100644 --- a/apps/plugins/mikmod/mikmod.c +++ b/apps/plugins/mikmod/mikmod.c @@ -36,6 +36,8 @@ static struct event_queue thread_q SHAREDBSS_ATTR; unsigned long thread_stack[THREAD_STACK_SIZE/sizeof(long)]; #endif +static int font_h, font_w; + /* the current full file name */ static char np_file[MAX_PATH]; static int curfile = 0, direction = DIR_NEXT, entries = 0; @@ -304,31 +306,31 @@ static void showinfo(void) sprintf(statustext, "Name: %s", module->songname); rb->lcd_putsxy(1, 1, statustext); sprintf(statustext, "Type: %s", module->modtype); - rb->lcd_putsxy(1, 11, statustext); + rb->lcd_putsxy(1, 1 + 1 * font_h, statustext); sprintf(statustext, "Samples: %d", module->numsmp); - rb->lcd_putsxy(1, 21, statustext); + rb->lcd_putsxy(1, 1 + 2 * font_h, statustext); if ( module->flags & UF_INST ) { sprintf(statustext, "Instruments: %d", module->numins); - rb->lcd_putsxy(1, 31, statustext); + rb->lcd_putsxy(1, 1 + 3 * font_h, statustext); } sprintf(statustext, "pat: %03d/%03d %2.2X", module->sngpos, module->numpos - 1, module->patpos); - rb->lcd_putsxy(1, 51, statustext); + rb->lcd_putsxy(1, 1 + 5 * font_h, statustext); sprintf(statustext, "spd: %d/%d", module->sngspd, module->bpm); - rb->lcd_putsxy(1, 61, statustext); + rb->lcd_putsxy(1, 1 + 6 * font_h, statustext); sprintf(statustext, "vol: %ddB", rb->global_settings->volume); - rb->lcd_putsxy(1, 71, statustext); + rb->lcd_putsxy(1, 1 + 7 * font_h, statustext); sprintf(statustext, "time: %d:%02d", (playingtime / 60) % 60, playingtime % 60); - rb->lcd_putsxy(1, 81, statustext); + rb->lcd_putsxy(1, 1 + 8 * font_h, statustext); if (module->flags & UF_NNA) { @@ -342,7 +344,7 @@ static void showinfo(void) sprintf(statustext, "chn: %d/%d", module->realchn, module->numchn); } - rb->lcd_putsxy(0, 91, statustext); + rb->lcd_putsxy(0, 1 + 9 * font_h, statustext); rb->lcd_update(); } @@ -360,7 +362,7 @@ static void showsamples(void) for( i=0; i<MAX_LINES && i+vscroll<module->numsmp; i++ ) { sprintf(statustext, "%02d %s", i+vscroll+1, module->samples[i+vscroll].samplename); - rb->lcd_putsxy(1, 1+(8*i), statustext); + rb->lcd_putsxy(1, 1+(font_h*i), statustext); } rb->lcd_update(); screenupdated = true; @@ -379,7 +381,7 @@ static void showinstruments(void) for( i=0; i<MAX_LINES && i+vscroll<module->numins; i++ ) { sprintf(statustext, "%02d %s", i+vscroll+1, module->instruments[i+vscroll].insname ? module->instruments[i+vscroll].insname : "[n/a]"); - rb->lcd_putsxy(1, 1+(8*i), statustext); + rb->lcd_putsxy(1, 1+(font_h*i), statustext); } rb->lcd_update(); screenupdated = true; @@ -406,7 +408,7 @@ static void showcomments(void) if(module->comment[i] == '\n' || j>LINE_LENGTH-1) { - rb->lcd_putsxy(1-(6*hscroll), 1+(8*k)-(8*vscroll), statustext); + rb->lcd_putsxy(1-(font_w*hscroll), 1+(font_h*k)-(font_h*vscroll), statustext); for( l=0; l<LINE_LENGTH; l++ ) { statustext[l] = 0; @@ -417,7 +419,7 @@ static void showcomments(void) } if (j>0) { - rb->lcd_putsxy(1-(6*hscroll), 1+(8*k)-(8*vscroll), statustext); + rb->lcd_putsxy(1-(font_w*hscroll), 1+(font_h*k)-(font_h*vscroll), statustext); } rb->lcd_update(); @@ -940,6 +942,8 @@ enum plugin_status plugin_start(const void* parameter) return PLUGIN_OK; } + rb->lcd_getstringsize("A", NULL, &font_h); + rb->talk_force_shutup(); rb->pcm_play_stop(); #if INPUT_SRC_CAPS != 0 |