|
|
| version 1.20, 2004/08/11 12:08:16 | version 1.24, 2004/08/12 14:03:14 |
|---|---|
| Line 24 | Line 24 |
| const OEMCHAR xmilversion[] = OEMTEXT(XMILVER_CORE); | const OEMCHAR xmilversion[] = OEMTEXT(XMILVER_CORE); |
| XMILCFG xmilcfg = { 2, 0, 1, | XMILCFG xmilcfg = { 2, 1, 0x03, |
| 1, 0, 0, 0, | 1, 0, 0, 0, |
| 22050, 500, 0, 0, 80, | 22050, 500, 0, 0, 80, |
| 0, 0, 0, 0}; | 0, 0, 0, 0}; |
| Line 40 const OEMCHAR xmilversion[] = OEMTEXT(XM | Line 40 const OEMCHAR xmilversion[] = OEMTEXT(XM |
| BYTE *RAM0w; | BYTE *RAM0w; |
| /*********************************************************************** | // ---- |
| IPL-ROM LOAD | |
| ***********************************************************************/ | |
| static void ipl_load(void) { | static void ipl_load(void) { |
| Line 66 static void ipl_load(void) { | Line 64 static void ipl_load(void) { |
| } | } |
| /*********************************************************************** | // ---- |
| 初期化 | |
| ***********************************************************************/ | void pccore_initialize(void) { |
| fddfile_initialize(); | |
| sndctrl_initialize(); | |
| makescrn_initialize(); | |
| font_load(NULL, TRUE); | |
| crtc_initialize(); | |
| pcg_initialize(); | |
| ppi_initialize(); | |
| } | |
| void pccore_deinitialize(void) { | |
| sndctrl_deinitialize(); | |
| fddfile_eject(0); | |
| fddfile_eject(1); | |
| fddfile_eject(2); | |
| fddfile_eject(3); | |
| } | |
| void pccore_reset(void) { | |
| soundmng_stop(); | |
| if (corestat.soundrenewal) { | |
| corestat.soundrenewal = 0; | |
| sndctrl_deinitialize(); | |
| sndctrl_initialize(); | |
| } | |
| sound_reset(); | |
| static BRESULT reset_x1(BYTE ROM_TYPE, BYTE SOUND_SW, BYTE DIP_SW) { | |
| pccore.baseclock = 2000000; | pccore.baseclock = 2000000; |
| pccore.multiple = 2; | pccore.multiple = 2; |
| pccore.realclock = pccore.baseclock * pccore.multiple; | pccore.realclock = pccore.baseclock * pccore.multiple; |
| pccore.HSYNC_CLK = 250; | |
| pccore.ROM_TYPE = ROM_TYPE; | pccore.ROM_TYPE = xmilcfg.ROM_TYPE; |
| pccore.SOUND_SW = SOUND_SW; | pccore.SOUND_SW = xmilcfg.SOUND_SW; |
| pccore.DIP_SW = DIP_SW; | pccore.DIP_SW = xmilcfg.DIP_SW; |
| // スクリーンモードの変更... | // スクリーンモードの変更... |
| if (pccore.ROM_TYPE >= 3) { | if (pccore.ROM_TYPE >= 3) { |
| Line 89 static BRESULT reset_x1(BYTE ROM_TYPE, B | Line 117 static BRESULT reset_x1(BYTE ROM_TYPE, B |
| else { | else { |
| scrnmng_setcolormode(FALSE); | scrnmng_setcolormode(FALSE); |
| } | } |
| sound_changeclock(); | |
| ipl_load(); | sound_changeclock(); |
| sysmng_cpureset(); | |
| Z80_RESET(); | Z80_RESET(); |
| nevent_allreset(); | |
| ievent_reset(); | |
| iocore_reset(); | iocore_reset(); |
| ipl_load(); | |
| RAM0r = mBIOS; | RAM0r = mBIOS; |
| RAM0w = mMAIN; | RAM0w = mMAIN; |
| sysmng_cpureset(); | |
| calendar_initialize(); | |
| cgrom_reset(); | cgrom_reset(); |
| cmt_reset(); | cmt_reset(); |
| Line 116 static BRESULT reset_x1(BYTE ROM_TYPE, B | Line 145 static BRESULT reset_x1(BYTE ROM_TYPE, B |
| subcpu_reset(); | subcpu_reset(); |
| vramio_reset(); | vramio_reset(); |
| calendar_reset(); | |
| pal_reset(); | pal_reset(); |
| makescrn_reset(); | makescrn_reset(); |
| timing_reset(); | timing_reset(); |
| return(SUCCESS); | |
| } | |
| /*********************************************************************** | |
| 実行/終了 | |
| ***********************************************************************/ | |
| void pccore_initialize(void) { | |
| fddfile_initialize(); | |
| sndctrl_initialize(); | |
| makescrn_initialize(); | |
| font_load(NULL, TRUE); | |
| crtc_initialize(); | |
| pcg_initialize(); | |
| ppi_initialize(); | |
| } | |
| void pccore_reset(void) { | |
| soundmng_stop(); | |
| if (corestat.soundrenewal) { | |
| corestat.soundrenewal = 0; | |
| sndctrl_deinitialize(); | |
| sndctrl_initialize(); | |
| } | |
| sound_reset(); | |
| nevent_allreset(); | |
| ievent_reset(); | |
| reset_x1(xmilcfg.ROM_TYPE, xmilcfg.SOUND_SW, xmilcfg.DIP_SW); | |
| soundmng_play(); | soundmng_play(); |
| } | } |
| void pccore_deinitialize(void) { | |
| sndctrl_deinitialize(); | |
| // keyboard_term(); | |
| fddfile_eject(0); | |
| fddfile_eject(1); | |
| fddfile_eject(2); | |
| fddfile_eject(3); | |
| } | |
| // ---- | // ---- |
| Line 204 void iptrace_out(void) { | Line 188 void iptrace_out(void) { |
| #endif | #endif |
| #if 0 | |
| void nvitem_raster(UINT id) { | |
| nevent_repeat(id); | |
| sound_makesample(pcmbufsize[v_cnt]); | |
| // x1_ctc_int(); | |
| if (!((++keyintcnt) & 15)) { | |
| x1_sub_int(); | |
| if (xmilcfg.MOUSE_SW) { | |
| sio_int(); | |
| } | |
| } | |
| v_cnt++; | |
| if (crtc.s.CRT_YL == v_cnt) { | |
| pcg.r.vsync = 1; | |
| if (xmilcfg.DISPSYNC & 1) { | |
| scrnupdate(); | |
| } | |
| } | |
| } | |
| #endif | |
| UINT pccore_getraster(UINT *h) { | UINT pccore_getraster(UINT *h) { |
| SINT32 work; | SINT32 work; |
| Line 249 void nvitem_vdisp(UINT id) { | Line 211 void nvitem_vdisp(UINT id) { |
| if (xmilcfg.DISPSYNC & 1) { | if (xmilcfg.DISPSYNC & 1) { |
| scrnupdate(); | scrnupdate(); |
| } | } |
| nevent_set(NEVENT_FRAMES, (corestat.tl - corestat.vl) * 250, | nevent_set(id, (corestat.tl - corestat.vl) * 250, |
| nvitem_vsync, NEVENT_RELATIVE); | nvitem_vsync, NEVENT_RELATIVE); |
| } | } |
| void nvitem_vsync(UINT id) { | void nvitem_vsync(UINT id) { |
| corestat.vsync = 2; | corestat.vsync = 2; |
| (void)id; | |
| } | } |
| Line 267 void pccore_exec(BRESULT draw) { | Line 230 void pccore_exec(BRESULT draw) { |
| soundmng_sync(); | soundmng_sync(); |
| corestat.tl = 266 * pccore.multiple / 2; | corestat.tl = 266 * pccore.multiple / 2; |
| corestat.vl = min(corestat.tl, crtc.s.CRT_YL); | corestat.vl = min(corestat.tl, crtc.e.dl); |
| corestat.vsync = 0; | corestat.vsync = 0; |
| nevent_set(NEVENT_FRAMES, corestat.vl * 250, | nevent_set(NEVENT_FRAMES, corestat.vl * 250, |
| nvitem_vdisp, NEVENT_RELATIVE); | nvitem_vdisp, NEVENT_RELATIVE); |
| Line 291 void pccore_exec(BRESULT draw) { | Line 254 void pccore_exec(BRESULT draw) { |
| } while(corestat.vsync < 2); | } while(corestat.vsync < 2); |
| scrnupdate(); | scrnupdate(); |
| calendar_inc(); | |
| sound_sync(); | sound_sync(); |
| } | } |