2 Gijutsu-Hyoron-Sha Babbage-2nd Emulator 'eBabbage-2nd'
4 Author : Takeda.Toshiya
10 #ifndef _BABBAGE_2ND_H_
11 #define _BABBAGE_2ND_H_
13 #define DEVICE_NAME "GIJUTSU HYORON SHA Babbage-2nd"
14 #define CONFIG_NAME "babbage2nd"
16 // device informations for virtual machine
17 #define FRAMES_PER_SEC 30
18 #define LINES_PER_FRAME 256
19 #define CPU_CLOCKS 2500000
20 #define SCREEN_WIDTH 640
21 #define SCREEN_HEIGHT 483
22 #define MEMORY_ADDR_MAX 0x10000
23 #define MEMORY_BANK_SIZE 0x800
25 // device informations for win32
26 #define ONE_BOARD_MICRO_COMPUTER
27 #define MAX_BUTTONS 21
28 #define MAX_DRAW_RANGES 14
29 #define USE_BINARY_FILE 1
30 #define NOTIFY_KEY_DOWN
35 #include "../../common.h"
36 #include "../../fileio.h"
37 #include "../vm_template.h"
44 {353, 419, 49, 49, 0x30}, // 0
45 {407, 419, 49, 49, 0x31}, // 1
46 {461, 419, 49, 49, 0x32}, // 2
47 {515, 419, 49, 49, 0x33}, // 3
48 {353, 353, 49, 49, 0x34}, // 4
49 {407, 353, 49, 49, 0x35}, // 5
50 {461, 353, 49, 49, 0x36}, // 6
51 {515, 353, 49, 49, 0x37}, // 7
52 {353, 287, 49, 49, 0x38}, // 8
53 {407, 287, 49, 49, 0x39}, // 9
54 {461, 287, 49, 49, 0x41}, // A
55 {515, 287, 49, 49, 0x42}, // B
56 {353, 221, 49, 49, 0x43}, // C
57 {407, 221, 49, 49, 0x44}, // D
58 {461, 221, 49, 49, 0x45}, // E
59 {515, 221, 49, 49, 0x46}, // F
60 {575, 419, 49, 49, 0x70}, // INC
61 {575, 353, 49, 49, 0x71}, // DA
62 {575, 287, 49, 49, 0x72}, // AD
63 {575, 221, 49, 49, 0x73}, // GO
64 { 36, 18, 49, 49, 0x00}, // RES
96 namespace BABBAGE2ND {
101 class VM : public VM_TEMPLATE
116 BABBAGE2ND::DISPLAY* display;
117 BABBAGE2ND::KEYBOARD* keyboard;
124 // ----------------------------------------
126 // ----------------------------------------
131 // ----------------------------------------
132 // for emulation class
133 // ----------------------------------------
135 // drive virtual machine
141 DEVICE *get_cpu(int index);
148 void initialize_sound(int rate, int samples);
149 uint16_t* create_sound(int* extra_frames);
150 int get_sound_buffer_ptr();
153 void key_down(int code, bool repeat);
154 void key_up(int code);
157 void load_binary(int drv, const _TCHAR* file_path);
158 void save_binary(int drv, const _TCHAR* file_path);
159 bool is_frame_skippable();
161 void update_config();
162 bool process_state(FILEIO* state_fio, bool loading);
164 // ----------------------------------------
166 // ----------------------------------------
169 DEVICE* get_device(int id);
171 //DEVICE* first_device;
172 //DEVICE* last_device;