summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author MoochMcGee <mszoopers@protonmail.com>2019-09-14 19:20:26 -0500
committer MoochMcGee <mszoopers@protonmail.com>2019-09-14 19:20:26 -0500
commitd3fa2c5b918406be83deeeaae4ab229338ab3e43 (patch)
tree116c25e56a5436c970a593533f7adeae816d831c
parent6fab7692981d7956fe400995e4774c9d007b215f (diff)
Fix M6502 reset procedure. Fixes MT6486 at the very least. [Melissa Goad]
-rw-r--r--src/devices/cpu/m6502/m6502.cpp2
-rw-r--r--src/devices/cpu/m6502/om6502.lst3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/devices/cpu/m6502/m6502.cpp b/src/devices/cpu/m6502/m6502.cpp
index 2ca7329bf87..5ea3e864bb0 100644
--- a/src/devices/cpu/m6502/m6502.cpp
+++ b/src/devices/cpu/m6502/m6502.cpp
@@ -99,7 +99,7 @@ void m6502_device::init()
X = 0x80;
Y = 0x00;
P = 0x36;
- SP = 0x01bd;
+ SP = 0x0100;
TMP = 0x0000;
TMP2 = 0x00;
IR = 0x00;
diff --git a/src/devices/cpu/m6502/om6502.lst b/src/devices/cpu/m6502/om6502.lst
index e9b8520c490..e831388a93a 100644
--- a/src/devices/cpu/m6502/om6502.lst
+++ b/src/devices/cpu/m6502/om6502.lst
@@ -1218,6 +1218,9 @@ tya_imp
# exceptions
reset
+ read_arg(SP); SP = 0x1ff;
+ read_arg(SP); SP--;
+ read_arg(SP); SP--;
P |= F_I; PC = read_arg(0xfffc);
PC = set_h(PC, read_arg(0xfffd));
prefetch();