2 CANON X-07 Emulator 'eX-07'
5 Author : Takeda.Toshiya
15 #include "../../emu.h"
16 #include "../device.h"
18 #define WRAM_OFS_UDC0 0x200
19 #define WRAM_OFS_UDC1 0x300
20 #define WRAM_OFS_KBUF 0x400
21 #define WRAM_OFS_SPGM 0x500
22 #define WRAM_OFS_RSVD 0x700
23 #define FONT_OFS_UDC0 0x400
24 #define FONT_OFS_UDC1 0x700
25 #define CMT_BUF_SIZE 0x40000
33 class IO : public DEVICE
37 DEVICE *d_cpu, *d_mem;
41 uint8_t rregs[8], wregs[8];
49 dll_cur_time_t cur_time;
59 bool ctrl, shift, kana, graph, brk;
60 uint8_t stick, strig, strig1;
66 bool cmt_play, cmt_rec, cmt_mode;
67 _TCHAR rec_file_path[_MAX_PATH];
69 uint8_t cmt_buf[CMT_BUF_SIZE];
76 void draw_font(int x, int y, uint8_t code);
78 void draw_line(int sx, int sy, int ex, int ey);
79 void draw_circle(int x, int y, int r);
80 void line_clear(int y);
82 uint8_t font[256 * 8], udc[256 * 8];
84 bool locate_on, cursor_on, udk_on;
85 int locate_x, locate_y;
86 int cursor_x, cursor_y, cursor_blink;
87 int scroll_min, scroll_max;
93 IO(VM_TEMPLATE* parent_vm, EMU_TEMPLATE* parent_emu) : DEVICE(parent_vm, parent_emu)
95 set_device_name(_T("I/O Bus"));
104 void event_vline(int v, int clock);
105 void event_callback(int event_id, int err);
106 void __FASTCALL write_io8(uint32_t addr, uint32_t data);
107 uint32_t __FASTCALL read_io8(uint32_t addr);
108 bool process_state(FILEIO* state_fio, bool loading);
111 void play_tape(const _TCHAR* file_path);
112 void rec_tape(const _TCHAR* file_path);
114 bool is_tape_inserted()
116 return (cmt_play || cmt_rec);
118 void set_context_beep(BEEP* device)
122 void set_context_cpu(DEVICE* device)
126 void set_context_mem(DEVICE* device, uint8_t* ptr)
132 void key_down(int code);
133 void key_up(int code);
134 bool get_caps_locked()
139 bool get_kana_locked()