OSDN Git Service

[VM][J3100] Fix some FTBFS. I can't check works well.
[csp-qt/common_source_project-fm7.git] / source / src / vm / j3100 / j3100.h
1 /*
2         TOSHIBA J-3100GT Emulator 'eJ-3100GT'
3         TOSHIBA J-3100SL Emulator 'eJ-3100SL'
4
5         Author : Takeda.Toshiya
6         Date   : 2011.08.16-
7
8         [ virtual machine ]
9 */
10
11 #ifndef _J3100_H_
12 #define _J3100_H_
13
14 #if defined(_J3100GT)
15 #define DEVICE_NAME             "TOSHIBA J-3100GT"
16 #define CONFIG_NAME             "j3100gt"
17 #elif defined(_J3100SL)
18 #define DEVICE_NAME             "TOSHIBA J-3100SL"
19 #define CONFIG_NAME             "j3100sl"
20 #endif
21
22 // device informations for virtual machine
23
24 #if defined(_J3100SL) || defined(_J3100SS) || defined(_J3100SE)
25 #define TYPE_SL
26 #endif
27
28 // TODO: check refresh rate
29 #define FRAMES_PER_SEC          59.9
30 // \97v\92²\8d¸
31 #define LINES_PER_FRAME         440
32 #define CHARS_PER_LINE          54
33 #define CPU_CLOCKS              9545456
34 #define SCREEN_WIDTH            640
35 #define SCREEN_HEIGHT           400
36 #define MAX_DRIVE               2
37 #define UPD765A_SENCE_INTSTAT_RESULT
38 #define UPD765A_EXT_DRVSEL
39 #ifdef TYPE_SL
40 #define HAS_I86
41 #define I8259_MAX_CHIPS         1
42 #else
43 #define HAS_I286
44 #define I8259_MAX_CHIPS         2
45 #endif
46 #if !(defined(_J3100SS) || defined(_J3100SE))
47 #define HAS_I8254
48 #endif
49 #define SINGLE_MODE_DMA
50 #define IO_ADDR_MAX             0x10000
51
52 // device informations for win32
53 #define USE_FD1
54 #define USE_FD2
55 #define NOTIFY_KEY_DOWN
56 #define USE_ALT_F10_KEY
57 #define USE_AUTO_KEY            5
58 #define USE_AUTO_KEY_RELEASE    6
59 #define USE_ACCESS_LAMP
60
61 #include "../../common.h"
62 #include "../../fileio.h"
63
64 class EMU;
65 class DEVICE;
66 class EVENT;
67
68 class HD46505;
69 class I8237;
70 //class I8250;
71 class I8253;
72 class I8259;
73 class I86;
74 class IO;
75 class PCM1BIT;
76 class UPD765A;
77 #ifdef TYPE_SL
78 class RP5C01;
79 #else
80 class HD146818P;
81 #endif
82
83 class DISPLAY;
84 class DMAREG;
85 class FLOPPY;
86 class KEYBOARD;
87 class MEMORY;
88 class SASI;
89 class SYSTEM;
90
91 class VM
92 {
93 protected:
94         EMU* emu;
95         
96         // devices
97         EVENT* event;
98         
99         HD46505* crtc;
100         I8237* dma;
101 //      I8250* sio;
102         I8253* pit;
103         I8259* pic;
104         I86* cpu;
105         IO* io;
106         PCM1BIT* pcm;
107         UPD765A* fdc;
108 #ifdef TYPE_SL
109         RP5C01* rtc;
110 #else
111         HD146818P* rtc;
112         I8237* dma2;
113 #endif
114         
115         DISPLAY* display;
116         DMAREG* dmareg;
117         FLOPPY* floppy;
118         KEYBOARD* keyboard;
119         MEMORY* memory;
120         SASI* sasi;
121         SYSTEM* system;
122         
123 public:
124         // ----------------------------------------
125         // initialize
126         // ----------------------------------------
127         
128         VM(EMU* parent_emu);
129         ~VM();
130         
131         // ----------------------------------------
132         // for emulation class
133         // ----------------------------------------
134         
135         // drive virtual machine
136         void reset();
137         void notify_power_off();
138         void run();
139         
140         // draw screen
141         void draw_screen();
142         int access_lamp();
143         
144         // sound generation
145         void initialize_sound(int rate, int samples);
146         uint16* create_sound(int* extra_frames);
147         int sound_buffer_ptr();
148         
149         // notify key
150         void key_down(int code, bool repeat);
151         void key_up(int code);
152         
153         // user interface
154         void open_disk(int drv, _TCHAR* file_path, int bank);
155         void close_disk(int drv);
156         bool disk_inserted(int drv);
157         bool now_skip();
158         
159         void update_config();
160         void register_frame_event(DEVICE* dev);
161         
162         // ----------------------------------------
163         // for each device
164         // ----------------------------------------
165         
166         // devices
167         DEVICE* get_device(int id);
168         DEVICE* dummy;
169         DEVICE* first_device;
170         DEVICE* last_device;
171 };
172
173 #endif