Skip to content

Commit

Permalink
Fix SLED games so they run on PS3 emulators
Browse files Browse the repository at this point in the history
Also update Official Playstation UK Magazine 01 pic1
to look better

Signed-off-by: Ronnie Sahlberg <[email protected]>

dfgdg

Signed-off-by: Ronnie Sahlberg <[email protected]>
  • Loading branch information
sahlberg committed Oct 11, 2024
1 parent 60b1740 commit 79349d0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gamedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion pop-fe-ps3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion pop-fe-psp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion pop-fe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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:
Expand Down
13 changes: 13 additions & 0 deletions popstation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import hashlib
import io
import os
import re
import struct
import sys
import zlib
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 79349d0

Please sign in to comment.