--- np2/i286c/memory.c 2003/12/08 17:57:29 1.11 +++ np2/i286c/memory.c 2003/12/12 01:04:40 1.13 @@ -1,6 +1,5 @@ #include "compiler.h" #include "cpucore.h" -#include "memory.h" #include "egcmem.h" #include "pccore.h" #include "iocore.h" @@ -8,7 +7,11 @@ #include "font.h" -#define USE_HIMEM + BYTE mem[0x200000]; + + +#define USE_HIMEM 0x10fff0 + #if defined(TRACE) #define MEMORY_DEBUG #endif @@ -747,7 +750,7 @@ static REG8 MEMCALL _i286_memoryread(UIN return(mem[address]); } #if defined(USE_HIMEM) - else if (address >= 0x10fff0) { + else if (address >= USE_HIMEM) { address -= 0x100000; if (address < CPU_EXTMEMSIZE) { return(CPU_EXTMEM[address]); @@ -770,9 +773,9 @@ static REG16 MEMCALL _i286_memoryread_w( return(LOADINTELWORD(mem + address)); } #if defined(USE_HIMEM) - else if (address >= (0x10fff0 - 1)) { + else if (address >= (USE_HIMEM - 1)) { address -= 0x100000; - if (address == (0x00fff0 - 1)) { + if (address == (USE_HIMEM - 0x100000 - 1)) { ret = mem[0x100000 + address]; } else if (address < CPU_EXTMEMSIZE) { @@ -830,7 +833,7 @@ REG8 MEMCALL i286_memoryread(UINT32 addr return(mem[address]); } #if defined(USE_HIMEM) - else if (address >= 0x10fff0) { + else if (address >= USE_HIMEM) { address -= 0x100000; if (address < CPU_EXTMEMSIZE) { return(CPU_EXTMEM[address]); @@ -853,9 +856,9 @@ REG16 MEMCALL i286_memoryread_w(UINT32 a return(LOADINTELWORD(mem + address)); } #if defined(USE_HIMEM) - else if (address >= (0x10fff0 - 1)) { + else if (address >= (USE_HIMEM - 1)) { address -= 0x100000; - if (address == (0x00fff0 - 1)) { + if (address == (USE_HIMEM - 0x100000 - 1)) { ret = mem[0x100000 + address]; } else if (address < CPU_EXTMEMSIZE) { @@ -892,7 +895,7 @@ void MEMCALL i286_memorywrite(UINT32 add mem[address] = (BYTE)value; } #if defined(USE_HIMEM) - else if (address >= 0x10fff0) { + else if (address >= USE_HIMEM) { address -= 0x100000; if (address < CPU_EXTMEMSIZE) { CPU_EXTMEM[address] = (BYTE)value; @@ -910,9 +913,9 @@ void MEMCALL i286_memorywrite_w(UINT32 a STOREINTELWORD(mem + address, value); } #if defined(USE_HIMEM) - else if (address >= (0x10fff0 - 1)) { + else if (address >= (USE_HIMEM - 1)) { address -= 0x100000; - if (address == (0x00fff0 - 1)) { + if (address == (USE_HIMEM - 0x100000 - 1)) { mem[address] = (BYTE)value; } else if (address < CPU_EXTMEMSIZE) {