Use CPP macro for duplicate assembly

This commit is contained in:
Aaron Culliney 2014-06-21 14:07:47 -07:00
parent c13caa0798
commit a4670b1eda
4 changed files with 9 additions and 7 deletions

View File

@ -54,6 +54,7 @@ GLUE_BANK_READ(iie_read_slotx,base_cxrom)
uint32_t softswitches;
const uint8_t *base_vmem = apple_ii_64k[0];
uint8_t *base_ramrd;
uint8_t *base_ramwrt;
uint8_t *base_textrd;

View File

@ -26,6 +26,12 @@
#define X86_CF_Bit 0x0 /* x86 carry */
#define X86_AF_Bit 0x4 /* x86 adj (nybble carry) */
#define RestoreAltZP \
/* Apple //e set stack point to ALTZP (or not) */ \
movLQ SN(base_stackzp), _XAX; \
subLQ SN(base_vmem), _XAX; \
orLQ _XAX, SP_Reg_X;
#if __LP64__
# define SZ_PTR 8
# define ROR_BIT 63

View File

@ -2119,10 +2119,7 @@ E(cpu65_run)
movb SN(cpu65_current)+5, Y_Reg
movb SN(cpu65_current)+6, SP_Reg_L
#ifdef APPLE2_VM
// Apple //e machine specific set stack point to ALTZP (or not)
movLQ SN(base_stackzp), _XAX
subLQ $SN(apple_ii_64k), _XAX
orLQ _XAX, SP_Reg_X
RestoreAltZP
#endif
jmp continue1

View File

@ -111,9 +111,7 @@ E(func) pushLQ XY_Reg_X; \
#define GLUE_C_READ_ALTZP(FUNC) _GLUE_C_READ(FUNC, \
pushLQ _XAX; \
andLQ $0xFFFF, SP_Reg_X; \
movLQ SN(base_stackzp), _XAX; \
subLQ $SN(apple_ii_64k), _XAX; \
orLQ _XAX, SP_Reg_X; \
RestoreAltZP \
popLQ _XAX; \
)