diff --git a/include/vga.h b/include/vga.h index d0500dbe..6e080aae 100644 --- a/include/vga.h +++ b/include/vga.h @@ -331,7 +331,7 @@ typedef union { } VGA_Latch; typedef struct { - Bit8u linear[VGA_MEMORY]; + Bit8u* linear; } VGA_Memory; typedef struct { diff --git a/src/hardware/vga_memory.cpp b/src/hardware/vga_memory.cpp index 76487aff..060644e5 100644 --- a/src/hardware/vga_memory.cpp +++ b/src/hardware/vga_memory.cpp @@ -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 diff --git a/src/ints/int10_modes.cpp b/src/ints/int10_modes.cpp index 143327bc..efd1fe12 100644 --- a/src/ints/int10_modes.cpp +++ b/src/ints/int10_modes.cpp @@ -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 @@ -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; } }