2 SHARP X1 Emulator 'eX1'
\r
3 SHARP X1twin Emulator 'eX1twin'
\r
4 SHARP X1turbo Emulator 'eX1turbo'
\r
6 Author : Takeda.Toshiya
\r
15 #if defined(_X1TURBOZ)
\r
16 #define DEVICE_NAME "SHARP X1turboZ"
\r
17 #define CONFIG_NAME "x1turboz"
\r
18 #elif defined(_X1TURBO)
\r
19 #define DEVICE_NAME "SHARP X1turbo"
\r
20 #define CONFIG_NAME "x1turbo"
\r
21 #elif defined(_X1TWIN)
\r
22 #define DEVICE_NAME "SHARP X1twin"
\r
23 #define CONFIG_NAME "x1twin"
\r
25 #define DEVICE_NAME "SHARP X1"
\r
26 #define CONFIG_NAME "x1"
\r
29 #if defined(_X1TURBO) || defined(_X1TURBOZ)
\r
30 #define _X1TURBO_FEATURE
\r
33 // device informations for virtual machine (x1)
\r
34 //#ifdef _X1TURBO_FEATURE
\r
36 //#define FRAMES_PER_SEC 55.49
\r
37 //#define LINES_PER_FRAME 448
\r
38 //#define CHARS_PER_LINE 56
\r
39 //#define HD46505_HORIZ_FREQ 24860
\r
42 #define FRAMES_PER_SEC 61.94
\r
43 #define LINES_PER_FRAME 258
\r
44 #define CHARS_PER_LINE 56
\r
45 #define HD46505_HORIZ_FREQ 15980
\r
47 #define CPU_CLOCKS 4000000
\r
48 #define SCREEN_WIDTH 640
\r
49 #define SCREEN_HEIGHT 400
\r
51 #define IO_ADDR_MAX 0x10000
\r
52 #define HAS_AY_3_8910
\r
54 #ifdef _X1TURBO_FEATURE
\r
55 #define SINGLE_MODE_DMA
\r
57 #define DATAREC_FF_REW_SPEED 16
\r
58 #define SUPPORT_VARIABLE_TIMING
\r
60 #ifdef _X1TURBO_FEATURE
\r
61 #define IPL_ROM_FILE_SIZE 0x8000
\r
62 #define IPL_ROM_FILE_NAME _T("IPLROM.X1T")
\r
63 #define SUB_ROM_FILE_NAME _T("SUBROM.X1T")
\r
64 #define KBD_ROM_FILE_NAME _T("KBDROM.X1T")
\r
66 #define IPL_ROM_FILE_SIZE 0x1000
\r
67 #define IPL_ROM_FILE_NAME _T("IPLROM.X1")
\r
68 #define SUB_ROM_FILE_NAME _T("SUBROM.X1")
\r
69 #define KBD_ROM_FILE_NAME _T("KBDROM.X1")
\r
71 #define CRC32_MSM80C49_262 0x43EE7D6F // X1turbo with CMT
\r
72 #define CRC32_MSM80C49_277 0x75904EFB // X1turbo (not supported yet)
\r
75 // device informations for virtual machine (pce)
\r
76 #define PCE_FRAMES_PER_SEC 60
\r
77 #define PCE_LINES_PER_FRAME 262
\r
78 #define PCE_CPU_CLOCKS 7159090
\r
81 // device informations for win32
\r
82 #define USE_SPECIAL_RESET
\r
83 #ifdef _X1TURBO_FEATURE
\r
84 #define USE_DEVICE_TYPE 2
\r
88 #define FD_BASE_NUMBER 0
\r
93 #define NOTIFY_KEY_DOWN
\r
94 #define USE_SHIFT_NUMPAD_KEY
\r
95 #define USE_ALT_F10_KEY
\r
96 #define USE_AUTO_KEY 8
\r
97 #define USE_AUTO_KEY_RELEASE 10
\r
98 #define USE_MONITOR_TYPE 2
\r
99 #define USE_CRT_FILTER
\r
100 #define USE_SCANLINE
\r
101 #define USE_ACCESS_LAMP
\r
102 #define USE_SOUND_DEVICE_TYPE 3
\r
103 #define USE_DEBUGGER
\r
106 #include "../../common.h"
\r
107 #include "../../fileio.h"
\r
122 #ifdef _X1TURBO_FEATURE
\r
168 #ifdef _X1TURBO_FEATURE
\r
190 bool pseudo_sub_cpu;
\r
191 int sound_device_type;
\r
202 // ----------------------------------------
\r
204 // ----------------------------------------
\r
206 VM(EMU* parent_emu);
\r
209 // ----------------------------------------
\r
210 // for emulation class
\r
211 // ----------------------------------------
\r
213 // drive virtual machine
\r
215 void special_reset();
\r
217 double frame_rate();
\r
219 #ifdef USE_DEBUGGER
\r
221 DEVICE *get_cpu(int index);
\r
225 void draw_screen();
\r
228 // sound generation
\r
229 void initialize_sound(int rate, int samples);
\r
230 uint16* create_sound(int* extra_frames);
\r
231 int sound_buffer_ptr();
\r
234 void key_down(int code, bool repeat);
\r
235 void key_up(int code);
\r
238 void open_disk(int drv, _TCHAR* file_path, int offset);
\r
239 void close_disk(int drv);
\r
240 bool disk_inserted(int drv);
\r
241 void write_protect_fd(int drv, bool flag);
\r
242 bool is_write_protect_fd(int drv);
\r
243 void play_tape(_TCHAR* file_path);
\r
244 void rec_tape(_TCHAR* file_path);
\r
246 bool tape_inserted();
\r
248 int get_tape_ptr(void);
\r
251 void open_cart(int drv, _TCHAR* file_path);
\r
252 void close_cart(int drv);
\r
253 bool cart_inserted(int drv);
\r
256 void update_config();
\r
257 #ifdef _X1TURBO_FEATURE
\r
258 void update_dipswitch();
\r
260 void save_state(FILEIO* state_fio);
\r
261 bool load_state(FILEIO* state_fio);
\r
263 // ----------------------------------------
\r
265 // ----------------------------------------
\r
268 DEVICE* get_device(int id);
\r
270 DEVICE* first_device;
\r
271 DEVICE* last_device;
\r