summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/m6502/r65c02gk.h
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-06-12 09:09:58 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-06-12 09:10:27 +0200
commit550175d8b8ec9739c5e7810bbdba789cf6b49158 (patch)
tree1e4fcca4235678fdc51a0aa9b2666fa5fc99dcf7 /src/devices/cpu/m6502/r65c02gk.h
parentd1574082185c137a1214885c73b9d34af6d3f293 (diff)
More work on gameking 3 [PeT]
Diffstat (limited to 'src/devices/cpu/m6502/r65c02gk.h')
-rw-r--r--src/devices/cpu/m6502/r65c02gk.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/devices/cpu/m6502/r65c02gk.h b/src/devices/cpu/m6502/r65c02gk.h
new file mode 100644
index 00000000000..878c0ab43f7
--- /dev/null
+++ b/src/devices/cpu/m6502/r65c02gk.h
@@ -0,0 +1,74 @@
+// license:BSD-3-Clause
+// copyright-holders:Peter Trauner
+/***************************************************************************
+
+ r65c02gk.h
+
+ gameking 65c02 with bitwise instructions and wai instruction, additional
+ interrupt vectors, special vector address base
+
+
+***************************************************************************/
+
+#ifndef __R65C02GK_H__
+#define __R65C02GK_H__
+
+#include "r65c02.h"
+
+class r65c02gk_device : public r65c02_device {
+public:
+ r65c02gk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ r65c02gk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ static const disasm_entry disasm_entries[0x100];
+
+ virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override;
+ virtual void do_exec_full() override;
+ virtual void do_exec_partial() override;
+ enum {
+ IRQ_GK3A=INPUT_LINE_IRQ0,
+ IRQ_GK3B,
+ IRQ_TIMERUSER=INPUT_LINE_IRQ6,
+ IRQ_INPUTS, //449C,
+ IRQ_USER, //=INPUT_LINE_IRQ8,
+ IRQ_TIMER, //=INPUT_LINE_IRQ9,
+ IRQ_6606,
+ R65C02GK_IRQ_LINE12 = IRQ_GK3A/*R65C02GK_IRQ_LINE0*/+12,
+ R65C02GK_NMI_LINE = INPUT_LINE_NMI // >12
+// R65C02GK_SET_OVERFLOW = m6502_device::V_LINE,
+ };
+
+ void set_irq_bank(memory_bank *m_bank4000, UINT8 *bank4000_normal, UINT8 *bank4000_irq);
+protected:
+ UINT8 *bank4000_normal, *bank4000_irq;
+ virtual void device_reset() override;
+ virtual void execute_set_input(int inputnum, int state) override;
+ memory_bank *m_bank4000;
+
+#if 0
+ void prefetch();
+ void prefetch_noirq();
+ void prefetch_wai();
+#endif
+
+ struct InterruptController { // nearly nothing known about it, only enough to get bios working
+ bool states[13];
+ int getlevel() { for (int i=12; i>=0; --i) { if (states[i]) return i; } return -1; }
+ void Reset() { memset(states, 0, sizeof(states)); }
+ } interrupt_controller;
+
+ #define O(o) void o ## _full(); void o ## _partial()
+
+ O(brk_c_imp);
+ O(rti_imp);
+ O(wai_imp);
+
+ // exceptions
+ O(reset);
+
+};
+
+
+extern const device_type R65C02GK;
+
+#endif