aboutsummaryrefslogtreecommitdiff
path: root/source/apu.h
diff options
context:
space:
mode:
authorNebuleon Fumika2012-12-26 14:42:02 -0500
committerNebuleon Fumika2012-12-26 14:42:02 -0500
commite5869adc4469115c7eac9abf70145fc178e017de (patch)
tree552805b1c150fea2f5e905e550d034f71c03fb75 /source/apu.h
parent139c793b584a76acd42d72ec019d2cabab7d3ee7 (diff)
downloadsnesemu-e5869adc4469115c7eac9abf70145fc178e017de.tar.gz
snesemu-e5869adc4469115c7eac9abf70145fc178e017de.tar.bz2
snesemu-e5869adc4469115c7eac9abf70145fc178e017de.zip
Merge Registers structures into their respective CPUs to avoid additional memory addresses being loaded every opcode.
Diffstat (limited to 'source/apu.h')
-rw-r--r--source/apu.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/source/apu.h b/source/apu.h
index 0a64e34..67b2525 100644
--- a/source/apu.h
+++ b/source/apu.h
@@ -95,6 +95,7 @@
struct SIAPU
{
uint8 *PC;
+ struct SAPURegisters Registers;
uint8 *RAM;
uint8 *DirectPage;
bool8 APUExecuting;
@@ -136,15 +137,15 @@ extern int spc_is_dumping_temp;
extern uint8 spc_dump_dsp[0x100];
STATIC inline void S9xAPUUnpackStatus()
{
- IAPU._Zero = ((APURegisters.P & Zero) == 0) | (APURegisters.P & Negative);
- IAPU._Carry = (APURegisters.P & Carry);
- IAPU._Overflow = (APURegisters.P & Overflow) >> 6;
+ IAPU._Zero = ((IAPU.Registers.P & Zero) == 0) | (IAPU.Registers.P & Negative);
+ IAPU._Carry = (IAPU.Registers.P & Carry);
+ IAPU._Overflow = (IAPU.Registers.P & Overflow) >> 6;
}
STATIC inline void S9xAPUPackStatus()
{
- APURegisters.P &= ~(Zero | Negative | Carry | Overflow);
- APURegisters.P |= IAPU._Carry | ((IAPU._Zero == 0) << 1) |
+ IAPU.Registers.P &= ~(Zero | Negative | Carry | Overflow);
+ IAPU.Registers.P |= IAPU._Carry | ((IAPU._Zero == 0) << 1) |
(IAPU._Zero & 0x80) | (IAPU._Overflow << 6);
}
@@ -162,8 +163,8 @@ void S9xSetAPUTimer (uint16 Address, uint8 byte);
bool8 S9xInitSound (int quality, bool8 stereo, int buffer_size);
void S9xOpenCloseSoundTracingFile (bool8);
void S9xPrintAPUState ();
-extern int32 S9xAPUCycles [256]; // Scaled cycle lengths
-extern int32 S9xAPUCycleLengths [256]; // Raw data.
+extern uint16 S9xAPUCycles [256]; // Scaled cycle lengths
+extern uint16 S9xAPUCycleLengths [256]; // Raw data.
extern void (*S9xApuOpcodes [256]) (void);
END_EXTERN_C