diff options
Diffstat (limited to 'source/cpuaddr.h')
-rw-r--r-- | source/cpuaddr.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/source/cpuaddr.h b/source/cpuaddr.h index bdeb242..2d638b9 100644 --- a/source/cpuaddr.h +++ b/source/cpuaddr.h @@ -33,7 +33,7 @@ static INLINE void RelativeLong(void) #ifdef FAST_LSB_WORD_ACCESS OpAddress = *(uint16_t*) CPU.PC; #else - OpAddress = *CPU.PC + (*(CPU.PC + 1) << 8); + OpAddress = CPU.PC[0] + (CPU.PC[1] << 8); #endif #ifndef SA1_OPCODES CPU.Cycles += CPU.MemSpeedx2 + ONE_CYCLE; @@ -48,12 +48,12 @@ static INLINE void AbsoluteIndexedIndirect(bool read) #ifdef FAST_LSB_WORD_ACCESS OpAddress = (ICPU.Registers.X.W + * (uint16_t*) CPU.PC) & 0xffff; #else - OpAddress = (ICPU.Registers.X.W + *CPU.PC + (*(CPU.PC + 1) << 8)) & 0xffff; + OpAddress = (ICPU.Registers.X.W + CPU.PC[0] + (CPU.PC[1] << 8)) & 0xffff; #endif #ifndef SA1_OPCODES CPU.Cycles += CPU.MemSpeedx2; #endif - OpenBus = *(CPU.PC + 1); + OpenBus = CPU.PC[1]; CPU.PC += 2; OpAddress = S9xGetWord(ICPU.ShiftedPB + OpAddress); if (read) @@ -65,12 +65,12 @@ static INLINE void AbsoluteIndirectLong(bool read) #ifdef FAST_LSB_WORD_ACCESS OpAddress = *(uint16_t*) CPU.PC; #else - OpAddress = *CPU.PC + (*(CPU.PC + 1) << 8); + OpAddress = CPU.PC[0] + (CPU.PC[1] << 8); #endif #ifndef SA1_OPCODES CPU.Cycles += CPU.MemSpeedx2; #endif - OpenBus = *(CPU.PC + 1); + OpenBus = CPU.PC[1]; CPU.PC += 2; if (read) OpAddress = S9xGetWord(OpAddress) | ((OpenBus = S9xGetByte(OpAddress + 2)) << 16); @@ -83,12 +83,12 @@ static INLINE void AbsoluteIndirect(bool read) #ifdef FAST_LSB_WORD_ACCESS OpAddress = *(uint16_t*) CPU.PC; #else - OpAddress = *CPU.PC + (*(CPU.PC + 1) << 8); + OpAddress = CPU.PC[0] + (CPU.PC[1] << 8); #endif #ifndef SA1_OPCODES CPU.Cycles += CPU.MemSpeedx2; #endif - OpenBus = *(CPU.PC + 1); + OpenBus = CPU.PC[1]; CPU.PC += 2; OpAddress = S9xGetWord(OpAddress); if (read) @@ -101,10 +101,10 @@ static INLINE void Absolute(bool read) #ifdef FAST_LSB_WORD_ACCESS OpAddress = *(uint16_t*) CPU.PC + ICPU.ShiftedDB; #else - OpAddress = *CPU.PC + (*(CPU.PC + 1) << 8) + ICPU.ShiftedDB; + OpAddress = CPU.PC[0] + (CPU.PC[1] << 8) + ICPU.ShiftedDB; #endif if (read) - OpenBus = *(CPU.PC + 1); + OpenBus = CPU.PC[1]; CPU.PC += 2; #ifndef SA1_OPCODES CPU.Cycles += CPU.MemSpeedx2; @@ -117,14 +117,14 @@ static INLINE void AbsoluteLong(bool read) OpAddress = (*(uint32_t*) CPU.PC) & 0xffffff; #elif defined FAST_ALIGNED_LSB_WORD_ACCESS if (((int32_t) CPU.PC & 1) == 0) - OpAddress = (*(uint16_t*) CPU.PC) + (*(CPU.PC + 2) << 16); + OpAddress = (*(uint16_t*) CPU.PC) + (CPU.PC[2] << 16); else - OpAddress = *CPU.PC + ((*(uint16_t*)(CPU.PC + 1)) << 8); + OpAddress = *CPU.PC + ((*(uint16_t*) (CPU.PC + 1)) << 8); #else - OpAddress = *CPU.PC + (*(CPU.PC + 1) << 8) + (*(CPU.PC + 2) << 16); + OpAddress = CPU.PC[0] + (CPU.PC[1] << 8) + (CPU.PC[2] << 16); #endif if (read) - OpenBus = *(CPU.PC + 2); + OpenBus = CPU.PC[2]; CPU.PC += 3; #ifndef SA1_OPCODES CPU.Cycles += CPU.MemSpeedx2 + CPU.MemSpeed; @@ -210,10 +210,10 @@ static INLINE void AbsoluteIndexedX(bool read) #ifdef FAST_LSB_WORD_ACCESS OpAddress = ICPU.ShiftedDB + *(uint16_t*) CPU.PC + ICPU.Registers.X.W; #else - OpAddress = ICPU.ShiftedDB + *CPU.PC + (*(CPU.PC + 1) << 8) + ICPU.Registers.X.W; + OpAddress = ICPU.ShiftedDB + CPU.PC[0] + (CPU.PC[1] << 8) + ICPU.Registers.X.W; #endif if (read) - OpenBus = *(CPU.PC + 1); + OpenBus = CPU.PC[1]; CPU.PC += 2; #ifndef SA1_OPCODES CPU.Cycles += CPU.MemSpeedx2; @@ -225,10 +225,10 @@ static INLINE void AbsoluteIndexedY(bool read) #ifdef FAST_LSB_WORD_ACCESS OpAddress = ICPU.ShiftedDB + *(uint16_t*) CPU.PC + ICPU.Registers.Y.W; #else - OpAddress = ICPU.ShiftedDB + *CPU.PC + (*(CPU.PC + 1) << 8) + ICPU.Registers.Y.W; + OpAddress = ICPU.ShiftedDB + CPU.PC[0] + (CPU.PC[1] << 8) + ICPU.Registers.Y.W; #endif if (read) - OpenBus = *(CPU.PC + 1); + OpenBus = CPU.PC[1]; CPU.PC += 2; #ifndef SA1_OPCODES CPU.Cycles += CPU.MemSpeedx2; @@ -241,14 +241,14 @@ static INLINE void AbsoluteLongIndexedX(bool read) OpAddress = (*(uint32_t*) CPU.PC + ICPU.Registers.X.W) & 0xffffff; #elif defined FAST_ALIGNED_LSB_WORD_ACCESS if (((int32_t) CPU.PC & 1) == 0) - OpAddress = ((*(uint16_t*) CPU.PC) + (*(CPU.PC + 2) << 16) + ICPU.Registers.X.W) & 0xFFFFFF; + OpAddress = ((*(uint16_t*) CPU.PC) + (CPU.PC[2] << 16) + ICPU.Registers.X.W) & 0xFFFFFF; else - OpAddress = (*CPU.PC + ((*(uint16_t*)(CPU.PC + 1)) << 8) + ICPU.Registers.X.W) & 0xFFFFFF; + OpAddress = (*CPU.PC + ((*(uint16_t*) (CPU.PC + 1)) << 8) + ICPU.Registers.X.W) & 0xFFFFFF; #else - OpAddress = (*CPU.PC + (*(CPU.PC + 1) << 8) + (*(CPU.PC + 2) << 16) + ICPU.Registers.X.W) & 0xffffff; + OpAddress = (CPU.PC[0] + (CPU.PC[1] << 8) + (CPU.PC[2] << 16) + ICPU.Registers.X.W) & 0xffffff; #endif if (read) - OpenBus = *(CPU.PC + 2); + OpenBus = CPU.PC[2]; CPU.PC += 3; #ifndef SA1_OPCODES CPU.Cycles += CPU.MemSpeedx2 + CPU.MemSpeed; |