2 NEC PC-8801MA Emulator 'ePC-8801MA'
3 NEC PC-8001mkIISR Emulator 'ePC-8001mkIISR'
5 Author : Takeda.Toshiya
14 #if defined(_PC8801MA)
15 #define DEVICE_NAME "NEC PC-8801MA"
16 #define CONFIG_NAME "pc8801ma"
17 #elif defined(_PC8001SR)
18 #define DEVICE_NAME "NEC PC-8001mkIISR"
19 #define CONFIG_NAME "pc8001mk2sr"
22 #if defined(_PC8001SR)
23 #define MODE_PC80_V1 0
24 #define MODE_PC80_V2 1
27 #define MODE_PC88_V1S 0
28 #define MODE_PC88_V1H 1
29 #define MODE_PC88_V2 2
33 #if defined(_PC8801MA)
34 #define SUPPORT_PC88_DICTIONARY
35 #define SUPPORT_PC88_HIGH_CLOCK
36 #define SUPPORT_PC88_OPNA
37 #define SUPPORT_PC88_SB2
38 #define PC88_EXRAM_BANKS 4
41 #define SUPPORT_PC88_JOYSTICK
42 #define SUPPORT_PC88_PCG8100
44 // device informations for virtual machine
45 #define FRAMES_PER_SEC 62.422
46 #define LINES_PER_FRAME 260
47 #define CPU_CLOCKS 3993624
48 #define SCREEN_WIDTH 640
49 #define SCREEN_HEIGHT 400
50 #define WINDOW_HEIGHT_ASPECT 480
52 #define UPD765A_NO_ST1_EN_OR_FOR_RESULT7
53 #if defined(_PC8801MA)
54 #define PC80S31K_NO_WAIT
56 #if defined(SUPPORT_PC88_OPNA) || defined(SUPPORT_PC88_SB2)
59 #define Z80_MEMORY_WAIT
60 #define OVERRIDE_SOUND_FREQ_48000HZ 55467
61 #define SUPPORT_VARIABLE_TIMING
63 // device informations for win32
64 #if defined(_PC8001SR)
65 #define USE_BOOT_MODE 3
66 #define USE_CPU_TYPE 2
68 #define USE_BOOT_MODE 4
69 #define USE_CPU_TYPE 3
71 #if defined(_PC8801MA)
73 #define BOOT_MODE_DEFAULT 2
74 #define CPU_TYPE_DEFAULT 1
77 #define USE_JOYSTICK_TYPE 2
78 #define USE_FLOPPY_DISK 2
80 #define TAPE_BINARY_ONLY
81 #define NOTIFY_KEY_DOWN
82 #define USE_KEY_LOCKED
83 #define USE_SHIFT_NUMPAD_KEY
84 #define USE_ALT_F10_KEY
85 // slow enough for N88-
\93ú
\96{
\8cêBASIC
86 #define USE_AUTO_KEY 8
87 #define USE_AUTO_KEY_RELEASE 10
88 #define USE_AUTO_KEY_NUMPAD
89 #define USE_MONITOR_TYPE 2
90 #define USE_SCREEN_FILTER
92 #ifdef SUPPORT_PC88_OPNA
93 #ifdef SUPPORT_PC88_SB2
94 #define USE_SOUND_TYPE 6
96 #define USE_SOUND_TYPE 2
99 #if defined(SUPPORT_PC88_OPNA) && defined(SUPPORT_PC88_SB2) && defined(SUPPORT_PC88_PCG8100)
100 #define USE_SOUND_VOLUME (4 + 4 + 1 + 1 + 1)
101 #elif defined(SUPPORT_PC88_OPNA) && defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
102 #define USE_SOUND_VOLUME (4 + 4 + 0 + 1 + 1)
103 #elif defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) && defined(SUPPORT_PC88_PCG8100)
104 #define USE_SOUND_VOLUME (4 + 0 + 1 + 1 + 1)
105 #elif defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
106 #define USE_SOUND_VOLUME (4 + 0 + 0 + 1 + 1)
107 #elif !defined(SUPPORT_PC88_OPNA) && defined(SUPPORT_PC88_SB2) && defined(SUPPORT_PC88_PCG8100)
108 #define USE_SOUND_VOLUME (2 + 2 + 1 + 1 + 1)
109 #elif !defined(SUPPORT_PC88_OPNA) && defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
110 #define USE_SOUND_VOLUME (2 + 2 + 0 + 1 + 1)
111 #elif !defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) && defined(SUPPORT_PC88_PCG8100)
112 #define USE_SOUND_VOLUME (2 + 0 + 1 + 1 + 1)
113 #elif !defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
114 #define USE_SOUND_VOLUME (2 + 0 + 0 + 1 + 1)
117 #define SUPPORT_TV_RENDER
121 #define USE_PRINTER_TYPE 3
126 #include "../../common.h"
127 #include "../../fileio.h"
129 #ifdef USE_SOUND_VOLUME
130 static const _TCHAR *sound_device_caption[] = {
131 #ifdef SUPPORT_PC88_OPNA
132 _T("OPNA (FM)"), _T("OPNA (PSG)"), _T("OPNA (ADPCM)"), _T("OPNA (Rhythm)"),
134 _T("OPN (FM)"), _T("OPN (PSG)"),
136 #ifdef SUPPORT_PC88_SB2
137 #ifdef SUPPORT_PC88_OPNA
138 _T("SB2 (FM)"), _T("SB2 (PSG)"), _T("SB2 (ADPCM)"), _T("SB2 (Rhythm)"),
140 _T("SB2 (FM)"), _T("SB2 (PSG)"),
143 #ifdef SUPPORT_PC88_PCG8100
146 _T("Beep"), _T("Noise (FDD)"),
150 class csp_state_utils;
166 #ifdef SUPPORT_PC88_PCG8100
175 csp_state_utils* state_entry;
186 #ifdef SUPPORT_PC88_SB2
194 UPD765A* pc88fdc_sub;
195 NOISE* pc88noise_seek;
196 NOISE* pc88noise_head_down;
197 NOISE* pc88noise_head_up;
199 #ifdef SUPPORT_PC88_PCG8100
211 // ----------------------------------------
213 // ----------------------------------------
218 // ----------------------------------------
219 // for emulation class
220 // ----------------------------------------
222 // drive virtual machine
225 double get_frame_rate();
229 DEVICE *get_cpu(int index);
236 void initialize_sound(int rate, int samples);
237 uint16_t* create_sound(int* extra_frames);
238 int get_sound_buffer_ptr();
239 #ifdef USE_SOUND_VOLUME
240 void set_sound_device_volume(int ch, int decibel_l, int decibel_r);
244 void key_down(int code, bool repeat);
245 void key_up(int code);
246 bool get_caps_locked();
247 bool get_kana_locked();
250 void open_floppy_disk(int drv, const _TCHAR* file_path, int bank);
251 void close_floppy_disk(int drv);
252 bool is_floppy_disk_inserted(int drv);
253 void is_floppy_disk_protected(int drv, bool value);
254 bool is_floppy_disk_protected(int drv);
255 uint32_t is_floppy_disk_accessed();
256 void play_tape(int drv, const _TCHAR* file_path);
257 void rec_tape(int drv, const _TCHAR* file_path);
258 void close_tape(int drv);
259 bool is_tape_inserted(int drv);
260 bool is_frame_skippable();
262 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;