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

View File

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

View File

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

View File

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