Skip to content

Commit

Permalink
games: Add The Amazing Spider-Man [EUR] internal res. + FPS cap patch
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Chvila <miso.chvila@gmail.com>
  • Loading branch information
Electry committed Sep 1, 2018
1 parent abe5cbc commit 98a10e1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ add_executable(VitaGrafix
target_link_libraries(VitaGrafix
taihen_stub
SceAppMgr_stub
SceDisplay_stub
kuio_stub
k
gcc
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ NOTE: If some options are left out, the plugin will use their default values (fo
| MXGP: The Official Motocross Videogame | PCSB00470 <br/> PCSE00530 | Internal res. | 704x448 | 960x544 | |
| Persona 4 Golden | PCSB00245 <br/> PCSE00120 <br/> PCSG00004 <br/> PCSG00563 <br/> PCSH00021 | Internal res. | 840x476 | 960x544 | |
| Ridge Racer | PCSB00048 <br/> PCSE00001 <br/> PCSG00001 | Internal res. | 720x408 | 960x544 | |
| The Amazing Spider-Man | PCSB00428 | Internal res. <br/> FPS cap | 704x400 <br/> 60 | OFF <br/> OFF | Only few resolutions work properly (704x400, 480x272 known working). 960x544 causes GPU crash |
| Utawarerumono: Mask of Deception / Itsuwari no Kamen | PCSB01093 <br/> PCSE00959 <br/> PCSG00617 | Internal res. | 672x384 | 960x544 | |
| Utawarerumono: Mask of Truth / Futari no Hakuoro | PCSB01145 <br/> PCSE01102 <br/> PCSG00838 | Internal res. | 672x384 | 960x544 | |
| World of Final Fantasy | PCSB00951 <br/> PCSE00880 <br/> PCSH00223 <br/> PCSG00709 | Internal res. | 640x384 | 800x480 | Only few resolutions work properly (with visible effects and no glitches) |
Expand Down
29 changes: 29 additions & 0 deletions games.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
#include <psp2/types.h>
#include <libk/string.h>
#include <vitasdk.h>
#include <taihen.h>

#include "tools.h"
#include "config.h"
#include "main.h"
#include "games.h"

int sceDisplayWaitVblankStartMulti(unsigned int vcount);

int sceDisplaySetFrameBuf_withWait(const SceDisplayFrameBuf *pParam, int sync) {
int ret = TAI_CONTINUE(int, hooks_ref[0], pParam, sync);

sceDisplayWaitVblankStartMulti(0x2);

return ret;
}

uint8_t patch_game(const char *titleid, tai_module_info_t *eboot_info, VG_Config *config) {
if (!strncmp(titleid, "PCSF00243", 9) || // Killzone Mercenary [EUR] [1.12]
!strncmp(titleid, "PCSF00403", 9) || // Killzone Mercenary [EUR] [1.12]
Expand Down Expand Up @@ -721,6 +732,24 @@ uint8_t patch_game(const char *titleid, tai_module_info_t *eboot_info, VG_Config

return 1;
}
else if (!strncmp(titleid, "PCSB00428", 9)) { // The Amazing Spider-Man [EUR]
config_set_unsupported(FT_UNSUPPORTED, FT_ENABLED, FT_ENABLED, config);
config_set_default(FT_DISABLED, FT_DISABLED, FT_DISABLED, config);

if (config_is_ib_enabled(config)) {
uint8_t movs_r1_width_r0_height[4];
make_thumb2_t2_mov(1, 1, config->ib_width, movs_r1_width_r0_height);
make_thumb2_t2_mov(0, 1, config->ib_height, &movs_r1_width_r0_height[4]);

injectData(eboot_info->modid, 0, 0x16CD7E, &movs_r1_width_r0_height, sizeof(movs_r1_width_r0_height));
}
if (config_is_fps_enabled(config)) {
if (config->fps == FPS_30) // Force 2 vblank wait
hookFunctionImport(0x7A410B64, sceDisplaySetFrameBuf_withWait);
}

return 1;
}

return 0;
}

1 comment on commit 98a10e1

@chrmichael
Copy link

@chrmichael chrmichael commented on 98a10e1 Sep 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Observations:

704 as with works with ANY height (1-544).
Visually there is zero difference.

480x272 does not work and neither does 960x544 - because height remains 400 (or whatever it is by default)

Y-resolution remains unchanged regardless of what is configured.

GPU crash for ANY res other than 704x### always comes when pressing select button and showing the upgrade options.

Conclusion: Only x resolution is patched

I also verified that any width that is a multiple of 32 works, as long as the select button is not presses during game.

Hope this is helpful for fixing the patch

Please sign in to comment.