Pair opcode read with first instruction cycle. Remove opcode_cycle switching from unneeded cases.

This commit is contained in:
Brandon Wright 2011-09-19 15:15:19 -05:00
parent b97e56d64d
commit 70159fd939
6 changed files with 71 additions and 294 deletions

View File

@ -60,10 +60,11 @@ void SMP::op_step() {
#if defined(CYCLE_ACCURATE)
if(opcode_cycle == 0) {
if(opcode_cycle == 0)
opcode_number = op_readpc();
opcode_cycle++;
} else switch(opcode_number) {
// opcode_cycle++;
switch(opcode_number) {
#include "core/opcycle_misc.cpp"
#include "core/opcycle_mov.cpp"
#include "core/opcycle_pc.cpp"

View File

@ -1,20 +1,17 @@
case 0x00: {
op_io();
opcode_cycle = 0;
break;
}
case 0xef: {
op_io(2);
regs.pc--;
opcode_cycle = 0;
break;
}
case 0xff: {
op_io(2);
regs.pc--;
opcode_cycle = 0;
break;
}
@ -23,7 +20,6 @@ case 0x9f: {
regs.a = (regs.a >> 4) | (regs.a << 4);
regs.p.n = !!(regs.a & 0x80);
regs.p.z = (regs.a == 0);
opcode_cycle = 0;
break;
}
@ -38,7 +34,6 @@ case 0xdf: {
}
regs.p.n = !!(regs.a & 0x80);
regs.p.z = (regs.a == 0);
opcode_cycle = 0;
break;
}
@ -53,35 +48,30 @@ case 0xbe: {
}
regs.p.n = !!(regs.a & 0x80);
regs.p.z = (regs.a == 0);
opcode_cycle = 0;
break;
}
case 0x60: {
op_io();
regs.p.c = 0;
opcode_cycle = 0;
break;
}
case 0x20: {
op_io();
regs.p.p = 0;
opcode_cycle = 0;
break;
}
case 0x80: {
op_io();
regs.p.c = 1;
opcode_cycle = 0;
break;
}
case 0x40: {
op_io();
regs.p.p = 1;
opcode_cycle = 0;
break;
}
@ -89,28 +79,24 @@ case 0xe0: {
op_io();
regs.p.v = 0;
regs.p.h = 0;
opcode_cycle = 0;
break;
}
case 0xed: {
op_io(2);
regs.p.c = !regs.p.c;
opcode_cycle = 0;
break;
}
case 0xa0: {
op_io(2);
regs.p.i = 1;
opcode_cycle = 0;
break;
}
case 0xc0: {
op_io(2);
regs.p.i = 0;
opcode_cycle = 0;
break;
}
@ -119,7 +105,6 @@ case 0x02: {
rd = op_readdp(dp);
rd |= 0x01;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -128,7 +113,6 @@ case 0x12: {
rd = op_readdp(dp);
rd &= ~0x01;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -137,7 +121,6 @@ case 0x22: {
rd = op_readdp(dp);
rd |= 0x02;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -146,7 +129,6 @@ case 0x32: {
rd = op_readdp(dp);
rd &= ~0x02;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -155,7 +137,6 @@ case 0x42: {
rd = op_readdp(dp);
rd |= 0x04;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -164,7 +145,6 @@ case 0x52: {
rd = op_readdp(dp);
rd &= ~0x04;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -173,7 +153,6 @@ case 0x62: {
rd = op_readdp(dp);
rd |= 0x08;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -182,7 +161,6 @@ case 0x72: {
rd = op_readdp(dp);
rd &= ~0x08;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -191,7 +169,6 @@ case 0x82: {
rd = op_readdp(dp);
rd |= 0x10;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -200,7 +177,6 @@ case 0x92: {
rd = op_readdp(dp);
rd &= ~0x10;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -209,7 +185,6 @@ case 0xa2: {
rd = op_readdp(dp);
rd |= 0x20;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -218,7 +193,6 @@ case 0xb2: {
rd = op_readdp(dp);
rd &= ~0x20;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -227,7 +201,6 @@ case 0xc2: {
rd = op_readdp(dp);
rd |= 0x40;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -236,7 +209,6 @@ case 0xd2: {
rd = op_readdp(dp);
rd &= ~0x40;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -245,7 +217,6 @@ case 0xe2: {
rd = op_readdp(dp);
rd |= 0x80;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -254,63 +225,54 @@ case 0xf2: {
rd = op_readdp(dp);
rd &= ~0x80;
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
case 0x2d: {
op_io(2);
op_writestack(regs.a);
opcode_cycle = 0;
break;
}
case 0x4d: {
op_io(2);
op_writestack(regs.x);
opcode_cycle = 0;
break;
}
case 0x6d: {
op_io(2);
op_writestack(regs.y);
opcode_cycle = 0;
break;
}
case 0x0d: {
op_io(2);
op_writestack(regs.p);
opcode_cycle = 0;
break;
}
case 0xae: {
op_io(2);
regs.a = op_readstack();
opcode_cycle = 0;
break;
}
case 0xce: {
op_io(2);
regs.x = op_readstack();
opcode_cycle = 0;
break;
}
case 0xee: {
op_io(2);
regs.y = op_readstack();
opcode_cycle = 0;
break;
}
case 0x8e: {
op_io(2);
regs.p = op_readstack();
opcode_cycle = 0;
break;
}
@ -322,7 +284,6 @@ case 0xcf: {
//result is set based on y (high-byte) only
regs.p.n = !!(regs.y & 0x80);
regs.p.z = (regs.y == 0);
opcode_cycle = 0;
break;
}
@ -345,7 +306,6 @@ case 0x9e: {
//result is set based on a (quotient) only
regs.p.n = !!(regs.a & 0x80);
regs.p.z = (regs.a == 0);
opcode_cycle = 0;
break;
}

View File

@ -3,7 +3,6 @@ case 0x7d: {
regs.a = regs.x;
regs.p.n = !!(regs.a & 0x80);
regs.p.z = (regs.a == 0);
opcode_cycle = 0;
break;
}
@ -12,7 +11,6 @@ case 0xdd: {
regs.a = regs.y;
regs.p.n = !!(regs.a & 0x80);
regs.p.z = (regs.a == 0);
opcode_cycle = 0;
break;
}
@ -21,7 +19,6 @@ case 0x5d: {
regs.x = regs.a;
regs.p.n = !!(regs.x & 0x80);
regs.p.z = (regs.x == 0);
opcode_cycle = 0;
break;
}
@ -30,7 +27,6 @@ case 0xfd: {
regs.y = regs.a;
regs.p.n = !!(regs.y & 0x80);
regs.p.z = (regs.y == 0);
opcode_cycle = 0;
break;
}
@ -39,14 +35,12 @@ case 0x9d: {
regs.x = regs.sp;
regs.p.n = !!(regs.x & 0x80);
regs.p.z = (regs.x == 0);
opcode_cycle = 0;
break;
}
case 0xbd: {
op_io();
regs.sp = regs.x;
opcode_cycle = 0;
break;
}
@ -54,7 +48,6 @@ case 0xe8: {
regs.a = op_readpc();
regs.p.n = !!(regs.a & 0x80);
regs.p.z = (regs.a == 0);
opcode_cycle = 0;
break;
}
@ -62,7 +55,6 @@ case 0xcd: {
regs.x = op_readpc();
regs.p.n = !!(regs.x & 0x80);
regs.p.z = (regs.x == 0);
opcode_cycle = 0;
break;
}
@ -70,12 +62,11 @@ case 0x8d: {
regs.y = op_readpc();
regs.p.n = !!(regs.y & 0x80);
regs.p.z = (regs.y == 0);
opcode_cycle = 0;
break;
}
case 0xe6: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
op_io();
break;
@ -90,7 +81,7 @@ case 0xe6: {
}
case 0xbf: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
op_io();
break;
@ -106,7 +97,7 @@ case 0xbf: {
}
case 0xe4: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
break;
@ -121,7 +112,7 @@ case 0xe4: {
}
case 0xf8: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
break;
@ -136,7 +127,7 @@ case 0xf8: {
}
case 0xeb: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
break;
@ -151,7 +142,7 @@ case 0xeb: {
}
case 0xf4: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
op_io();
@ -167,7 +158,7 @@ case 0xf4: {
}
case 0xf9: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
op_io();
@ -183,7 +174,7 @@ case 0xf9: {
}
case 0xfb: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
op_io();
@ -199,7 +190,7 @@ case 0xfb: {
}
case 0xe5: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
break;
@ -217,7 +208,7 @@ case 0xe5: {
}
case 0xe9: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
sp |= op_readpc() << 8;
@ -233,7 +224,7 @@ case 0xe9: {
}
case 0xec: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
sp |= op_readpc() << 8;
@ -249,7 +240,7 @@ case 0xec: {
}
case 0xf5: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
sp |= op_readpc() << 8;
@ -266,7 +257,7 @@ case 0xf5: {
}
case 0xf6: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
sp |= op_readpc() << 8;
@ -283,7 +274,7 @@ case 0xf6: {
}
case 0xe7: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc() + regs.x;
op_io();
@ -305,7 +296,7 @@ case 0xe7: {
}
case 0xf7: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
op_io();
@ -327,7 +318,7 @@ case 0xf7: {
}
case 0xfa: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
break;
@ -346,7 +337,7 @@ case 0xfa: {
}
case 0x8f: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
rd = op_readpc();
dp = op_readpc();
@ -363,7 +354,7 @@ case 0x8f: {
}
case 0xc6: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
op_io();
break;
@ -379,7 +370,7 @@ case 0xc6: {
}
case 0xaf: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
op_io(2);
case 2:
@ -391,7 +382,7 @@ case 0xaf: {
}
case 0xc4: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
break;
@ -407,7 +398,7 @@ case 0xc4: {
}
case 0xd8: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
break;
@ -423,7 +414,7 @@ case 0xd8: {
}
case 0xcb: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
break;
@ -439,7 +430,7 @@ case 0xcb: {
}
case 0xd4: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
op_io();
@ -457,7 +448,7 @@ case 0xd4: {
}
case 0xd9: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
op_io();
@ -475,7 +466,7 @@ case 0xd9: {
}
case 0xdb: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
op_io();
@ -493,7 +484,7 @@ case 0xdb: {
}
case 0xc5: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
break;
@ -512,7 +503,7 @@ case 0xc5: {
}
case 0xc9: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
break;
@ -531,7 +522,7 @@ case 0xc9: {
}
case 0xcc: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
break;
@ -550,7 +541,7 @@ case 0xcc: {
}
case 0xd5: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
dp |= op_readpc() << 8;
@ -569,7 +560,7 @@ case 0xd5: {
}
case 0xd6: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
dp |= op_readpc() << 8;
@ -588,7 +579,7 @@ case 0xd6: {
}
case 0xc7: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
op_io();
@ -612,7 +603,7 @@ case 0xc7: {
}
case 0xd7: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
break;
@ -636,7 +627,7 @@ case 0xd7: {
}
case 0xba: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
break;
@ -655,7 +646,7 @@ case 0xba: {
}
case 0xda: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
break;
@ -674,7 +665,7 @@ case 0xda: {
}
case 0xaa: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
sp = op_readpc();
sp |= op_readpc() << 8;
@ -691,7 +682,7 @@ case 0xaa: {
}
case 0xca: {
switch(opcode_cycle++) {
switch(++opcode_cycle) {
case 1:
dp = op_readpc();
dp |= op_readpc() << 8;

View File

@ -1,81 +1,72 @@
case 0x2f: {
rd = op_readpc();
if(0){ opcode_cycle = 0; break; }
if(0){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
case 0xf0: {
rd = op_readpc();
if(!regs.p.z){ opcode_cycle = 0; break; }
if(!regs.p.z){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
case 0xd0: {
rd = op_readpc();
if(regs.p.z){ opcode_cycle = 0; break; }
if(regs.p.z){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
case 0xb0: {
rd = op_readpc();
if(!regs.p.c){ opcode_cycle = 0; break; }
if(!regs.p.c){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
case 0x90: {
rd = op_readpc();
if(regs.p.c){ opcode_cycle = 0; break; }
if(regs.p.c){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
case 0x70: {
rd = op_readpc();
if(!regs.p.v){ opcode_cycle = 0; break; }
if(!regs.p.v){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
case 0x50: {
rd = op_readpc();
if(regs.p.v){ opcode_cycle = 0; break; }
if(regs.p.v){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
case 0x30: {
rd = op_readpc();
if(!regs.p.n){ opcode_cycle = 0; break; }
if(!regs.p.n){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
case 0x10: {
rd = op_readpc();
if(regs.p.n){ opcode_cycle = 0; break; }
if(regs.p.n){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -84,10 +75,9 @@ case 0x03: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x01) != 0x01){ opcode_cycle = 0; break; }
if((sp & 0x01) != 0x01){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -96,10 +86,9 @@ case 0x13: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x01) == 0x01){ opcode_cycle = 0; break; }
if((sp & 0x01) == 0x01){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -108,10 +97,9 @@ case 0x23: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x02) != 0x02){ opcode_cycle = 0; break; }
if((sp & 0x02) != 0x02){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -120,10 +108,9 @@ case 0x33: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x02) == 0x02){ opcode_cycle = 0; break; }
if((sp & 0x02) == 0x02){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -132,10 +119,9 @@ case 0x43: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x04) != 0x04){ opcode_cycle = 0; break; }
if((sp & 0x04) != 0x04){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -144,10 +130,9 @@ case 0x53: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x04) == 0x04){ opcode_cycle = 0; break; }
if((sp & 0x04) == 0x04){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -156,10 +141,9 @@ case 0x63: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x08) != 0x08){ opcode_cycle = 0; break; }
if((sp & 0x08) != 0x08){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -168,10 +152,9 @@ case 0x73: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x08) == 0x08){ opcode_cycle = 0; break; }
if((sp & 0x08) == 0x08){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -180,10 +163,9 @@ case 0x83: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x10) != 0x10){ opcode_cycle = 0; break; }
if((sp & 0x10) != 0x10){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -192,10 +174,9 @@ case 0x93: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x10) == 0x10){ opcode_cycle = 0; break; }
if((sp & 0x10) == 0x10){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -204,10 +185,9 @@ case 0xa3: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x20) != 0x20){ opcode_cycle = 0; break; }
if((sp & 0x20) != 0x20){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -216,10 +196,9 @@ case 0xb3: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x20) == 0x20){ opcode_cycle = 0; break; }
if((sp & 0x20) == 0x20){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -228,10 +207,9 @@ case 0xc3: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x40) != 0x40){ opcode_cycle = 0; break; }
if((sp & 0x40) != 0x40){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -240,10 +218,9 @@ case 0xd3: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x40) == 0x40){ opcode_cycle = 0; break; }
if((sp & 0x40) == 0x40){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -252,10 +229,9 @@ case 0xe3: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x80) != 0x80){ opcode_cycle = 0; break; }
if((sp & 0x80) != 0x80){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -264,10 +240,9 @@ case 0xf3: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if((sp & 0x80) == 0x80){ opcode_cycle = 0; break; }
if((sp & 0x80) == 0x80){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -276,10 +251,9 @@ case 0x2e: {
sp = op_readdp(dp);
rd = op_readpc();
op_io();
if(regs.a == sp){ opcode_cycle = 0; break; }
if(regs.a == sp){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -289,10 +263,9 @@ case 0xde: {
sp = op_readdp(dp + regs.x);
rd = op_readpc();
op_io();
if(regs.a == sp){ opcode_cycle = 0; break; }
if(regs.a == sp){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -301,10 +274,9 @@ case 0x6e: {
wr = op_readdp(dp);
op_writedp(dp, --wr);
rd = op_readpc();
if(wr == 0x00){ opcode_cycle = 0; break; }
if(wr == 0x00){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -313,10 +285,9 @@ case 0xfe: {
op_io();
regs.y--;
op_io();
if(regs.y == 0x00){ opcode_cycle = 0; break; }
if(regs.y == 0x00){ break; }
op_io(2);
regs.pc += (int8)rd;
opcode_cycle = 0;
break;
}
@ -324,7 +295,6 @@ case 0x5f: {
rd = op_readpc();
rd |= op_readpc() << 8;
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -336,7 +306,6 @@ case 0x1f: {
rd = op_readaddr(dp);
rd |= op_readaddr(dp + 1) << 8;
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -347,7 +316,6 @@ case 0x3f: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -357,7 +325,6 @@ case 0x4f: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = 0xff00 | rd;
opcode_cycle = 0;
break;
}
@ -369,7 +336,6 @@ case 0x01: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -381,7 +347,6 @@ case 0x11: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -393,7 +358,6 @@ case 0x21: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -405,7 +369,6 @@ case 0x31: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -417,7 +380,6 @@ case 0x41: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -429,7 +391,6 @@ case 0x51: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -441,7 +402,6 @@ case 0x61: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -453,7 +413,6 @@ case 0x71: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -465,7 +424,6 @@ case 0x81: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -477,7 +435,6 @@ case 0x91: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -489,7 +446,6 @@ case 0xa1: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -501,7 +457,6 @@ case 0xb1: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -513,7 +468,6 @@ case 0xc1: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -525,7 +479,6 @@ case 0xd1: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -537,7 +490,6 @@ case 0xe1: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -549,7 +501,6 @@ case 0xf1: {
op_writestack(regs.pc >> 8);
op_writestack(regs.pc);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -563,7 +514,6 @@ case 0x0f: {
regs.pc = rd;
regs.p.b = 1;
regs.p.i = 0;
opcode_cycle = 0;
break;
}
@ -572,7 +522,6 @@ case 0x6f: {
rd |= op_readstack() << 8;
op_io(2);
regs.pc = rd;
opcode_cycle = 0;
break;
}
@ -582,7 +531,6 @@ case 0x7f: {
rd |= op_readstack() << 8;
op_io(2);
regs.pc = rd;
opcode_cycle = 0;
break;
}

View File

@ -1,56 +1,48 @@
case 0x88: {
rd = op_readpc();
regs.a = op_adc(regs.a, rd);
opcode_cycle = 0;
break;
}
case 0x28: {
rd = op_readpc();
regs.a = op_and(regs.a, rd);
opcode_cycle = 0;
break;
}
case 0x68: {
rd = op_readpc();
regs.a = op_cmp(regs.a, rd);
opcode_cycle = 0;
break;
}
case 0xc8: {
rd = op_readpc();
regs.x = op_cmp(regs.x, rd);
opcode_cycle = 0;
break;
}
case 0xad: {
rd = op_readpc();
regs.y = op_cmp(regs.y, rd);
opcode_cycle = 0;
break;
}
case 0x48: {
rd = op_readpc();
regs.a = op_eor(regs.a, rd);
opcode_cycle = 0;
break;
}
case 0x08: {
rd = op_readpc();
regs.a = op_or(regs.a, rd);
opcode_cycle = 0;
break;
}
case 0xa8: {
rd = op_readpc();
regs.a = op_sbc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -58,7 +50,6 @@ case 0x86: {
op_io();
rd = op_readdp(regs.x);
regs.a = op_adc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -66,7 +57,6 @@ case 0x26: {
op_io();
rd = op_readdp(regs.x);
regs.a = op_and(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -74,7 +64,6 @@ case 0x66: {
op_io();
rd = op_readdp(regs.x);
regs.a = op_cmp(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -82,7 +71,6 @@ case 0x46: {
op_io();
rd = op_readdp(regs.x);
regs.a = op_eor(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -90,7 +78,6 @@ case 0x06: {
op_io();
rd = op_readdp(regs.x);
regs.a = op_or(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -98,7 +85,6 @@ case 0xa6: {
op_io();
rd = op_readdp(regs.x);
regs.a = op_sbc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -106,7 +92,6 @@ case 0x84: {
dp = op_readpc();
rd = op_readdp(dp);
regs.a = op_adc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -114,7 +99,6 @@ case 0x24: {
dp = op_readpc();
rd = op_readdp(dp);
regs.a = op_and(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -122,7 +106,6 @@ case 0x64: {
dp = op_readpc();
rd = op_readdp(dp);
regs.a = op_cmp(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -130,7 +113,6 @@ case 0x3e: {
dp = op_readpc();
rd = op_readdp(dp);
regs.x = op_cmp(regs.x, rd);
opcode_cycle = 0;
break;
}
@ -138,7 +120,6 @@ case 0x7e: {
dp = op_readpc();
rd = op_readdp(dp);
regs.y = op_cmp(regs.y, rd);
opcode_cycle = 0;
break;
}
@ -146,7 +127,6 @@ case 0x44: {
dp = op_readpc();
rd = op_readdp(dp);
regs.a = op_eor(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -154,7 +134,6 @@ case 0x04: {
dp = op_readpc();
rd = op_readdp(dp);
regs.a = op_or(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -162,7 +141,6 @@ case 0xa4: {
dp = op_readpc();
rd = op_readdp(dp);
regs.a = op_sbc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -171,7 +149,6 @@ case 0x94: {
op_io();
rd = op_readdp(dp + regs.x);
regs.a = op_adc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -180,7 +157,6 @@ case 0x34: {
op_io();
rd = op_readdp(dp + regs.x);
regs.a = op_and(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -189,7 +165,6 @@ case 0x74: {
op_io();
rd = op_readdp(dp + regs.x);
regs.a = op_cmp(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -198,7 +173,6 @@ case 0x54: {
op_io();
rd = op_readdp(dp + regs.x);
regs.a = op_eor(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -207,7 +181,6 @@ case 0x14: {
op_io();
rd = op_readdp(dp + regs.x);
regs.a = op_or(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -216,7 +189,6 @@ case 0xb4: {
op_io();
rd = op_readdp(dp + regs.x);
regs.a = op_sbc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -225,7 +197,6 @@ case 0x85: {
dp |= op_readpc() << 8;
rd = op_readaddr(dp);
regs.a = op_adc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -234,7 +205,6 @@ case 0x25: {
dp |= op_readpc() << 8;
rd = op_readaddr(dp);
regs.a = op_and(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -243,7 +213,6 @@ case 0x65: {
dp |= op_readpc() << 8;
rd = op_readaddr(dp);
regs.a = op_cmp(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -252,7 +221,6 @@ case 0x1e: {
dp |= op_readpc() << 8;
rd = op_readaddr(dp);
regs.x = op_cmp(regs.x, rd);
opcode_cycle = 0;
break;
}
@ -261,7 +229,6 @@ case 0x5e: {
dp |= op_readpc() << 8;
rd = op_readaddr(dp);
regs.y = op_cmp(regs.y, rd);
opcode_cycle = 0;
break;
}
@ -270,7 +237,6 @@ case 0x45: {
dp |= op_readpc() << 8;
rd = op_readaddr(dp);
regs.a = op_eor(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -279,7 +245,6 @@ case 0x05: {
dp |= op_readpc() << 8;
rd = op_readaddr(dp);
regs.a = op_or(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -288,7 +253,6 @@ case 0xa5: {
dp |= op_readpc() << 8;
rd = op_readaddr(dp);
regs.a = op_sbc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -298,7 +262,6 @@ case 0x95: {
op_io();
rd = op_readaddr(dp + regs.x);
regs.a = op_adc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -308,7 +271,6 @@ case 0x96: {
op_io();
rd = op_readaddr(dp + regs.y);
regs.a = op_adc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -318,7 +280,6 @@ case 0x35: {
op_io();
rd = op_readaddr(dp + regs.x);
regs.a = op_and(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -328,7 +289,6 @@ case 0x36: {
op_io();
rd = op_readaddr(dp + regs.y);
regs.a = op_and(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -338,7 +298,6 @@ case 0x75: {
op_io();
rd = op_readaddr(dp + regs.x);
regs.a = op_cmp(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -348,7 +307,6 @@ case 0x76: {
op_io();
rd = op_readaddr(dp + regs.y);
regs.a = op_cmp(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -358,7 +316,6 @@ case 0x55: {
op_io();
rd = op_readaddr(dp + regs.x);
regs.a = op_eor(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -368,7 +325,6 @@ case 0x56: {
op_io();
rd = op_readaddr(dp + regs.y);
regs.a = op_eor(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -378,7 +334,6 @@ case 0x15: {
op_io();
rd = op_readaddr(dp + regs.x);
regs.a = op_or(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -388,7 +343,6 @@ case 0x16: {
op_io();
rd = op_readaddr(dp + regs.y);
regs.a = op_or(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -398,7 +352,6 @@ case 0xb5: {
op_io();
rd = op_readaddr(dp + regs.x);
regs.a = op_sbc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -408,7 +361,6 @@ case 0xb6: {
op_io();
rd = op_readaddr(dp + regs.y);
regs.a = op_sbc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -419,7 +371,6 @@ case 0x87: {
sp |= op_readdp(dp + 1) << 8;
rd = op_readaddr(sp);
regs.a = op_adc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -430,7 +381,6 @@ case 0x27: {
sp |= op_readdp(dp + 1) << 8;
rd = op_readaddr(sp);
regs.a = op_and(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -441,7 +391,6 @@ case 0x67: {
sp |= op_readdp(dp + 1) << 8;
rd = op_readaddr(sp);
regs.a = op_cmp(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -452,7 +401,6 @@ case 0x47: {
sp |= op_readdp(dp + 1) << 8;
rd = op_readaddr(sp);
regs.a = op_eor(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -463,7 +411,6 @@ case 0x07: {
sp |= op_readdp(dp + 1) << 8;
rd = op_readaddr(sp);
regs.a = op_or(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -474,7 +421,6 @@ case 0xa7: {
sp |= op_readdp(dp + 1) << 8;
rd = op_readaddr(sp);
regs.a = op_sbc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -485,7 +431,6 @@ case 0x97: {
sp |= op_readdp(dp + 1) << 8;
rd = op_readaddr(sp + regs.y);
regs.a = op_adc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -496,7 +441,6 @@ case 0x37: {
sp |= op_readdp(dp + 1) << 8;
rd = op_readaddr(sp + regs.y);
regs.a = op_and(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -507,7 +451,6 @@ case 0x77: {
sp |= op_readdp(dp + 1) << 8;
rd = op_readaddr(sp + regs.y);
regs.a = op_cmp(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -518,7 +461,6 @@ case 0x57: {
sp |= op_readdp(dp + 1) << 8;
rd = op_readaddr(sp + regs.y);
regs.a = op_eor(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -529,7 +471,6 @@ case 0x17: {
sp |= op_readdp(dp + 1) << 8;
rd = op_readaddr(sp + regs.y);
regs.a = op_or(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -540,7 +481,6 @@ case 0xb7: {
sp |= op_readdp(dp + 1) << 8;
rd = op_readaddr(sp + regs.y);
regs.a = op_sbc(regs.a, rd);
opcode_cycle = 0;
break;
}
@ -550,7 +490,6 @@ case 0x99: {
wr = op_readdp(regs.x);
wr = op_adc(wr, rd);
(1) ? op_writedp(regs.x, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -560,7 +499,6 @@ case 0x39: {
wr = op_readdp(regs.x);
wr = op_and(wr, rd);
(1) ? op_writedp(regs.x, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -570,7 +508,6 @@ case 0x79: {
wr = op_readdp(regs.x);
wr = op_cmp(wr, rd);
(0) ? op_writedp(regs.x, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -580,7 +517,6 @@ case 0x59: {
wr = op_readdp(regs.x);
wr = op_eor(wr, rd);
(1) ? op_writedp(regs.x, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -590,7 +526,6 @@ case 0x19: {
wr = op_readdp(regs.x);
wr = op_or(wr, rd);
(1) ? op_writedp(regs.x, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -600,7 +535,6 @@ case 0xb9: {
wr = op_readdp(regs.x);
wr = op_sbc(wr, rd);
(1) ? op_writedp(regs.x, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -611,7 +545,6 @@ case 0x89: {
wr = op_readdp(dp);
wr = op_adc(wr, rd);
(1) ? op_writedp(dp, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -622,7 +555,6 @@ case 0x29: {
wr = op_readdp(dp);
wr = op_and(wr, rd);
(1) ? op_writedp(dp, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -633,7 +565,6 @@ case 0x69: {
wr = op_readdp(dp);
wr = op_cmp(wr, rd);
(0) ? op_writedp(dp, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -644,7 +575,6 @@ case 0x49: {
wr = op_readdp(dp);
wr = op_eor(wr, rd);
(1) ? op_writedp(dp, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -655,7 +585,6 @@ case 0x09: {
wr = op_readdp(dp);
wr = op_or(wr, rd);
(1) ? op_writedp(dp, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -666,7 +595,6 @@ case 0xa9: {
wr = op_readdp(dp);
wr = op_sbc(wr, rd);
(1) ? op_writedp(dp, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -676,7 +604,6 @@ case 0x98: {
wr = op_readdp(dp);
wr = op_adc(wr, rd);
(1) ? op_writedp(dp, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -686,7 +613,6 @@ case 0x38: {
wr = op_readdp(dp);
wr = op_and(wr, rd);
(1) ? op_writedp(dp, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -696,7 +622,6 @@ case 0x78: {
wr = op_readdp(dp);
wr = op_cmp(wr, rd);
(0) ? op_writedp(dp, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -706,7 +631,6 @@ case 0x58: {
wr = op_readdp(dp);
wr = op_eor(wr, rd);
(1) ? op_writedp(dp, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -716,7 +640,6 @@ case 0x18: {
wr = op_readdp(dp);
wr = op_or(wr, rd);
(1) ? op_writedp(dp, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -726,7 +649,6 @@ case 0xb8: {
wr = op_readdp(dp);
wr = op_sbc(wr, rd);
(1) ? op_writedp(dp, wr) : op_io();
opcode_cycle = 0;
break;
}
@ -736,7 +658,6 @@ case 0x7a: {
op_io();
rd |= op_readdp(dp + 1) << 8;
regs.ya = op_addw(regs.ya, rd);
opcode_cycle = 0;
break;
}
@ -746,7 +667,6 @@ case 0x9a: {
op_io();
rd |= op_readdp(dp + 1) << 8;
regs.ya = op_subw(regs.ya, rd);
opcode_cycle = 0;
break;
}
@ -755,7 +675,6 @@ case 0x5a: {
rd = op_readdp(dp);
rd |= op_readdp(dp + 1) << 8;
op_cmpw(regs.ya, rd);
opcode_cycle = 0;
break;
}
@ -766,7 +685,6 @@ case 0x4a: {
dp &= 0x1fff;
rd = op_readaddr(dp);
regs.p.c = regs.p.c & !!(rd & (1 << bit));
opcode_cycle = 0;
break;
}
@ -777,7 +695,6 @@ case 0x6a: {
dp &= 0x1fff;
rd = op_readaddr(dp);
regs.p.c = regs.p.c & !(rd & (1 << bit));
opcode_cycle = 0;
break;
}
@ -789,7 +706,6 @@ case 0x8a: {
rd = op_readaddr(dp);
op_io();
regs.p.c = regs.p.c ^ !!(rd & (1 << bit));
opcode_cycle = 0;
break;
}
@ -801,7 +717,6 @@ case 0xea: {
rd = op_readaddr(dp);
rd ^= (1 << bit);
op_writeaddr(dp, rd);
opcode_cycle = 0;
break;
}
@ -813,7 +728,6 @@ case 0x0a: {
rd = op_readaddr(dp);
op_io();
regs.p.c = regs.p.c | !!(rd & (1 << bit));
opcode_cycle = 0;
break;
}
@ -825,7 +739,6 @@ case 0x2a: {
rd = op_readaddr(dp);
op_io();
regs.p.c = regs.p.c | !(rd & (1 << bit));
opcode_cycle = 0;
break;
}

View File

@ -1,75 +1,61 @@
case 0xbc: {
op_io();
regs.a = op_inc(regs.a);
opcode_cycle = 0;
break;
}
case 0x3d: {
op_io();
regs.x = op_inc(regs.x);
opcode_cycle = 0;
break;
}
case 0xfc: {
op_io();
regs.y = op_inc(regs.y);
opcode_cycle = 0;
break;
}
case 0x9c: {
op_io();
regs.a = op_dec(regs.a);
opcode_cycle = 0;
break;
}
case 0x1d: {
op_io();
regs.x = op_dec(regs.x);
opcode_cycle = 0;
break;
}
case 0xdc: {
op_io();
regs.y = op_dec(regs.y);
opcode_cycle = 0;
break;
}
case 0x1c: {
op_io();
regs.a = op_asl(regs.a);
opcode_cycle = 0;
break;
}
case 0x5c: {
op_io();
regs.a = op_lsr(regs.a);
opcode_cycle = 0;
break;
}
case 0x3c: {
op_io();
regs.a = op_rol(regs.a);
opcode_cycle = 0;
break;
}
case 0x7c: {
switch(opcode_cycle++) {
case 1:
op_io();
regs.a = op_ror(regs.a);
opcode_cycle = 0;
op_io();
regs.a = op_ror(regs.a);
break;
}
break;
}
case 0xab: {
@ -77,7 +63,6 @@ case 0xab: {
rd = op_readdp(dp);
rd = op_inc(rd);
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -86,7 +71,6 @@ case 0x8b: {
rd = op_readdp(dp);
rd = op_dec(rd);
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -95,7 +79,6 @@ case 0x0b: {
rd = op_readdp(dp);
rd = op_asl(rd);
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -104,7 +87,6 @@ case 0x4b: {
rd = op_readdp(dp);
rd = op_lsr(rd);
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -113,7 +95,6 @@ case 0x2b: {
rd = op_readdp(dp);
rd = op_rol(rd);
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -122,7 +103,6 @@ case 0x6b: {
rd = op_readdp(dp);
rd = op_ror(rd);
op_writedp(dp, rd);
opcode_cycle = 0;
break;
}
@ -132,7 +112,6 @@ case 0xbb: {
rd = op_readdp(dp + regs.x);
rd = op_inc(rd);
op_writedp(dp + regs.x, rd);
opcode_cycle = 0;
break;
}
@ -142,7 +121,6 @@ case 0x9b: {
rd = op_readdp(dp + regs.x);
rd = op_dec(rd);
op_writedp(dp + regs.x, rd);
opcode_cycle = 0;
break;
}
@ -152,7 +130,6 @@ case 0x1b: {
rd = op_readdp(dp + regs.x);
rd = op_asl(rd);
op_writedp(dp + regs.x, rd);
opcode_cycle = 0;
break;
}
@ -162,7 +139,6 @@ case 0x5b: {
rd = op_readdp(dp + regs.x);
rd = op_lsr(rd);
op_writedp(dp + regs.x, rd);
opcode_cycle = 0;
break;
}
@ -172,7 +148,6 @@ case 0x3b: {
rd = op_readdp(dp + regs.x);
rd = op_rol(rd);
op_writedp(dp + regs.x, rd);
opcode_cycle = 0;
break;
}
@ -182,7 +157,6 @@ case 0x7b: {
rd = op_readdp(dp + regs.x);
rd = op_ror(rd);
op_writedp(dp + regs.x, rd);
opcode_cycle = 0;
break;
}
@ -192,7 +166,6 @@ case 0xac: {
rd = op_readaddr(dp);
rd = op_inc(rd);
op_writeaddr(dp, rd);
opcode_cycle = 0;
break;
}
@ -202,7 +175,6 @@ case 0x8c: {
rd = op_readaddr(dp);
rd = op_dec(rd);
op_writeaddr(dp, rd);
opcode_cycle = 0;
break;
}
@ -212,7 +184,6 @@ case 0x0c: {
rd = op_readaddr(dp);
rd = op_asl(rd);
op_writeaddr(dp, rd);
opcode_cycle = 0;
break;
}
@ -222,7 +193,6 @@ case 0x4c: {
rd = op_readaddr(dp);
rd = op_lsr(rd);
op_writeaddr(dp, rd);
opcode_cycle = 0;
break;
}
@ -232,7 +202,6 @@ case 0x2c: {
rd = op_readaddr(dp);
rd = op_rol(rd);
op_writeaddr(dp, rd);
opcode_cycle = 0;
break;
}
@ -242,7 +211,6 @@ case 0x6c: {
rd = op_readaddr(dp);
rd = op_ror(rd);
op_writeaddr(dp, rd);
opcode_cycle = 0;
break;
}
@ -254,7 +222,6 @@ case 0x0e: {
regs.p.z = ((regs.a - rd) == 0);
op_readaddr(dp);
op_writeaddr(dp, rd | regs.a);
opcode_cycle = 0;
break;
}
@ -266,7 +233,6 @@ case 0x4e: {
regs.p.z = ((regs.a - rd) == 0);
op_readaddr(dp);
op_writeaddr(dp, rd &~ regs.a);
opcode_cycle = 0;
break;
}
@ -279,7 +245,6 @@ case 0x3a: {
op_writedp(dp, rd >> 8);
regs.p.n = !!(rd & 0x8000);
regs.p.z = (rd == 0);
opcode_cycle = 0;
break;
}
@ -292,7 +257,6 @@ case 0x1a: {
op_writedp(dp, rd >> 8);
regs.p.n = !!(rd & 0x8000);
regs.p.z = (rd == 0);
opcode_cycle = 0;
break;
}