1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-23 05:13:53 +02:00
This commit is contained in:
XProger
2018-02-02 03:55:29 +03:00
2 changed files with 42 additions and 49 deletions

View File

@@ -15,13 +15,14 @@ inspired by OpenTomb project http://opentomb.github.io/
## Roadmap ## Roadmap
- save game crystals - save game crystals
- camera - camera
- alpha-3 release (December) - RELEASE alpha-3 (February)
- enemies - enemies
- Wii port
- bug fixes - bug fixes
- beta-1 release (January) - RELEASE beta-1
- bug fixes - bug fixes
- graphics improvements - graphics improvements
- release (February) - RELEASE
- OpenLara 2... - OpenLara 2...
## Screenshots ## Screenshots

View File

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