1
0
Fork 0
forked from len0rd/rockbox

sysfont: Fix buffering debug screen, cube plugin, and vu_meter plugin

Instead of being hardcoded to expect 8px sysfont, make them scale properly

Change-Id: I02cc6cb53eebbd8241a142964bff305a1c5e535a
This commit is contained in:
Solomon Peachy 2025-03-04 13:39:23 -05:00
parent d5db4202ab
commit f3ce792af8
3 changed files with 20 additions and 20 deletions

View file

@ -430,7 +430,7 @@ static bool dbg_buffering_thread(void)
screens[i].putsf(0, line++, fmt_used, "pcm", (long) bufused, (long) bufsize); screens[i].putsf(0, line++, fmt_used, "pcm", (long) bufused, (long) bufsize);
gui_scrollbar_draw(&screens[i],0, line*8, screens[i].lcdwidth, 6, gui_scrollbar_draw(&screens[i],0, line*SYSFONT_HEIGHT, screens[i].lcdwidth, 6,
bufsize, 0, bufused, HORIZONTAL); bufsize, 0, bufused, HORIZONTAL);
line++; line++;
@ -440,14 +440,14 @@ static bool dbg_buffering_thread(void)
#if LCD_HEIGHT > 80 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_HEIGHT > 80) #if LCD_HEIGHT > 80 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_HEIGHT > 80)
if (screens[i].lcdheight > 80) if (screens[i].lcdheight > 80)
{ {
gui_scrollbar_draw(&screens[i],0, line*8, screens[i].lcdwidth, 6, gui_scrollbar_draw(&screens[i],0, line*SYSFONT_HEIGHT, screens[i].lcdwidth, 6,
filebuflen, 0, audio_filebufused(), HORIZONTAL); filebuflen, 0, audio_filebufused(), HORIZONTAL);
line++; line++;
screens[i].putsf(0, line++, fmt_used, "real", (long)d.buffered_data, screens[i].putsf(0, line++, fmt_used, "real", (long)d.buffered_data,
(long)filebuflen); (long)filebuflen);
gui_scrollbar_draw(&screens[i],0, line*8, screens[i].lcdwidth, 6, gui_scrollbar_draw(&screens[i],0, line*SYSFONT_HEIGHT, screens[i].lcdwidth, 6,
filebuflen, 0, (long)d.buffered_data, HORIZONTAL); filebuflen, 0, (long)d.buffered_data, HORIZONTAL);
line++; line++;
} }
@ -459,7 +459,7 @@ static bool dbg_buffering_thread(void)
#if LCD_HEIGHT > 80 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_HEIGHT > 80) #if LCD_HEIGHT > 80 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_HEIGHT > 80)
if (screens[i].lcdheight > 80) if (screens[i].lcdheight > 80)
{ {
gui_scrollbar_draw(&screens[i],0, line*8, screens[i].lcdwidth, 6, gui_scrollbar_draw(&screens[i],0, line*SYSFONT_HEIGHT, screens[i].lcdwidth, 6,
filebuflen, 0, d.useful_data, HORIZONTAL); filebuflen, 0, d.useful_data, HORIZONTAL);
line++; line++;
} }

View file

@ -797,7 +797,7 @@ enum plugin_status plugin_start(const void* parameter)
axes[curr].label, axes[curr].label,
paused ? axes[curr].angle : axes[curr].speed, paused ? axes[curr].angle : axes[curr].speed,
highspeed ? "(hs)" : ""); highspeed ? "(hs)" : "");
MYLCD(putsxy)(0, LCD_HEIGHT-8, buffer); MYLCD(putsxy)(0, LCD_HEIGHT-SYSFONT_HEIGHT, buffer);
if (t_disp == 0) if (t_disp == 0)
redraw = true; redraw = true;
} }

View file

