1
0
Fork 0

align vga memory

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3021
This commit is contained in:
Sebastian Strohhäcker 2007-10-19 20:30:24 +00:00
parent a7e852daac
commit ecbec7dda0
3 changed files with 8 additions and 5 deletions

View file

@ -331,7 +331,7 @@ typedef union {
} VGA_Latch;
typedef struct {
Bit8u linear[VGA_MEMORY];
Bit8u* linear;
} VGA_Memory;
typedef struct {

View file

@ -870,7 +870,10 @@ void VGA_UnmapMMIO(void) {
void VGA_SetupMemory() {
memset( &vga.mem, 0, VGA_MEMORY );
// allocate 16byte-aligned memory
vga.mem.linear = new Bit8u[VGA_MEMORY+16];
vga.mem.linear=(Bit8u*)(((Bitu)vga.mem.linear + 16-1) & ~(16-1));
memset( vga.mem.linear, 0, VGA_MEMORY );
#ifdef VGA_KEEP_CHANGES
memset( &vga.changes, 0, sizeof( vga.changes ));
#endif

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: int10_modes.cpp,v 1.68 2007-10-13 16:34:06 c2woody Exp $ */
/* $Id: int10_modes.cpp,v 1.69 2007-10-19 20:30:24 c2woody Exp $ */
#include <string.h>
@ -277,7 +277,7 @@ static void FinishSetMode(bool clearmem) {
case M_LIN16:
case M_LIN32:
/* Hack we just acess the memory directly */
memset(&vga.mem,0,sizeof(vga.mem));
memset(vga.mem.linear,0,VGA_MEMORY);
}
}
/* Setup the BIOS */
@ -672,7 +672,7 @@ bool INT10_SetVideoMode(Bitu mode) {
switch (CurMode->vdispend) {
case 350: vblank_trim=0;
break;
default: vblank_trim+23;
default: vblank_trim=23;
}
}