forked from meepingsnesroms/libretro-meowPC98
-
Notifications
You must be signed in to change notification settings - Fork 11
/
pccore.h
209 lines (168 loc) · 3.65 KB
/
pccore.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/**
* @file pccore.h
* @brief Interface of the core
*/
#pragma once
#include "nevent.h"
enum {
PCBASECLOCK25 = 2457600,
PCBASECLOCK20 = 1996800
};
enum {
CPUMODE_8MHZ = 0x20,
PCMODEL_VF = 0,
PCMODEL_VM = 1,
PCMODEL_VX = 2,
PCMODELMASK = 0x3f,
PCMODEL_PC9821 = 0x40,
PCMODEL_EPSON = 0x80,
PCHDD_SASI = 0x01,
PCHDD_SCSI = 0x02,
PCHDD_IDE = 0x04,
PCROM_BIOS = 0x01,
PCROM_SOUND = 0x02,
PCROM_SASI = 0x04,
PCROM_SCSI = 0x08,
PCROM_BIOS9821 = 0x10,
PCCBUS_PC9861K = 0x0001,
PCCBUS_MPU98 = 0x0002
};
/**
* Sound ID
*/
enum tagSoundId
{
SOUNDID_NONE = 0, /*!< No boards */
SOUNDID_PC_9801_14 = 0x01, /*!< PC-9801-14 */
SOUNDID_PC_9801_26K = 0x02, /*!< PC-9801-26K */
SOUNDID_PC_9801_86 = 0x04, /*!< PC-9801-86 */
SOUNDID_PC_9801_86_26K = 0x06, /*!< PC-9801-86 + 26K */
SOUNDID_PC_9801_118 = 0x08, /*!< PC-9801-118 */
SOUNDID_PC_9801_86_ADPCM = 0x14, /*!< PC-9801-86 with ADPCM */
SOUNDID_SPEAKBOARD = 0x20, /*!< Speak board */
SOUNDID_SPARKBOARD = 0x40, /*!< Spark board */
SOUNDID_AMD98 = 0x80, /*!< AMD-98 */
SOUNDID_SOUNDORCHESTRA = 0x32, /*!< SOUND ORCHESTRA */
SOUNDID_SOUNDORCHESTRAV = 0x82, /*!< SOUND ORCHESTRA-V */
#if defined(SUPPORT_PX)
SOUNDID_PX1 = 0x30,
SOUNDID_PX2 = 0x50,
#endif /* defined(SUPPORT_PX) */
};
typedef enum tagSoundId SOUNDID;
/**
* @brief config
*/
struct tagNP2Config
{
// エミュレート中によく参照される奴
UINT8 uPD72020;
UINT8 DISPSYNC;
UINT8 RASTER;
UINT8 realpal;
UINT8 LCD_MODE;
UINT8 skipline;
UINT16 skiplight;
UINT8 KEY_MODE;
UINT8 XSHIFT;
UINT8 BTN_RAPID;
UINT8 BTN_MODE;
UINT8 dipsw[3];
UINT8 MOUSERAPID;
UINT8 calendar;
UINT8 usefd144;
UINT8 wait[6];
// リセット時とかあんまり参照されない奴
OEMCHAR model[8];
UINT baseclock;
UINT multiple;
UINT8 memsw[8];
UINT8 ITF_WORK;
UINT8 EXTMEM;
UINT8 grcg;
UINT8 color16;
UINT32 BG_COLOR;
UINT32 FG_COLOR;
UINT32 samplingrate;
UINT16 delayms;
UINT8 SOUND_SW;
UINT8 snd_x;
UINT8 snd14opt[3];
UINT8 snd26opt;
UINT8 snd86opt;
UINT8 spbopt;
UINT8 spb_vrc; // ver0.30
UINT8 spb_vrl; // ver0.30
UINT8 spb_x; // ver0.30
UINT8 BEEP_VOL;
UINT8 vol14[6];
UINT8 vol_fm;
UINT8 vol_ssg;
UINT8 vol_adpcm;
UINT8 vol_pcm;
UINT8 vol_rhythm;
UINT8 mpuenable;
UINT8 mpuopt;
UINT8 pc9861enable;
UINT8 pc9861sw[3];
UINT8 pc9861jmp[6];
UINT8 fddequip;
UINT8 MOTOR;
UINT8 MOTORVOL;
UINT8 PROTECTMEM;
UINT8 hdrvacc;
OEMCHAR sasihdd[2][MAX_PATH]; // ver0.74
#if defined(SUPPORT_SCSI)
OEMCHAR scsihdd[4][MAX_PATH]; // ver0.74
#endif
OEMCHAR fontfile[MAX_PATH];
OEMCHAR biospath[MAX_PATH];
OEMCHAR hdrvroot[MAX_PATH];
};
typedef struct tagNP2Config NP2CFG; /*!< The define of config */
typedef struct {
UINT32 baseclock;
UINT multiple;
UINT8 cpumode;
UINT8 model;
UINT8 hddif;
UINT8 extmem;
UINT8 dipsw[3]; // リセット時のDIPSW
UINT8 rom;
SOUNDID sound;
UINT32 device;
UINT32 realclock;
} PCCORE;
enum {
COREEVENT_SHUT = 0,
COREEVENT_RESET = 1,
COREEVENT_EXIT = 2
};
typedef struct
{
UINT8 screenupdate;
UINT8 screendispflag;
UINT8 drawframe;
UINT8 hardwarereset;
} PCSTAT;
#ifdef __cplusplus
extern "C" {
#endif
extern const OEMCHAR np2version[];
extern NP2CFG np2cfg;
extern PCCORE pccore;
extern PCSTAT pcstat;
extern UINT8 soundrenewal;
extern UINT drawcount;
void getbiospath(OEMCHAR *path, const OEMCHAR *fname, int maxlen);
void screendisp(NEVENTITEM item);
void screenvsync(NEVENTITEM item);
void pccore_cfgupdate(void);
void pccore_init(void);
void pccore_term(void);
void pccore_reset(void);
void pccore_exec(BOOL draw);
void pccore_postevent(UINT32 event);
#ifdef __cplusplus
}
#endif