1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-12-27 01:32:17 +00:00

Port similar changes from DE* to IN*

This commit is contained in:
Peter Evans 2018-04-30 22:15:24 -05:00
parent 49687d9a7a
commit 1ac19aaaae

View File

@ -190,14 +190,15 @@ DEFINE_INST(dey)
*/ */
DEFINE_INST(inc) DEFINE_INST(inc)
{ {
oper++;
MOS_CHECK_NZ(oper);
if (cpu->addr_mode == ACC) { if (cpu->addr_mode == ACC) {
MOS_CHECK_NZ(cpu->A + 1); cpu->A = oper;
cpu->A++;
return; return;
} }
MOS_CHECK_NZ(oper + 1); mos6502_set(cpu, cpu->eff_addr, oper);
mos6502_set(cpu, cpu->eff_addr, oper + 1);
} }
/* /*
@ -205,8 +206,9 @@ DEFINE_INST(inc)
*/ */
DEFINE_INST(inx) DEFINE_INST(inx)
{ {
MOS_CHECK_NZ(cpu->X + 1); oper++;
cpu->X++; MOS_CHECK_NZ(oper);
cpu->X = oper;
} }
/* /*
@ -214,8 +216,9 @@ DEFINE_INST(inx)
*/ */
DEFINE_INST(iny) DEFINE_INST(iny)
{ {
MOS_CHECK_NZ(cpu->Y + 1); oper++;
cpu->Y++; MOS_CHECK_NZ(oper);
cpu->Y = oper;
} }
/* /*