2 SANYO PHC-20 Emulator 'ePHC-20'
4 Author : Takeda.Toshiya
13 #define DEVICE_NAME "SANYO PHC-20"
14 #define CONFIG_NAME "phc20"
16 // device informations for virtual machine
17 #define FRAMES_PER_SEC 60
18 #define LINES_PER_FRAME 262
19 #define CPU_CLOCKS 4000000
20 #define SCREEN_WIDTH 256
21 #define SCREEN_HEIGHT 192
23 #define MC6847_VRAM_INV 0x40
25 // device informations for win32
27 #define USE_TAPE_BUTTON
28 #define USE_ALT_F10_KEY
29 #define USE_AUTO_KEY 6
30 #define USE_AUTO_KEY_RELEASE 10
31 #define USE_AUTO_KEY_NO_CAPS
32 #define USE_SOUND_VOLUME 2
38 #include "../../common.h"
39 #include "../../fileio.h"
40 #include "../vm_template.h"
42 #ifdef USE_SOUND_VOLUME
43 static const _TCHAR *sound_device_caption[] = {
44 _T("CMT (Signal)"), _T("Noise (CMT)"),
60 class VM : public VM_TEMPLATE
64 //csp_state_utils* state_entry;
73 PHC20::MEMORY* memory;
76 // ----------------------------------------
78 // ----------------------------------------
83 // ----------------------------------------
84 // for emulation class
85 // ----------------------------------------
87 // drive virtual machine
93 DEVICE *get_cpu(int index);
100 void initialize_sound(int rate, int samples);
101 uint16_t* create_sound(int* extra_frames);
102 int get_sound_buffer_ptr();
103 #ifdef USE_SOUND_VOLUME
104 void set_sound_device_volume(int ch, int decibel_l, int decibel_r);
108 void play_tape(int drv, const _TCHAR* file_path);
109 void rec_tape(int drv, const _TCHAR* file_path);
110 void close_tape(int drv);
111 bool is_tape_inserted(int drv);
112 bool is_tape_playing(int drv);
113 bool is_tape_recording(int drv);
114 int get_tape_position(int drv);
115 const _TCHAR* get_tape_message(int drv);
116 void push_play(int drv);
117 void push_stop(int drv);
118 void push_fast_forward(int drv);
119 void push_fast_rewind(int drv);
120 void push_apss_forward(int drv) {}
121 void push_apss_rewind(int drv) {}
122 bool is_frame_skippable();
124 void update_config();
125 bool process_state(FILEIO* state_fio, bool loading);
127 // ----------------------------------------
129 // ----------------------------------------
132 DEVICE* get_device(int id);
134 //DEVICE* first_device;
135 //DEVICE* last_device;