1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-08-20 09:29:01 +00:00

Draw text in 40 column mode

This commit is contained in:
Peter Evans 2018-01-18 16:21:25 -06:00
parent a55fd2f71f
commit d4bf5da480
3 changed files with 16 additions and 0 deletions

View File

@ -6,5 +6,6 @@
extern void apple2_draw_pixel(apple2 *, vm_16bit);
extern void apple2_draw_text(apple2 *, vm_16bit);
extern void apple2_draw_40col(apple2 *);
#endif

View File

@ -324,6 +324,7 @@ apple2_run_loop(apple2 *mach)
while (vm_screen_active(mach->screen)) {
mos6502_dis_opcode(mach->cpu, stdout, mach->cpu->PC);
mos6502_execute(mach->cpu);
apple2_draw_40col(mach);
vm_screen_refresh(mach->screen);
}
}

View File

@ -159,3 +159,17 @@ apple2_draw_text(apple2 *mach, vm_16bit addr)
// Now show the goddamned thing
vm_bitfont_render(mach->sysfont, mach->screen, &dest, ch);
}
void
apple2_draw_40col(apple2 *mach)
{
size_t addr;
for (addr = 0x400; addr < 0x800; addr++) {
if ((addr & 0xFF) == 0x39) {
addr += 0x40;
}
apple2_draw_text(mach, addr);
}
}