aboutsummaryrefslogtreecommitdiff
path: root/source/spc700.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/spc700.c')
-rw-r--r--source/spc700.c623
1 files changed, 308 insertions, 315 deletions
diff --git a/source/spc700.c b/source/spc700.c
index 6737e30..fed54ff 100644
--- a/source/spc700.c
+++ b/source/spc700.c
@@ -19,8 +19,8 @@ uint8_t Work8 = 0;
uint16_t Work16 = 0;
uint32_t Work32 = 0;
-#define OP1 (*(IAPU.PC + 1))
-#define OP2 (*(IAPU.PC + 2))
+#define OP1 IAPU.PC[1]
+#define OP2 IAPU.PC[2]
#define APUShutdown() \
if (Settings.Shutdown && (IAPU.PC == IAPU.WaitAddress1 || IAPU.PC == IAPU.WaitAddress2)) \
@@ -39,19 +39,19 @@ uint32_t Work32 = 0;
}
#define APUSetZN8(b) \
- IAPU._Zero = (b);
+ IAPU._Zero = (b)
#define APUSetZN16(w) \
- IAPU._Zero = ((w) != 0) | ((w) >> 8);
+ IAPU._Zero = ((w) != 0) | ((w) >> 8)
#define TCALL(n) \
{\
- SPC700_PushW (IAPU.PC - IAPU.RAM + 1); \
+ PushW (IAPU.PC - IAPU.RAM + 1); \
IAPU.PC = IAPU.RAM + S9xAPUGetByte(0xffc0 + ((15 - n) << 1)) + \
(S9xAPUGetByte(0xffc1 + ((15 - n) << 1)) << 8); \
}
-#define SBC(a,b) \
+#define SBC(a, b) \
Int16 = (int16_t) (a) - (int16_t) (b) + (int16_t) (APUCheckCarry ()) - 1; \
IAPU._Carry = Int16 >= 0; \
if ((((a) ^ (b)) & 0x80) && (((a) ^ (uint8_t) Int16) & 0x80)) \
@@ -80,62 +80,68 @@ uint32_t Work32 = 0;
#define CMP(a,b) \
Int16 = (int16_t) (a) - (int16_t) (b); \
IAPU._Carry = Int16 >= 0; \
- APUSetZN8((uint8_t) Int16);
+ APUSetZN8((uint8_t) Int16)
#define ASL(b) \
IAPU._Carry = ((b) & 0x80) != 0; \
(b) <<= 1; \
- APUSetZN8 (b);
+ APUSetZN8 (b)
+
#define LSR(b) \
IAPU._Carry = (b) & 1; \
(b) >>= 1; \
- APUSetZN8 (b);
+ APUSetZN8 (b)
+
#define ROL(b) \
Work16 = ((b) << 1) | APUCheckCarry (); \
IAPU._Carry = Work16 >= 0x100; \
(b) = (uint8_t) Work16; \
- APUSetZN8 (b);
+ APUSetZN8 (b)
+
#define ROR(b) \
Work16 = (b) | ((uint16_t) APUCheckCarry () << 8); \
IAPU._Carry = (uint8_t) Work16 & 1; \
Work16 >>= 1; \
(b) = (uint8_t) Work16; \
- APUSetZN8 (b);
+ APUSetZN8 (b)
#define Push(b) \
- *(IAPU.RAM + 0x100 + IAPU.Registers.S) = b; \
- IAPU.Registers.S--;
+ IAPU.RAM[0x100 + IAPU.Registers.S] = b; \
+ IAPU.Registers.S--
#define Pop(b) \
IAPU.Registers.S++; \
- (b) = *(IAPU.RAM + 0x100 + IAPU.Registers.S);
+ (b) = *(IAPU.RAM + 0x100 + IAPU.Registers.S)
#ifdef FAST_LSB_WORD_ACCESS
-#define SPC700_PushW(w) \
- if (IAPU.Registers.S == 0) {\
+#define PushW(w) \
+ if (IAPU.Registers.S == 0) \
+ {\
*(IAPU.RAM + 0x1ff) = (w); \
*(IAPU.RAM + 0x100) = ((w) >> 8); \
- } else { \
+ } \
+ else \
*(uint16_t *) (IAPU.RAM + 0xff + IAPU.Registers.S) = w; \
- }\
- IAPU.Registers.S -= 2;
+ IAPU.Registers.S -= 2
+
#define PopW(w) \
IAPU.Registers.S += 2; \
if (IAPU.Registers.S == 0) \
(w) = *(IAPU.RAM + 0x1ff) | (*(IAPU.RAM + 0x100) << 8); \
else \
- (w) = *(uint16_t *) (IAPU.RAM + 0xff + IAPU.Registers.S);
+ (w) = *(uint16_t *) (IAPU.RAM + 0xff + IAPU.Registers.S)
#else
-#define SPC700_PushW(w) \
+#define PushW(w) \
*(IAPU.RAM + 0xff + IAPU.Registers.S) = w; \
*(IAPU.RAM + 0x100 + IAPU.Registers.S) = ((w) >> 8); \
- IAPU.Registers.S -= 2;
+ IAPU.Registers.S -= 2
+
#define PopW(w) \
IAPU.Registers.S += 2; \
if(IAPU.Registers.S == 0) \
(w) = *(IAPU.RAM + 0x1ff) | (*(IAPU.RAM + 0x100) << 8); \
else \
- (w) = *(IAPU.RAM + 0xff + IAPU.Registers.S) + (*(IAPU.RAM + 0x100 + IAPU.Registers.S) << 8);
+ (w) = *(IAPU.RAM + 0xff + IAPU.Registers.S) + (*(IAPU.RAM + 0x100 + IAPU.Registers.S) << 8)
#endif
#define Relative() \
@@ -170,6 +176,7 @@ uint32_t Work32 = 0;
#define IndexedXIndirect() \
IAPU.Address = *(IAPU.DirectPage + ((OP1 + IAPU.Registers.X) & 0xff)) + \
(*(IAPU.DirectPage + ((OP1 + IAPU.Registers.X + 1) & 0xff)) << 8);
+
#define Absolute() \
IAPU.Address = OP1 + (OP2 << 8);
@@ -190,104 +197,103 @@ uint32_t Work32 = 0;
IAPU.Registers.YA.B.Y;
#endif
-void Apu00()
+void Apu00(void) // NOP
{
- // NOP
IAPU.PC++;
}
-void Apu01()
+void Apu01(void)
{
- TCALL(0)
+ TCALL(0);
}
-void Apu11()
+void Apu11(void)
{
- TCALL(1)
+ TCALL(1);
}
-void Apu21()
+void Apu21(void)
{
- TCALL(2)
+ TCALL(2);
}
-void Apu31()
+void Apu31(void)
{
- TCALL(3)
+ TCALL(3);
}
-void Apu41()
+void Apu41(void)
{
- TCALL(4)
+ TCALL(4);
}
-void Apu51()
+void Apu51(void)
{
- TCALL(5)
+ TCALL(5);
}
-void Apu61()
+void Apu61(void)
{
- TCALL(6)
+ TCALL(6);
}
-void Apu71()
+void Apu71(void)
{
- TCALL(7)
+ TCALL(7);
}
-void Apu81()
+void Apu81(void)
{
- TCALL(8)
+ TCALL(8);
}
-void Apu91()
+void Apu91(void)
{
- TCALL(9)
+ TCALL(9);
}
-void ApuA1()
+void ApuA1(void)
{
- TCALL(10)
+ TCALL(10);
}
-void ApuB1()
+void ApuB1(void)
{
- TCALL(11)
+ TCALL(11);
}
-void ApuC1()
+void ApuC1(void)
{
- TCALL(12)
+ TCALL(12);
}
-void ApuD1()
+void ApuD1(void)
{
- TCALL(13)
+ TCALL(13);
}
-void ApuE1()
+void ApuE1(void)
{
- TCALL(14)
+ TCALL(14);
}
-void ApuF1()
+void ApuF1(void)
{
- TCALL(15)
+ TCALL(15);
}
-void Apu3F() // CALL absolute
+void Apu3F(void) // CALL absolute
{
Absolute();
// 0xB6f for Star Fox 2
- SPC700_PushW(IAPU.PC + 3 - IAPU.RAM);
+ PushW(IAPU.PC + 3 - IAPU.RAM);
IAPU.PC = IAPU.RAM + IAPU.Address;
}
-void Apu4F() // PCALL $XX
+void Apu4F(void) // PCALL $XX
{
Work8 = OP1;
- SPC700_PushW(IAPU.PC + 2 - IAPU.RAM);
+ PushW(IAPU.PC + 2 - IAPU.RAM);
IAPU.PC = IAPU.RAM + 0xff00 + Work8;
}
@@ -295,42 +301,42 @@ void Apu4F() // PCALL $XX
S9xAPUSetByteZ ((uint8_t) (S9xAPUGetByteZ (OP1 ) | (1 << (b))), OP1); \
IAPU.PC += 2
-void Apu02()
+void Apu02(void)
{
SET(0);
}
-void Apu22()
+void Apu22(void)
{
SET(1);
}
-void Apu42()
+void Apu42(void)
{
SET(2);
}
-void Apu62()
+void Apu62(void)
{
SET(3);
}
-void Apu82()
+void Apu82(void)
{
SET(4);
}
-void ApuA2()
+void ApuA2(void)
{
SET(5);
}
-void ApuC2()
+void ApuC2(void)
{
SET(6);
}
-void ApuE2()
+void ApuE2(void)
{
SET(7);
}
@@ -339,42 +345,42 @@ void ApuE2()
S9xAPUSetByteZ ((uint8_t) (S9xAPUGetByteZ (OP1) & ~(1 << (b))), OP1); \
IAPU.PC += 2;
-void Apu12()
+void Apu12(void)
{
CLR(0);
}
-void Apu32()
+void Apu32(void)
{
CLR(1);
}
-void Apu52()
+void Apu52(void)
{
CLR(2);
}
-void Apu72()
+void Apu72(void)
{
CLR(3);
}
-void Apu92()
+void Apu92(void)
{
CLR(4);
}
-void ApuB2()
+void ApuB2(void)
{
CLR(5);
}
-void ApuD2()
+void ApuD2(void)
{
CLR(6);
}
-void ApuF2()
+void ApuF2(void)
{
CLR(7);
}
@@ -390,42 +396,42 @@ if (S9xAPUGetByteZ (Work8) & (1 << (b))) \
else \
IAPU.PC += 3
-void Apu03()
+void Apu03(void)
{
BBS(0);
}
-void Apu23()
+void Apu23(void)
{
BBS(1);
}
-void Apu43()
+void Apu43(void)
{
BBS(2);
}
-void Apu63()
+void Apu63(void)
{
BBS(3);
}
-void Apu83()
+void Apu83(void)
{
BBS(4);
}
-void ApuA3()
+void ApuA3(void)
{
BBS(5);
}
-void ApuC3()
+void ApuC3(void)
{
BBS(6);
}
-void ApuE3()
+void ApuE3(void)
{
BBS(7);
}
@@ -441,47 +447,47 @@ if (!(S9xAPUGetByteZ (Work8) & (1 << (b)))) \
else \
IAPU.PC += 3
-void Apu13()
+void Apu13(void)
{
BBC(0);
}
-void Apu33()
+void Apu33(void)
{
BBC(1);
}
-void Apu53()
+void Apu53(void)
{
BBC(2);
}
-void Apu73()
+void Apu73(void)
{
BBC(3);
}
-void Apu93()
+void Apu93(void)
{
BBC(4);
}
-void ApuB3()
+void ApuB3(void)
{
BBC(5);
}
-void ApuD3()
+void ApuD3(void)
{
BBC(6);
}
-void ApuF3()
+void ApuF3(void)
{
BBC(7);
}
-void Apu04()
+void Apu04(void)
{
// OR A,dp
IAPU.Registers.YA.B.A |= S9xAPUGetByteZ(OP1);
@@ -489,7 +495,7 @@ void Apu04()
IAPU.PC += 2;
}
-void Apu05()
+void Apu05(void)
{
// OR A,abs
Absolute();
@@ -498,7 +504,7 @@ void Apu05()
IAPU.PC += 3;
}
-void Apu06()
+void Apu06(void)
{
// OR A,(X)
IAPU.Registers.YA.B.A |= S9xAPUGetByteZ(IAPU.Registers.X);
@@ -506,7 +512,7 @@ void Apu06()
IAPU.PC++;
}
-void Apu07()
+void Apu07(void)
{
// OR A,(dp+X)
IndexedXIndirect();
@@ -515,7 +521,7 @@ void Apu07()
IAPU.PC += 2;
}
-void Apu08()
+void Apu08(void)
{
// OR A,#00
IAPU.Registers.YA.B.A |= OP1;
@@ -523,7 +529,7 @@ void Apu08()
IAPU.PC += 2;
}
-void Apu09()
+void Apu09(void)
{
// OR dp(dest),dp(src)
Work8 = S9xAPUGetByteZ(OP1);
@@ -533,7 +539,7 @@ void Apu09()
IAPU.PC += 3;
}
-void Apu14()
+void Apu14(void)
{
// OR A,dp+X
IAPU.Registers.YA.B.A |= S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
@@ -541,7 +547,7 @@ void Apu14()
IAPU.PC += 2;
}
-void Apu15()
+void Apu15(void)
{
// OR A,abs+X
AbsoluteX();
@@ -550,7 +556,7 @@ void Apu15()
IAPU.PC += 3;
}
-void Apu16()
+void Apu16(void)
{
// OR A,abs+Y
AbsoluteY();
@@ -559,7 +565,7 @@ void Apu16()
IAPU.PC += 3;
}
-void Apu17()
+void Apu17(void)
{
// OR A,(dp)+Y
IndirectIndexedY();
@@ -568,7 +574,7 @@ void Apu17()
IAPU.PC += 2;
}
-void Apu18()
+void Apu18(void)
{
// OR dp,#00
Work8 = OP1;
@@ -578,7 +584,7 @@ void Apu18()
IAPU.PC += 3;
}
-void Apu19()
+void Apu19(void)
{
// OR (X),(Y)
Work8 = S9xAPUGetByteZ(IAPU.Registers.X) | S9xAPUGetByteZ(IAPU.Registers.YA.B.Y);
@@ -587,55 +593,47 @@ void Apu19()
IAPU.PC++;
}
-void Apu0A()
+void Apu0A(void)
{
// OR1 C,membit
MemBit();
if (!APUCheckCarry())
- {
if (S9xAPUGetByte(IAPU.Address) & (1 << IAPU.Bit))
APUSetCarry();
- }
IAPU.PC += 3;
}
-void Apu2A()
+void Apu2A(void)
{
// OR1 C,not membit
MemBit();
if (!APUCheckCarry())
- {
if (!(S9xAPUGetByte(IAPU.Address) & (1 << IAPU.Bit)))
APUSetCarry();
- }
IAPU.PC += 3;
}
-void Apu4A()
+void Apu4A(void)
{
// AND1 C,membit
MemBit();
if (APUCheckCarry())
- {
if (!(S9xAPUGetByte(IAPU.Address) & (1 << IAPU.Bit)))
APUClearCarry();
- }
IAPU.PC += 3;
}
-void Apu6A()
+void Apu6A(void)
{
// AND1 C, not membit
MemBit();
if (APUCheckCarry())
- {
if ((S9xAPUGetByte(IAPU.Address) & (1 << IAPU.Bit)))
APUClearCarry();
- }
IAPU.PC += 3;
}
-void Apu8A()
+void Apu8A(void)
{
// EOR1 C, membit
MemBit();
@@ -649,7 +647,7 @@ void Apu8A()
IAPU.PC += 3;
}
-void ApuAA()
+void ApuAA(void)
{
// MOV1 C,membit
MemBit();
@@ -660,7 +658,7 @@ void ApuAA()
IAPU.PC += 3;
}
-void ApuCA()
+void ApuCA(void)
{
// MOV1 membit,C
MemBit();
@@ -671,7 +669,7 @@ void ApuCA()
IAPU.PC += 3;
}
-void ApuEA()
+void ApuEA(void)
{
// NOT1 membit
MemBit();
@@ -679,7 +677,7 @@ void ApuEA()
IAPU.PC += 3;
}
-void Apu0B()
+void Apu0B(void)
{
// ASL dp
Work8 = S9xAPUGetByteZ(OP1);
@@ -688,7 +686,7 @@ void Apu0B()
IAPU.PC += 2;
}
-void Apu0C()
+void Apu0C(void)
{
// ASL abs
Absolute();
@@ -698,7 +696,7 @@ void Apu0C()
IAPU.PC += 3;
}
-void Apu1B()
+void Apu1B(void)
{
// ASL dp+X
Work8 = S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
@@ -707,14 +705,14 @@ void Apu1B()
IAPU.PC += 2;
}
-void Apu1C()
+void Apu1C(void)
{
// ASL A
ASL(IAPU.Registers.YA.B.A);
IAPU.PC++;
}
-void Apu0D()
+void Apu0D(void)
{
// PUSH PSW
S9xAPUPackStatus();
@@ -722,28 +720,28 @@ void Apu0D()
IAPU.PC++;
}
-void Apu2D()
+void Apu2D(void)
{
// PUSH A
Push(IAPU.Registers.YA.B.A);
IAPU.PC++;
}
-void Apu4D()
+void Apu4D(void)
{
// PUSH X
Push(IAPU.Registers.X);
IAPU.PC++;
}
-void Apu6D()
+void Apu6D(void)
{
// PUSH Y
Push(IAPU.Registers.YA.B.Y);
IAPU.PC++;
}
-void Apu8E()
+void Apu8E(void)
{
// POP PSW
Pop(IAPU.Registers.P);
@@ -755,28 +753,28 @@ void Apu8E()
IAPU.PC++;
}
-void ApuAE()
+void ApuAE(void)
{
// POP A
Pop(IAPU.Registers.YA.B.A);
IAPU.PC++;
}
-void ApuCE()
+void ApuCE(void)
{
// POP X
Pop(IAPU.Registers.X);
IAPU.PC++;
}
-void ApuEE()
+void ApuEE(void)
{
// POP Y
Pop(IAPU.Registers.YA.B.Y);
IAPU.PC++;
}
-void Apu0E()
+void Apu0E(void)
{
// TSET1 abs
Absolute();
@@ -787,7 +785,7 @@ void Apu0E()
IAPU.PC += 3;
}
-void Apu4E()
+void Apu4E(void)
{
// TCLR1 abs
Absolute();
@@ -798,10 +796,10 @@ void Apu4E()
IAPU.PC += 3;
}
-void Apu0F()
+void Apu0F(void)
{
// BRK
- SPC700_PushW(IAPU.PC + 1 - IAPU.RAM);
+ PushW(IAPU.PC + 1 - IAPU.RAM);
S9xAPUPackStatus();
Push(IAPU.Registers.P);
APUSetBreak();
@@ -809,14 +807,14 @@ void Apu0F()
IAPU.PC = IAPU.RAM + S9xAPUGetByte(0xffde) + (S9xAPUGetByte(0xffdf) << 8);
}
-void ApuEF()
+void ApuEF(void)
{
// SLEEP
APU.TimerEnabled[0] = APU.TimerEnabled[1] = APU.TimerEnabled[2] = false;
IAPU.APUExecuting = false;
}
-void ApuFF()
+void ApuFF(void)
{
// STOP
APU.TimerEnabled[0] = APU.TimerEnabled[1] = APU.TimerEnabled[2] = false;
@@ -824,7 +822,7 @@ void ApuFF()
Settings.APUEnabled = false; // re-enabled on next APU reset
}
-void Apu10()
+void Apu10(void)
{
// BPL
Relative();
@@ -838,7 +836,7 @@ void Apu10()
IAPU.PC += 2;
}
-void Apu30()
+void Apu30(void)
{
// BMI
Relative();
@@ -852,7 +850,7 @@ void Apu30()
IAPU.PC += 2;
}
-void Apu90()
+void Apu90(void)
{
// BCC
Relative();
@@ -866,7 +864,7 @@ void Apu90()
IAPU.PC += 2;
}
-void ApuB0()
+void ApuB0(void)
{
// BCS
Relative();
@@ -880,7 +878,7 @@ void ApuB0()
IAPU.PC += 2;
}
-void ApuD0()
+void ApuD0(void)
{
// BNE
Relative();
@@ -894,7 +892,7 @@ void ApuD0()
IAPU.PC += 2;
}
-void ApuF0()
+void ApuF0(void)
{
// BEQ
Relative();
@@ -908,7 +906,7 @@ void ApuF0()
IAPU.PC += 2;
}
-void Apu50()
+void Apu50(void)
{
// BVC
Relative();
@@ -921,7 +919,7 @@ void Apu50()
IAPU.PC += 2;
}
-void Apu70()
+void Apu70(void)
{
// BVS
Relative();
@@ -934,28 +932,28 @@ void Apu70()
IAPU.PC += 2;
}
-void Apu2F()
+void Apu2F(void)
{
// BRA
Relative();
IAPU.PC = IAPU.RAM + (uint16_t) Int16;
}
-void Apu80()
+void Apu80(void)
{
// SETC
APUSetCarry();
IAPU.PC++;
}
-void ApuED()
+void ApuED(void)
{
// NOTC
IAPU._Carry ^= 1;
IAPU.PC++;
}
-void Apu40()
+void Apu40(void)
{
// SETP
APUSetDirectPage();
@@ -963,7 +961,7 @@ void Apu40()
IAPU.PC++;
}
-void Apu1A()
+void Apu1A(void)
{
// DECW dp
Work16 = S9xAPUGetByteZ(OP1) + (S9xAPUGetByteZ(OP1 + 1) << 8) - 1;
@@ -973,7 +971,7 @@ void Apu1A()
IAPU.PC += 2;
}
-void Apu5A()
+void Apu5A(void)
{
// CMPW YA,dp
Work16 = S9xAPUGetByteZ(OP1) + (S9xAPUGetByteZ(OP1 + 1) << 8);
@@ -983,7 +981,7 @@ void Apu5A()
IAPU.PC += 2;
}
-void Apu3A()
+void Apu3A(void)
{
// INCW dp
Work16 = S9xAPUGetByteZ(OP1) + (S9xAPUGetByteZ(OP1 + 1) << 8) + 1;
@@ -993,7 +991,7 @@ void Apu3A()
IAPU.PC += 2;
}
-void Apu7A()
+void Apu7A(void)
{
// ADDW YA,dp
Work16 = S9xAPUGetByteZ(OP1) + (S9xAPUGetByteZ(OP1 + 1) << 8);
@@ -1011,15 +1009,14 @@ void Apu7A()
IAPU.PC += 2;
}
-void Apu9A()
+void Apu9A(void)
{
// SUBW YA,dp
Work16 = S9xAPUGetByteZ(OP1) + (S9xAPUGetByteZ(OP1 + 1) << 8);
Int32 = (int32_t) IAPU.Registers.YA.W - (int32_t) Work16;
APUClearHalfCarry();
IAPU._Carry = Int32 >= 0;
- if (((IAPU.Registers.YA.W ^ Work16) & 0x8000) &&
- ((IAPU.Registers.YA.W ^ (uint16_t) Int32) & 0x8000))
+ if (((IAPU.Registers.YA.W ^ Work16) & 0x8000) && ((IAPU.Registers.YA.W ^ (uint16_t) Int32) & 0x8000))
APUSetOverflow();
else
APUClearOverflow();
@@ -1031,7 +1028,7 @@ void Apu9A()
IAPU.PC += 2;
}
-void ApuBA()
+void ApuBA(void)
{
// MOVW YA,dp
IAPU.Registers.YA.B.A = S9xAPUGetByteZ(OP1);
@@ -1040,7 +1037,7 @@ void ApuBA()
IAPU.PC += 2;
}
-void ApuDA()
+void ApuDA(void)
{
// MOVW dp,YA
S9xAPUSetByteZ(IAPU.Registers.YA.B.A, OP1);
@@ -1048,7 +1045,7 @@ void ApuDA()
IAPU.PC += 2;
}
-void Apu64()
+void Apu64(void)
{
// CMP A,dp
Work8 = S9xAPUGetByteZ(OP1);
@@ -1056,7 +1053,7 @@ void Apu64()
IAPU.PC += 2;
}
-void Apu65()
+void Apu65(void)
{
// CMP A,abs
Absolute();
@@ -1065,7 +1062,7 @@ void Apu65()
IAPU.PC += 3;
}
-void Apu66()
+void Apu66(void)
{
// CMP A,(X)
Work8 = S9xAPUGetByteZ(IAPU.Registers.X);
@@ -1073,7 +1070,7 @@ void Apu66()
IAPU.PC++;
}
-void Apu67()
+void Apu67(void)
{
// CMP A,(dp+X)
IndexedXIndirect();
@@ -1082,7 +1079,7 @@ void Apu67()
IAPU.PC += 2;
}
-void Apu68()
+void Apu68(void)
{
// CMP A,#00
Work8 = OP1;
@@ -1090,7 +1087,7 @@ void Apu68()
IAPU.PC += 2;
}
-void Apu69()
+void Apu69(void)
{
// CMP dp(dest), dp(src)
W1 = S9xAPUGetByteZ(OP1);
@@ -1099,7 +1096,7 @@ void Apu69()
IAPU.PC += 3;
}
-void Apu74()
+void Apu74(void)
{
// CMP A, dp+X
Work8 = S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
@@ -1107,7 +1104,7 @@ void Apu74()
IAPU.PC += 2;
}
-void Apu75()
+void Apu75(void)
{
// CMP A,abs+X
AbsoluteX();
@@ -1116,7 +1113,7 @@ void Apu75()
IAPU.PC += 3;
}
-void Apu76()
+void Apu76(void)
{
// CMP A, abs+Y
AbsoluteY();
@@ -1125,7 +1122,7 @@ void Apu76()
IAPU.PC += 3;
}
-void Apu77()
+void Apu77(void)
{
// CMP A,(dp)+Y
IndirectIndexedY();
@@ -1134,7 +1131,7 @@ void Apu77()
IAPU.PC += 2;
}
-void Apu78()
+void Apu78(void)
{
// CMP dp,#00
Work8 = OP1;
@@ -1143,7 +1140,7 @@ void Apu78()
IAPU.PC += 3;
}
-void Apu79()
+void Apu79(void)
{
// CMP (X),(Y)
W1 = S9xAPUGetByteZ(IAPU.Registers.X);
@@ -1152,7 +1149,7 @@ void Apu79()
IAPU.PC++;
}
-void Apu1E()
+void Apu1E(void)
{
// CMP X,abs
Absolute();
@@ -1161,7 +1158,7 @@ void Apu1E()
IAPU.PC += 3;
}
-void Apu3E()
+void Apu3E(void)
{
// CMP X,dp
Work8 = S9xAPUGetByteZ(OP1);
@@ -1169,14 +1166,14 @@ void Apu3E()
IAPU.PC += 2;
}
-void ApuC8()
+void ApuC8(void)
{
// CMP X,#00
CMP(IAPU.Registers.X, OP1);
IAPU.PC += 2;
}
-void Apu5E()
+void Apu5E(void)
{
// CMP Y,abs
Absolute();
@@ -1185,7 +1182,7 @@ void Apu5E()
IAPU.PC += 3;
}
-void Apu7E()
+void Apu7E(void)
{
// CMP Y,dp
Work8 = S9xAPUGetByteZ(OP1);
@@ -1193,7 +1190,7 @@ void Apu7E()
IAPU.PC += 2;
}
-void ApuAD()
+void ApuAD(void)
{
// CMP Y,#00
Work8 = OP1;
@@ -1201,22 +1198,21 @@ void ApuAD()
IAPU.PC += 2;
}
-void Apu1F()
+void Apu1F(void)
{
// JMP (abs+X)
Absolute();
- IAPU.PC = IAPU.RAM + S9xAPUGetByte(IAPU.Address + IAPU.Registers.X) +
- (S9xAPUGetByte(IAPU.Address + IAPU.Registers.X + 1) << 8);
+ IAPU.PC = IAPU.RAM + S9xAPUGetByte(IAPU.Address + IAPU.Registers.X) + (S9xAPUGetByte(IAPU.Address + IAPU.Registers.X + 1) << 8);
}
-void Apu5F()
+void Apu5F(void)
{
// JMP abs
Absolute();
IAPU.PC = IAPU.RAM + IAPU.Address;
}
-void Apu20()
+void Apu20(void)
{
// CLRP
APUClearDirectPage();
@@ -1224,14 +1220,14 @@ void Apu20()
IAPU.PC++;
}
-void Apu60()
+void Apu60(void)
{
// CLRC
APUClearCarry();
IAPU.PC++;
}
-void ApuE0()
+void ApuE0(void)
{
// CLRV
APUClearHalfCarry();
@@ -1239,7 +1235,7 @@ void ApuE0()
IAPU.PC++;
}
-void Apu24()
+void Apu24(void)
{
// AND A,dp
IAPU.Registers.YA.B.A &= S9xAPUGetByteZ(OP1);
@@ -1247,7 +1243,7 @@ void Apu24()
IAPU.PC += 2;
}
-void Apu25()
+void Apu25(void)
{
// AND A,abs
Absolute();
@@ -1256,7 +1252,7 @@ void Apu25()
IAPU.PC += 3;
}
-void Apu26()
+void Apu26(void)
{
// AND A,(X)
IAPU.Registers.YA.B.A &= S9xAPUGetByteZ(IAPU.Registers.X);
@@ -1264,7 +1260,7 @@ void Apu26()
IAPU.PC++;
}
-void Apu27()
+void Apu27(void)
{
// AND A,(dp+X)
IndexedXIndirect();
@@ -1273,7 +1269,7 @@ void Apu27()
IAPU.PC += 2;
}
-void Apu28()
+void Apu28(void)
{
// AND A,#00
IAPU.Registers.YA.B.A &= OP1;
@@ -1281,7 +1277,7 @@ void Apu28()
IAPU.PC += 2;
}
-void Apu29()
+void Apu29(void)
{
// AND dp(dest),dp(src)
Work8 = S9xAPUGetByteZ(OP1);
@@ -1291,7 +1287,7 @@ void Apu29()
IAPU.PC += 3;
}
-void Apu34()
+void Apu34(void)
{
// AND A,dp+X
IAPU.Registers.YA.B.A &= S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
@@ -1299,7 +1295,7 @@ void Apu34()
IAPU.PC += 2;
}
-void Apu35()
+void Apu35(void)
{
// AND A,abs+X
AbsoluteX();
@@ -1308,7 +1304,7 @@ void Apu35()
IAPU.PC += 3;
}
-void Apu36()
+void Apu36(void)
{
// AND A,abs+Y
AbsoluteY();
@@ -1317,7 +1313,7 @@ void Apu36()
IAPU.PC += 3;
}
-void Apu37()
+void Apu37(void)
{
// AND A,(dp)+Y
IndirectIndexedY();
@@ -1326,7 +1322,7 @@ void Apu37()
IAPU.PC += 2;
}
-void Apu38()
+void Apu38(void)
{
// AND dp,#00
Work8 = OP1;
@@ -1336,7 +1332,7 @@ void Apu38()
IAPU.PC += 3;
}
-void Apu39()
+void Apu39(void)
{
// AND (X),(Y)
Work8 = S9xAPUGetByteZ(IAPU.Registers.X) & S9xAPUGetByteZ(IAPU.Registers.YA.B.Y);
@@ -1345,7 +1341,7 @@ void Apu39()
IAPU.PC++;
}
-void Apu2B()
+void Apu2B(void)
{
// ROL dp
Work8 = S9xAPUGetByteZ(OP1);
@@ -1354,7 +1350,7 @@ void Apu2B()
IAPU.PC += 2;
}
-void Apu2C()
+void Apu2C(void)
{
// ROL abs
Absolute();
@@ -1364,7 +1360,7 @@ void Apu2C()
IAPU.PC += 3;
}
-void Apu3B()
+void Apu3B(void)
{
// ROL dp+X
Work8 = S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
@@ -1373,14 +1369,14 @@ void Apu3B()
IAPU.PC += 2;
}
-void Apu3C()
+void Apu3C(void)
{
// ROL A
ROL(IAPU.Registers.YA.B.A);
IAPU.PC++;
}
-void Apu2E()
+void Apu2E(void)
{
// CBNE dp,rel
Work8 = OP1;
@@ -1396,7 +1392,7 @@ void Apu2E()
IAPU.PC += 3;
}
-void ApuDE()
+void ApuDE(void)
{
// CBNE dp+X,rel
Work8 = OP1 + IAPU.Registers.X;
@@ -1412,7 +1408,7 @@ void ApuDE()
IAPU.PC += 3;
}
-void Apu3D()
+void Apu3D(void)
{
// INC X
IAPU.Registers.X++;
@@ -1421,7 +1417,7 @@ void Apu3D()
IAPU.PC++;
}
-void ApuFC()
+void ApuFC(void)
{
// INC Y
IAPU.Registers.YA.B.Y++;
@@ -1430,7 +1426,7 @@ void ApuFC()
IAPU.PC++;
}
-void Apu1D()
+void Apu1D(void)
{
// DEC X
IAPU.Registers.X--;
@@ -1439,7 +1435,7 @@ void Apu1D()
IAPU.PC++;
}
-void ApuDC()
+void ApuDC(void)
{
// DEC Y
IAPU.Registers.YA.B.Y--;
@@ -1448,7 +1444,7 @@ void ApuDC()
IAPU.PC++;
}
-void ApuAB()
+void ApuAB(void)
{
// INC dp
Work8 = S9xAPUGetByteZ(OP1) + 1;
@@ -1458,7 +1454,7 @@ void ApuAB()
IAPU.PC += 2;
}
-void ApuAC()
+void ApuAC(void)
{
// INC abs
Absolute();
@@ -1469,7 +1465,7 @@ void ApuAC()
IAPU.PC += 3;
}
-void ApuBB()
+void ApuBB(void)
{
// INC dp+X
Work8 = S9xAPUGetByteZ(OP1 + IAPU.Registers.X) + 1;
@@ -1479,7 +1475,7 @@ void ApuBB()
IAPU.PC += 2;
}
-void ApuBC()
+void ApuBC(void)
{
// INC A
IAPU.Registers.YA.B.A++;
@@ -1488,7 +1484,7 @@ void ApuBC()
IAPU.PC++;
}
-void Apu8B()
+void Apu8B(void)
{
// DEC dp
Work8 = S9xAPUGetByteZ(OP1) - 1;
@@ -1498,7 +1494,7 @@ void Apu8B()
IAPU.PC += 2;
}
-void Apu8C()
+void Apu8C(void)
{
// DEC abs
Absolute();
@@ -1509,7 +1505,7 @@ void Apu8C()
IAPU.PC += 3;
}
-void Apu9B()
+void Apu9B(void)
{
// DEC dp+X
Work8 = S9xAPUGetByteZ(OP1 + IAPU.Registers.X) - 1;
@@ -1519,7 +1515,7 @@ void Apu9B()
IAPU.PC += 2;
}
-void Apu9C()
+void Apu9C(void)
{
// DEC A
IAPU.Registers.YA.B.A--;
@@ -1528,7 +1524,7 @@ void Apu9C()
IAPU.PC++;
}
-void Apu44()
+void Apu44(void)
{
// EOR A,dp
IAPU.Registers.YA.B.A ^= S9xAPUGetByteZ(OP1);
@@ -1536,7 +1532,7 @@ void Apu44()
IAPU.PC += 2;
}
-void Apu45()
+void Apu45(void)
{
// EOR A,abs
Absolute();
@@ -1545,7 +1541,7 @@ void Apu45()
IAPU.PC += 3;
}
-void Apu46()
+void Apu46(void)
{
// EOR A,(X)
IAPU.Registers.YA.B.A ^= S9xAPUGetByteZ(IAPU.Registers.X);
@@ -1553,7 +1549,7 @@ void Apu46()
IAPU.PC++;
}
-void Apu47()
+void Apu47(void)
{
// EOR A,(dp+X)
IndexedXIndirect();
@@ -1562,7 +1558,7 @@ void Apu47()
IAPU.PC += 2;
}
-void Apu48()
+void Apu48(void)
{
// EOR A,#00
IAPU.Registers.YA.B.A ^= OP1;
@@ -1570,7 +1566,7 @@ void Apu48()
IAPU.PC += 2;
}
-void Apu49()
+void Apu49(void)
{
// EOR dp(dest),dp(src)
Work8 = S9xAPUGetByteZ(OP1);
@@ -1580,7 +1576,7 @@ void Apu49()
IAPU.PC += 3;
}
-void Apu54()
+void Apu54(void)
{
// EOR A,dp+X
IAPU.Registers.YA.B.A ^= S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
@@ -1588,7 +1584,7 @@ void Apu54()
IAPU.PC += 2;
}
-void Apu55()
+void Apu55(void)
{
// EOR A,abs+X
AbsoluteX();
@@ -1597,7 +1593,7 @@ void Apu55()
IAPU.PC += 3;
}
-void Apu56()
+void Apu56(void)
{
// EOR A,abs+Y
AbsoluteY();
@@ -1606,7 +1602,7 @@ void Apu56()
IAPU.PC += 3;
}
-void Apu57()
+void Apu57(void)
{
// EOR A,(dp)+Y
IndirectIndexedY();
@@ -1615,7 +1611,7 @@ void Apu57()
IAPU.PC += 2;
}
-void Apu58()
+void Apu58(void)
{
// EOR dp,#00
Work8 = OP1;
@@ -1625,7 +1621,7 @@ void Apu58()
IAPU.PC += 3;
}
-void Apu59()
+void Apu59(void)
{
// EOR (X),(Y)
Work8 = S9xAPUGetByteZ(IAPU.Registers.X) ^ S9xAPUGetByteZ(IAPU.Registers.YA.B.Y);
@@ -1634,7 +1630,7 @@ void Apu59()
IAPU.PC++;
}
-void Apu4B()
+void Apu4B(void)
{
// LSR dp
Work8 = S9xAPUGetByteZ(OP1);
@@ -1643,7 +1639,7 @@ void Apu4B()
IAPU.PC += 2;
}
-void Apu4C()
+void Apu4C(void)
{
// LSR abs
Absolute();
@@ -1653,7 +1649,7 @@ void Apu4C()
IAPU.PC += 3;
}
-void Apu5B()
+void Apu5B(void)
{
// LSR dp+X
Work8 = S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
@@ -1662,14 +1658,14 @@ void Apu5B()
IAPU.PC += 2;
}
-void Apu5C()
+void Apu5C(void)
{
// LSR A
LSR(IAPU.Registers.YA.B.A);
IAPU.PC++;
}
-void Apu7D()
+void Apu7D(void)
{
// MOV A,X
IAPU.Registers.YA.B.A = IAPU.Registers.X;
@@ -1677,7 +1673,7 @@ void Apu7D()
IAPU.PC++;
}
-void ApuDD()
+void ApuDD(void)
{
// MOV A,Y
IAPU.Registers.YA.B.A = IAPU.Registers.YA.B.Y;
@@ -1685,7 +1681,7 @@ void ApuDD()
IAPU.PC++;
}
-void Apu5D()
+void Apu5D(void)
{
// MOV X,A
IAPU.Registers.X = IAPU.Registers.YA.B.A;
@@ -1693,7 +1689,7 @@ void Apu5D()
IAPU.PC++;
}
-void ApuFD()
+void ApuFD(void)
{
// MOV Y,A
IAPU.Registers.YA.B.Y = IAPU.Registers.YA.B.A;
@@ -1701,7 +1697,7 @@ void ApuFD()
IAPU.PC++;
}
-void Apu9D()
+void Apu9D(void)
{
//MOV X,SP
IAPU.Registers.X = IAPU.Registers.S;
@@ -1709,14 +1705,14 @@ void Apu9D()
IAPU.PC++;
}
-void ApuBD()
+void ApuBD(void)
{
// MOV SP,X
IAPU.Registers.S = IAPU.Registers.X;
IAPU.PC++;
}
-void Apu6B()
+void Apu6B(void)
{
// ROR dp
Work8 = S9xAPUGetByteZ(OP1);
@@ -1725,7 +1721,7 @@ void Apu6B()
IAPU.PC += 2;
}
-void Apu6C()
+void Apu6C(void)
{
// ROR abs
Absolute();
@@ -1735,7 +1731,7 @@ void Apu6C()
IAPU.PC += 3;
}
-void Apu7B()
+void Apu7B(void)
{
// ROR dp+X
Work8 = S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
@@ -1744,14 +1740,14 @@ void Apu7B()
IAPU.PC += 2;
}
-void Apu7C()
+void Apu7C(void)
{
// ROR A
ROR(IAPU.Registers.YA.B.A);
IAPU.PC++;
}
-void Apu6E()
+void Apu6E(void)
{
// DBNZ dp,rel
Work8 = OP1;
@@ -1767,7 +1763,7 @@ void Apu6E()
IAPU.PC += 3;
}
-void ApuFE()
+void ApuFE(void)
{
// DBNZ Y,rel
Relative();
@@ -1781,14 +1777,14 @@ void ApuFE()
IAPU.PC += 2;
}
-void Apu6F()
+void Apu6F(void)
{
// RET
PopW(IAPU.Registers.PC);
IAPU.PC = IAPU.RAM + IAPU.Registers.PC;
}
-void Apu7F()
+void Apu7F(void)
{
// RETI
Pop(IAPU.Registers.P);
@@ -1797,7 +1793,7 @@ void Apu7F()
IAPU.PC = IAPU.RAM + IAPU.Registers.PC;
}
-void Apu84()
+void Apu84(void)
{
// ADC A,dp
Work8 = S9xAPUGetByteZ(OP1);
@@ -1805,7 +1801,7 @@ void Apu84()
IAPU.PC += 2;
}
-void Apu85()
+void Apu85(void)
{
// ADC A, abs
Absolute();
@@ -1814,7 +1810,7 @@ void Apu85()
IAPU.PC += 3;
}
-void Apu86()
+void Apu86(void)
{
// ADC A,(X)
Work8 = S9xAPUGetByteZ(IAPU.Registers.X);
@@ -1822,7 +1818,7 @@ void Apu86()
IAPU.PC++;
}
-void Apu87()
+void Apu87(void)
{
// ADC A,(dp+X)
IndexedXIndirect();
@@ -1831,7 +1827,7 @@ void Apu87()
IAPU.PC += 2;
}
-void Apu88()
+void Apu88(void)
{
// ADC A,#00
Work8 = OP1;
@@ -1839,7 +1835,7 @@ void Apu88()
IAPU.PC += 2;
}
-void Apu89()
+void Apu89(void)
{
// ADC dp(dest),dp(src)
Work8 = S9xAPUGetByteZ(OP1);
@@ -1849,7 +1845,7 @@ void Apu89()
IAPU.PC += 3;
}
-void Apu94()
+void Apu94(void)
{
// ADC A,dp+X
Work8 = S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
@@ -1857,7 +1853,7 @@ void Apu94()
IAPU.PC += 2;
}
-void Apu95()
+void Apu95(void)
{
// ADC A, abs+X
AbsoluteX();
@@ -1866,7 +1862,7 @@ void Apu95()
IAPU.PC += 3;
}
-void Apu96()
+void Apu96(void)
{
// ADC A, abs+Y
AbsoluteY();
@@ -1875,7 +1871,7 @@ void Apu96()
IAPU.PC += 3;
}
-void Apu97()
+void Apu97(void)
{
// ADC A, (dp)+Y
IndirectIndexedY();
@@ -1884,7 +1880,7 @@ void Apu97()
IAPU.PC += 2;
}
-void Apu98()
+void Apu98(void)
{
// ADC dp,#00
Work8 = OP1;
@@ -1894,7 +1890,7 @@ void Apu98()
IAPU.PC += 3;
}
-void Apu99()
+void Apu99(void)
{
// ADC (X),(Y)
W1 = S9xAPUGetByteZ(IAPU.Registers.X);
@@ -1904,7 +1900,7 @@ void Apu99()
IAPU.PC++;
}
-void Apu8D()
+void Apu8D(void)
{
// MOV Y,#00
IAPU.Registers.YA.B.Y = OP1;
@@ -1912,7 +1908,7 @@ void Apu8D()
IAPU.PC += 2;
}
-void Apu8F()
+void Apu8F(void)
{
// MOV dp,#00
Work8 = OP1;
@@ -1920,7 +1916,7 @@ void Apu8F()
IAPU.PC += 3;
}
-void Apu9E()
+void Apu9E(void)
{
// DIV YA,X
if ((IAPU.Registers.X & 0x0f) <= (IAPU.Registers.YA.B.Y & 0x0f))
@@ -1935,13 +1931,10 @@ void Apu9E()
for (i = 0 ; i < 9 ; ++i)
{
yva <<= 1;
-
if (yva & 0x20000)
yva = (yva & 0x1ffff) | 1;
-
if (yva >= x)
yva ^= 1;
-
if (yva & 1)
yva = (yva - x) & 0x1ffff;
}
@@ -1957,7 +1950,7 @@ void Apu9E()
IAPU.PC++;
}
-void Apu9F()
+void Apu9F(void)
{
// XCN A
IAPU.Registers.YA.B.A = (IAPU.Registers.YA.B.A >> 4) | (IAPU.Registers.YA.B.A << 4);
@@ -1965,7 +1958,7 @@ void Apu9F()
IAPU.PC++;
}
-void ApuA4()
+void ApuA4(void)
{
// SBC A, dp
Work8 = S9xAPUGetByteZ(OP1);
@@ -1973,7 +1966,7 @@ void ApuA4()
IAPU.PC += 2;
}
-void ApuA5()
+void ApuA5(void)
{
// SBC A, abs
Absolute();
@@ -1982,7 +1975,7 @@ void ApuA5()
IAPU.PC += 3;
}
-void ApuA6()
+void ApuA6(void)
{
// SBC A, (X)
Work8 = S9xAPUGetByteZ(IAPU.Registers.X);
@@ -1990,7 +1983,7 @@ void ApuA6()
IAPU.PC++;
}
-void ApuA7()
+void ApuA7(void)
{
// SBC A,(dp+X)
IndexedXIndirect();
@@ -1999,7 +1992,7 @@ void ApuA7()
IAPU.PC += 2;
}
-void ApuA8()
+void ApuA8(void)
{
// SBC A,#00
Work8 = OP1;
@@ -2007,7 +2000,7 @@ void ApuA8()
IAPU.PC += 2;
}
-void ApuA9()
+void ApuA9(void)
{
// SBC dp(dest), dp(src)
Work8 = S9xAPUGetByteZ(OP1);
@@ -2017,7 +2010,7 @@ void ApuA9()
IAPU.PC += 3;
}
-void ApuB4()
+void ApuB4(void)
{
// SBC A, dp+X
Work8 = S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
@@ -2025,7 +2018,7 @@ void ApuB4()
IAPU.PC += 2;
}
-void ApuB5()
+void ApuB5(void)
{
// SBC A,abs+X
AbsoluteX();
@@ -2034,7 +2027,7 @@ void ApuB5()
IAPU.PC += 3;
}
-void ApuB6()
+void ApuB6(void)
{
// SBC A,abs+Y
AbsoluteY();
@@ -2043,7 +2036,7 @@ void ApuB6()
IAPU.PC += 3;
}
-void ApuB7()
+void ApuB7(void)
{
// SBC A,(dp)+Y
IndirectIndexedY();
@@ -2052,7 +2045,7 @@ void ApuB7()
IAPU.PC += 2;
}
-void ApuB8()
+void ApuB8(void)
{
// SBC dp,#00
Work8 = OP1;
@@ -2062,7 +2055,7 @@ void ApuB8()
IAPU.PC += 3;
}
-void ApuB9()
+void ApuB9(void)
{
// SBC (X),(Y)
W1 = S9xAPUGetByteZ(IAPU.Registers.X);
@@ -2072,14 +2065,14 @@ void ApuB9()
IAPU.PC++;
}
-void ApuAF()
+void ApuAF(void)
{
// MOV (X)+, A
S9xAPUSetByteZ(IAPU.Registers.YA.B.A, IAPU.Registers.X++);
IAPU.PC++;
}
-void ApuBE()
+void ApuBE(void)
{
// DAS
if (IAPU.Registers.YA.B.A > 0x99 || !IAPU._Carry)
@@ -2097,7 +2090,7 @@ void ApuBE()
IAPU.PC++;
}
-void ApuBF()
+void ApuBF(void)
{
// MOV A,(X)+
IAPU.Registers.YA.B.A = S9xAPUGetByteZ(IAPU.Registers.X++);
@@ -2105,28 +2098,28 @@ void ApuBF()
IAPU.PC++;
}
-void ApuC0()
+void ApuC0(void)
{
// DI
APUClearInterrupt();
IAPU.PC++;
}
-void ApuA0()
+void ApuA0(void)
{
// EI
APUSetInterrupt();
IAPU.PC++;
}
-void ApuC4()
+void ApuC4(void)
{
// MOV dp,A
S9xAPUSetByteZ(IAPU.Registers.YA.B.A, OP1);
IAPU.PC += 2;
}
-void ApuC5()
+void ApuC5(void)
{
// MOV abs,A
Absolute();
@@ -2134,14 +2127,14 @@ void ApuC5()
IAPU.PC += 3;
}
-void ApuC6()
+void ApuC6(void)
{
// MOV (X), A
S9xAPUSetByteZ(IAPU.Registers.YA.B.A, IAPU.Registers.X);
IAPU.PC++;
}
-void ApuC7()
+void ApuC7(void)
{
// MOV (dp+X),A
IndexedXIndirect();
@@ -2149,7 +2142,7 @@ void ApuC7()
IAPU.PC += 2;
}
-void ApuC9()
+void ApuC9(void)
{
// MOV abs,X
Absolute();
@@ -2157,14 +2150,14 @@ void ApuC9()
IAPU.PC += 3;
}
-void ApuCB()
+void ApuCB(void)
{
// MOV dp,Y
S9xAPUSetByteZ(IAPU.Registers.YA.B.Y, OP1);
IAPU.PC += 2;
}
-void ApuCC()
+void ApuCC(void)
{
// MOV abs,Y
Absolute();
@@ -2172,7 +2165,7 @@ void ApuCC()
IAPU.PC += 3;
}
-void ApuCD()
+void ApuCD(void)
{
// MOV X,#00
IAPU.Registers.X = OP1;
@@ -2180,7 +2173,7 @@ void ApuCD()
IAPU.PC += 2;
}
-void ApuCF()
+void ApuCF(void)
{
// MUL YA
IAPU.Registers.YA.W = (uint16_t) IAPU.Registers.YA.B.A * IAPU.Registers.YA.B.Y;
@@ -2188,14 +2181,14 @@ void ApuCF()
IAPU.PC++;
}
-void ApuD4()
+void ApuD4(void)
{
// MOV dp+X, A
S9xAPUSetByteZ(IAPU.Registers.YA.B.A, OP1 + IAPU.Registers.X);
IAPU.PC += 2;
}
-void ApuD5()
+void ApuD5(void)
{
// MOV abs+X,A
AbsoluteX();
@@ -2203,7 +2196,7 @@ void ApuD5()
IAPU.PC += 3;
}
-void ApuD6()
+void ApuD6(void)
{
// MOV abs+Y,A
AbsoluteY();
@@ -2211,7 +2204,7 @@ void ApuD6()
IAPU.PC += 3;
}
-void ApuD7()
+void ApuD7(void)
{
// MOV (dp)+Y,A
IndirectIndexedY();
@@ -2219,28 +2212,28 @@ void ApuD7()
IAPU.PC += 2;
}
-void ApuD8()
+void ApuD8(void)
{
// MOV dp,X
S9xAPUSetByteZ(IAPU.Registers.X, OP1);
IAPU.PC += 2;
}
-void ApuD9()
+void ApuD9(void)
{
// MOV dp+Y,X
S9xAPUSetByteZ(IAPU.Registers.X, OP1 + IAPU.Registers.YA.B.Y);
IAPU.PC += 2;
}
-void ApuDB()
+void ApuDB(void)
{
// MOV dp+X,Y
S9xAPUSetByteZ(IAPU.Registers.YA.B.Y, OP1 + IAPU.Registers.X);
IAPU.PC += 2;
}
-void ApuDF()
+void ApuDF(void)
{
// DAA
if (IAPU.Registers.YA.B.A > 0x99 || IAPU._Carry)
@@ -2258,7 +2251,7 @@ void ApuDF()
IAPU.PC++;
}
-void ApuE4()
+void ApuE4(void)
{
// MOV A, dp
IAPU.Registers.YA.B.A = S9xAPUGetByteZ(OP1);
@@ -2266,7 +2259,7 @@ void ApuE4()
IAPU.PC += 2;
}
-void ApuE5()
+void ApuE5(void)
{
// MOV A,abs
Absolute();
@@ -2275,7 +2268,7 @@ void ApuE5()
IAPU.PC += 3;
}
-void ApuE6()
+void ApuE6(void)
{
// MOV A,(X)
IAPU.Registers.YA.B.A = S9xAPUGetByteZ(IAPU.Registers.X);
@@ -2283,7 +2276,7 @@ void ApuE6()
IAPU.PC++;
}
-void ApuE7()
+void ApuE7(void)
{
// MOV A,(dp+X)
IndexedXIndirect();
@@ -2292,7 +2285,7 @@ void ApuE7()
IAPU.PC += 2;
}
-void ApuE8()
+void ApuE8(void)
{
// MOV A,#00
IAPU.Registers.YA.B.A = OP1;
@@ -2300,7 +2293,7 @@ void ApuE8()
IAPU.PC += 2;
}
-void ApuE9()
+void ApuE9(void)
{
// MOV X, abs
Absolute();
@@ -2309,7 +2302,7 @@ void ApuE9()
IAPU.PC += 3;
}
-void ApuEB()
+void ApuEB(void)
{
// MOV Y,dp
IAPU.Registers.YA.B.Y = S9xAPUGetByteZ(OP1);
@@ -2317,7 +2310,7 @@ void ApuEB()
IAPU.PC += 2;
}
-void ApuEC()
+void ApuEC(void)
{
// MOV Y,abs
Absolute();
@@ -2326,7 +2319,7 @@ void ApuEC()
IAPU.PC += 3;
}
-void ApuF4()
+void ApuF4(void)
{
// MOV A, dp+X
IAPU.Registers.YA.B.A = S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
@@ -2334,7 +2327,7 @@ void ApuF4()
IAPU.PC += 2;
}
-void ApuF5()
+void ApuF5(void)
{
// MOV A, abs+X
AbsoluteX();
@@ -2343,7 +2336,7 @@ void ApuF5()
IAPU.PC += 3;
}
-void ApuF6()
+void ApuF6(void)
{
// MOV A, abs+Y
AbsoluteY();
@@ -2352,7 +2345,7 @@ void ApuF6()
IAPU.PC += 3;
}
-void ApuF7()
+void ApuF7(void)
{
// MOV A, (dp)+Y
IndirectIndexedY();
@@ -2361,7 +2354,7 @@ void ApuF7()
IAPU.PC += 2;
}
-void ApuF8()
+void ApuF8(void)
{
// MOV X,dp
IAPU.Registers.X = S9xAPUGetByteZ(OP1);
@@ -2369,7 +2362,7 @@ void ApuF8()
IAPU.PC += 2;
}
-void ApuF9()
+void ApuF9(void)
{
// MOV X,dp+Y
IAPU.Registers.X = S9xAPUGetByteZ(OP1 + IAPU.Registers.YA.B.Y);
@@ -2377,14 +2370,14 @@ void ApuF9()
IAPU.PC += 2;
}
-void ApuFA()
+void ApuFA(void)
{
// MOV dp(dest),dp(src)
S9xAPUSetByteZ(S9xAPUGetByteZ(OP1), OP2);
IAPU.PC += 3;
}
-void ApuFB()
+void ApuFB(void)
{
// MOV Y,dp+X
IAPU.Registers.YA.B.Y = S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
@@ -2392,7 +2385,7 @@ void ApuFB()
IAPU.PC += 2;
}
-void (*S9xApuOpcodes[256])() =
+void (*S9xApuOpcodes[256])(void) =
{
Apu00, Apu01, Apu02, Apu03, Apu04, Apu05, Apu06, Apu07,
Apu08, Apu09, Apu0A, Apu0B, Apu0C, Apu0D, Apu0E, Apu0F,