2 NEC PC-6001 Emulator 'yaPC-6001'
3 NEC PC-6001mkII Emulator 'yaPC-6201'
4 NEC PC-6001mkIISR Emulator 'yaPC-6401'
5 NEC PC-6601 Emulator 'yaPC-6601'
6 NEC PC-6601SR Emulator 'yaPC-6801'
18 #define DEVICE_NAME "NEC PC-6001"
19 #define CONFIG_NAME "pc6001"
20 #define SUB_CPU_ROM_FILE_NAME "SUBCPU.60"
21 #define SCREEN_WIDTH 256
22 #define SCREEN_HEIGHT 192
23 #define CPU_CLOCKS 3993600
25 #elif defined(_PC6001MK2)
26 #define DEVICE_NAME "NEC PC-6001mkII"
27 #define CONFIG_NAME "pc6001mk2"
28 #define SUB_CPU_ROM_FILE_NAME "SUBCPU.62"
29 #define SCREEN_WIDTH 640
30 #define SCREEN_HEIGHT 400
31 #define WINDOW_HEIGHT_ASPECT 480
32 #define CPU_CLOCKS 4000000
34 #elif defined(_PC6001MK2SR)
35 #define DEVICE_NAME "NEC PC-6001mkIISR"
36 #define CONFIG_NAME "pc6001mk2sr"
37 #define SUB_CPU_ROM_FILE_NAME "SUBCPU.68"
38 #define SCREEN_WIDTH 640
39 #define SCREEN_HEIGHT 400
40 #define WINDOW_HEIGHT_ASPECT 480
41 #define CPU_CLOCKS 3580000
42 #elif defined(_PC6601)
43 #define DEVICE_NAME "NEC PC-6601"
44 #define CONFIG_NAME "pc6601"
45 #define SUB_CPU_ROM_FILE_NAME "SUBCPU.66"
46 #define SCREEN_WIDTH 640
47 #define SCREEN_HEIGHT 400
48 #define WINDOW_HEIGHT_ASPECT 480
49 #define CPU_CLOCKS 4000000
51 #elif defined(_PC6601SR)
52 #define DEVICE_NAME "NEC PC-6601SR"
53 #define CONFIG_NAME "pc6601sr"
54 #define SUB_CPU_1_ROM_FILE_NAME "SUBCPU1.68"
55 #define SUB_CPU_2_ROM_FILE_NAME "SUBCPU2.68"
56 #define SUB_CPU_3_ROM_FILE_NAME "SUBCPU3.68"
57 #define SCREEN_WIDTH 640
58 #define SCREEN_HEIGHT 400
59 #define WINDOW_HEIGHT_ASPECT 480
60 #define CPU_CLOCKS 3580000
63 // device informations for virtual machine
64 #define FRAMES_PER_SEC 60
65 #define LINES_PER_FRAME 262
67 #define MC6847_ATTR_OFS 0
68 #define MC6847_VRAM_OFS 0x200
69 #define MC6847_ATTR_AG 0x80
70 #define MC6847_ATTR_AS 0x40
71 #define MC6847_ATTR_INTEXT 0x20
72 #define MC6847_ATTR_GM0 0x10
73 #define MC6847_ATTR_GM1 0x08
74 #define MC6847_ATTR_GM2 0x04
75 #define MC6847_ATTR_CSS 0x02
76 #define MC6847_ATTR_INV 0x01
78 // device informations for win32
82 #if defined(_PC6601) || defined(_PC6601SR)
88 #define NOTIFY_KEY_DOWN
89 #define USE_SHIFT_NUMPAD_KEY
90 #define USE_ALT_F10_KEY
91 #define USE_AUTO_KEY 6
92 #define USE_AUTO_KEY_RELEASE 10
93 #define USE_AUTO_KEY_CAPS
95 #define USE_CRT_FILTER
99 #define USE_SOUND_VOLUME 4
101 #define USE_SOUND_VOLUME 5
108 #include "../../common.h"
109 #include "../../fileio.h"
111 #ifdef USE_SOUND_VOLUME
112 static const _TCHAR *sound_device_caption[] = {
114 #if !defined(_PC6001)
117 _T("CMT (Signal)"), _T("Noise (FDD)"), _T("Noise (CMT)"),
136 #if defined(_PC6001MK2SR) || defined(_PC6601SR)
149 #if defined(_PC6601) || defined(_PC6601SR)
171 NOISE* noise_head_down;
172 NOISE* noise_head_up;
173 #if defined(_PC6001MK2SR) || defined(_PC6601SR)
185 #if defined(_PC6601) || defined(_PC6601SR)
201 UPD765A* fdc_pc80s31k;
204 bool support_sub_cpu;
205 bool support_pc80s31k;
208 // ----------------------------------------
210 // ----------------------------------------
215 // ----------------------------------------
216 // for emulation class
217 // ----------------------------------------
219 // drive virtual machine
225 DEVICE *get_cpu(int index);
232 void initialize_sound(int rate, int samples);
233 uint16_t* create_sound(int* extra_frames);
234 int get_sound_buffer_ptr();
235 #ifdef USE_SOUND_VOLUME
236 void set_sound_device_volume(int ch, int decibel_l, int decibel_r);
240 void key_down(int code, bool repeat);
241 void key_up(int code);
244 void open_cart(int drv, const _TCHAR* file_path);
245 void close_cart(int drv);
246 bool is_cart_inserted(int drv);
247 void open_floppy_disk(int drv, const _TCHAR* file_path, int bank);
248 void close_floppy_disk(int drv);
249 bool is_floppy_disk_inserted(int drv);
250 void is_floppy_disk_protected(int drv, bool value);
251 bool is_floppy_disk_protected(int drv);
252 uint32_t is_floppy_disk_accessed();
253 void play_tape(const _TCHAR* file_path);
254 void rec_tape(const _TCHAR* file_path);
256 bool is_tape_inserted();
257 bool is_tape_playing();
258 bool is_tape_recording();
259 int get_tape_position();
260 const _TCHAR* get_tape_message();
261 bool is_frame_skippable();
263 void update_config();
264 void save_state(FILEIO* state_fio);
265 bool load_state(FILEIO* state_fio);
267 // ----------------------------------------
269 // ----------------------------------------
272 DEVICE* get_device(int id);
274 DEVICE* first_device;