diff --git a/vga/render.c b/vga/render.c index ca59e9f..7909768 100644 --- a/vga/render.c +++ b/vga/render.c @@ -207,8 +207,12 @@ void DELAYED_COPY_CODE(render_loop)() { } #if defined(ANALOG_GS) || defined(OVERCLOCKED) } else if(soft_switches & SOFTSW_SHR) { + vga_prepare_frame(); render_shr(); #endif + } else if(soft_switches & SOFTSW_TERMINAL) { + vga_prepare_frame(); + render_terminal(); } else { vga_prepare_frame(); @@ -220,9 +224,6 @@ void DELAYED_COPY_CODE(render_loop)() { render_border(32); } - if(soft_switches & SOFTSW_TERMINAL) { - render_terminal(); - } else switch(soft_switches & SOFTSW_MODE_MASK) { case 0: if(soft_switches & SOFTSW_DGR) { diff --git a/vga/render_80col.c b/vga/render_80col.c index 81fd7f9..976e989 100644 --- a/vga/render_80col.c +++ b/vga/render_80col.c @@ -184,9 +184,10 @@ void DELAYED_COPY_CODE(terminal_process_input)() { } static void DELAYED_COPY_CODE(render_terminal_line)(uint16_t line) { - uint glyph_line = line & 0x7; - const uint8_t *line_buf = (const uint8_t *)terminal_memory + (((line/10) * 128) & 0xFFF); - bool cursor_row = ((((terminal_row+terminal_jsoffset) * 128) & 0xFFF) == (((line>>3) * 128) & 0xFFF)); + uint glyph_line = line % 10; + uint text_line_offset = ((line / 10) * 128) & 0xFFF; + const uint8_t *line_buf = (const uint8_t *)terminal_memory + text_line_offset; + bool cursor_row = ((((terminal_row+terminal_jsoffset) * 128) & 0xFFF) == text_line_offset); struct vga_scanline *sl = vga_prepare_scanline(); uint sl_pos = 0; diff --git a/vga/render_shr.c b/vga/render_shr.c index 8b4db77..0cf3141 100644 --- a/vga/render_shr.c +++ b/vga/render_shr.c @@ -17,8 +17,6 @@ static inline uint16_t rgb444(uint16_t a) { #endif void DELAYED_COPY_CODE(render_shr)() { - vga_prepare_frame(); - render_border(40); for(uint line=0; line < 200; line++) {