--- np2/i386c/memory.c 2003/12/08 00:55:31 1.1 +++ np2/i386c/memory.c 2003/12/25 19:21:17 1.4 @@ -11,6 +11,9 @@ #include "font.h" + BYTE mem[0x200000]; + + #define USE_HIMEM // ---- write byte @@ -830,6 +833,14 @@ void MEMCALL __i286_memorywrite_w(UINT32 if (address < (I286_MEMWRITEMAX - 1)) { STOREINTELWORD(mem + address, value); +#if defined(TRACE) + if (address == 0x00404) { + TRACEOUT(("CPU_SP = %.4x [%.4x:%.4x]", value, CPU_CS, CPU_IP)); + } + if (address == 0x00406) { + TRACEOUT(("CPU_SS = %.4x [%.4x:%.4x]", value, CPU_CS, CPU_IP)); + } +#endif } #if defined(USE_HIMEM) else if (address >= (0x10fff0 - 1)) { @@ -867,7 +878,7 @@ REG8 MEMCALL i286_membyte_read(UINT seg, UINT32 address; - address = (seg << 4) + off; + address = (seg << 4) + LOW16(off); if (address < I286_MEMREADMAX) { return(mem[address]); } @@ -880,7 +891,7 @@ REG16 MEMCALL i286_memword_read(UINT seg UINT32 address; - address = (seg << 4) + off; + address = (seg << 4) + LOW16(off); if (address < (I286_MEMREADMAX - 1)) { return(LOADINTELWORD(mem + address)); } @@ -893,7 +904,7 @@ void MEMCALL i286_membyte_write(UINT seg UINT32 address; - address = (seg << 4) + off; + address = (seg << 4) + LOW16(off); if (address < I286_MEMWRITEMAX) { mem[address] = (BYTE)value; } @@ -906,7 +917,7 @@ void MEMCALL i286_memword_write(UINT seg UINT32 address; - address = (seg << 4) + off; + address = (seg << 4) + LOW16(off); if (address < (I286_MEMWRITEMAX - 1)) { STOREINTELWORD(mem + address, value); } @@ -924,6 +935,7 @@ void MEMCALL i286_memstr_read(UINT seg, out = (BYTE *)dat; adrs = seg << 4; + off = LOW16(off); if ((I286_MEMREADMAX >= 0x10000) && (adrs < (I286_MEMREADMAX - 0x10000))) { if (leng) { @@ -962,6 +974,7 @@ void MEMCALL i286_memstr_write(UINT seg, out = (BYTE *)dat; adrs = seg << 4; + off = LOW16(off); if ((I286_MEMWRITEMAX >= 0x10000) && (adrs < (I286_MEMWRITEMAX - 0x10000))) { if (leng) {