From 21a5e8f112ade9a8ee7aa1b2da0c13e5966d114e Mon Sep 17 00:00:00 2001 From: Brad Grantham Date: Sun, 6 Nov 2016 14:18:17 -0800 Subject: [PATCH] another LSR and another EOR --- apple2e.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/apple2e.cpp b/apple2e.cpp index a39f800..3f304cb 100644 --- a/apple2e.cpp +++ b/apple2e.cpp @@ -629,6 +629,18 @@ struct CPU6502 break; } + case 0x4E: { + int addr = read_pc_inc(bus) + read_pc_inc(bus) * 256; + if(debug & DEBUG_DECODE) printf("LSR %04X\n", addr); + unsigned char m = bus.read(addr); + flag_change(C, m & 0x01); + m = m >> 1; + flag_change(N, m & 0x80); + flag_change(Z, m == 0); + bus.write(addr, m); + break; + } + case 0x4A: { if(debug & DEBUG_DECODE) printf("LSR A\n"); flag_change(C, a & 0x01); @@ -862,6 +874,15 @@ struct CPU6502 break; } + case 0x45: { + unsigned char zpg = read_pc_inc(bus); + if(debug & DEBUG_DECODE) printf("EOR %02X\n", zpg); + a = a ^ bus.read(zpg); + flag_change(N, a & 0x80); + flag_change(Z, a == 0); + break; + } + case 0x49: { unsigned char imm = read_pc_inc(bus); if(debug & DEBUG_DECODE) printf("EOR #%02X\n", imm);