--- xmil/pccore.c 2004/08/05 11:30:12 1.9 +++ xmil/pccore.c 2004/08/07 07:19:56 1.12 @@ -7,10 +7,9 @@ #include "z80core.h" #include "pccore.h" #include "iocore.h" -#include "draw.h" +#include "makescrn.h" #include "sound.h" #include "sndctrl.h" -#include "menu.h" #include "font.h" #include "xmilver.h" #include "fddfile.h" @@ -22,15 +21,16 @@ const OEMCHAR xmilversion[] = OEMTEXT(XMILVER_CORE); - XMILCFG xmilcfg = { 0, 0, 1, 0, 1, 2, 0, 1, + XMILCFG xmilcfg = { 0, 0, 1, + 2, 0, 1, 22050, 1000, 0, 80, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0}; PCCORE pccore = {250, 0, 1, 0}; + CORESTAT corestat; BYTE mMAIN[0x10000]; BYTE mBIOS[0x8000]; BYTE mBANK[16][0x8000]; @@ -40,7 +40,6 @@ const OEMCHAR xmilversion[] = OEMTEXT(XM BYTE *RAM0r; BYTE *RAM0w; DWORD h_cntbase; - BRESULT soundrenewal; @@ -91,7 +90,6 @@ BYTE reset_x1(BYTE ROM_TYPE, BYTE SOUND_ scrnmng_setcolormode(FALSE); } - textdrawproc_renewal(); ipl_load(); Z80_RESET(); @@ -150,11 +148,13 @@ void pccore_initialize(void) { void pccore_reset(void) { soundmng_stop(); - if (soundrenewal) { - soundrenewal = 0; + if (corestat.soundrenewal) { + corestat.soundrenewal = 0; sndctrl_deinitialize(); sndctrl_initialize(); } + sound_reset(); + reset_x1(xmilcfg.ROM_TYPE, xmilcfg.SOUND_SW, xmilcfg.DIP_SW); soundmng_play(); } @@ -205,15 +205,14 @@ void iptrace_out(void) { } #endif - - -void x1r_exec(void) { +void pccore_exec(BRESULT draw) { REG8 inttiming; + corestat.drawframe = draw; + v_cnt = 0; s_cnt = 0; - xmilcfg.DISPSYNC &= 1; inttiming = xmilcfg.CPU8MHz & 1; while(s_cnt < 266) { @@ -229,10 +228,10 @@ void x1r_exec(void) { h_cntbase += pccore.HSYNC_CLK; inttiming ^= 2; if (inttiming != 3) { - if (xmilcfg.SOUNDPLY) { - sound_makesample(pcmbufsize[s_cnt]); + sound_makesample(pcmbufsize[s_cnt]); +// if (xmilcfg.SOUNDPLY) { // juliet2_exec(); - } +// } s_cnt++; x1_ctc_int(); if (!((++keyintcnt) & 15)) { @@ -244,20 +243,14 @@ void x1r_exec(void) { } v_cnt++; if (crtc.s.CRT_YL == v_cnt) { -// TRACEOUT(("--->sync")); pcg.r.vsync = 1; - if (xmilcfg.DISPSYNC == 1) { - xmilcfg.DISPSYNC |= 0x80; + if (xmilcfg.DISPSYNC & 1) { scrnupdate(); } } } + sound_sync(); calendar_inc(); - if (!xmilcfg.SOUNDPLY) { - sound_makesample(framesoundcnt); - } - if (!(xmilcfg.DISPSYNC & 0x80)) { - scrnupdate(); - } + scrnupdate(); }