2 SHARP X1 Emulator 'eX1'
3 SHARP X1twin Emulator 'eX1twin'
4 SHARP X1turbo Emulator 'eX1turbo'
6 Author : Takeda.Toshiya
15 #if defined(_X1TURBOZ)
16 #define DEVICE_NAME "SHARP X1turboZ"
17 #define CONFIG_NAME "x1turboz"
18 #elif defined(_X1TURBO)
19 #define DEVICE_NAME "SHARP X1turbo"
20 #define CONFIG_NAME "x1turbo"
21 #elif defined(_X1TWIN)
22 #define DEVICE_NAME "SHARP X1twin"
23 #define CONFIG_NAME "x1twin"
25 #define DEVICE_NAME "SHARP X1"
26 #define CONFIG_NAME "x1"
29 #if defined(_X1TURBO) || defined(_X1TURBOZ)
30 #define _X1TURBO_FEATURE
33 // device informations for virtual machine (x1)
34 //#ifdef _X1TURBO_FEATURE
36 //#define FRAMES_PER_SEC 55.49
37 //#define LINES_PER_FRAME 448
38 //#define CHARS_PER_LINE 56
39 //#define HD46505_HORIZ_FREQ 24860
42 #define FRAMES_PER_SEC 61.94
43 #define LINES_PER_FRAME 258
44 #define CHARS_PER_LINE 56
45 #define HD46505_HORIZ_FREQ 15980
47 #define CPU_CLOCKS 4000000
48 #define SCREEN_WIDTH 640
49 #define SCREEN_HEIGHT 400
51 #define IO_ADDR_MAX 0x10000
54 #ifdef _X1TURBO_FEATURE
55 #define SINGLE_MODE_DMA
57 #define DATAREC_FF_REW_SPEED 16
58 #define SUPPORT_VARIABLE_TIMING
60 #ifdef _X1TURBO_FEATURE
61 #define IPL_ROM_FILE_SIZE 0x8000
62 #define IPL_ROM_FILE_NAME _T("IPLROM.X1T")
63 #define SUB_ROM_FILE_NAME _T("SUBROM.X1T")
64 #define KBD_ROM_FILE_NAME _T("KBDROM.X1T")
66 #define IPL_ROM_FILE_SIZE 0x1000
67 #define IPL_ROM_FILE_NAME _T("IPLROM.X1")
68 #define SUB_ROM_FILE_NAME _T("SUBROM.X1")
69 #define KBD_ROM_FILE_NAME _T("KBDROM.X1")
71 #define CRC32_MSM80C49_262 0x43EE7D6F // X1turbo with CMT
72 #define CRC32_MSM80C49_277 0x75904EFB // X1turbo (not supported yet)
75 // device informations for virtual machine (pce)
76 #define PCE_FRAMES_PER_SEC 60
77 #define PCE_LINES_PER_FRAME 262
78 #define PCE_CPU_CLOCKS 7159090
82 #define SCREEN_WIDTH_ASPECT 400
83 #define SCREEN_HEIGHT_ASPECT 300
84 // device informations for win32
85 #define USE_SPECIAL_RESET
86 #ifdef _X1TURBO_FEATURE
87 #define USE_DEVICE_TYPE 2
88 #define USE_DRIVE_TYPE 2
92 #define FD_BASE_NUMBER 0
94 #define USE_TAPE_BUTTON
99 #define NOTIFY_KEY_DOWN
100 #define USE_SHIFT_NUMPAD_KEY
101 #define USE_ALT_F10_KEY
102 #define USE_AUTO_KEY 8
103 #define USE_AUTO_KEY_RELEASE 10
104 #define USE_MONITOR_TYPE 2
105 #define USE_CRT_FILTER
107 #define USE_ACCESS_LAMP
108 #define USE_DISK_WRITE_PROTECT
109 #define USE_SOUND_DEVICE_TYPE 3
113 #include "../../common.h"
114 #include "../../fileio.h"
130 #ifdef _X1TURBO_FEATURE
175 #ifdef _X1TURBO_FEATURE
198 int sound_device_type;
209 // ----------------------------------------
211 // ----------------------------------------
216 // ----------------------------------------
217 // for emulation class
218 // ----------------------------------------
220 // drive virtual machine
222 void special_reset();
228 DEVICE *get_cpu(int index);
236 void initialize_sound(int rate, int samples);
237 uint16* create_sound(int* extra_frames);
238 int sound_buffer_ptr();
241 void key_down(int code, bool repeat);
242 void key_up(int code);
245 void open_disk(int drv, _TCHAR* file_path, int bank);
246 void close_disk(int drv);
247 bool disk_inserted(int drv);
248 #if defined(USE_DISK_WRITE_PROTECT)
249 void write_protect_fd(int drv, bool flag);
250 bool is_write_protect_fd(int drv);
252 void play_tape(_TCHAR* file_path);
253 void rec_tape(_TCHAR* file_path);
255 bool tape_inserted();
258 void push_fast_forward();
259 void push_fast_rewind();
260 void push_apss_forward();
261 void push_apss_rewind();
263 #if defined(USE_TAPE_PTR)
264 int get_tape_ptr(void);
266 bool get_tape_play(void);
268 void open_cart(int drv, _TCHAR* file_path);
269 void close_cart(int drv);
270 bool cart_inserted(int drv);
273 void update_config();
274 #ifdef _X1TURBO_FEATURE
275 void update_dipswitch();
277 void save_state(FILEIO* state_fio);
278 bool load_state(FILEIO* state_fio);
280 // ----------------------------------------
282 // ----------------------------------------
285 DEVICE* get_device(int id);
287 DEVICE* first_device;