2 TOSHIBA EX-80 Emulator 'eEX-80'
4 Author : Takeda.Toshiya
13 #define DEVICE_NAME "TOSHIBA EX-80"
14 #define CONFIG_NAME "ex80"
16 // device informations for virtual machine
17 #define FRAMES_PER_SEC 59.94
18 #define LINES_PER_FRAME 525
19 #define CPU_CLOCKS 2048000
21 #define SCREEN_WIDTH 960
22 #define SCREEN_HEIGHT 670
23 #define MEMORY_ADDR_MAX 0x10000
24 #define MEMORY_BANK_SIZE 0x400
25 #define IO_ADDR_MAX 0x100
27 // device informations for win32
28 #define ONE_BOARD_MICRO_COMPUTER
29 #define MAX_BUTTONS 25
30 //#define MAX_DRAW_RANGES 9
32 SW1 ON = STEP / OFF = AUTO
33 SW2 ON = CHAR / OFF = BIT
34 SW3-1/2 ON ,ON = 8000H-81FFH
40 #define DIPSWITCH_DEFAULT 0x0e
42 #define TAPE_BINARY_ONLY
43 #define USE_BINARY_FILE 1
44 #define USE_ALT_F10_KEY
45 #define USE_AUTO_KEY 5
46 #define USE_AUTO_KEY_RELEASE 6
47 #define USE_AUTO_KEY_NO_CAPS
48 #define USE_MONITOR_TYPE 2
49 #define USE_SOUND_VOLUME 1
54 #include "../../common.h"
55 #include "../../fileio.h"
57 #ifdef USE_SOUND_VOLUME
58 static const _TCHAR *sound_device_caption[] = {
71 // virtual key codes 0x80-0x8f and 0x98-0x9f are not used in pc keyboard
72 {763 + 36 * 0, 478 + 34 * 4, 30, 21, 0x80}, // 0
73 {763 + 36 * 1, 478 + 34 * 4, 30, 21, 0x81}, // 1
74 {763 + 36 * 2, 478 + 34 * 4, 30, 21, 0x82}, // 2
75 {763 + 36 * 3, 478 + 34 * 4, 30, 21, 0x83}, // 3
76 {763 + 36 * 0, 478 + 34 * 3, 30, 21, 0x84}, // 4
77 {763 + 36 * 1, 478 + 34 * 3, 30, 21, 0x85}, // 5
78 {763 + 36 * 2, 478 + 34 * 3, 30, 21, 0x86}, // 6
79 {763 + 36 * 3, 478 + 34 * 3, 30, 21, 0x87}, // 7
80 {763 + 36 * 0, 478 + 34 * 2, 30, 21, 0x88}, // 8
81 {763 + 36 * 1, 478 + 34 * 2, 30, 21, 0x89}, // 9
82 {763 + 36 * 2, 478 + 34 * 2, 30, 21, 0x8a}, // A
83 {763 + 36 * 3, 478 + 34 * 2, 30, 21, 0x8b}, // B
84 {763 + 36 * 0, 478 + 34 * 1, 30, 21, 0x8c}, // C
85 {763 + 36 * 1, 478 + 34 * 1, 30, 21, 0x8d}, // D
86 {763 + 36 * 2, 478 + 34 * 1, 30, 21, 0x8e}, // E
87 {763 + 36 * 3, 478 + 34 * 1, 30, 21, 0x8f}, // F
88 {763 + 36 * 0, 478 + 34 * 0, 30, 21, 0x98}, // RET
89 {763 + 36 * 1, 478 + 34 * 0, 30, 21, 0x99}, // RUN
90 {763 + 36 * 2, 478 + 34 * 0, 30, 21, 0x9a}, // SDA
91 {763 + 36 * 3, 478 + 34 * 0, 30, 21, 0x9b}, // LDA
92 {763 + 36 * 4, 478 + 34 * 0, 30, 21, 0x00}, // RST
93 {763 + 36 * 4, 478 + 34 * 1, 30, 21, 0x9c}, // ADR
94 {763 + 36 * 4, 478 + 34 * 2, 30, 21, 0x9d}, // RIC
95 {763 + 36 * 4, 478 + 34 * 3, 30, 21, 0x9e}, // RDC
96 {763 + 36 * 4, 478 + 34 * 4, 30, 21, 0x9f}, // WIC
102 {668 + 33 * 0, 295, LED_WIDTH, LED_HEIGHT}, // 7-seg LEDs
103 {668 + 33 * 1, 295, LED_WIDTH, LED_HEIGHT},
104 {668 + 33 * 2, 295, LED_WIDTH, LED_HEIGHT},
105 {668 + 33 * 3, 295, LED_WIDTH, LED_HEIGHT},
106 {828 + 33 * 0, 295, LED_WIDTH, LED_HEIGHT},
107 {828 + 33 * 1, 295, LED_WIDTH, LED_HEIGHT},
108 {828 + 33 * 2, 295, LED_WIDTH, LED_HEIGHT},
109 {828 + 33 * 3, 295, LED_WIDTH, LED_HEIGHT},
110 {8, 8, 8 * 6 * 12, 8 * 2 * 29}, // CRT
148 // ----------------------------------------
150 // ----------------------------------------
155 // ----------------------------------------
156 // for emulation class
157 // ----------------------------------------
159 // drive virtual machine
165 DEVICE *get_cpu(int index);
170 int max_draw_ranges();
173 void initialize_sound(int rate, int samples);
174 uint16_t* create_sound(int* extra_frames);
175 int get_sound_buffer_ptr();
176 #ifdef USE_SOUND_VOLUME
177 void set_sound_device_volume(int ch, int decibel_l, int decibel_r);
181 void load_binary(int drv, const _TCHAR* file_path);
182 void save_binary(int drv, const _TCHAR* file_path);
183 void play_tape(int drv, const _TCHAR* file_path);
184 void rec_tape(int drv, const _TCHAR* file_path);
185 void close_tape(int drv);
186 bool is_tape_inserted(int drv);
187 bool is_frame_skippable();
189 void update_config();
190 void save_state(FILEIO* state_fio);
191 bool load_state(FILEIO* state_fio);
193 // ----------------------------------------
195 // ----------------------------------------
198 DEVICE* get_device(int id);
200 DEVICE* first_device;