Skip to content

Commit

Permalink
Support launching multiple titles from LiveArea, minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Northfear committed Oct 10, 2020
1 parent 2de594c commit 1c6661e
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 7 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ Install gemrb.vpk to your Vita. Extract "GemRB" folder from gemrb_data.zip to ux

Copy original game folder to ux0:data/GemRB/ and edit ux0:data/GemRB/GemRB.cfg file (set correct "GameType" and "GamePath" parameters. Game auto detection isn't working, so set "GameType" manually).

LiveArea launcher supports launching different games from it by selecting appropriate game title.

Here are the game config names and default game folders (where you should copy your game data) that are used by each title from LiveArea (configs should be located in ux0:data/GemRB/):

- Baldur's Gate - BG1.cfg. Default game path: ux0:data/GemRB/BG1
- Baldur's Gate 2 - BG2.cfg. Default game path: ux0:data/GemRB/BG2
- Icewind Dale - IWD.cfg. Default game path: ux0:data/GemRB/IWD
- Planescape: Torment - PST.cfg . Default game path: ux0:data/GemRB/PST

rePatch reDux0 plugin is required for proper suspend/resume support

https://github.com/dots-tb/rePatch-reDux0
Expand Down Expand Up @@ -76,9 +85,7 @@ VitaKeepAspectRatio=1 keeps aspect ratio of original image when scaling. VitaKee

Widescreen mod is supported, but performance with native resolution can be poor in areas with a lot of characters.

The game is pretty IO heavy. Loading can take quite some time. And a big number of sound effects playing at the same time can cause a lot of stuttering. To improve the situation I STRONGLY recommend disabling character movement and attack sounds in game options. Disabling sound altogether (by seting "AudioDriver = none" in GemRB.cfg) can improve it even further.

"Bpp=16" option is recommended for better performance.
"Bpp=16" option is recommended for better performance. The game is pretty IO heavy. Loading can take quite some time.

## Controls
- Left analog stick - Pointer movement
Expand Down
28 changes: 28 additions & 0 deletions gemrb/GemRB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#ifdef VITA
#include <psp2/kernel/processmgr.h>
#include <psp2/power.h>
#include <psp2/apputil.h>

// allocating memory for application on Vita
int _newlib_heap_size_user = 344 * 1024 * 1024;
Expand Down Expand Up @@ -70,6 +71,33 @@ int main(int argc, char* argv[])
scePowerSetBusClockFrequency(222);
scePowerSetGpuClockFrequency(222);
scePowerSetGpuXbarClockFrequency(166);

// Selecting game config from init params
SceAppUtilInitParam appUtilParam;
SceAppUtilBootParam appUtilBootParam;
memset(&appUtilParam, 0, sizeof(SceAppUtilInitParam));
memset(&appUtilBootParam, 0, sizeof(SceAppUtilBootParam));
sceAppUtilInit(&appUtilParam, &appUtilBootParam);
SceAppUtilAppEventParam eventParam;
memset(&eventParam, 0, sizeof(SceAppUtilAppEventParam));
sceAppUtilReceiveAppEvent(&eventParam);
int vita_argc = 1;
char *vita_argv[3];
vita_argv[0] = (char*)"";
if (eventParam.type == 0x05) {
char buffer[2048];
memset(buffer, 0, 2048);
sceAppUtilAppEventParseLiveArea(&eventParam, buffer);
vita_argv[1] = (char*)"-c";
char configPath[2080];
sprintf(configPath, "ux0:data/GemRB/%s.cfg", buffer);
vita_argv[2] = configPath;
vita_argc = 3;
}
argc = vita_argc;
argv = vita_argv;
#else

#endif

setlocale(LC_ALL, "");
Expand Down
2 changes: 1 addition & 1 deletion gemrb/plugins/SDLAudio/SDLAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <vector>
#include <SDL_mixer.h>

#define BUFFER_CACHE_SIZE 40
#define BUFFER_CACHE_SIZE 50

struct SDL_mutex;

Expand Down
Binary file modified platforms/vita/sce_sys/livearea/contents/startup.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 37 additions & 1 deletion platforms/vita/sce_sys/livearea/contents/template.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>

<livearea style="a1" format-ver="01.00" content-rev="1">
<livearea style="a5" format-ver="01.00" content-rev="1">
<livearea-background>
<image>bg.png</image>
</livearea-background>

<gate>
<startup-image>startup.png</startup-image>
</gate>

<frame id='frame1' multi='o' autoflip='3' >
<liveitem>
<target>psla:BG1</target>
<text valign="bottom" align="left" text-align="left" margin-left="60" word-wrap="off" ellipsis="on">
<str bold="on" size="30" color="#ffffff" emboss="on" shadow="on">Baldur's Gate</str>
</text>
</liveitem>
</frame>

<frame id='frame2' multi='o' autoflip='3' >
<liveitem>
<target>psla:BG2</target>
<text valign="bottom" align="left" text-align="left" margin-left="60" word-wrap="off" ellipsis="on">
<str bold="on" size="30" color="#ffffff" emboss="on" shadow="on">Baldur's Gate 2</str>
</text>
</liveitem>
</frame>

<frame id='frame3' multi='o' autoflip='3' >
<liveitem>
<target>psla:IWD</target>
<text valign="bottom" align="left" text-align="left" margin-left="60" word-wrap="off" ellipsis="on">
<str bold="on" size="30" color="#ffffff" emboss="on" shadow="on">Icewind Dale</str>
</text>
</liveitem>
</frame>

<frame id='frame4' multi='o' autoflip='3' >
<liveitem>
<target>psla:PST</target>
<text valign="bottom" align="left" text-align="left" margin-left="60" word-wrap="off" ellipsis="on">
<str bold="on" size="30" color="#ffffff" emboss="on" shadow="on">Planescape: Torment</str>
</text>
</liveitem>
</frame>
</livearea>
5 changes: 3 additions & 2 deletions platforms/vita/vita.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ SET(CMAKE_DL_LIBS "")
SET(VITA_FLAGS "-Ofast -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -ftree-vectorize -D_GLIBCXX_USE_C99_MATH=0 -DNDEBUG")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VITA_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VITA_FLAGS}")
SET(VITA_LIBRARIES_SDL "-lvorbis -logg -lmikmod -lSceAudio_stub -lSceCtrl_stub -lvita2d -lSceGxm_stub -lSceHid_stub -lSceDisplay_stub -lSceDisplayUser_stub -lSceSysmodule_stub -lSceAppMgr_stub -lSceCommonDialog_stub -lScePower_stub")
SET(VITA_LIBRARIES_SDL2 "-lvorbis -logg -lFLAC -lmikmod -lmpg123 -lSceAudio_stub -lSceCtrl_stub -lvita2d -lSceGxm_stub -lSceHid_stub -lSceDisplay_stub -lSceDisplayUser_stub -lSceSysmodule_stub -lSceAppMgr_stub -lSceCommonDialog_stub -lScePower_stub -lSceTouch_stub")
SET(VITA_LIBRARIES_SDL_COMMON "-lvorbis -logg -lmikmod -lSceAudio_stub -lSceCtrl_stub -lvita2d -lSceGxm_stub -lSceHid_stub -lSceDisplay_stub -lSceDisplayUser_stub -lSceSysmodule_stub -lSceAppMgr_stub -lSceCommonDialog_stub -lScePower_stub -lSceAppUtil_stub")
SET(VITA_LIBRARIES_SDL "${VITA_LIBRARIES_SDL_COMMON}")
SET(VITA_LIBRARIES_SDL2 "-lFLAC -lSceTouch_stub ${VITA_LIBRARIES_SDL_COMMON}")

SET(DEFAULT_CACHE_DIR "ux0:data/GemRB/Cache2/")
SET(DATA_DIR "ux0:data/GemRB/")
Expand Down

0 comments on commit 1c6661e

Please # to comment.