Diff for /xmil/pccore.c between versions 1.25 and 1.35

version 1.25, 2004/08/12 17:57:36 version 1.35, 2004/08/20 23:01:13
Line 26  const OEMCHAR xmilversion[] = OEMTEXT(XM Line 26  const OEMCHAR xmilversion[] = OEMTEXT(XM
   
         XMILCFG         xmilcfg = { 2, 1, 0x03,          XMILCFG         xmilcfg = { 2, 1, 0x03,
                                                         1, 0, 0, 0,                                                          1, 0, 0, 0,
                                                         22050, 500, 0, 0, 80,                                                          22050, 500, 0, 64, 64, 0, 80,
                                                         0, 0, 0, 0};                                                          0, 0, 0, 0};
   
         PCCORE          pccore;          PCCORE          pccore;
         CORESTAT        corestat;          CORESTAT        corestat;
         UINT8           mMAIN[0x10000];  
         UINT8           mBIOS[0x8000];  
 #if defined(SUPPORT_BANKMEM)  
         UINT8           mBANK[16][0x8000];  
 #endif  
         BYTE            *RAM0r;  
         BYTE            *RAM0w;  
   
   
 // ----  // ----
Line 46  static void ipl_load(void) { Line 39  static void ipl_load(void) {
   
         FILEH   hdl;          FILEH   hdl;
   
         ZeroMemory(mBIOS, sizeof(mBIOS));          ZeroMemory(biosmem, 0x8000);
         CopyMemory(mBIOS, DEFROM, sizeof(DEFROM));          CopyMemory(biosmem, DEFROM, sizeof(DEFROM));
   
         if (pccore.ROM_TYPE >= 2) {          if (pccore.ROM_TYPE >= 2) {
                 if ((hdl = file_open_c(OEMTEXT("IPLROM.X1T"))) != FILEH_INVALID) {                  if ((hdl = file_open_c(OEMTEXT("IPLROM.X1T"))) != FILEH_INVALID) {
                         file_read(hdl, mBIOS, 0x8000);                          file_read(hdl, biosmem, 0x8000);
                         file_close(hdl);                          file_close(hdl);
                 }                  }
         }          }
         else if (pccore.ROM_TYPE == 1) {          else if (pccore.ROM_TYPE == 1) {
                 if ((hdl = file_open_c(OEMTEXT("IPLROM.X1"))) != FILEH_INVALID) {                  if ((hdl = file_open_c(OEMTEXT("IPLROM.X1"))) != FILEH_INVALID) {
                         file_read(hdl, mBIOS, 0x8000);                          file_read(hdl, biosmem, 0x8000);
                         file_close(hdl);                          file_close(hdl);
                 }                  }
         }          }
Line 68  static void ipl_load(void) { Line 61  static void ipl_load(void) {
   
 void pccore_initialize(void) {  void pccore_initialize(void) {
   
           Z80_INITIALIZE();
         fddfile_initialize();          fddfile_initialize();
         sndctrl_initialize();          sndctrl_initialize();
         makescrn_initialize();          makescrn_initialize();
Line 129  void pccore_reset(void) { Line 123  void pccore_reset(void) {
   
         ipl_load();          ipl_load();
   
         RAM0r = mBIOS;  
         RAM0w = mMAIN;  
   
         pal_reset();          pal_reset();
         makescrn_reset();          makescrn_reset();
         timing_reset();          timing_reset();
Line 174  void iptrace_out(void) { Line 165  void iptrace_out(void) {
 #endif  #endif
   
   
 UINT pccore_getraster(UINT *h) {  
   
         SINT32  work;  
         UINT    vl;  
   
         work = nevent_getwork(NEVENT_FRAMES);  
         vl = work / 250;  
         if (h) {  
                 *h = work - (vl * 250);  
         }  
         if (corestat.vsync) {  
                 vl += corestat.vl;  
         }  
         return(vl);  
 }  
   
 void neitem_disp(UINT id) {  void neitem_disp(UINT id) {
   
         corestat.vsync = 1;          corestat.vsync = 1;
         pcg.r.vsync = 1;  
         if (xmilcfg.DISPSYNC & 1) {          if (xmilcfg.DISPSYNC & 1) {
                 scrnupdate();                  scrnupdate();
         }          }
         nevent_set(id, (corestat.tl - corestat.vl) * 250,          nevent_set(id, corestat.syncclock, neitem_vsync, NEVENT_RELATIVE);
                                                                                         neitem_vsync, NEVENT_RELATIVE);  
 }  }
   
 void neitem_vsync(UINT id) {  void neitem_vsync(UINT id) {
Line 208  void neitem_vsync(UINT id) { Line 181  void neitem_vsync(UINT id) {
 }  }
   
   
   // ----
   
 // #define      SINGLESTEPONLY  // #define      SINGLESTEPONLY
   
   
 void pccore_exec(BRESULT draw) {  void pccore_exec(BRESULT draw) {
   
           SINT32  frameclock;
           SINT32  dispclock;
   
         corestat.drawframe = draw;          corestat.drawframe = draw;
           pal_eventclear();
         soundmng_sync();          soundmng_sync();
   
         corestat.tl = 266 * pccore.multiple / 2;          timing_setrate(crtc.e.frameclock);
         corestat.vl = min(corestat.tl, crtc.e.dl);          frameclock = crtc.e.frameclock * pccore.multiple / 2;
           dispclock = min(frameclock, crtc.e.dispclock);
           corestat.dispclock = dispclock;
           corestat.syncclock = frameclock - dispclock;
         corestat.vsync = 0;          corestat.vsync = 0;
         nevent_set(NEVENT_FRAMES, corestat.vl * 250,          nevent_set(NEVENT_FRAMES, dispclock, neitem_disp, NEVENT_RELATIVE);
                                                                                         neitem_disp, NEVENT_RELATIVE);  
         do {          do {
 #if !defined(SINGLESTEPONLY)  #if !defined(SINGLESTEPONLY)
                 if (CPU_REMCLOCK > 0) {                  if (CPU_REMCLOCK > 0) {
Line 227  void pccore_exec(BRESULT draw) { Line 209  void pccore_exec(BRESULT draw) {
                 }                  }
 #else  #else
                 while(CPU_REMCLOCK > 0) {                  while(CPU_REMCLOCK > 0) {
                         TRACEOUT(("%.4x", Z80_PC));                  //      TRACEOUT(("%.4x", Z80_PC));
 #if defined(TRACE) && IPTRACE  #if defined(TRACE) && IPTRACE
                         treip[trpos & (IPTRACE - 1)] = Z80_PC;                          treip[trpos & (IPTRACE - 1)] = Z80_PC;
                         trpos++;                          trpos++;
Line 241  void pccore_exec(BRESULT draw) { Line 223  void pccore_exec(BRESULT draw) {
   
         scrnupdate();          scrnupdate();
         sound_sync();          sound_sync();
           fdc_callback();
 }  }
   

Removed from v.1.25  
changed lines
  Added in v.1.35


RetroPC.NET-CVS <cvs@retropc.net>