From 603e8219f7e07ba36a9eefc46cca698cfad79bf4 Mon Sep 17 00:00:00 2001 From: XProger Date: Wed, 31 Jan 2018 17:06:32 +0300 Subject: [PATCH 1/2] #15 PSP remove tabs --- src/platform/psp/main.cpp | 84 ++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 46 deletions(-) diff --git a/src/platform/psp/main.cpp b/src/platform/psp/main.cpp index 56c5070..9bfb824 100644 --- a/src/platform/psp/main.cpp +++ b/src/platform/psp/main.cpp @@ -4,7 +4,6 @@ #include #include -//#include #include #include #include @@ -14,38 +13,35 @@ 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; int osTimerFreq; - + int osGetTime() { - u64 time; + u64 time; sceRtcGetCurrentTick(&time); return int(time * 1000 / osTimerFreq - osStartTime); } @@ -76,7 +72,7 @@ void joyInit() { void joyUpdate() { SceCtrlData pad; sceCtrlReadBufferPositive(&pad, 1); - + Input::setDown(ikJoyA, (pad.Buttons & PSP_CTRL_CROSS)); Input::setDown(ikJoyB, (pad.Buttons & PSP_CTRL_CIRCLE)); Input::setDown(ikJoyX, (pad.Buttons & PSP_CTRL_SQUARE)); @@ -85,13 +81,13 @@ void joyUpdate() { Input::setDown(ikJoyRB, (pad.Buttons & PSP_CTRL_RTRIGGER)); Input::setDown(ikJoyStart, (pad.Buttons & PSP_CTRL_START)); Input::setDown(ikJoySelect, (pad.Buttons & PSP_CTRL_SELECT)); - - int pov = joyGetPOV( ((pad.Buttons & PSP_CTRL_UP) != 0) | - (((pad.Buttons & PSP_CTRL_DOWN) != 0) << 1) | - (((pad.Buttons & PSP_CTRL_LEFT) != 0) << 2) | + + int pov = joyGetPOV( ((pad.Buttons & PSP_CTRL_UP) != 0) | + (((pad.Buttons & PSP_CTRL_DOWN) != 0) << 1) | + (((pad.Buttons & PSP_CTRL_LEFT) != 0) << 2) | (((pad.Buttons & PSP_CTRL_RIGHT) != 0) << 3)); Input::setPos(ikJoyPOV, vec2(float(pov), 0.0f)); - + vec2 stick = vec2(float(pad.Lx), float(pad.Ly)) / 128.0f - 1.0f; if (fabsf(stick.x) < 0.2f && fabsf(stick.y) < 0.2f) stick = vec2(0.0f); @@ -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); - sceGuScissor(0, 0, SCR_WIDTH, SCR_HEIGHT); - sceGuEnable(GU_SCISSOR_TEST); + 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); 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(); @@ -151,15 +143,15 @@ int main() { Game::render(); Core::submitCmdBuf(); - - //sceDisplayWaitVblankStart(); - Core::curBackBuffer = sceGuSwapBuffers(); + + //sceDisplayWaitVblankStart(); + Core::curBackBuffer = sceGuSwapBuffers(); } Game::deinit(); - sceGuTerm(); - sceKernelExitGame(); - - return 0; + sceGuTerm(); + sceKernelExitGame(); + + return 0; } \ No newline at end of file From 2a7c231baeba4152ba7f99f774b2243ca0fdd5ca Mon Sep 17 00:00:00 2001 From: Timur Gagiev Date: Wed, 31 Jan 2018 20:20:15 +0300 Subject: [PATCH 2/2] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0129db1..94a2473 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,14 @@ inspired by OpenTomb project http://opentomb.github.io/ ## Roadmap - save game crystals - camera -- alpha-3 release (December) +- RELEASE alpha-3 (February) - enemies +- Wii port - bug fixes -- beta-1 release (January) +- RELEASE beta-1 - bug fixes - graphics improvements -- release (February) +- RELEASE - OpenLara 2... ## Screenshots