--- np2/pccore.h 2004/01/29 10:54:05 1.16 +++ np2/pccore.h 2004/06/20 00:56:26 1.27 @@ -8,8 +8,11 @@ enum { }; enum { - PCMODEL_VM = 0, - PCMODEL_VX = 1, + CPUMODE_8MHZ = 0x20, + + PCMODEL_VF = 0, + PCMODEL_VM = 1, + PCMODEL_VX = 2, PCMODELMASK = 0x3f, PCMODEL_PC9821 = 0x40, PCMODEL_EPSON = 0x80, @@ -18,13 +21,18 @@ enum { PCHDD_SCSI = 0x02, PCHDD_IDE = 0x04, + PCROM_BIOS = 0x01, + PCROM_SOUND = 0x02, + PCROM_SASI = 0x04, + PCROM_SCSI = 0x08, + PCROM_BIOS9821 = 0x10, + PCSOUND_NONE = 0x00, PCCBUS_PC9861K = 0x0001, PCCBUS_MPU98 = 0x0002 }; -#define CPUMODE_8MHz 0x20 typedef struct { // エミュレート中によく参照される奴 @@ -41,20 +49,19 @@ typedef struct { UINT8 BTN_RAPID; UINT8 BTN_MODE; - BYTE dipsw[3]; + UINT8 dipsw[3]; UINT8 MOUSERAPID; UINT8 calendar; UINT8 usefd144; - BYTE wait[6]; - + UINT8 wait[6]; // リセット時とかあんまり参照されない奴 - char model[8]; + OEMCHAR model[8]; UINT baseclock; UINT multiple; - BYTE memsw[8]; + UINT8 memsw[8]; UINT8 ITF_WORK; UINT8 EXTMEM; @@ -68,7 +75,7 @@ typedef struct { UINT8 SOUND_SW; UINT8 snd_x; - BYTE snd14opt[3]; + UINT8 snd14opt[3]; UINT8 snd26opt; UINT8 snd86opt; UINT8 spbopt; @@ -77,7 +84,7 @@ typedef struct { UINT8 spb_x; // ver0.30 UINT8 BEEP_VOL; - BYTE vol14[6]; + UINT8 vol14[6]; UINT8 vol_fm; UINT8 vol_ssg; UINT8 vol_adpcm; @@ -88,8 +95,8 @@ typedef struct { UINT8 mpuopt; UINT8 pc9861enable; - BYTE pc9861sw[3]; - BYTE pc9861jmp[6]; + UINT8 pc9861sw[3]; + UINT8 pc9861jmp[6]; UINT8 fddequip; UINT8 MOTOR; @@ -97,11 +104,13 @@ typedef struct { UINT8 PROTECTMEM; UINT8 hdrvacc; - char sasihdd[2][MAX_PATH]; // ver0.74 - char scsihdd[4][MAX_PATH]; // ver0.74 - char fontfile[MAX_PATH]; - char biospath[MAX_PATH]; - char hdrvroot[MAX_PATH]; + 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]; } NP2CFG; typedef struct { @@ -110,40 +119,39 @@ typedef struct { UINT8 cpumode; UINT8 model; - UINT8 fddif; UINT8 hddif; - UINT8 extmem; - UINT8 padding[3]; + UINT8 dipsw[3]; // リセット時のDIPSW + UINT8 rom; UINT32 sound; UINT32 device; UINT32 realclock; - UINT32 dispclock; - UINT32 vsyncclock; - UINT32 keyboardclock; - UINT32 midiclock; - UINT32 raster; - UINT32 hsync; } PCCORE; +enum { + COREEVENT_SHUT = 0, + COREEVENT_RESET = 1, + COREEVENT_EXIT = 2 +}; + #ifdef __cplusplus extern "C" { #endif -extern const char np2version[]; +extern const OEMCHAR np2version[]; extern NP2CFG np2cfg; extern PCCORE pccore; -extern BYTE screenupdate; +extern UINT8 screenupdate; extern int soundrenewal; extern BOOL drawframe; extern UINT drawcount; extern BOOL hardwarereset; -void getbiospath(char *path, const char *fname, int maxlen); +void getbiospath(OEMCHAR *path, const OEMCHAR *fname, int maxlen); void screendisp(NEVENTITEM item); void screenvsync(NEVENTITEM item); @@ -155,6 +163,8 @@ void pccore_term(void); void pccore_reset(void); void pccore_exec(BOOL draw); +void pccore_postevent(UINT32 event); + #ifdef __cplusplus } #endif