2011-06-12 06:25:22 +00:00
|
|
|
case 0xbc: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
op_io();
|
|
|
|
regs.a = op_inc(regs.a);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x3d: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
op_io();
|
|
|
|
regs.x = op_inc(regs.x);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0xfc: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
op_io();
|
|
|
|
regs.y = op_inc(regs.y);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x9c: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
op_io();
|
|
|
|
regs.a = op_dec(regs.a);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x1d: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
op_io();
|
|
|
|
regs.x = op_dec(regs.x);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0xdc: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
op_io();
|
|
|
|
regs.y = op_dec(regs.y);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x1c: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
op_io();
|
|
|
|
regs.a = op_asl(regs.a);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x5c: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
op_io();
|
|
|
|
regs.a = op_lsr(regs.a);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x3c: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
op_io();
|
|
|
|
regs.a = op_rol(regs.a);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x7c: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
op_io();
|
|
|
|
regs.a = op_ror(regs.a);
|
|
|
|
opcode_cycle = 0;
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
2011-10-18 18:10:06 +00:00
|
|
|
}
|
|
|
|
break;
|
2011-06-12 06:25:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case 0xab: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
rd = op_readdp(dp);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_inc(rd);
|
|
|
|
op_writedp(dp, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x8b: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
rd = op_readdp(dp);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_dec(rd);
|
|
|
|
op_writedp(dp, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x0b: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
rd = op_readdp(dp);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_asl(rd);
|
|
|
|
op_writedp(dp, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x4b: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
rd = op_readdp(dp);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_lsr(rd);
|
|
|
|
op_writedp(dp, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x2b: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
rd = op_readdp(dp);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_rol(rd);
|
|
|
|
op_writedp(dp, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x6b: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
rd = op_readdp(dp);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_ror(rd);
|
|
|
|
op_writedp(dp, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0xbb: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
op_io();
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readdp(dp + regs.x);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd = op_inc(rd);
|
|
|
|
op_writedp(dp + regs.x, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x9b: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
op_io();
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readdp(dp + regs.x);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd = op_dec(rd);
|
|
|
|
op_writedp(dp + regs.x, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x1b: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
op_io();
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readdp(dp + regs.x);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd = op_asl(rd);
|
|
|
|
op_writedp(dp + regs.x, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x5b: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
op_io();
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readdp(dp + regs.x);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd = op_lsr(rd);
|
|
|
|
op_writedp(dp + regs.x, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x3b: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
op_io();
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readdp(dp + regs.x);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd = op_rol(rd);
|
|
|
|
op_writedp(dp + regs.x, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x7b: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
op_io();
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readdp(dp + regs.x);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd = op_ror(rd);
|
|
|
|
op_writedp(dp + regs.x, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0xac: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
dp |= op_readpc() << 8;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readaddr(dp);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd = op_inc(rd);
|
|
|
|
op_writeaddr(dp, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x8c: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
dp |= op_readpc() << 8;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readaddr(dp);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd = op_dec(rd);
|
|
|
|
op_writeaddr(dp, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x0c: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
dp |= op_readpc() << 8;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readaddr(dp);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd = op_asl(rd);
|
|
|
|
op_writeaddr(dp, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x4c: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
dp |= op_readpc() << 8;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readaddr(dp);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd = op_lsr(rd);
|
|
|
|
op_writeaddr(dp, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x2c: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
dp |= op_readpc() << 8;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readaddr(dp);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd = op_rol(rd);
|
|
|
|
op_writeaddr(dp, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x6c: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
dp |= op_readpc() << 8;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readaddr(dp);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd = op_ror(rd);
|
|
|
|
op_writeaddr(dp, rd);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x0e: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
dp |= op_readpc() << 8;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readaddr(dp);
|
|
|
|
regs.p.n = !!((regs.a - rd) & 0x80);
|
|
|
|
regs.p.z = ((regs.a - rd) == 0);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
op_readaddr(dp);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
op_writeaddr(dp, rd | regs.a);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x4e: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
dp |= op_readpc() << 8;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rd = op_readaddr(dp);
|
|
|
|
regs.p.n = !!((regs.a - rd) & 0x80);
|
|
|
|
regs.p.z = ((regs.a - rd) == 0);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
op_readaddr(dp);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
op_writeaddr(dp, rd &~ regs.a);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x3a: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
rd = op_readdp(dp);
|
|
|
|
rd++;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
op_writedp(dp++, rd);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd += op_readdp(dp) << 8;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
op_writedp(dp, rd >> 8);
|
|
|
|
regs.p.n = !!(rd & 0x8000);
|
|
|
|
regs.p.z = (rd == 0);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x1a: {
|
2011-10-18 18:10:06 +00:00
|
|
|
switch(opcode_cycle++) {
|
|
|
|
case 1:
|
|
|
|
dp = op_readpc();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
rd = op_readdp(dp);
|
|
|
|
rd--;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
op_writedp(dp++, rd);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rd += op_readdp(dp) << 8;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
op_writedp(dp, rd >> 8);
|
|
|
|
regs.p.n = !!(rd & 0x8000);
|
|
|
|
regs.p.z = (rd == 0);
|
|
|
|
opcode_cycle = 0;
|
|
|
|
break;
|
|
|
|
}
|
2011-06-12 06:25:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|