wwww
Revision | cb4574433d1faa6a5345362d66211108f9aaaa3c (tree) |
---|---|
Time | 2016-04-17 15:53:43 |
Author | Jonathan Campbell <jonathan@cast...> |
Commiter | Jonathan Campbell |
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.
@@ -80,7 +80,6 @@ vgaGetMode() | ||
80 | 80 | void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) |
81 | 81 | { |
82 | 82 | word i; |
83 | - dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA; /* used for faster screen clearing */ | |
84 | 83 | struct vga_mode_params cm; |
85 | 84 | int CRTParmCount; |
86 | 85 |
@@ -138,10 +137,12 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) | ||
138 | 137 | /* clear video memory */ |
139 | 138 | switch (cmem) |
140 | 139 | { |
141 | - case 1: | |
142 | - /* clear video memory */ | |
143 | - vga_write_sequencer(2/*map mask register*/,0xf/*all 4 planes*/); | |
144 | - for(i=0; i<0x8000; i++) ptr[i] = 0x0000; | |
140 | + case 1: { | |
141 | + /* clear video memory */ | |
142 | + dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA; /* used for faster screen clearing */ | |
143 | + vga_write_sequencer(2/*map mask register*/,0xf/*all 4 planes*/); | |
144 | + for(i = 0;i < 0x4000; i++) ptr[i] = 0x0000; // 0x4000 x dword = 64KB | |
145 | + } | |
145 | 146 | break; |
146 | 147 | } |
147 | 148 | gv->video.page[0].tilesw = gv->video.page[0].sw/TILEWH; |