2 National JR-100 Emulator 'eJR-100'
4 Author : Takeda.Toshiya
13 #define DEVICE_NAME "National JR-100"
14 #define CONFIG_NAME "jr100"
16 // device informations for virtual machine
17 #define FRAMES_PER_SEC 60
18 #define LINES_PER_FRAME 262
19 #define CPU_CLOCKS 894886
20 #define SCREEN_WIDTH 256
21 #define SCREEN_HEIGHT 192
24 // device informations for win32
26 #define USE_TAPE_BUTTON
27 #define USE_ALT_F10_KEY
28 #define USE_AUTO_KEY 8
29 #define USE_AUTO_KEY_RELEASE 10
30 #define USE_VM_AUTO_KEY_TABLE
31 //#define USE_SCREEN_FILTER
32 //#define USE_SCANLINE
33 #define USE_SOUND_VOLUME 3
37 #define USE_CPU_MB8861
39 static const int vm_auto_key_table_base[][2] = {
41 {0x2f, 0x100 | 0x4c}, // '/' => 'L' + SHIFT
42 {0x3f, 0x100 | 0x4b}, // '?' => 'K' + SHIFT
43 {0x40, 0x100 | 0x55}, // '@' => 'U' + SHIFT
44 {0x41, 0x000 | 0x41}, // 'A'
45 {0x42, 0x000 | 0x42}, // 'B'
46 {0x43, 0x000 | 0x43}, // 'C'
47 {0x44, 0x000 | 0x44}, // 'D'
48 {0x45, 0x000 | 0x45}, // 'E'
49 {0x46, 0x000 | 0x46}, // 'F'
50 {0x47, 0x000 | 0x47}, // 'G'
51 {0x48, 0x000 | 0x48}, // 'H'
52 {0x49, 0x000 | 0x49}, // 'I'
53 {0x4a, 0x000 | 0x4a}, // 'J'
54 {0x4b, 0x000 | 0x4b}, // 'K'
55 {0x4c, 0x000 | 0x4c}, // 'L'
56 {0x4d, 0x000 | 0x4d}, // 'M'
57 {0x4e, 0x000 | 0x4e}, // 'N'
58 {0x4f, 0x000 | 0x4f}, // 'O'
59 {0x50, 0x000 | 0x50}, // 'P'
60 {0x51, 0x000 | 0x51}, // 'Q'
61 {0x52, 0x000 | 0x52}, // 'R'
62 {0x53, 0x000 | 0x53}, // 'S'
63 {0x54, 0x000 | 0x54}, // 'T'
64 {0x55, 0x000 | 0x55}, // 'U'
65 {0x56, 0x000 | 0x56}, // 'V'
66 {0x57, 0x000 | 0x57}, // 'W'
67 {0x58, 0x000 | 0x58}, // 'X'
68 {0x59, 0x000 | 0x59}, // 'Y'
69 {0x5a, 0x000 | 0x5a}, // 'Z'
70 {0x5b, 0x100 | 0x4f}, // '[' => 'O' + SHIFT
71 {0x5c, 0x100 | 0x49}, // '\' => 'I' + SHIFT
72 {0x5d, 0x100 | 0x50}, // ']' => 'P' + SHIFT
73 {0x5e, 0x100 | 0x30}, // '^' => '0' + SHIFT
74 {0x5f, 0x100 | 0x4d}, // '_' => 'M' + SHIFT
75 {0x61, 0x000 | 0x41}, // 'a'
76 {0x62, 0x000 | 0x42}, // 'b'
77 {0x63, 0x000 | 0x43}, // 'c'
78 {0x64, 0x000 | 0x44}, // 'd'
79 {0x65, 0x000 | 0x45}, // 'e'
80 {0x66, 0x000 | 0x46}, // 'f'
81 {0x67, 0x000 | 0x47}, // 'g'
82 {0x68, 0x000 | 0x48}, // 'h'
83 {0x69, 0x000 | 0x49}, // 'i'
84 {0x6a, 0x000 | 0x4a}, // 'j'
85 {0x6b, 0x000 | 0x4b}, // 'k'
86 {0x6c, 0x000 | 0x4c}, // 'l'
87 {0x6d, 0x000 | 0x4d}, // 'm'
88 {0x6e, 0x000 | 0x4e}, // 'n'
89 {0x6f, 0x000 | 0x4f}, // 'o'
90 {0x70, 0x000 | 0x50}, // 'p'
91 {0x71, 0x000 | 0x51}, // 'q'
92 {0x72, 0x000 | 0x52}, // 'r'
93 {0x73, 0x000 | 0x53}, // 's'
94 {0x74, 0x000 | 0x54}, // 't'
95 {0x75, 0x000 | 0x55}, // 'u'
96 {0x76, 0x000 | 0x56}, // 'v'
97 {0x77, 0x000 | 0x57}, // 'w'
98 {0x78, 0x000 | 0x58}, // 'x'
99 {0x79, 0x000 | 0x59}, // 'y'
100 {0x7a, 0x000 | 0x5a}, // 'z'
104 #include "../../common.h"
105 #include "../../fileio.h"
106 #include "../vm_template.h"
108 #ifdef USE_SOUND_VOLUME
109 static const _TCHAR *sound_device_caption[] = {
110 _T("Beep"), _T("CMT (Signal)"), _T("Noise (CMT)"),
127 class VM : public VM_TEMPLATE
143 JR100_MEMORY* memory;
146 // ----------------------------------------
148 // ----------------------------------------
153 // ----------------------------------------
154 // for emulation class
155 // ----------------------------------------
157 // drive virtual machine
159 void special_reset();
161 double get_frame_rate();
165 DEVICE *get_cpu(int index);
172 void initialize_sound(int rate, int samples);
173 uint16_t* create_sound(int* extra_frames);
174 int get_sound_buffer_ptr();
175 #ifdef USE_SOUND_VOLUME
176 void set_sound_device_volume(int ch, int decibel_l, int decibel_r);
180 void key_down(int code, bool repeat) { }
181 void key_up(int code) { }
184 void play_tape(int drv, const _TCHAR* file_path);
185 void rec_tape(int drv, const _TCHAR* file_path);
186 void close_tape(int drv);
187 bool is_tape_inserted(int drv);
188 bool is_tape_playing(int drv);
189 bool is_tape_recording(int drv);
190 int get_tape_position(int drv);
191 const _TCHAR* get_tape_message(int drv);
192 void push_play(int drv);
193 void push_stop(int drv);
194 void push_fast_forward(int drv);
195 void push_fast_rewind(int drv);
196 void push_apss_forward(int drv) {}
197 void push_apss_rewind(int drv) {}
198 bool is_frame_skippable();
200 void update_config();
201 bool process_state(FILEIO* state_fio, bool loading);
203 // ----------------------------------------
205 // ----------------------------------------
208 DEVICE* get_device(int id);
210 //DEVICE* first_device;
211 //DEVICE* last_device;