minor timing change

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@254 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-09-18 19:57:10 +00:00
parent f02439758e
commit 5f20bb8036
4 changed files with 13 additions and 9 deletions

View file

@ -57,7 +57,7 @@ u32 z80ReadBusReq(void)
int stop_before = SekCyclesDone() - z80stopCycle; int stop_before = SekCyclesDone() - z80stopCycle;
//elprintf(EL_BUSREQ, "get_zrun: stop before: %i", stop_before); //elprintf(EL_BUSREQ, "get_zrun: stop before: %i", stop_before);
// note: if we use 20 or more here, Barkley Shut Up and Jam! will purposedly crash itself. // note: if we use 20 or more here, Barkley Shut Up and Jam! will purposedly crash itself.
// TODO: CD Terminator // but CD Terminator needs at least 32, so it only works because next frame cycle wrap.
if (stop_before > 0 && stop_before < 20) // Gens uses 16 here if (stop_before > 0 && stop_before < 20) // Gens uses 16 here
d = 1; // bus not yet available d = 1; // bus not yet available
} }
@ -176,7 +176,7 @@ void OtherWrite8(u32 a,u32 d)
#endif #endif
if (a==0xa11100) { z80WriteBusReq(d); return; } if (a==0xa11100) { z80WriteBusReq(d); return; }
if (a==0xa11200) { if (a==0xa11200) {
dprintf("write z80Reset: %02x", d); elprintf(EL_BUSREQ, "write z80Reset: %02x", d);
if(!(d&1)) z80_reset(); if(!(d&1)) z80_reset();
return; return;
} }

View file

@ -17,15 +17,17 @@
{ \ { \
if ((PicoOpt&4) && Pico.m.z80Run) \ if ((PicoOpt&4) && Pico.m.z80Run) \
{ \ { \
int cnt; \
if (Pico.m.z80Run & 2) z80CycleAim += z80_cycles; \ if (Pico.m.z80Run & 2) z80CycleAim += z80_cycles; \
else { \ else { \
int cnt = SekCyclesDone() - z80startCycle; \ cnt = SekCyclesDone() - z80startCycle; \
cnt = (cnt>>1)-(cnt>>5); \ cnt = (cnt>>1)-(cnt>>5); \
if (cnt > (z80_cycles)) cnt = z80_cycles; \ if (cnt > (z80_cycles)) cnt = z80_cycles; \
Pico.m.z80Run |= 2; \ Pico.m.z80Run |= 2; \
z80CycleAim+=cnt; \ z80CycleAim+=cnt; \
} \ } \
total_z80+=z80_run(z80CycleAim-total_z80); \ cnt=z80CycleAim-total_z80; \
if (cnt > 0) total_z80+=z80_run(cnt); \
} \ } \
} }
@ -52,7 +54,7 @@
static int PicoFrameHints(void) static int PicoFrameHints(void)
{ {
struct PicoVideo *pv=&Pico.video; struct PicoVideo *pv=&Pico.video;
int total_z80=0,lines,y,lines_vis = 224,z80CycleAim = 0,line_sample; int lines,y,lines_vis = 224,total_z80 = 0,z80CycleAim = 0,line_sample;
int skip=PicoSkipFrame || (PicoOpt&0x10); int skip=PicoSkipFrame || (PicoOpt&0x10);
int hint; // Hint counter int hint; // Hint counter
@ -78,7 +80,9 @@ static int PicoFrameHints(void)
//dprintf("-hint: %i", hint); //dprintf("-hint: %i", hint);
// This is to make active scan longer (needed for Double Dragon 2, mainly) // This is to make active scan longer (needed for Double Dragon 2, mainly)
CPUS_RUN(CYCLES_M68K_ASD, CYCLES_Z80_ASD, CYCLES_S68K_ASD); // also trying to adjust for z80 overclock here (due to int line cycle counts)
z80CycleAim = Pico.m.pal ? -40 : 7;
CPUS_RUN(CYCLES_M68K_ASD, 0, CYCLES_S68K_ASD);
for (y=0;y<lines_vis;y++) for (y=0;y<lines_vis;y++)
{ {

View file

@ -405,12 +405,12 @@ PICO_INTERNAL void z80_exit(void);
#define EL_INTSW 0x0010 /* log irq switching on/off */ #define EL_INTSW 0x0010 /* log irq switching on/off */
#define EL_ASVDP 0x0020 /* VDP accesses during active scan */ #define EL_ASVDP 0x0020 /* VDP accesses during active scan */
#define EL_VDPDMA 0x0040 /* VDP DMA transfers and their timing */ #define EL_VDPDMA 0x0040 /* VDP DMA transfers and their timing */
#define EL_BUSREQ 0x0080 /* z80 busreq r/w */ #define EL_BUSREQ 0x0080 /* z80 busreq r/w or reset w */
#define EL_Z80BNK 0x0100 /* z80 i/o through bank area */ #define EL_Z80BNK 0x0100 /* z80 i/o through bank area */
#define EL_SRAMIO 0x0200 /* sram i/o */ #define EL_SRAMIO 0x0200 /* sram i/o */
#define EL_EEPROM 0x0400 /* eeprom debug */ #define EL_EEPROM 0x0400 /* eeprom debug */
#define EL_UIO 0x0800 /* unmapped i/o */ #define EL_UIO 0x0800 /* unmapped i/o */
#define EL_IO 0x1000 /* all i/o */ #define EL_IO 0x1000 /* all i/o (TODO) */
#define EL_STATUS 0x4000 /* status messages */ #define EL_STATUS 0x4000 /* status messages */
#define EL_ANOMALY 0x8000 /* some unexpected conditions */ #define EL_ANOMALY 0x8000 /* some unexpected conditions */

View file

@ -13,7 +13,7 @@
#define CAN_HANDLE_240_LINES 1 #define CAN_HANDLE_240_LINES 1
// logging emu events // logging emu events
#define EL_LOGMASK 0 // (EL_STATUS|EL_ANOMALY|EL_UIO) // xffff #define EL_LOGMASK 0 // (EL_STATUS|EL_ANOMALY|EL_UIO|EL_SRAMIO) // xffff
//#define dprintf(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__) //#define dprintf(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__)
#define dprintf(x...) #define dprintf(x...)