change SBC to be ADC with one's complement instead of two's

It seems that is what was expected when run with nestest.
This commit is contained in:
Vineet K 2024-06-30 06:28:41 -04:00
parent 4b7fae0010
commit 5535e5de70

8
cpu.c
View File

@ -664,7 +664,7 @@ static void
sbc(uint8_t arg) sbc(uint8_t arg)
{ {
/* SBC is described online as ADC with argument as two's complement */ /* SBC is described online as ADC with argument as two's complement */
adc(~arg + 1); adc(~arg);
} }
static void static void
@ -733,7 +733,8 @@ tay(void)
static void static void
tsx(void) tsx(void)
{ {
regs.x = PULL(); // regs.x = PULL();
regs.x = regs.sp;
STATUS_UPDATE_ZERO(regs.x); STATUS_UPDATE_ZERO(regs.x);
STATUS_UPDATE_NEGATIVE(regs.x); STATUS_UPDATE_NEGATIVE(regs.x);
@ -751,7 +752,8 @@ txa(void)
static void static void
txs(void) txs(void)
{ {
PUSH(regs.x); // PUSH(regs.x);
regs.sp = regs.x;
} }
static void static void