Alright, heres the deal... for some reason, my compiler doesnt work well with luaplayer. Although I can compile it, it crashes on exit.
So, heres some sample code:
Add to luasystem.cpp right before the get current directory function.
Code: Select all
static int highGraphicsMode = 1;
Code: Select all
static int lua_highGraphics(lua_State *L)
{
if (lua_gettop(L) != 0) return luaL_error(L, "no arguments expected");
if (highGraphicsMode) return 0;
highGraphicsMode = 0;
return 0;
}
static int lua_lowGraphics(lua_State *L)
{
if (lua_gettop(L) != 0) return luaL_error(L, "no arguments expected");
if (!highGraphicsMode) return 0;
highGraphicsMode = 1;
return 0;
}
Code: Select all
{"lowGraphicsMode", lua_lowGraphics},
{"highGraphicsMode", lua_highGraphics},
Code: Select all
void blitImageToScreen(int sx, int sy, int width, int height, Image* source, int dx, int dy)
{
if (!initialized) return;
Color* vram = getVramDrawBuffer();
sceKernelDcacheWritebackInvalidateAll();
guStart();
if (highGraphicsMode) sceGuCopyImage(GU_PSM_8888, sx, sy, width, height, source->textureWidth, source->data, dx, dy, PSP_LINE_SIZE, vram);
if (!highGraphicsMode) sceGuCopyImage(GU_PSM_5551, sx, sy, width, height, source->textureWidth, source->data, dx, dy, PSP_LINE_SIZE, vram);
sceGuFinish();
sceGuSync(0,0);
}
However, Im not sure about:
sceGuDrawBuffer(GU_PSM_8888, (void*)FRAMEBUFFER_SIZE, PSP_LINE_SIZE);
...
sceGuTexMode(GU_PSM_8888, 0, 0, 0);
Dont know much about what that does....
So, if someone could test this out, that would be great, thanks!