2 ASCII MSX1 Emulator 'yaMSX1'
3 ASCII MSX2 Emulator 'yaMSX2'
4 Pioneer PX-7 Emulator 'ePX-7'
9 modified by Takeda.Toshiya
19 #define DEVICE_NAME "PIONEER PX-7"
20 #define CONFIG_NAME "px7"
22 #define DEVICE_NAME "ASCII MSX1"
23 #define CONFIG_NAME "msx1"
25 #define DEVICE_NAME "ASCII MSX2"
26 #define CONFIG_NAME "msx2"
29 // device informations for virtual machine
30 #define FRAMES_PER_SEC 60
31 #define LINES_PER_FRAME 262
32 #define CPU_CLOCKS 3579545
34 #define SCREEN_WIDTH ((256 + 15)*2) // V99X8_WIDTH
35 #define SCREEN_HEIGHT ((212 + 15)*2) // V99X8_HEIGHT
37 #define SCREEN_WIDTH 512
38 #define SCREEN_HEIGHT 384
40 #define TMS9918A_VRAM_SIZE 0x4000
41 #define TMS9918A_LIMIT_SPRITES
43 #define TMS9918A_SUPER_IMPOSE
46 #define SUPPORT_MEDIA_TYPE_1DD
47 #define Z80_PSEUDO_BIOS
50 // for Flappy Limited '85
51 #define AY_3_891X_PORT_MODE 0x80
53 // device informations for win32
57 #define USE_LASER_DISC 1
58 #define USE_MOVIE_PLAYER
60 #define USE_FLOPPY_DISK 2
62 #define USE_AUTO_KEY 6
63 #define USE_AUTO_KEY_RELEASE 10
65 #define USE_SOUND_VOLUME 5
67 //#define USE_SOUND_VOLUME 5
68 #define USE_SOUND_VOLUME 4
70 #define SUPPORT_TV_RENDER
76 #include "../../common.h"
77 #include "../../fileio.h"
78 #include "../vm_template.h"
80 #ifdef USE_SOUND_VOLUME
81 static const _TCHAR *sound_device_caption[] = {
82 _T("PSG"), _T("Beep"), _T("CMT (Signal)"),
124 class VM : public VM_TEMPLATE
150 MSX::JOYSTICK* joystick;
151 MSX::KEYBOARD* keyboard;
162 // ----------------------------------------
164 // ----------------------------------------
166 VM(EMU_TEMPLATE* parent_emu);
169 // ----------------------------------------
170 // for emulation class
171 // ----------------------------------------
173 // drive virtual machine
174 void reset() override;
176 double get_frame_rate() override
178 return FRAMES_PER_SEC;
183 DEVICE *get_cpu(int index) override;
187 void draw_screen() override;
190 void initialize_sound(int rate, int samples) override;
191 uint16_t* create_sound(int* extra_frames) override;
192 int get_sound_buffer_ptr() override;
194 void movie_sound_callback(uint8_t *buffer, long size) override;
196 #ifdef USE_SOUND_VOLUME
197 void set_sound_device_volume(int ch, int decibel_l, int decibel_r) override;
201 void open_cart(int drv, const _TCHAR* file_path) override;
202 void close_cart(int drv) override;
203 bool is_cart_inserted(int drv) override;
204 void play_tape(int drv, const _TCHAR* file_path) override;
205 void rec_tape(int drv, const _TCHAR* file_path) override;
206 void close_tape(int drv) override;
207 bool is_tape_inserted(int drv) override;
208 bool is_tape_playing(int drv) override;
209 bool is_tape_recording(int drv) override;
210 int get_tape_position(int drv) override;
211 const _TCHAR* get_tape_message(int drv) override;
212 void push_play(int drv) override;
213 void push_stop(int drv) override;
214 void push_fast_forward(int drv) override;
215 void push_fast_rewind(int drv) override;
216 void push_apss_forward(int drv) override {}
217 void push_apss_rewind(int drv) override {}
219 void open_laser_disc(int drv, const _TCHAR* file_path) override;
220 void close_laser_disc(int drv) override;
221 bool is_laser_disc_inserted(int drv) override;
222 uint32_t is_laser_disc_accessed() override;
224 void open_floppy_disk(int drv, const _TCHAR* file_path, int bank) override;
225 void close_floppy_disk(int drv) override;
226 bool is_floppy_disk_inserted(int drv) override;
227 void is_floppy_disk_protected(int drv, bool value) override;
228 bool is_floppy_disk_protected(int drv) override;
229 uint32_t is_floppy_disk_accessed() override;
231 bool is_frame_skippable() override;
233 double get_current_usec() override;
234 uint64_t get_current_clock_uint64() override;
236 void update_config() override;
237 bool process_state(FILEIO* state_fio, bool loading);
239 // ----------------------------------------
241 // ----------------------------------------
244 DEVICE* get_device(int id) override;
246 //DEVICE* first_device;
247 //DEVICE* last_device;