From 79349d00d7ef80218ddca0f125cf40a8d205bd25 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Fri, 11 Oct 2024 18:57:28 +1000 Subject: [PATCH] Fix SLED games so they run on PS3 emulators Also update Official Playstation UK Magazine 01 pic1 to look better Signed-off-by: Ronnie Sahlberg dfgdg Signed-off-by: Ronnie Sahlberg --- gamedb.py | 2 +- pop-fe-ps3.py | 2 +- pop-fe-psp.py | 2 +- pop-fe.py | 5 ++++- popstation.py | 13 +++++++++++++ 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/gamedb.py b/gamedb.py index 41ae7be..9fe6cdf 100644 --- a/gamedb.py +++ b/gamedb.py @@ -233,7 +233,7 @@ 'title': 'THE OFFICIAL PLAYSTATION MAGAZINE 1 [DEMO]', 'icon0': 'https://crimson-ceremony.net/demopals/eurodemo/uk001-1.jpg', 'pic0': None, - 'pic1': 'https://crimson-ceremony.net/demopals/eurodemo/uk001-1.jpg', + 'pic1': 'https://www.retromags.com/rmg_fs/gallery_imgs/monthly_2018_09/large.gallery_19000_268_46987.jpg.eb09ba9596e5ad389d38135272295ef7.jpg', }, 'SLES00150': { 'id': 'SLES00150', diff --git a/pop-fe-ps3.py b/pop-fe-ps3.py index a3777c8..1916614 100755 --- a/pop-fe-ps3.py +++ b/pop-fe-ps3.py @@ -677,7 +677,7 @@ def on_create_pkg(self): magic_word.append(0) subchannels.append(None) - if disc_id[:4] == 'SLES' or disc_id[:4] == 'SCES': + if disc_id[:3] == 'SLE' or disc_id[:3] == 'SCE': print('SLES/SCES PAL game. Default resolution set to 2 (640x512)') if verbose else None resolution = 2 if self.builder.get_variable('force_pal_variable').get() == 'on': diff --git a/pop-fe-psp.py b/pop-fe-psp.py index 9cd5863..8898a9f 100755 --- a/pop-fe-psp.py +++ b/pop-fe-psp.py @@ -500,7 +500,7 @@ def on_create_eboot(self): magic_word.append(0) subchannels.append(None) - if disc_id[:4] == 'SLES' or disc_id[:4] == 'SCES': + if disc_id[:3] == 'SLE' or disc_id[:3] == 'SCE': print('SLES/SCES PAL game. Default resolution set to 2 (640x512)') if verbose else None resolution = 2 diff --git a/pop-fe.py b/pop-fe.py index 0b301a0..431a36a 100755 --- a/pop-fe.py +++ b/pop-fe.py @@ -2967,6 +2967,9 @@ def create_ps3(dest, disc_ids, game_title, icon0, pic0, pic1, cue_files, cu2_fil bc.open(cue_files[i]) # store how big the data track is p.add_track0_size(bc.tracks[1]['INDEX'][1]['STOPSECT'] * SECTLEN) + if disc_ids[0][:4] == 'SLED': + print('Apply hotfix for SLED games') + p.hotfixes = [ (b'SLED', b'SLES'), ] # create directory structure f = subdir + disc_ids[0] @@ -4408,7 +4411,7 @@ def process_disk_file(cue_file, idx, temp_files, subdir='./'): quit() resolution = 1 - if args.ps3_pkg and (real_disc_ids[0][:4] == 'SLES' or real_disc_ids[0][:4] == 'SCES'): + if args.ps3_pkg and (real_disc_ids[0][:3] == 'SLE' or real_disc_ids[0][:3] == 'SCE'): print('SLES/SCES PAL game. Default resolution set to 2 (640x512)') if verbose else None resolution = 2 if args.resolution: diff --git a/popstation.py b/popstation.py index fb2e5fd..f5e0041 100755 --- a/popstation.py +++ b/popstation.py @@ -16,6 +16,7 @@ import hashlib import io import os +import re import struct import sys import zlib @@ -2413,6 +2414,7 @@ def __init__(self): self._configs = None self._magic_word = [] self._subchannels = [] + self._hotfixes = None self._verbose = False self._striptracks = False # complevel is >0 for PSP and ==0 for PS3 @@ -2457,6 +2459,14 @@ def magic_word(self): def magic_word(self, magic_word): self._magic_word = magic_word + @property + def hotfixes(self): + return self._hotfixes + + @hotfixes.setter + def hotfixes(self, hotfixes): + self._hotfixes = hotfixes + @property def subchannels(self): return self._subchannels @@ -2815,6 +2825,9 @@ def bcd(i): break if len(buf) < 0x9300: buf = buf + bytearray(0x9300 - len(buf)) + if self._hotfixes and fi.tell() < 1048576: + for fix in self._hotfixes: + buf = buf.replace(fix[0], fix[1]) c = buf if self._complevel != 0: c = zlib.compress(buf, self._complevel)