@ -555,7 +555,7 @@ int screen_foreground;
#define MAX_PEAK 0x8000 #define MAX_PEAK 0x8000
/* gap at the top for left/right etc */ /* gap at the top for left/right etc */
#define NEEDLE_TOP 25 #define NEEDLE_TOP SYSFONT_HEIGHT*3+1
/* pow(M_E, 5) * 65536 */ /* pow(M_E, 5) * 65536 */
#define E_POW_5 9726404 #define E_POW_5 9726404
@ -740,28 +740,28 @@ static bool vu_meter_menu(void)
} }
static void draw_analog_minimeters(void) { static void draw_analog_minimeters(void) {
rb->lcd_mono_bitmap(sound_speaker, quarter_width-28, 12, 4, 8); rb->lcd_mono_bitmap(sound_speaker, quarter_width-28, SYSFONT_HEIGHT+4, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_set_drawmode(DRMODE_FG);
if(analog_mini_1<left_needle_top_x) if(analog_mini_1<left_needle_top_x)
rb->lcd_mono_bitmap(sound_low_level, quarter_width-23, 12, 2, 8); rb->lcd_mono_bitmap(sound_low_level, quarter_width-23, SYSFONT_HEIGHT+4, 2, 8);
if(analog_mini_2<left_needle_top_x) if(analog_mini_2<left_needle_top_x)
rb->lcd_mono_bitmap(sound_med_level, quarter_width-21, 12, 2, 8); rb->lcd_mono_bitmap(sound_med_level, quarter_width-21, SYSFONT_HEIGHT+4, 2, 8);
if(analog_mini_3<left_needle_top_x) if(analog_mini_3<left_needle_top_x)
rb->lcd_mono_bitmap(sound_high_level, quarter_width-19, 12, 2, 8); rb->lcd_mono_bitmap(sound_high_level, quarter_width-19, SYSFONT_HEIGHT+4, 2, 8);
if(analog_mini_4<left_needle_top_x) if(analog_mini_4<left_needle_top_x)
rb->lcd_mono_bitmap(sound_max_level, quarter_width-16, 12, 3, 8); rb->lcd_mono_bitmap(sound_max_level, quarter_width-16, SYSFONT_HEIGHT+4, 3, 8);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_mono_bitmap(sound_speaker, quarter_width+half_width-30, 12, 4, 8); rb->lcd_mono_bitmap(sound_speaker, quarter_width+half_width-30, SYSFONT_HEIGHT+4, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_set_drawmode(DRMODE_FG);
if(analog_mini_1<(right_needle_top_x-half_width)) if(analog_mini_1<(right_needle_top_x-half_width))
rb->lcd_mono_bitmap(sound_low_level, quarter_width+half_width-25, 12, 2, 8); rb->lcd_mono_bitmap(sound_low_level, quarter_width+half_width-25, SYSFONT_HEIGHT+4, 2, 8);
if(analog_mini_2<(right_needle_top_x-half_width)) if(analog_mini_2<(right_needle_top_x-half_width))
rb->lcd_mono_bitmap(sound_med_level, quarter_width+half_width-23, 12, 2, 8); rb->lcd_mono_bitmap(sound_med_level, quarter_width+half_width-23, SYSFONT_HEIGHT+4, 2, 8);
if(analog_mini_3<(right_needle_top_x-half_width)) if(analog_mini_3<(right_needle_top_x-half_width))
rb->lcd_mono_bitmap(sound_high_level, quarter_width+half_width-21, 12, 2, 8); rb->lcd_mono_bitmap(sound_high_level, quarter_width+half_width-21, SYSFONT_HEIGHT+4, 2, 8);
if(analog_mini_4<(right_needle_top_x-half_width)) if(analog_mini_4<(right_needle_top_x-half_width))
rb->lcd_mono_bitmap(sound_max_level, quarter_width+half_width-18, 12, 3, 8); rb->lcd_mono_bitmap(sound_max_level, quarter_width+half_width-18, SYSFONT_HEIGHT+4, 3, 8);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
} }
@ -844,12 +844,12 @@ static void analog_meter(void) {
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
/* Show Left/Right */ /* Show Left/Right */
rb->lcd_putsxy(quarter_width-12, 12, "Left"); rb->lcd_putsxy(quarter_width-12, SYSFONT_HEIGHT+4, "Left");
rb->lcd_putsxy(half_width+quarter_width-12, 12, "Right"); rb->lcd_putsxy(half_width+quarter_width-12, SYSFONT_HEIGHT+4, "Right");
/* Line above/below the Left/Right text */ /* Line above/below the Left/Right text */
rb->lcd_hline(0,LCD_WIDTH-1,9); rb->lcd_hline(0,LCD_WIDTH-1,SYSFONT_HEIGHT+1);
rb->lcd_hline(0,LCD_WIDTH-1,21); rb->lcd_hline(0,LCD_WIDTH-1,SYSFONT_HEIGHT*2+5);
for(i=0; i<half_width; i++) { for(i=0; i<half_width; i++) {
rb->lcd_drawpixel(i, (y_values[i])-2); rb->lcd_drawpixel(i, (y_values[i])-2);