-/*\r
- Skelton for retropc emulator\r
-\r
- Author : Takeda.Toshiya\r
- Date : 2008.04.19-\r
-\r
- [ uPD1990A / uPD4990A ]\r
-*/\r
-\r
-#ifndef _UPD1990A_H_\r
-#define _UPD1990A_H_\r
-\r
-#define SIG_UPD1990A_CLK 0\r
-#define SIG_UPD1990A_STB 1\r
-#define SIG_UPD1990A_CMD 2\r
-#define SIG_UPD1990A_C0 3\r
-#define SIG_UPD1990A_C1 4\r
-#define SIG_UPD1990A_C2 5\r
-#define SIG_UPD1990A_DIN 6\r
-\r
-#include "vm.h"\r
-#include "../emu.h"\r
-#include "device.h"\r
-\r
-class UPD1990A : public DEVICE\r
-{\r
-private:\r
- // output signals\r
- outputs_t outputs_dout;\r
- outputs_t outputs_tp;\r
- \r
- cur_time_t cur_time;\r
- int register_id_1sec;\r
- \r
- uint8 cmd, mode, tpmode;\r
- uint64 shift_data;\r
- bool clk, stb, din, hold, tp;\r
- uint32 dout;\r
- bool dout_changed;\r
- int register_id_tp;\r
- \r
-#ifdef HAS_UPD4990A\r
- uint8 shift_cmd;\r
-#endif\r
- \r
-public:\r
- UPD1990A(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)\r
- {\r
- init_output_signals(&outputs_dout);\r
- init_output_signals(&outputs_tp);\r
- cmd = mode = tpmode = 0;\r
- shift_data = 0;\r
- clk = stb = din = tp = true;\r
- hold = false;\r
- dout = 0;\r
- dout_changed = false;\r
-#ifdef HAS_UPD4990A\r
- shift_cmd = 0;\r
-#endif\r
- }\r
- ~UPD1990A() {}\r
- \r
- // common functions\r
- void initialize();\r
- void write_signal(int id, uint32 data, uint32 mask);\r
- uint32 read_signal(int ch)\r
- {\r
- return dout;\r
- }\r
- void event_callback(int event_id, int err);\r
- void save_state(FILEIO* state_fio);\r
- bool load_state(FILEIO* state_fio);\r
- \r
- // unique functions\r
- void set_context_dout(DEVICE* device, int id, uint32 mask)\r
- {\r
- register_output_signal(&outputs_dout, device, id, mask);\r
- }\r
- void set_context_tp(DEVICE* device, int id, uint32 mask)\r
- {\r
- register_output_signal(&outputs_tp, device, id, mask);\r
- }\r
-};\r
-\r
-#endif\r
-\r
+/*
+ Skelton for retropc emulator
+
+ Author : Takeda.Toshiya
+ Date : 2008.04.19-
+
+ [ uPD1990A / uPD4990A ]
+*/
+
+#ifndef _UPD1990A_H_
+#define _UPD1990A_H_
+
+#define SIG_UPD1990A_CLK 0
+#define SIG_UPD1990A_STB 1
+#define SIG_UPD1990A_CMD 2
+#define SIG_UPD1990A_C0 3
+#define SIG_UPD1990A_C1 4
+#define SIG_UPD1990A_C2 5
+#define SIG_UPD1990A_DIN 6
+
+#include "vm.h"
+#include "../emu.h"
+#include "device.h"
+
+class UPD1990A : public DEVICE
+{
+private:
+ // output signals
+ outputs_t outputs_dout;
+ outputs_t outputs_tp;
+
+ cur_time_t cur_time;
+ int register_id_1sec;
+
+ uint8 cmd, mode, tpmode;
+ uint64 shift_data;
+ bool clk, stb, din, hold, tp;
+ uint32 dout;
+ bool dout_changed;
+ int register_id_tp;
+
+#ifdef HAS_UPD4990A
+ uint8 shift_cmd;
+#endif
+
+public:
+ UPD1990A(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
+ {
+ init_output_signals(&outputs_dout);
+ init_output_signals(&outputs_tp);
+ cmd = mode = tpmode = 0;
+ shift_data = 0;
+ clk = stb = din = tp = true;
+ hold = false;
+ dout = 0;
+ dout_changed = false;
+#ifdef HAS_UPD4990A
+ shift_cmd = 0;
+#endif
+ }
+ ~UPD1990A() {}
+
+ // common functions
+ void initialize();
+ void write_signal(int id, uint32 data, uint32 mask);
+ uint32 read_signal(int ch)
+ {
+ return dout;
+ }
+ void event_callback(int event_id, int err);
+ void save_state(FILEIO* state_fio);
+ bool load_state(FILEIO* state_fio);
+
+ // unique functions
+ void set_context_dout(DEVICE* device, int id, uint32 mask)
+ {
+ register_output_signal(&outputs_dout, device, id, mask);
+ }
+ void set_context_tp(DEVICE* device, int id, uint32 mask)
+ {
+ register_output_signal(&outputs_tp, device, id, mask);
+ }
+};
+
+#endif
+