diff options
author | vin <git@vineetk.net> | 2024-06-11 14:43:41 +0530 |
---|---|---|
committer | vin <git@vineetk.net> | 2024-06-11 14:43:41 +0530 |
commit | 142e35ff696d00b5ecd00be7ecd233bb9cec3be3 (patch) | |
tree | 6ec293fd8f6fedc565e8fe1ce51354b92e664eaa | |
parent | a3189d90af2c675086e6dd629cfa071e4d75d4c9 (diff) |
remove opcode json converter helper scripts
They were only used to automate writing the boilerplate for each
instruction. They're not needed at the moment and they were using
65c02 instructions instead of 6502 anyways.
-rw-r--r-- | converter.py | 39 | ||||
-rw-r--r-- | converter_blank_funs.py | 31 |
2 files changed, 0 insertions, 70 deletions
diff --git a/converter.py b/converter.py deleted file mode 100644 index da9d8cd..0000000 --- a/converter.py +++ /dev/null @@ -1,39 +0,0 @@ -import json - -address_mode_table = { - 'Implied': 'AM_ACC', - 'Immediate': 'AM_IMM', - 'Zero Page': 'AM_ZP', - 'Zero Page, X': 'AM_ZP_X', - 'Zero Page, Y': 'AM_ZP_Y', - 'Absolute': 'AM_ABS', - 'Absolute, X': 'AM_ABS_X', - 'Absolute, Y': 'AM_ABS_Y', - 'Indirect': 'AM_IND', - '(Indirect)': 'AM_IND', - '(Indirect, X)': 'AM_IND_X', - '(Indirect), Y': 'AM_IND_Y', -} - -# https://github.com/ericTheEchidna/65C02-JSON/ -j = json.load(open('opcodes_65c02.json', 'r')) - -#print(j) - -for i in j: - #print(i) - instruction = str.lower(i["instruction"]) - for op in i["opcodes"]: - address_mode = i["opcodes"][op]["address_mode"] - if "Bit " in address_mode: - am = 'AM_REL' - else: - am = address_mode_table[address_mode] - - bytes = i["opcodes"][op]["bytes"] - cycles = i["opcodes"][op]["cycles"] - - print(f'''case {op}: - {instruction}(opcode_arg({am})); - cycles += {cycles}; - break;''') diff --git a/converter_blank_funs.py b/converter_blank_funs.py deleted file mode 100644 index 9502ca8..0000000 --- a/converter_blank_funs.py +++ /dev/null @@ -1,31 +0,0 @@ -import json - -address_mode_table = { - 'Implied': 'AM_ACC', - 'Immediate': 'AM_IMM', - 'Zero Page': 'AM_ZP', - 'Zero Page, X': 'AM_ZP_X', - 'Zero Page, Y': 'AM_ZP_Y', - 'Absolute': 'AM_ABS', - 'Absolute, X': 'AM_ABS_X', - 'Absolute, Y': 'AM_ABS_Y', - 'Indirect': 'AM_IND', - '(Indirect)': 'AM_IND', - '(Indirect, X)': 'AM_IND_X', - '(Indirect), Y': 'AM_IND_Y', -} - -# https://github.com/ericTheEchidna/65C02-JSON/ -j = json.load(open('opcodes_65c02.json', 'r')) - -#print(j) - -for i in j: - #print(i) - instruction = str.lower(i["instruction"]) - print(''' -static void -''' + instruction + '''(uint8_t arg) -{ -/* TODO: complete this */ -}''') |