OSDN Git Service

[General] Merge upstream 2015-01-31 , pc8801ma is still not working correct.
[csp-qt/common_source_project-fm7.git] / source / src / vm / hc80 / hc80.h
1 /*
2         EPSON HC-80 Emulator 'eHC-80'
3
4         Author : Takeda.Toshiya
5         Date   : 2008.03.14 -
6
7         [ virtual machine ]
8 */
9
10 #ifndef _HC80_H_
11 #define _HC80_H_
12
13 #define DEVICE_NAME             "EPSON HC-80"
14 #define CONFIG_NAME             "hc80"
15
16 // device informations for virtual machine
17 #define FRAMES_PER_SEC          64
18 #define LINES_PER_FRAME         64
19 #define CPU_CLOCKS              2457600
20 #define SCREEN_WIDTH            480
21 #define SCREEN_HEIGHT           64
22 #define MAX_DRIVE               4
23
24 // device informations for win32
25 #define USE_SPECIAL_RESET
26 #define USE_DEVICE_TYPE         3
27 #define USE_FD1
28 #define USE_FD2
29 #define USE_FD3
30 #define USE_FD4
31 #define NOTIFY_KEY_DOWN
32 #define USE_ALT_F10_KEY
33 #define USE_AUTO_KEY            6
34 #define USE_AUTO_KEY_RELEASE    10
35 #define USE_ACCESS_LAMP
36 #define USE_DEBUGGER
37
38 #include "../../common.h"
39
40 class EMU;
41 class DEVICE;
42 class EVENT;
43
44 class BEEP;
45 class I8251;
46 class PTF20;
47 class Z80;
48
49 class IO;
50 class MEMORY;
51
52 class VM
53 {
54 protected:
55         EMU* emu;
56         
57         // devices
58         EVENT* event;
59         
60         BEEP* beep;
61         I8251* sio;
62         PTF20* tf20;
63         Z80* cpu;
64         
65         IO* io;
66         MEMORY* memory;
67         
68 public:
69         // ----------------------------------------
70         // initialize
71         // ----------------------------------------
72         
73         VM(EMU* parent_emu);
74         ~VM();
75         
76         // ----------------------------------------
77         // for emulation class
78         // ----------------------------------------
79         
80         // drive virtual machine
81         void reset();
82         void special_reset();
83         void run();
84         
85 #ifdef USE_DEBUGGER
86         // debugger
87         DEVICE *get_cpu(int index);
88 #endif
89         
90         // draw screen
91         void draw_screen();
92         int access_lamp();
93         
94         // sound generation
95         void initialize_sound(int rate, int samples);
96         uint16* create_sound(int* extra_frames);
97         int sound_buffer_ptr();
98         
99         // notify key
100         void key_down(int code, bool repeat);
101         void key_up(int code);
102         
103         // user interface
104         void open_disk(int drv, _TCHAR* file_path, int bank);
105         void close_disk(int drv);
106         bool disk_inserted(int drv);
107         bool now_skip();
108         
109         void update_config();
110         
111         // ----------------------------------------
112         // for each device
113         // ----------------------------------------
114         
115         // devices
116         DEVICE* get_device(int id);
117         DEVICE* dummy;
118         DEVICE* first_device;
119         DEVICE* last_device;
120 };
121
122 #endif