1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-06-24 15:29:32 +00:00

Try to match technical behavior described for JSR/RTS

This commit is contained in:
Peter Evans 2018-01-21 01:17:04 -06:00
parent 0581ed6b44
commit 5f93bdae25

View File

@ -37,7 +37,7 @@ DEFINE_INST(jmp)
*/
DEFINE_INST(jsr)
{
vm_16bit pc3 = cpu->PC + 3;
vm_16bit pc3 = cpu->PC + 2;
mos6502_push_stack(cpu, pc3 >> 8);
mos6502_push_stack(cpu, pc3 & 0xff);
@ -72,4 +72,5 @@ DEFINE_INST(rts)
{
cpu->PC = mos6502_pop_stack(cpu);
cpu->PC |= mos6502_pop_stack(cpu) << 8;
cpu->PC++;
}