From 5af23eec3427193e95bb28215ed95be09a6017e0 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 15 Aug 2019 17:03:39 +0200 Subject: [PATCH] 6502: update prev commmit (moves P |= F_I; to STATE_RESET instead of device_reset) (nw) --- src/devices/cpu/m6502/m6502.cpp | 3 ++- src/devices/cpu/m6502/odeco16.lst | 2 +- src/devices/cpu/m6502/om6502.lst | 2 +- src/devices/cpu/m6502/om740.lst | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/devices/cpu/m6502/m6502.cpp b/src/devices/cpu/m6502/m6502.cpp index e7c6dc8ab7e..2ca7329bf87 100644 --- a/src/devices/cpu/m6502/m6502.cpp +++ b/src/devices/cpu/m6502/m6502.cpp @@ -9,6 +9,8 @@ TODO: - device_start SP = 0x01bd; can't be right. At power-on, SP = 0(0x100) and at RESET, it is decremented 3 times without writing to the stack + see: https://www.pagetable.com/?p=410 + In other words, the first couple of cycles of STATE_RESET aren't emulated ***************************************************************************/ @@ -116,7 +118,6 @@ void m6502_device::init() void m6502_device::device_reset() { - P |= F_I; inst_state = STATE_RESET; inst_substate = 0; inst_state_base = 0; diff --git a/src/devices/cpu/m6502/odeco16.lst b/src/devices/cpu/m6502/odeco16.lst index 367f1c00704..694eb2f3613 100644 --- a/src/devices/cpu/m6502/odeco16.lst +++ b/src/devices/cpu/m6502/odeco16.lst @@ -97,7 +97,7 @@ vbl_zpg # exceptions reset_16 - PC = read_arg(0xfff1); + P |= F_I; PC = read_arg(0xfff1); PC = set_h(PC, read_arg(0xfff0)); prefetch(); inst_state = -1; diff --git a/src/devices/cpu/m6502/om6502.lst b/src/devices/cpu/m6502/om6502.lst index bd0f3cb3f4e..e9b8520c490 100644 --- a/src/devices/cpu/m6502/om6502.lst +++ b/src/devices/cpu/m6502/om6502.lst @@ -1218,7 +1218,7 @@ tya_imp # exceptions reset - PC = read_arg(0xfffc); + P |= F_I; PC = read_arg(0xfffc); PC = set_h(PC, read_arg(0xfffd)); prefetch(); inst_state = -1; diff --git a/src/devices/cpu/m6502/om740.lst b/src/devices/cpu/m6502/om740.lst index 0d84ca7cb5d..34652361335 100644 --- a/src/devices/cpu/m6502/om740.lst +++ b/src/devices/cpu/m6502/om740.lst @@ -114,7 +114,7 @@ jmp_zpi prefetch(); reset740 - PC = read_arg(0xfffe); + P |= F_I; PC = read_arg(0xfffe); PC = set_h(PC, read_arg(0xffff)); prefetch(); inst_state = -1;