From d3fa2c5b918406be83deeeaae4ab229338ab3e43 Mon Sep 17 00:00:00 2001 From: MoochMcGee Date: Sat, 14 Sep 2019 19:20:26 -0500 Subject: Fix M6502 reset procedure. Fixes MT6486 at the very least. [Melissa Goad] --- src/devices/cpu/m6502/m6502.cpp | 2 +- src/devices/cpu/m6502/om6502.lst | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3