--- np2/pccore.h 2003/11/12 15:35:16 1.5 +++ np2/pccore.h 2004/01/13 05:30:58 1.13 @@ -1,30 +1,69 @@ #include "nevent.h" +enum { + PCBASECLOCK25 = 2457600, + PCBASECLOCK20 = 1996800 +}; + +enum { + PCMODEL_VM = 0, + PCMODEL_VX = 1, + PCMODELMASK = 0x3f, + PCMODEL_PC9821 = 0x40, + PCMODEL_EPSON = 0x80, + + PCHDD_SASI = 0x01, + PCHDD_SCSI = 0x02, + PCHDD_IDE = 0x04, + + PCSOUND_NONE = 0x00 +}; + +#define CPUMODE_8MHz 0x20 + typedef struct { - UINT baseclock; - UINT multiple; + // エミュレート中によく参照される奴 BYTE uPD72020; + BYTE DISPSYNC; + BYTE RASTER; + BYTE realpal; + BYTE LCD_MODE; + BYTE skipline; + UINT16 skiplight; + + BYTE KEY_MODE; + BYTE XSHIFT; + BYTE BTN_RAPID; + BYTE BTN_MODE; BYTE dipsw[3]; - BYTE memsw[8]; - BYTE vol14[6]; + BYTE MOUSERAPID; + + BYTE calendar; + BYTE usefd144; BYTE wait[6]; - BYTE KEY_MODE; - BYTE SOUND_SW; - BYTE realpal; // ver0.28 - UINT16 samplingrate; - UINT16 delayms; - BYTE MIDIRESET; - BYTE DISPSYNC; + + // リセット時とかあんまり参照されない奴 + char model[8]; + UINT baseclock; + UINT multiple; + + BYTE memsw[8]; + + BYTE ITF_WORK; BYTE EXTMEM; - BYTE PROTECTMEM; // qn + BYTE grcg; + BYTE color16; + UINT32 BG_COLOR; + UINT32 FG_COLOR; - BYTE BTN_RAPID; - BYTE BTN_MODE; + UINT16 samplingrate; + UINT16 delayms; + BYTE SOUND_SW; + BYTE snd_x; - BYTE snd_x; // ver0.30 BYTE snd14opt[3]; BYTE snd26opt; BYTE snd86opt; @@ -32,64 +71,54 @@ typedef struct { BYTE spb_vrc; // ver0.30 BYTE spb_vrl; // ver0.30 BYTE spb_x; // ver0.30 - BYTE mpuopt; - BYTE MOTOR; - BYTE MOTORVOL; BYTE BEEP_VOL; - BYTE ITF_WORK; - BYTE EMM_WORK; - BYTE LCD_MODE; - UINT32 BG_COLOR; - UINT32 FG_COLOR; - - BYTE MOUSERAPID; - BYTE XSHIFT; - BYTE skipline; - UINT16 skiplight; - BYTE RASTER; - - BYTE vol_fm; // ver0.27 + BYTE vol14[6]; + BYTE vol_fm; BYTE vol_ssg; BYTE vol_adpcm; BYTE vol_pcm; BYTE vol_rhythm; - BYTE pc9861enable; // ver0.29 + BYTE mpuenable; + BYTE mpuopt; + + BYTE pc9861enable; BYTE pc9861sw[3]; BYTE pc9861jmp[6]; - BYTE grcg; - BYTE color16; - BYTE calendar; - BYTE usefd144; + BYTE MOTOR; + BYTE MOTORVOL; + BYTE PROTECTMEM; + BYTE hdrvacc; char hddfile[2][MAX_PATH]; // ver0.30 char fontfile[MAX_PATH]; + char biospath[MAX_PATH]; + char hdrvroot[MAX_PATH]; } NP2CFG; typedef struct { UINT32 baseclock; UINT multiple; + + UINT8 cpumode; + UINT8 model; + UINT8 hddmode; + UINT8 padding; + + UINT32 device; + UINT32 sound; + UINT32 realclock; UINT32 dispclock; UINT32 vsyncclock; - UINT32 mouseclock; UINT32 keyboardclock; UINT32 midiclock; - UINT32 frame1000; UINT32 raster; UINT32 hsync; - BYTE cpumode; } PCCORE; -enum { - PCBASECLOCK25 = 2457600, - PCBASECLOCK20 = 1996800 -}; - -#define CPUMODE_8MHz 0x20 - #ifdef __cplusplus extern "C" { @@ -98,13 +127,13 @@ extern "C" { extern const char np2version[]; extern NP2CFG np2cfg; -extern PCCORE pc; +extern PCCORE pccore; extern BYTE screenupdate; extern int soundrenewal; extern BOOL drawframe; extern UINT drawcount; - +void getbiospath(char *path, const char *fname, int maxlen); void screendisp(NEVENTITEM item); void screenvsync(NEVENTITEM item);