OSDN Git Service

[VM] Set 4:3 monitor flag to using TV/4:3 CRT (at least I know).
[csp-qt/common_source_project-fm7.git] / source / src / vm / sc3000 / sc3000.h
1 /*
2         SEGA SC-3000 Emulator 'eSC-3000'
3
4         Author : Takeda.Toshiya
5         Date   : 2010.08.17-
6
7         [ virtual machine ]
8 */
9
10 #ifndef _SC3000_H_
11 #define _SC3000_H_
12
13 #define DEVICE_NAME             "SEGA SC-3000"
14 #define CONFIG_NAME             "sc3000"
15
16 // device informations for virtual machine
17 #define FRAMES_PER_SEC          60
18 #define LINES_PER_FRAME         262
19 #define CPU_CLOCKS              3579545
20 #define SCREEN_WIDTH            256
21 #define SCREEN_HEIGHT           192
22 #define TMS9918A_VRAM_SIZE      0x4000
23 #define TMS9918A_LIMIT_SPRITES
24 #define MAX_DRIVE               4
25
26 // device informations for win32
27 #define USE_CART1
28 #define USE_FD1
29 #define USE_TAPE
30 #define USE_ALT_F10_KEY
31 #define USE_AUTO_KEY            5
32 #define USE_AUTO_KEY_RELEASE    8
33 #define USE_AUTO_KEY_CAPS
34 #define USE_ACCESS_LAMP
35 #define USE_DEBUGGER
36 #define USE_STATE
37 #define USE_JOYSTICK
38 #define USE_CRT_MONITOR_4_3 1
39
40 #include "../../common.h"
41 #include "../../fileio.h"
42
43 class EMU;
44 class DEVICE;
45 class EVENT;
46
47 class DATAREC;
48 class I8251;
49 class I8255;
50 class IO;
51 class SN76489AN;
52 class TMS9918A;
53 class UPD765A;
54 class Z80;
55
56 class KEYBOARD;
57 class MEMORY;
58
59 class VM
60 {
61 protected:
62         EMU* emu;
63         
64         // devices
65         EVENT* event;
66         
67         DATAREC* drec;
68         I8251* sio;
69         I8255* pio_k;
70         I8255* pio_f;
71         IO* io;
72         SN76489AN* psg;
73         TMS9918A* vdp;
74         UPD765A* fdc;
75         Z80* cpu;
76         
77         KEYBOARD* key;
78         MEMORY* memory;
79         
80 public:
81         // ----------------------------------------
82         // initialize
83         // ----------------------------------------
84         
85         VM(EMU* parent_emu);
86         ~VM();
87         
88         // ----------------------------------------
89         // for emulation class
90         // ----------------------------------------
91         
92         // drive virtual machine
93         void reset();
94         void run();
95         
96 #ifdef USE_DEBUGGER
97         // debugger
98         DEVICE *get_cpu(int index);
99 #endif
100         
101         // draw screen
102         void draw_screen();
103         int access_lamp();
104         
105         // sound generation
106         void initialize_sound(int rate, int samples);
107         uint16* create_sound(int* extra_frames);
108         int sound_buffer_ptr();
109         
110         // user interface
111         void open_cart(int drv, const _TCHAR* file_path);
112         void close_cart(int drv);
113         bool cart_inserted(int drv);
114         void open_disk(int drv, const _TCHAR* file_path, int bank);
115         void close_disk(int drv);
116         bool disk_inserted(int drv);
117         void set_disk_protected(int drv, bool value);
118         bool get_disk_protected(int drv);
119         void play_tape(const _TCHAR* file_path);
120         void rec_tape(const _TCHAR* file_path);
121         void close_tape();
122         bool tape_inserted();
123         bool tape_playing();
124         bool tape_recording();
125         int tape_position();
126         bool now_skip();
127         
128         void update_config();
129         void save_state(FILEIO* state_fio);
130         bool load_state(FILEIO* state_fio);
131         
132         // ----------------------------------------
133         // for each device
134         // ----------------------------------------
135         
136         // devices
137         DEVICE* get_device(int id);
138         DEVICE* dummy;
139         DEVICE* first_device;
140         DEVICE* last_device;
141 };
142
143 #endif