Well, now I know how to find vblank handler address :)
mb this will help somebody else (for 5.00FW)
Code: Select all
pspVblankInterruptHandler = (void*)((int)sctrlHENFindFunction("sceDisplay_Service", "sceDisplay", 0xB4F378FA)+0x248);
Now there is another problem how to speed up vblank int. up to 60Hz...
I tried to use systimer and I'd got nice speed :) but there are some delays. Say... game lags a little sometimes
Here is code of speedbooster
Code: Select all
#include "speedbooster.h"
extern char spb;
SceSysTimerId vblanktmr;
int vcount = 0;
int tacts = 0;
int allowed = 1;
void vblank_60Hz(void)
{
tacts++;
if (tacts == vcount)
{
allowed = 0;
pspVblankInterruptHandler(0x1E);
allowed = 1;
}
return -1;
}
int vblank(int id)
{
if (allowed)
{
vcount = tacts >> 1;
tacts = 0;
}
return -1;
}
void speedboost_enable(void)
{
int intc = pspSdkDisableInterrupts();
vblanktmr = STimerAlloc();
STimerSetHandler(vblanktmr, 0xFF, vblank_60Hz, 0);
STimerStartCount(vblanktmr);
sceKernelRegisterSubIntrHandler(PSP_VBLANK_INT, 0, &vblank, 0);
sceKernelEnableSubIntr(PSP_VBLANK_INT, 0);
spb = 1;
pspSdkEnableInterrupts(intc);
}
void speedboost_disable(void)
{
int intc = pspSdkDisableInterrupts();
STimerStopCount(vblanktmr);
STimerFree(vblanktmr);
sceKernelDisableSubIntr(PSP_VBLANK_INT, 0);
sceKernelReleaseSubIntrHandler(PSP_VBLANK_INT, 0);
spb = 0;
pspSdkEnableInterrupts(intc);
}
I think it'll be better to put counter and call into some interrupt which triggers 1/60 sec or oftener...
We are SO CLOSE to solution (fixing speed issues for SDTVs) :)
Guys maybe you've got some other ideas? Ah?