From 3f2daf7b086bcccd1f82a23fd80ce137eba5a963 Mon Sep 17 00:00:00 2001 From: Takashi Toyoshima Date: Mon, 8 Dec 2014 03:01:27 +0900 Subject: [PATCH] Bug fix: data was broken on absolute and absolute indexed destination Now it can show "Apple ][" logo by using Apple BASIC ROM!! --- 6502.S | 18 ++++++------------ Makefile | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/6502.S b/6502.S index a6beba0..76b14af 100644 --- a/6502.S +++ b/6502.S @@ -245,11 +245,10 @@ _ldb .endm -.macro _toAbsb +.macro _toAbsolute reg adds r0, PC, #1 - mov TZ, T0 _ldw - mov r1, TZ + mov r1, \reg _stb adds PC, PC, #3 .endm @@ -258,7 +257,7 @@ adds r0, PC, #1 _ldw add r0, r0, \reg - mov r1, T0 + mov r1, RA _stb adds PC, PC, #3 .endm @@ -1248,18 +1247,15 @@ op8a: // TXA _decode op8c: // STY - Absolute - mov T0, RY - _toAbsb + _toAbsolute RY _decode op8d: // STA - Absolute - mov T0, RA - _toAbsb + _toAbsolute RA _decode op8e: // STX - Absolute - mov T0, RX - _toAbsb + _toAbsolute RX _decode op90: // BCC (C==0) @@ -1296,7 +1292,6 @@ op98: // TYA _decode op99: // STA - Absolute, Y - mov T0, RA _toAbsoluteIndexed RY _decode @@ -1309,7 +1304,6 @@ op9a: // TXS _decode op9d: // STA - Absolute, X - mov T0, RA _toAbsoluteIndexed RX _decode diff --git a/Makefile b/Makefile index 4bbc445..338050a 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ $(ROM).rom: # Test binary that runs on qemu user mode emulation for testing test: 6502.S test.c $(CC) -mthumb -static $(FRAMEPTR) test.c 6502.S -o test && \ - qemu-arm test + reset && qemu-arm test 2> log # Test binary that runs on qemu user mode emulation for functional tests ftest: 6502.S ftest.c