From 92546483084d76dc0a2f629e9a05c5fe45711829 Mon Sep 17 00:00:00 2001 From: Preston Skupinski Date: Sat, 7 May 2011 15:16:37 -0400 Subject: [PATCH] added ADC direct page indexed x, ADC absolute indexed x, ADC absolute indexed y --- cpu.js | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/cpu.js b/cpu.js index c693400..d9a968d 100644 --- a/cpu.js +++ b/cpu.js @@ -81,7 +81,10 @@ function CPU_65816() { 0xf0 : BEQ, 0xd0 : BNE, 0x90 : BCC, 0xb0 : BCS, 0x50 : BVC, 0x70 : BVS, 0x10 : BPL, 0x30 : BMI, 0x69 : ADC_const, 0x6d : ADC_absolute, - 0x65 : ADC_direct_page, 0x72 : ADC_direct_page_indirect }; + 0x65 : ADC_direct_page, 0x72 : ADC_direct_page_indirect, + 0x7d : ADC_absolute_indexed_x, + 0x79 : ADC_absolute_indexed_y, + 0x75 : ADC_direct_page_indexed_x }; } var MMU = { @@ -230,6 +233,33 @@ var ADC_direct_page_indirect = { } }; +ADC_absolute_indexed_x = { + bytes_required:function() { + return 3; + }, + execute:function(cpu, bytes) { + ADC_absolute.execute(cpu, ((bytes[1]<<8)|bytes[0])+cpu.r.x); + } +}; + +ADC_absolute_indexed_y = { + bytes_required:function() { + return 3; + }, + execute:function(cpu, bytes) { + ADC_absolute.execute(cpu, ((bytes[1]<<8)|bytes[0])+cpu.r.y); + } +}; + +ADC_direct_page_indexed_x = { + bytes_required:function() { + return 2; + }, + execute:function(cpu, bytes) { + ADC_direct_page.execute(cpu, bytes[0]+cpu.r.x); + } +}; + var BMI = { bytes_required:function() { return 2;