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_SB2
37 #define SUPPORT_PC88_OPNA
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
51 #define UPD765A_NO_ST1_EN_OR_FOR_RESULT7
52 #if defined(_PC8801MA)
53 #define PC80S31K_NO_WAIT
55 #if defined(SUPPORT_PC88_OPNA) || defined(SUPPORT_PC88_SB2)
58 #define Z80_MEMORY_WAIT
59 #define OVERRIDE_SOUND_FREQ_48000HZ 55467
60 #define SUPPORT_VARIABLE_TIMING
62 // device informations for win32
63 #if defined(_PC8001SR)
64 #define USE_BOOT_MODE 3
65 #define USE_CPU_TYPE 2
67 #define USE_BOOT_MODE 4
68 #define USE_CPU_TYPE 3
70 #if defined(_PC8801MA)
72 #define BOOT_MODE_DEFAULT 2
73 #define CPU_TYPE_DEFAULT 1
76 #define USE_DEVICE_TYPE 2
80 //#define USE_TAPE_PTR
81 #define TAPE_BINARY_ONLY
82 #define NOTIFY_KEY_DOWN
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_MONITOR_TYPE 2
89 #define USE_CRT_FILTER
91 #define USE_SCREEN_ROTATE
92 #define USE_ACCESS_LAMP
93 #define USE_DISK_WRITE_PROTECT
95 #ifdef SUPPORT_PC88_OPNA
96 #ifdef SUPPORT_PC88_SB2
97 #define USE_SOUND_DEVICE_TYPE 3
99 #define USE_SOUND_DEVICE_TYPE 2
103 #if defined(SUPPORT_PC88_OPNA) && defined(SUPPORT_PC88_SB2) && defined(SUPPORT_PC88_PCG8100)
104 #define USE_SOUND_VOLUME (4 + 4 + 1 + 1)
105 #elif defined(SUPPORT_PC88_OPNA) && defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
106 #define USE_SOUND_VOLUME (4 + 4 + 0 + 1)
107 #elif defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) && defined(SUPPORT_PC88_PCG8100)
108 #define USE_SOUND_VOLUME (4 + 0 + 1 + 1)
109 #elif defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
110 #define USE_SOUND_VOLUME (4 + 0 + 0 + 1)
111 #elif !defined(SUPPORT_PC88_OPNA) && defined(SUPPORT_PC88_SB2) && defined(SUPPORT_PC88_PCG8100)
112 #define USE_SOUND_VOLUME (2 + 4 + 1 + 1)
113 #elif !defined(SUPPORT_PC88_OPNA) && defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
114 #define USE_SOUND_VOLUME (2 + 4 + 0 + 1)
115 #elif !defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) && defined(SUPPORT_PC88_PCG8100)
116 #define USE_SOUND_VOLUME (2 + 0 + 1 + 1)
117 #elif !defined(SUPPORT_PC88_OPNA) && !defined(SUPPORT_PC88_SB2) && !defined(SUPPORT_PC88_PCG8100)
118 #define USE_SOUND_VOLUME (2 + 0 + 0 + 1)
121 #define USE_PRINTER_TYPE 4
126 #define USE_CRT_MONITOR_4_3 1
128 #include "../../common.h"
129 #include "../../fileio.h"
131 #ifdef USE_SOUND_VOLUME
132 static const _TCHAR *sound_device_caption[] = {
133 #ifdef SUPPORT_PC88_OPNA
134 _T("OPNA (FM)"), _T("OPNA (PSG)"), _T("OPNA (ADPCM)"), _T("OPNA (Rhythm)"),
136 _T("OPN (FM)"), _T("OPN (PSG)"),
138 #ifdef SUPPORT_PC88_SB2
139 _T("SB2 (FM)"), _T("SB2 (PSG)"), _T("SB2 (ADPCM)"), _T("SB2 (Rhythm)"),
141 #ifdef SUPPORT_PC88_PCG8100
146 static const bool sound_device_monophonic[] = {
147 #ifdef SUPPORT_PC88_OPNA
148 true, true, true, true,
152 #ifdef SUPPORT_PC88_SB2
153 true, true, true, true,
155 #ifdef SUPPORT_PC88_PCG8100
176 #ifdef SUPPORT_PC88_PCG8100
196 #ifdef SUPPORT_PC88_SB2
204 UPD765A* pc88fdc_sub;
207 #ifdef SUPPORT_PC88_PCG8100
219 // ----------------------------------------
221 // ----------------------------------------
226 // ----------------------------------------
227 // for emulation class
228 // ----------------------------------------
230 // drive virtual machine
237 DEVICE *get_cpu(int index);
245 void initialize_sound(int rate, int samples);
246 uint16* create_sound(int* extra_frames);
247 int sound_buffer_ptr();
248 #ifdef USE_SOUND_VOLUME
249 void set_sound_device_volume(int ch, int decibel_l, int decibel_r);
253 void key_down(int code, bool repeat);
254 void key_up(int code);
257 void open_disk(int drv, const _TCHAR* file_path, int bank);
258 void close_disk(int drv);
259 bool disk_inserted(int drv);
260 void set_disk_protected(int drv, bool value);
261 bool get_disk_protected(int drv);
262 void play_tape(const _TCHAR* file_path);
263 void rec_tape(const _TCHAR* file_path);
265 bool tape_inserted();
268 void update_config();
269 void save_state(FILEIO* state_fio);
270 bool load_state(FILEIO* state_fio);
271 // ----------------------------------------
273 // ----------------------------------------
276 DEVICE* get_device(int id);
278 DEVICE* first_device;