diff options
| author | vin <git@vineetk.net> | 2024-06-30 19:10:29 -0400 |
|---|---|---|
| committer | vin <git@vineetk.net> | 2024-06-30 19:10:29 -0400 |
| commit | a4b39966aed8d41ad4ddc6700683c4779e8d1cb2 (patch) | |
| tree | 8fab3574f3d83199a4965ffecd0db549105ff96c /cpu.c | |
| parent | f28733401ebfe5457a4a79a37fbd5d2001de90bd (diff) | |
start refactoring opcode defs into an array
Diffstat (limited to 'cpu.c')
| -rw-r--r-- | cpu.c | 18 |
1 files changed, 2 insertions, 16 deletions
| @@ -4,6 +4,8 @@ | |||
| 4 | #include <stdlib.h> | 4 | #include <stdlib.h> |
| 5 | #include <string.h> | 5 | #include <string.h> |
| 6 | 6 | ||
| 7 | #include "cpu.h" | ||
| 8 | #include "opcodes.h" | ||
| 7 | #include "rom.h" | 9 | #include "rom.h" |
| 8 | 10 | ||
| 9 | #define MAX(a, b) ((a > b) ? a : b) | 11 | #define MAX(a, b) ((a > b) ? a : b) |
| @@ -52,22 +54,6 @@ struct registers regs = {0}; | |||
| 52 | 54 | ||
| 53 | struct Rom rom = {0}; | 55 | struct Rom rom = {0}; |
| 54 | 56 | ||
| 55 | enum addressing_mode { | ||
| 56 | AM_ACC, | ||
| 57 | AM_IMPLICIT, | ||
| 58 | AM_IMM, | ||
| 59 | AM_ZP, | ||
| 60 | AM_ZP_X, | ||
| 61 | AM_ZP_Y, | ||
| 62 | AM_REL, | ||
| 63 | AM_ABS, | ||
| 64 | AM_ABS_X, | ||
| 65 | AM_ABS_Y, | ||
| 66 | AM_IND, | ||
| 67 | AM_IND_X, | ||
| 68 | AM_IND_Y, | ||
| 69 | }; | ||
| 70 | |||
| 71 | /* 64K address space, 16bit words */ | 57 | /* 64K address space, 16bit words */ |
| 72 | uint8_t memory[0x16000]; | 58 | uint8_t memory[0x16000]; |
| 73 | 59 | ||
