diff options
author | vin <git@vineetk.net> | 2024-07-04 12:11:53 -0400 |
---|---|---|
committer | vin <git@vineetk.net> | 2024-07-04 12:11:53 -0400 |
commit | c4fc40a036293a8f5899800ad3ecb1d24ba77bc4 (patch) | |
tree | dc81c2ffd74287ef8f9867e50e463513641680fb /cpu.c | |
parent | 5cd467eaf6b4f15f28b98c5fa49ab788dac945b3 (diff) |
start implementing unofficial opcodes
Diffstat (limited to 'cpu.c')
-rw-r--r-- | cpu.c | 149 |
1 files changed, 148 insertions, 1 deletions
@@ -177,6 +177,8 @@ branch(uint16_t addr, bool cond) regs.pc = addr; } +/* OFFICIAL OPCODES */ + void ADC(uint16_t arg) { @@ -696,6 +698,140 @@ TYA(uint16_t arg) STATUS_UPDATE_NZ(regs.a); } +/* UNOFFICIAL OPCODES */ + +void +AAC(uint16_t arg) +{ + NOP(0); +} + +void +AAX(uint16_t arg) +{ + NOP(0); +} + +void +ARR(uint16_t arg) +{ + NOP(0); +} + +void +ASR(uint16_t arg) +{ + NOP(0); +} + +void +ATX(uint16_t arg) +{ + NOP(0); +} + +void +AXA(uint16_t arg) +{ + NOP(0); +} + +void +AXS(uint16_t arg) +{ + NOP(0); +} + +void +DCP(uint16_t arg) +{ + NOP(0); +} + +void +DOP(uint16_t arg) +{ + NOP(0); +} + +void +ISC(uint16_t arg) +{ + NOP(0); +} + +void +KIL(uint16_t arg) +{ + NOP(0); +} + +void +LAR(uint16_t arg) +{ + NOP(0); +} + +void +LAX(uint16_t arg) +{ + NOP(0); +} + +void +RLA(uint16_t arg) +{ + NOP(0); +} + +void +RRA(uint16_t arg) +{ + NOP(0); +} + +void +SLO(uint16_t arg) +{ + NOP(0); +} + +void +SRE(uint16_t arg) +{ + NOP(0); +} + +void +SXA(uint16_t arg) +{ + NOP(0); +} + +void +SYA(uint16_t arg) +{ + NOP(0); +} + +void +TOP(uint16_t arg) +{ + NOP(0); +} + +void +XAA(uint16_t arg) +{ + NOP(0); +} + +void +XAS(uint16_t arg) +{ + NOP(0); +} + static void interpret(void) { @@ -711,7 +847,18 @@ interpret(void) printf("%02X", op); for (uint8_t i = 0; i < opcodes[op].bytes - 1; i++) printf(" %02X", peek(regs.pc + i)); - printf("\t%s ", opcodes[op].name); + + if (opcodes[op].unofficial) { + if (opcodes[op].bytes == 1) + printf(" "); + else if (opcodes[op].bytes == 2) + printf(" "); + else if (opcodes[op].bytes == 3) + putchar(' '); + putchar('*'); + } else + putchar('\t'); + printf("%s ", opcodes[op].name); mode = opcodes[op].mode; arg = opcode_mem(mode); |