2 NEC PC-2001 Emulator 'ePC-2001'
5 Author : Takeda.Toshiya
14 #define DEVICE_NAME "NEC PC-2001"
15 #define CONFIG_NAME "pc2001"
17 // device informations for virtual machine
18 #define FRAMES_PER_SEC 60
19 #define LINES_PER_FRAME 24
20 #define CPU_CLOCKS (4000000 / 4)
21 #define SCREEN_WIDTH 240
22 #define SCREEN_HEIGHT 24
24 #define MEMORY_ADDR_MAX 0x10000
25 #define MEMORY_BANK_SIZE 0x1000
27 // device informations for win32
28 #define WINDOW_MODE_BASE 2
30 #define USE_TAPE_BUTTON
31 #define USE_ALT_F10_KEY
32 #define USE_AUTO_KEY 6
33 #define USE_AUTO_KEY_RELEASE 10
34 #define USE_AUTO_KEY_CAPS_LOCK (0xf2 | 0x100)
35 #define USE_AUTO_KEY_NUMPAD
36 #define DONT_KEEEP_KEY_PRESSED
37 #define USE_SOUND_VOLUME 3
40 #define USE_CPU_UPD7810
42 #include "../../common.h"
43 #include "../../fileio.h"
44 #include "../vm_template.h"
46 #ifdef USE_SOUND_VOLUME
47 static const _TCHAR *sound_device_caption[] = {
48 _T("Beep"), _T("CMT (Signal)"), _T("Noise (CMT)"),
52 //class csp_state_utils;
67 class VM : public VM_TEMPLATE
71 //csp_state_utils *state_entry;
91 // ----------------------------------------
93 // ----------------------------------------
98 // ----------------------------------------
99 // for emulation class
100 // ----------------------------------------
102 // drive virtual machine
108 DEVICE *get_cpu(int index);
115 void initialize_sound(int rate, int samples);
116 uint16_t* create_sound(int* extra_frames);
117 int get_sound_buffer_ptr();
118 #ifdef USE_SOUND_VOLUME
119 void set_sound_device_volume(int ch, int decibel_l, int decibel_r);
123 void play_tape(int drv, const _TCHAR* file_path);
124 void rec_tape(int drv, const _TCHAR* file_path);
125 void close_tape(int drv);
126 bool is_tape_inserted(int drv);
127 bool is_tape_playing(int drv);
128 bool is_tape_recording(int drv);
129 int get_tape_position(int drv);
130 const _TCHAR* get_tape_message(int drv);
131 void push_play(int drv);
132 void push_stop(int drv);
133 void push_fast_forward(int drv);
134 void push_fast_rewind(int drv);
135 void push_apss_forward(int drv) {}
136 void push_apss_rewind(int drv) {}
137 bool is_frame_skippable();
139 void update_config();
140 bool process_state(FILEIO* state_fio, bool loading);
142 // ----------------------------------------
144 // ----------------------------------------
147 DEVICE* get_device(int id);
149 //DEVICE* first_device;
150 //DEVICE* last_device;