mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-03-14 13:17:09 +00:00
CPU emu: add _IABS_CMOS and IABS_NMOS macros
This commit is contained in:
@@ -500,6 +500,7 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
|
||||
#define WRITE(value) _WRITE(value)
|
||||
#define POP _POP
|
||||
#define PUSH(value) _PUSH(value)
|
||||
#define IABS_CMOS _IABS_CMOS
|
||||
|
||||
#include "CPU/cpu65C02.h" // WDC 65C02
|
||||
|
||||
@@ -507,6 +508,7 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
|
||||
#undef WRITE
|
||||
#undef POP
|
||||
#undef PUSH
|
||||
#undef IABS_CMOS
|
||||
|
||||
//-------
|
||||
|
||||
@@ -515,6 +517,7 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
|
||||
#define WRITE(value) _WRITE_ALT(value)
|
||||
#define POP _POP_ALT
|
||||
#define PUSH(value) _PUSH_ALT(value)
|
||||
#define IABS_CMOS _IABS_CMOS_ALT
|
||||
|
||||
#define Cpu65C02 Cpu65C02_altRW
|
||||
#include "CPU/cpu65C02.h" // WDC 65C02
|
||||
@@ -524,6 +527,7 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
|
||||
#undef WRITE
|
||||
#undef POP
|
||||
#undef PUSH
|
||||
#undef IABS_CMOS
|
||||
#undef HEATMAP_X
|
||||
|
||||
//-----------------
|
||||
@@ -570,6 +574,7 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
|
||||
#define WRITE(value) Heatmap_WriteByte(addr, value, uExecutedCycles);
|
||||
#define POP _POP
|
||||
#define PUSH(value) _PUSH(value)
|
||||
#define IABS_CMOS _IABS_CMOS
|
||||
|
||||
#define Cpu65C02 Cpu65C02_debug
|
||||
#include "CPU/cpu65C02.h" // WDC 65C02
|
||||
@@ -579,6 +584,7 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
|
||||
#undef WRITE
|
||||
#undef POP
|
||||
#undef PUSH
|
||||
#undef IABS_CMOS
|
||||
|
||||
//-------
|
||||
|
||||
@@ -587,6 +593,7 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
|
||||
#define WRITE(value) _WRITE_ALT(value)
|
||||
#define POP _POP_ALT
|
||||
#define PUSH(value) _PUSH_ALT(value)
|
||||
#define IABS_CMOS _IABS_CMOS_ALT
|
||||
|
||||
#define Cpu65C02 Cpu65C02_debug_altRW
|
||||
#include "CPU/cpu65C02.h" // WDC 65C02
|
||||
@@ -596,6 +603,7 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
|
||||
#undef WRITE
|
||||
#undef POP
|
||||
#undef PUSH
|
||||
#undef IABS_CMOS
|
||||
#undef HEATMAP_X
|
||||
|
||||
//===========================================================================
|
||||
|
||||
@@ -175,16 +175,30 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#define ABSY_CONST base = *(LPWORD)(mem+regs.pc); addr = base+(WORD)regs.y; regs.pc += 2;
|
||||
|
||||
// TODO Optimization Note (just for IABSCMOS): uExtraCycles = ((base & 0xFF) + 1) >> 8;
|
||||
#define IABS_CMOS base = *(LPWORD)(mem+regs.pc); \
|
||||
#define _IABS_CMOS base = *(LPWORD)(mem+regs.pc); \
|
||||
addr = *(LPWORD)(mem+base); \
|
||||
if ((base & 0xFF) == 0xFF) uExtraCycles=1; \
|
||||
regs.pc += 2;
|
||||
#define _IABS_CMOS_ALT base = *(LPWORD)(mem+regs.pc); \
|
||||
if (memreadPageType[base >> 8] == MEM_Aux1K) \
|
||||
base = TEXT_PAGE1_BEGIN + (base & (TEXT_PAGE1_SIZE-1)); \
|
||||
addr = *(LPWORD)(mem+base); \
|
||||
if ((base & 0xFF) == 0xFF) uExtraCycles=1; \
|
||||
regs.pc += 2;
|
||||
#define IABS_NMOS base = *(LPWORD)(mem+regs.pc); \
|
||||
if ((base & 0xFF) == 0xFF) \
|
||||
addr = *(mem+base)+((WORD)*(mem+(base&0xFF00))<<8);\
|
||||
else \
|
||||
addr = *(LPWORD)(mem+base); \
|
||||
regs.pc += 2;
|
||||
#define _IABS_NMOS_ALT base = *(LPWORD)(mem+regs.pc); \
|
||||
if (memreadPageType[base >> 8] == MEM_Aux1K) \
|
||||
base = TEXT_PAGE1_BEGIN + (base & (TEXT_PAGE1_SIZE-1)); \
|
||||
if ((base & 0xFF) == 0xFF) \
|
||||
addr = *(mem+base)+((WORD)*(mem+(base&0xFF00))<<8); \
|
||||
else \
|
||||
addr = *(LPWORD)(mem+base); \
|
||||
regs.pc += 2;
|
||||
|
||||
#define IMM addr = regs.pc++;
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ void NTSC_VideoUpdateCycles( long cycles6502 )
|
||||
#undef WRITE
|
||||
#undef POP
|
||||
#undef PUSH
|
||||
#undef IABS_CMOS
|
||||
|
||||
//-------
|
||||
|
||||
@@ -106,6 +107,7 @@ void NTSC_VideoUpdateCycles( long cycles6502 )
|
||||
#define WRITE(a) _WRITE(a)
|
||||
#define POP _POP
|
||||
#define PUSH(a) _PUSH(a)
|
||||
#define IABS_CMOS _IABS_CMOS_ALT
|
||||
|
||||
#include "../../source/CPU/cpu65C02.h" // WDC 65C02
|
||||
|
||||
@@ -113,6 +115,7 @@ void NTSC_VideoUpdateCycles( long cycles6502 )
|
||||
#undef WRITE
|
||||
#undef POP
|
||||
#undef PUSH
|
||||
#undef IABS_CMOS
|
||||
#undef HEATMAP_X
|
||||
|
||||
//-------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user