mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
timing for fast mode
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@246 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
b8cbd802cd
commit
e849512f15
2 changed files with 30 additions and 20 deletions
43
Pico/Pico.c
43
Pico/Pico.c
|
@ -495,21 +495,21 @@ static int PicoFrameSimple(void)
|
||||||
int y=0,line=0,lines=0,lines_step=0,sects;
|
int y=0,line=0,lines=0,lines_step=0,sects;
|
||||||
int cycles_68k_vblock,cycles_68k_block;
|
int cycles_68k_vblock,cycles_68k_block;
|
||||||
|
|
||||||
if (Pico.m.pal) {
|
// split to 16 run calls for active scan, for vblank split to 2 (ntsc), 3 (pal 240), 4 (pal 224)
|
||||||
// M68k cycles/frame: 152009.78
|
if (Pico.m.pal && (pv->reg[1]&8)) { // 240 lines
|
||||||
if(pv->reg[1]&8) { // 240 lines
|
if(pv->reg[1]&8) { // 240 lines
|
||||||
cycles_68k_block = (int) ((double) OSC_PAL / 7 / 50 / 312 * 15 + 0.4); // 16 sects, 16*15=240, 7308
|
cycles_68k_block = 7329; // (488*240+148)/16.0, -4
|
||||||
cycles_68k_vblock = (int) ((double) OSC_PAL / 7 / 50 / 312 * 24 + 0.4); // 3 sects, 3*24=72, 35163?
|
cycles_68k_vblock = 11640; // (72*488-148-68)/3.0, 0
|
||||||
lines_step = 15;
|
lines_step = 15;
|
||||||
} else {
|
} else {
|
||||||
cycles_68k_block = (int) ((double) OSC_PAL / 7 / 50 / 312 * 14 + 0.4); // 16*14=224
|
cycles_68k_block = 6841; // (488*224+148)/16.0, -4
|
||||||
cycles_68k_vblock = (int) ((double) OSC_PAL / 7 / 50 / 312 * 22 + 0.4); // 4 sects, 4*22=88
|
cycles_68k_vblock = 10682; // (88*488-148-68)/4.0, 0
|
||||||
lines_step = 14;
|
lines_step = 14;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// M68k cycles/frame: 127840.71
|
// M68k cycles/frame: 127840.71
|
||||||
cycles_68k_block = (int) ((double) OSC_NTSC / 7 / 60 / 262 * 14 + 0.4); // 16*14=224, 6831
|
cycles_68k_block = 6841; // (488*224+148)/16.0, -4
|
||||||
cycles_68k_vblock = (int) ((double) OSC_NTSC / 7 / 60 / 262 * 19 + 0.4); // 2 sects, 2*19=38, 18544
|
cycles_68k_vblock = 9164; // (38*488-148-68)/2.0, 0
|
||||||
lines_step = 14;
|
lines_step = 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -557,19 +557,20 @@ static int PicoFrameSimple(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// here we render sound if ym2612 is disabled
|
// here we render sound if ym2612 is disabled
|
||||||
if(!(PicoOpt&1) && PsndOut) {
|
if (!(PicoOpt&1) && PsndOut) {
|
||||||
int len = sound_render(0, PsndLen);
|
int len = sound_render(0, PsndLen);
|
||||||
if(PicoWriteSound) PicoWriteSound(len);
|
if (PicoWriteSound) PicoWriteSound(len);
|
||||||
// clear sound buffer
|
// clear sound buffer
|
||||||
sound_clear();
|
sound_clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// render screen
|
// render screen
|
||||||
if(!PicoSkipFrame) {
|
if (!PicoSkipFrame)
|
||||||
if(!(PicoOpt&0x10))
|
{
|
||||||
|
if (!(PicoOpt&0x10))
|
||||||
// Draw the screen
|
// Draw the screen
|
||||||
#if CAN_HANDLE_240_LINES
|
#if CAN_HANDLE_240_LINES
|
||||||
if(pv->reg[1]&8) {
|
if (pv->reg[1]&8) {
|
||||||
for (y=0;y<240;y++) PicoLine(y);
|
for (y=0;y<240;y++) PicoLine(y);
|
||||||
} else {
|
} else {
|
||||||
for (y=0;y<224;y++) PicoLine(y);
|
for (y=0;y<224;y++) PicoLine(y);
|
||||||
|
@ -580,6 +581,11 @@ static int PicoFrameSimple(void)
|
||||||
else PicoFrameFull();
|
else PicoFrameFull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// a gap between flags set and vint
|
||||||
|
pv->pending_ints|=0x20;
|
||||||
|
pv->status|=8; // go into vblank
|
||||||
|
SekRun(68+4);
|
||||||
|
|
||||||
// ---- V-Blanking period ----
|
// ---- V-Blanking period ----
|
||||||
// fix line counts
|
// fix line counts
|
||||||
if(Pico.m.pal) {
|
if(Pico.m.pal) {
|
||||||
|
@ -598,14 +604,11 @@ static int PicoFrameSimple(void)
|
||||||
lines_step = 19;
|
lines_step = 19;
|
||||||
}
|
}
|
||||||
|
|
||||||
//dprintf("vint: @ %06x [%i]", SekPc, SekCycleCnt);
|
|
||||||
pv->pending_ints|=0x20;
|
|
||||||
if (pv->reg[1]&0x20) SekInterrupt(6); // Set IRQ
|
if (pv->reg[1]&0x20) SekInterrupt(6); // Set IRQ
|
||||||
pv->status|=8; // go into vblank
|
if (Pico.m.z80Run && (PicoOpt&4))
|
||||||
if(Pico.m.z80Run && (PicoOpt&4)) // ?
|
|
||||||
z80_int();
|
z80_int();
|
||||||
|
|
||||||
while(sects) {
|
while (sects) {
|
||||||
lines += lines_step;
|
lines += lines_step;
|
||||||
|
|
||||||
SekRun(cycles_68k_vblock);
|
SekRun(cycles_68k_vblock);
|
||||||
|
@ -614,11 +617,11 @@ static int PicoFrameSimple(void)
|
||||||
line=lines;
|
line=lines;
|
||||||
|
|
||||||
sects--;
|
sects--;
|
||||||
if(sects && CheckIdle()) break;
|
if (sects && CheckIdle()) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// run Z80 for remaining sections
|
// run Z80 for remaining sections
|
||||||
if(sects) {
|
if (sects) {
|
||||||
lines += sects*lines_step;
|
lines += sects*lines_step;
|
||||||
PicoRunZ80Simple(line, lines);
|
PicoRunZ80Simple(line, lines);
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,6 +227,13 @@ Symbian:
|
||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
---------
|
---------
|
||||||
|
1.332
|
||||||
|
+ Some new optimizations in memory handlers, and for shadow/hilight mode.
|
||||||
|
+ Added some hacks to make more games work without enabling "accurate timing".
|
||||||
|
* Fixed hang of NBA Jam (ingame saves do not work though).
|
||||||
|
* Adjusted timing for "accurate timing" mode and added preliminary VDP FIFO
|
||||||
|
emulation. Fixes Double Dragon 2, tearing in Chaos Engine and some other games.
|
||||||
|
|
||||||
1.33
|
1.33
|
||||||
* Updated Cyclone core to 0.0088.
|
* Updated Cyclone core to 0.0088.
|
||||||
+ Added A r k's usbjoy fix.
|
+ Added A r k's usbjoy fix.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue