1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-18 02:41:29 +02:00

#15 PSP remove tabs

This commit is contained in:
XProger
2018-01-31 17:06:32 +03:00
parent 1fb18ab819
commit 603e8219f7

View File

@@ -4,7 +4,6 @@
#include <pspkernel.h>
#include <pspdisplay.h>
//#include <pspdebug.h>
#include <pspctrl.h>
#include <psprtc.h>
#include <pspaudiolib.h>
@@ -14,31 +13,28 @@ PSP_MODULE_INFO("OpenLara", 0, 1, 1);
PSP_HEAP_SIZE_KB(20480);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_VFPU);
//#define printf pspDebugScreenPrintf
//#define printf Kprintf
#include "game.h"
#define BUF_WIDTH (512)
#define SCR_WIDTH (480)
#define SCR_HEIGHT (272)
#define BUF_WIDTH (512)
#define SCR_WIDTH (480)
#define SCR_HEIGHT (272)
int exitCallback(int arg1, int arg2, void *common) {
Core::quit();
return 0;
return 0;
}
int callbackThread(SceSize args, void *argp) {
int cbid = sceKernelCreateCallback("Exit Callback", exitCallback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
int cbid = sceKernelCreateCallback("Exit Callback", exitCallback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
int setupCallbacks(void) {
int thid = sceKernelCreateThread("update_thread", callbackThread, 0x11, 0xFA0, 0, 0);
int thid = sceKernelCreateThread("update_thread", callbackThread, 0x11, 0xFA0, 0, 0);
sceKernelStartThread(thid, 0, 0);
return thid;
return thid;
}
int osStartTime = 0;
@@ -103,27 +99,26 @@ void sndFill(void* buf, unsigned int length, void *userdata) {
}
void sndInit() {
pspAudioInit();
pspAudioSetChannelCallback(0, sndFill, NULL);
pspAudioInit();
pspAudioSetChannelCallback(0, sndFill, NULL);
}
char Stream::cacheDir[255];
char Stream::contentDir[255];
int main() {
//pspDebugScreenInit();
setupCallbacks();
setupCallbacks();
sceGuInit();
sceGuInit();
Core::beginCmdBuf();
sceGuDrawBuffer(GU_PSM_5650, (void*)0, BUF_WIDTH);
sceGuDispBuffer(SCR_WIDTH, SCR_HEIGHT, (void*)(BUF_WIDTH * SCR_HEIGHT * 2), BUF_WIDTH);
sceGuDepthBuffer((void*)(BUF_WIDTH * SCR_HEIGHT * 2 * 2), BUF_WIDTH);
sceGuDrawBuffer(GU_PSM_5650, (void*)0, BUF_WIDTH);
sceGuDispBuffer(SCR_WIDTH, SCR_HEIGHT, (void*)(BUF_WIDTH * SCR_HEIGHT * 2), BUF_WIDTH);
sceGuDepthBuffer((void*)(BUF_WIDTH * SCR_HEIGHT * 2 * 2), BUF_WIDTH);
sceGuScissor(0, 0, SCR_WIDTH, SCR_HEIGHT);
sceGuEnable(GU_SCISSOR_TEST);
sceGuScissor(0, 0, SCR_WIDTH, SCR_HEIGHT);
sceGuEnable(GU_SCISSOR_TEST);
sndInit();
joyInit();
@@ -135,15 +130,12 @@ int main() {
Core::submitCmdBuf();
sceDisplayWaitVblankStart();
sceGuDisplay(GU_TRUE);
sceDisplayWaitVblankStart();
sceGuDisplay(GU_TRUE);
Core::curBackBuffer = 0;
while (!Core::isQuit) {
//pspDebugScreenSetOffset((int)frameOffset);
//pspDebugScreenSetXY(0, 0);
while (!Core::isQuit) {
Core::beginCmdBuf();
joyUpdate();
@@ -152,14 +144,14 @@ int main() {
Core::submitCmdBuf();
//sceDisplayWaitVblankStart();
Core::curBackBuffer = sceGuSwapBuffers();
//sceDisplayWaitVblankStart();
Core::curBackBuffer = sceGuSwapBuffers();
}
Game::deinit();
sceGuTerm();
sceKernelExitGame();
sceGuTerm();
sceKernelExitGame();
return 0;
return 0;
}