|
|
| version 1.17, 2005/03/05 16:47:04 | version 1.20, 2008/01/25 17:49:46 |
|---|---|
| Line 12 | Line 12 |
| * 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright |
| * notice, this list of conditions and the following disclaimer in the | * notice, this list of conditions and the following disclaimer in the |
| * documentation and/or other materials provided with the distribution. | * documentation and/or other materials provided with the distribution. |
| * 3. The name of the author may not be used to endorse or promote products | |
| * derived from this software without specific prior written permission. | |
| * | * |
| * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| Line 31 | Line 29 |
| #include "cpu.h" | #include "cpu.h" |
| #include "ia32.mcr" | #include "ia32.mcr" |
| I386CORE i386core; | I386CORE i386core; |
| UINT8 *reg8_b20[0x100]; | UINT8 *reg8_b20[0x100]; |
| Line 41 UINT16 *reg16_b53[0x100]; | Line 38 UINT16 *reg16_b53[0x100]; |
| UINT32 *reg32_b20[0x100]; | UINT32 *reg32_b20[0x100]; |
| UINT32 *reg32_b53[0x100]; | UINT32 *reg32_b53[0x100]; |
| void | void |
| ia32_init(void) | ia32_init(void) |
| { | { |
| Line 85 ia32_setextsize(UINT32 size) | Line 81 ia32_setextsize(UINT32 size) |
| { | { |
| if (CPU_EXTMEMSIZE != size) { | if (CPU_EXTMEMSIZE != size) { |
| if (CPU_EXTMEM) { | UINT8 *extmem; |
| _MFREE(CPU_EXTMEM); | extmem = CPU_EXTMEM; |
| CPU_EXTMEM = NULL; | if (extmem != NULL) { |
| _MFREE(extmem); | |
| extmem = NULL; | |
| } | |
| if (size != 0) { | |
| extmem = (UINT8 *)_MALLOC(size + 16, "EXTMEM"); | |
| } | |
| if (extmem != NULL) { | |
| ZeroMemory(extmem, size + 16); | |
| CPU_EXTMEM = extmem; | |
| CPU_EXTMEMSIZE = size; | |
| CPU_EXTMEMBASE = CPU_EXTMEM - 0x100000; | |
| CPU_EXTLIMIT16 = min(size + 0x100000, 0xf00000); | |
| CPU_EXTLIMIT = size + 0x100000; | |
| } | } |
| if (size) { | else { |
| CPU_EXTMEM = (BYTE *)_MALLOC(size + 16, "EXTMEM"); | CPU_EXTMEM = NULL; |
| if (CPU_EXTMEM == NULL) { | CPU_EXTMEMSIZE = 0; |
| size = 0; | CPU_EXTMEMBASE = NULL; |
| } | CPU_EXTLIMIT16 = 0; |
| ZeroMemory(CPU_EXTMEM, size + 16); | CPU_EXTLIMIT = 0; |
| } | } |
| CPU_EXTMEMSIZE = size; | |
| } | } |
| CPU_EMSPTR[0] = mem + 0xc0000; | CPU_EMSPTR[0] = mem + 0xc0000; |
| CPU_EMSPTR[1] = mem + 0xc4000; | CPU_EMSPTR[1] = mem + 0xc4000; |
| Line 183 change_vm(BOOL onoff) | Line 191 change_vm(BOOL onoff) |
| } | } |
| } | } |
| #if !defined(IA32_DONT_USE_SET_EFLAGS_FUNCTION) | |
| /* | /* |
| * flags | * flags |
| */ | */ |
| Line 227 set_eflags(UINT32 new_flags, UINT32 mask | Line 234 set_eflags(UINT32 new_flags, UINT32 mask |
| mask |= AC_FLAG|ID_FLAG; | mask |= AC_FLAG|ID_FLAG; |
| modify_eflags(new_flags, mask); | modify_eflags(new_flags, mask); |
| } | } |
| #endif /* !IA32_DONT_USE_SET_EFLAGS_FUNCTION */ |