summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ti99/peb/pcode.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/ti99/peb/pcode.h')
-rw-r--r--src/devices/bus/ti99/peb/pcode.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/devices/bus/ti99/peb/pcode.h b/src/devices/bus/ti99/peb/pcode.h
new file mode 100644
index 00000000000..088ca1ae4b3
--- /dev/null
+++ b/src/devices/bus/ti99/peb/pcode.h
@@ -0,0 +1,67 @@
+// license:LGPL-2.1+
+// copyright-holders:Michael Zapf
+/****************************************************************************
+
+ TI-99 P-Code Card emulation.
+ See p_code.c for documentation
+
+ Michael Zapf
+ July 2009
+ Revised July 2010
+ February 2012: Rewritten as class
+
+*****************************************************************************/
+
+#ifndef MAME_BUS_TI99_PEB_PCODE_H
+#define MAME_BUS_TI99_PEB_PCODE_H
+
+#pragma once
+
+#include "peribox.h"
+#include "machine/tmc0430.h"
+
+DECLARE_DEVICE_TYPE(TI99_P_CODE, ti_pcode_card_device)
+
+class ti_pcode_card_device : public ti_expansion_card_device
+{
+public:
+ ti_pcode_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ DECLARE_READ8Z_MEMBER(readz) override;
+ DECLARE_WRITE8_MEMBER(write) override;
+ DECLARE_READ8Z_MEMBER(crureadz) override;
+ DECLARE_WRITE8_MEMBER(cruwrite) override;
+ DECLARE_SETADDRESS_DBIN_MEMBER(setaddress_dbin) override;
+
+ DECLARE_WRITE_LINE_MEMBER(clock_in) override;
+
+ DECLARE_WRITE_LINE_MEMBER( ready_line );
+ DECLARE_INPUT_CHANGED_MEMBER( switch_changed );
+
+protected:
+ virtual void device_start() override;
+ virtual void device_reset() override;
+ virtual void device_config_complete() override;
+ virtual const tiny_rom_entry *device_rom_region() const override;
+ virtual machine_config_constructor device_mconfig_additions() const override;
+ virtual ioport_constructor device_input_ports() const override;
+
+private:
+ void debugger_read(address_space& space, uint16_t addr, uint8_t& value);
+ tmc0430_device* m_grom[8];
+ uint8_t* m_rom;
+ int m_bank_select;
+ bool m_active;
+ int m_clock_count;
+ bool m_clockhigh;
+
+ // Address in card area
+ bool m_inDsrArea;
+ bool m_isrom0;
+ bool m_isrom12;
+ bool m_isgrom;
+
+ // Recent address
+ int m_address;
+};
+
+#endif // MAME_BUS_TI99_PEB_PCODE_H