OSDN Git Service

[INITIAL] Import 20141226 version of http://homepage3.nifty.com/takeda-toshiya/common...
[csp-qt/common_source_project-fm7.git] / source / src / vm / pv1000 / pv1000.h
1 /*\r
2         CASIO PV-1000 Emulator 'ePV-1000'\r
3 \r
4         Author : Takeda.Toshiya\r
5         Date   : 2006.11.16 -\r
6 \r
7         [ virtual machine ]\r
8 */\r
9 \r
10 #ifndef _PV1000_H_\r
11 #define _PV1000_H_\r
12 \r
13 #define DEVICE_NAME             "CASIO PV-1000"\r
14 #define CONFIG_NAME             "pv1000"\r
15 \r
16 // device informations for virtual machine\r
17 #define FRAMES_PER_SEC          60\r
18 #define LINES_PER_FRAME         67\r
19 #define CPU_CLOCKS              3579545\r
20 #define SCREEN_WIDTH            256\r
21 #define SCREEN_HEIGHT           192\r
22 #define LINES_PER_HBLANK        51\r
23 #define CLOCKS_PER_HBLANK       800\r
24 #define MEMORY_ADDR_MAX         0x10000\r
25 #define MEMORY_BANK_SIZE        0x800\r
26 \r
27 // device informations for win32\r
28 #define USE_CART1\r
29 #define USE_KEY_TO_JOY\r
30 #define KEY_TO_JOY_BUTTON_1     0x5a\r
31 #define KEY_TO_JOY_BUTTON_2     0x58\r
32 #define KEY_TO_JOY_BUTTON_3     0x41\r
33 #define KEY_TO_JOY_BUTTON_4     0x53\r
34 #define USE_DEBUGGER\r
35 \r
36 #include "../../common.h"\r
37 \r
38 class EMU;\r
39 class DEVICE;\r
40 class EVENT;\r
41 \r
42 class IO;\r
43 class MEMORY;\r
44 class Z80;\r
45 \r
46 class JOYSTICK;\r
47 class PSG;\r
48 class VDP;\r
49 \r
50 class VM\r
51 {\r
52 protected:\r
53         EMU* emu;\r
54         \r
55         // devices\r
56         EVENT* event;\r
57         \r
58         IO* io;\r
59         MEMORY* memory;\r
60         Z80* cpu;\r
61         \r
62         JOYSTICK* joystick;\r
63         PSG* psg;\r
64         VDP* vdp;\r
65         \r
66         // memory\r
67         uint8 mem[0x10000];\r
68         bool inserted;\r
69         \r
70 public:\r
71         // ----------------------------------------\r
72         // initialize\r
73         // ----------------------------------------\r
74         \r
75         VM(EMU* parent_emu);\r
76         ~VM();\r
77         \r
78         // ----------------------------------------\r
79         // for emulation class\r
80         // ----------------------------------------\r
81         \r
82         // drive virtual machine\r
83         void reset();\r
84         void run();\r
85         \r
86 #ifdef USE_DEBUGGER\r
87         // debugger\r
88         DEVICE *get_cpu(int index);\r
89 #endif\r
90         \r
91         // draw screen\r
92         void draw_screen();\r
93         \r
94         // sound generation\r
95         void initialize_sound(int rate, int samples);\r
96         uint16* create_sound(int* extra_frames);\r
97         int sound_buffer_ptr();\r
98         \r
99         // user interface\r
100         void open_cart(int drv, _TCHAR* file_path);\r
101         void close_cart(int drv);\r
102         bool cart_inserted(int drv);\r
103         bool now_skip();\r
104         \r
105         void update_config();\r
106         \r
107         // ----------------------------------------\r
108         // for each device\r
109         // ----------------------------------------\r
110         \r
111         // devices\r
112         DEVICE* get_device(int id);\r
113         DEVICE* dummy;\r
114         DEVICE* first_device;\r
115         DEVICE* last_device;\r
116 };\r
117 \r
118 #endif\r