Code: Select all
#include <oslib/oslib.h>
//#include <psppower.h>
PSP_MODULE_INFO("OSLib Sample", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
enum colors
{
RED = RGBA(255,0,0,255),
GREEN = RGBA(0,255,0,255),
BLUE = RGBA(0,0,255,255),
WHITE = RGBA(255,255,255,255),
LITEGRAY = RGBA(125,125,125,255),
GRAY = RGBA(150,150,150,255),
DARKGRAY = RGBA(125,125,125,255),
BLACK = RGBA(0,0,0,255),
};
OSL_FONT *dopeness;
OSL_SOUND *mario;
OSL_IMAGE *buttondoc;
int main()
{
oslInit(0);
oslInitGfx(OSL_PF_8888, 1);
oslInitConsole();
oslInitAudioME(2);
oslIntraFontInit(INTRAFONT_CACHE_ALL | INTRAFONT_STRING_UTF8);
//scePowerSetClockFrequency( 333, 333, 166 );
dopeness = oslLoadIntraFontFile("font.pgf", INTRAFONT_CACHE_ALL);
mario = oslLoadSoundFileMP3( "mario.mp3", OSL_FMT_STREAM );
buttondoc = oslLoadImageFile( "buttondoc.jpg", OSL_IN_RAM, OSL_PF_8888 );
if ( !dopeness )
{
oslDebug(" Check if font.pgf is in your folder.");
}
if ( !mario )
{
oslDebug(" Check if mario.mp3 is in your folder.");
}
if ( !buttondoc )
{
oslDebug(" Check if buttondoc.jpg is in your folder.");
}
oslPlaySound(mario, 0);
oslSetSoundLoop(mario, 1);
while ( !osl_quit)
{
oslReadKeys();
oslStartDrawing();
oslClearScreen(WHITE);
oslDrawImage(buttondoc);
oslIntraFontSetStyle(dopeness, 1.2f,RED,0,INTRAFONT_ALIGN_CENTER);
oslSetFont( dopeness );
oslDrawStringf(240, 132, "NintendoBoy13 -\n Press [O] to pause/play");
if (osl_keys->pressed.circle) oslPauseSound(mario, -1);
oslEndDrawing();
oslSyncFrame();
oslAudioVSync();
}
oslIntraFontShutdown();
oslEndGfx();
oslQuit();
return 0;
}
Now my only question is, has anyone else tried this and to what end?
I'm trying to solve the standby/CPU speed lock issues we currently have with the ME. This may at least provide us some clue.
Also is the Media Engine being called from OSLib via pspSdkLoadStartModule("flash0:/kd/me_for_vsh.prx", PSP_MEMORY_PARTITION_KERNEL);
Or a different prx? And if it is that one, why don't I see it in my flash0:/kd/ on my PSP?
Note: This wasn't my code I was looking at it for NintendoBoy13 a coder new to PSP development and just noticed this behavior and thought it warranted investigation.