From cb4574433d1faa6a5345362d66211108f9aaaa3c Mon Sep 17 00:00:00 2001 From: Jonathan Campbell Date: Sat, 16 Apr 2016 23:53:43 -0700 Subject: [PATCH] clear video RAM using pointer set after INT 10h + vga update, not before. this fixes scribbling over VGA ROM BIOS and possible DOSBox UMB corruption. --- src/lib/modex16.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 70e8e871..cab13766 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -80,7 +80,6 @@ vgaGetMode() void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) { word i; - dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA; /* used for faster screen clearing */ struct vga_mode_params cm; int CRTParmCount; @@ -138,10 +137,12 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) /* clear video memory */ switch (cmem) { - case 1: - /* clear video memory */ - vga_write_sequencer(2/*map mask register*/,0xf/*all 4 planes*/); - for(i=0; i<0x8000; i++) ptr[i] = 0x0000; + case 1: { + /* clear video memory */ + dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA; /* used for faster screen clearing */ + vga_write_sequencer(2/*map mask register*/,0xf/*all 4 planes*/); + for(i = 0;i < 0x4000; i++) ptr[i] = 0x0000; // 0x4000 x dword = 64KB + } break; } gv->video.page[0].tilesw = gv->video.page[0].sw/TILEWH; -- 2.39.5