frameskipping tweaks

This commit is contained in:
dborth 2008-10-21 07:17:07 +00:00
parent 8968dd802c
commit de7c11dd25
4 changed files with 13 additions and 14 deletions

View File

@ -23,7 +23,6 @@
#include "audio.h"
#include "video.h"
#include "input.h"
#include "tbtime.h"
#define VBA_BUTTON_A 1
#define VBA_BUTTON_B 2
@ -301,7 +300,7 @@ u32 GetJoy(int pad)
{
StopAudio();
ConfigRequested = 1;
return 0;
return 0;
}
else
{

View File

@ -43,7 +43,6 @@ extern bool ROMLoaded;
extern int emulating;
int ConfigRequested = 0;
/****************************************************************************
* main
*
@ -100,14 +99,13 @@ int main()
selectedMenu = 2; // change to preferences menu
}
//Main loop
while(1)
while(1) // main loop
{
ResetVideo_Menu (); // change to menu video mode
MainMenu(selectedMenu);
selectedMenu = 3; // return to game menu from now on
while (emulating)
while (emulating) // emulation loop
{
emulator.emuMain(emulator.emuCount);

View File

@ -147,9 +147,11 @@ void system10Frames(int rate)
timeOff = 0; // timeoff was not valid
// consider increasing skip
if(diff >= 230)
if(diff >= 270)
systemFrameSkip += 4;
else if(diff >= 240)
systemFrameSkip += 3;
else if(diff >= 200)
else if(diff >= 210)
systemFrameSkip += 2;
else if(diff >= 170)
systemFrameSkip += 1;
@ -159,7 +161,7 @@ void system10Frames(int rate)
systemFrameSkip -= 3;
else if(diff <= 120)
systemFrameSkip -= 2;
else if(diff <= 150)
else if(diff <= 135)
systemFrameSkip -= 1;
// correct invalid frame skip values

View File

@ -41,7 +41,7 @@ unsigned int MEM2Storage = 0x91000000;
static u32 GBAROMSize = 0;
#ifdef USE_VM
extern u32 loadtimeradjust;
//extern u32 loadtimeradjust;
/** Setup VM to use small 16kb windows **/
#define VMSHIFTBITS 14
@ -291,7 +291,7 @@ int VMCPULoadROM(int method)
VMInit();
VMAllocGBA();
loadtimeradjust = GBAROMSize = 0;
GBAROMSize = 0;
switch (method)
{
@ -363,7 +363,7 @@ static void VMNewPage( int pageid )
tb_t start,end;
char msg[512];
mftb(&start);
//mftb(&start);
res = fseek( romfile, pageid << VMSHIFTBITS, SEEK_SET );
if (res) // fseek returns non-zero on a failure
@ -385,9 +385,9 @@ static void VMNewPage( int pageid )
return;
}
mftb(&end);
//mftb(&end);
loadtimeradjust += tb_diff_msec(&end, &start);
//loadtimeradjust += tb_diff_msec(&end, &start);
}
/****************************************************************************