From b33b05330713a46adad4f0cbb137da06f15dfd1a Mon Sep 17 00:00:00 2001 From: Zsolt Branyiczky Date: Tue, 10 Nov 2020 10:32:29 +0100 Subject: [PATCH] add c64dtv support --- asminc/cpu.mac | 2 + asminc/opcodes.inc | 8 ++ doc/ca65.sgml | 2 +- src/ca65/instr.c | 92 +++++++++++++ src/cc65/codegen.c | 3 +- src/cc65/coptjmp.c | 2 +- src/cc65/main.c | 3 +- src/cc65/opcodes.c | 2 +- src/common/cpu.c | 2 + src/common/cpu.h | 2 + src/da65.vcxproj | 2 + src/da65/opc6502dtv.c | 308 ++++++++++++++++++++++++++++++++++++++++++ src/da65/opc6502dtv.h | 61 +++++++++ src/da65/opctable.c | 2 + 14 files changed, 486 insertions(+), 5 deletions(-) create mode 100644 src/da65/opc6502dtv.c create mode 100644 src/da65/opc6502dtv.h diff --git a/asminc/cpu.mac b/asminc/cpu.mac index 6b9cb9947..55727c93e 100644 --- a/asminc/cpu.mac +++ b/asminc/cpu.mac @@ -9,6 +9,7 @@ CPU_ISET_SWEET16 = $0040 CPU_ISET_HUC6280 = $0080 ;CPU_ISET_M740 = $0100 not actually implemented CPU_ISET_4510 = $0200 +CPU_ISET_6502DTV = $0400 ; CPU capabilities CPU_NONE = CPU_ISET_NONE @@ -20,3 +21,4 @@ CPU_65816 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65816 CPU_SWEET16 = CPU_ISET_SWEET16 CPU_HUC6280 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_HUC6280 CPU_4510 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_4510 +CPU_6502DTV = CPU_ISET_6502|CPU_ISET_6502X|CPU_ISET_6502DTV diff --git a/asminc/opcodes.inc b/asminc/opcodes.inc index aa7a65f00..e6b7e73df 100644 --- a/asminc/opcodes.inc +++ b/asminc/opcodes.inc @@ -505,4 +505,12 @@ OPC_ISC_aby = $FB OPC_NOP_abx = $FC OPC_ISC_abx = $FF +.if (.cpu .bitand ::CPU_ISET_6502DTV) + +OPC_BRA = $12 +OPC_SAC_imm = $32 +OPC_SIR_imm = $42 + +.endif + .endif diff --git a/doc/ca65.sgml b/doc/ca65.sgml index 8d97bddfd..25a47b29a 100644 --- a/doc/ca65.sgml +++ b/doc/ca65.sgml @@ -151,7 +151,7 @@ Here is a description of all the command line options: Set the default for the CPU type. The option takes a parameter, which may be one of - 6502, 6502X, 65SC02, 65C02, 65816, sweet16, HuC6280, 4510 + 6502, 6502X, 6502DTV, 65SC02, 65C02, 65816, sweet16, HuC6280, 4510