Skip to content

Commit

Permalink
Add external configs for PSP to pop-fe and pop-fe-psp
Browse files Browse the repository at this point in the history
Add a link to the config for BraveFencerMusashi

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
  • Loading branch information
sahlberg committed Oct 7, 2023
1 parent 0ae3177 commit f2f59f7
Show file tree
Hide file tree
Showing 45 changed files with 74 additions and 11 deletions.
18 changes: 16 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ $ ./pop-fe.py --psp-dir=auto --romhacks none,X.ppf D1.cue D2.cue

PS3 External config files
=========================
External configs is a way to add commands to the ps1_netemu emulator that to
tweak gameplay for individual titles.
External configs is a way to add commands to the ps1_netemu emulator to
tweak gameplay and fix bugs for individual titles.

See: https://www.psdevwiki.com/ps3/Talk:PS1_Emulation#External_Configs

Expand All @@ -243,6 +243,20 @@ automatically eject when you create a PS3 package.
This is done by storing the config file in the same directory as the cue file
and with the filename <cue-file>.ps3config

PSP External config files
=========================
External configs is a way to add commands to the pops emulator to
tweak gameplay and fix bugs for individual titles.

See: ...

pop-fe/pop-fe-psp comes with a bunch of configs built in for various games.
(See the pspconfigs subdirectory.)

You can also specify additional config files that pop-fe/pop-fe-psp will
automatically eject when you create a PSP EBOOT.
This is done by storing the config file in the same directory as the cue file
and with the filename <cue-file>.pspconfig

Image files for PS3 packages
============================
Expand Down
1 change: 1 addition & 0 deletions gamedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3316,6 +3316,7 @@
'pic1': 'https://images.launchbox-app.com/67a30f77-495f-419a-bbd4-c9235379a48c.jpg',
'snd0': 'https://www.youtube.com/watch?v=FBzZB7rZlqA&list=PL4A9348AFB63EBB15&index=1',
'manual': 'https://archive.org/download/SonyPlaystationManuals/Brave%20Fencer%20Musashi%20%28USA%29_jp2.zip',
'pspconfig': 'pspconfigs/Brave Fencer Musashi/SLUS-00726.bin',
},
'SLUS90029': {
'url': "games/U/B/SLUS-00726.html",
Expand Down
21 changes: 19 additions & 2 deletions pop-fe-psp.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def __init__(self, master=None):
self.watermark = 'on'
self.pic0_disabled = 'off'
self.snd0_disabled = 'off'
self.configs = []
self.subdir='pop-fe-psp-work/'

self.master = master
Expand Down Expand Up @@ -146,6 +147,7 @@ def init_data(self):
self.pic1_tk = None
self.pkgdir = None
self.preview_tk = None
self.configs = []
self.builder.get_variable('watermark_variable').set(self.watermark)
for idx in range(1,6):
self.builder.get_object('discid%d' % (idx), self.master).config(state='disabled')
Expand Down Expand Up @@ -326,7 +328,21 @@ def on_path_changed(self, event):
self.disc_ids.append(disc_id)
self.real_disc_ids.append(disc_id)
self.cue_files.append(cue_file)
self.configs.append(bytes())

try:
os.stat(cue_file[:-3]+'pspconfig').st_size
print('Found an external config ', cue_file[:-3]+'pspconfig')
with open(cue_file[:-3]+'pspconfig', 'rb') as f:
f.seek(8)
self.configs[-1] = self.configs[-1] + f.read()
except:
True
if disc_id in games and 'pspconfig' in games[disc_id]:
print('Found an external config for', disc_id)
with open(games[disc_id]['pspconfig'], 'rb') as f:
f.seek(8)
self.configs[-1] = self.configs[-1] + f.read()
if disc == 'd1':
self.builder.get_object('discid1', self.master).config(state='normal')
self.builder.get_variable('title_variable').set(popfe.get_title_from_game(disc_id))
Expand Down Expand Up @@ -520,15 +536,16 @@ def on_create_eboot(self):
self.cu2_files = popfe.generate_cu2_files(self.cue_files, self.img_files, self.subdir)

aea_files = popfe.generate_aea_files(self.cue_files, self.img_files, self.subdir)

popfe.create_psp(ebootdir, disc_ids, title,
self.icon0,
self.pic0 if self.pic0_disabled =='off' else None,
self.pic1,
self.cue_files, self.cu2_files, self.img_files, [],
aea_files, subdir=self.subdir, snd0=snd0,
watermark=True if self.watermark=='on' else False,
subchannels=subchannels, manual=manual)
subchannels=subchannels, manual=manual,
configs=self.configs)
self.master.config(cursor='')

d = FinishedDialog(self.master)
Expand Down
34 changes: 29 additions & 5 deletions pop-fe.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ def bcd(i):
return toc


def generate_pbp(dest_file, disc_ids, game_title, icon0, pic0, pic1, cue_files, cu2_files, img_files, aea_files, snd0=None, whole_disk=True, subchannels=[]):
def generate_pbp(dest_file, disc_ids, game_title, icon0, pic0, pic1, cue_files, cu2_files, img_files, aea_files, snd0=None, whole_disk=True, subchannels=[], configs=None):
print('Create PBP file for', game_title) if verbose else None

SECTLEN = 2352
Expand All @@ -832,6 +832,8 @@ def generate_pbp(dest_file, disc_ids, game_title, icon0, pic0, pic1, cue_files,
p.disc_ids = disc_ids
p.game_title = game_title
p.subchannels = subchannels
if configs:
p.configs = configs
if icon0:
p.icon0 = icon0
if pic0:
Expand Down Expand Up @@ -867,7 +869,7 @@ def generate_pbp(dest_file, disc_ids, game_title, icon0, pic0, pic1, cue_files,
True


def create_psp(dest, disc_ids, game_title, icon0, pic0, pic1, cue_files, cu2_files, img_files, mem_cards, aea_files, subdir = './', snd0=None, watermark=False, subchannels=[], manual=None):
def create_psp(dest, disc_ids, game_title, icon0, pic0, pic1, cue_files, cu2_files, img_files, mem_cards, aea_files, subdir = './', snd0=None, watermark=False, subchannels=[], manual=None, configs=None):
# Convert ICON0 to a file object
if icon0:
if icon0.size[0] / icon0.size[1] < 1.4 and icon0.size[0] / icon0.size[1] > 0.75:
Expand Down Expand Up @@ -942,7 +944,7 @@ def create_psp(dest, disc_ids, game_title, icon0, pic0, pic1, cue_files, cu2_fil
snd0_data = i.read()

dest_file = f + '/EBOOT.PBP'
generate_pbp(dest_file, disc_ids, game_title, icon0, pic0, pic1, cue_files, cu2_files, img_files, aea_files, snd0=snd0_data, whole_disk=False, subchannels=subchannels)
generate_pbp(dest_file, disc_ids, game_title, icon0, pic0, pic1, cue_files, cu2_files, img_files, aea_files, snd0=snd0_data, whole_disk=False, subchannels=subchannels, configs=configs)

if manual:
print('Installing manual as', f + '/DOCUMENT.DAT')
Expand Down Expand Up @@ -2148,6 +2150,7 @@ def force_ntsc_config(ps3config):
exit(0)

ps3configs = None
pspconfigs = None

if args.psp_dir and args.psp_dir.upper() == 'AUTO':
args.psp_dir = find_psp_mount()
Expand Down Expand Up @@ -2189,6 +2192,10 @@ def force_ntsc_config(ps3config):
if not ps3configs:
ps3configs = []
ps3configs.append(bytes())
if args.psp_dir:
if not pspconfigs:
pspconfigs = []
pspconfigs.append(bytes())

real_cue_file = cue_file
real_cue_files.append(real_cue_file)
Expand Down Expand Up @@ -2301,7 +2308,7 @@ def force_ntsc_config(ps3config):
print('Found an external config ', real_cue_files[i][:-3]+'ps3config')
with open(real_cue_files[i][:-3]+'ps3config', 'rb') as f:
f.seek(8)
self.configs[-1] = self.configs[-1] + f.read()
ps3configs[-1] = ps3configs[-1] + f.read()
except:
True

Expand All @@ -2314,6 +2321,23 @@ def force_ntsc_config(ps3config):
if args.resolution == '1':
print('Inject config to force NTSC') if verbose else None
ps3configs[i] = force_ntsc_config(ps3configs[i])
if args.psp_dir:
for i in range(len(real_disc_ids)):
try:
os.stat(real_cue_files[i][:-3]+'pspconfig').st_size
print('Found an external config ', real_cue_files[i][:-3]+'pspconfig')
with open(real_cue_files[i][:-3]+'pspconfig', 'rb') as f:
f.seek(8)
pspconfigs[-1] = pspconfigs[-1] + f.read()
except:
True

disc_id = real_disc_ids[i]
if disc_id in games and 'pspconfig' in games[disc_id]:
print('Found an external config for', disc_id) if verbose else None
with open(games[disc_id]['pspconfig'], 'rb') as f:
f.seek(8)
pspconfigs[i] = pspconfigs[i] + f.read()
#
# Force use of ps1_newemu, this disables all other config settings
#
Expand Down Expand Up @@ -2521,7 +2545,7 @@ def force_ntsc_config(ps3config):
temp_files.append(snd0)

if args.psp_dir:
create_psp(args.psp_dir, disc_ids, game_title, icon0, pic0, pic1, cue_files, cu2_files, img_files, mem_cards, aea_files, snd0=snd0, subdir=subdir, watermark=args.watermark, subchannels=subchannels, manual=manual)
create_psp(args.psp_dir, disc_ids, game_title, icon0, pic0, pic1, cue_files, cu2_files, img_files, mem_cards, aea_files, snd0=snd0, subdir=subdir, watermark=args.watermark, subchannels=subchannels, manual=manual, configs=pspconfigs)
if args.ps2_dir:
create_ps2(args.ps2_dir, disc_ids, game_title, icon0, pic1, cue_files, cu2_files, img_files)
if args.ps3_pkg:
Expand Down
11 changes: 9 additions & 2 deletions popstation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2420,6 +2420,7 @@ def __init__(self):
self._subchannels = []
self._verbose = False
self._striptracks = False
# complevel is >0 for PSP and ==0 for PS3
self._complevel = 1
self._disc_ids = ['SLUS00000']
self._game_title = 'TITLE'
Expand Down Expand Up @@ -2725,8 +2726,14 @@ def bcd(i):
if self._configs:
_l = len(self._configs[disc_num])
if _l:
buf[0x24:0x24 + 8] = bytes([0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00])
buf[0x2c:0x2c + _l] = self._configs[disc_num]
if self._complevel:
# PSP
buf[0x20:0x20 + 8] = bytes([0x70, 0x00, 0x07, 0x06, 0x00, 0x00, 0x06, 0x06])
buf[0x28:0x28 + _l] = self._configs[disc_num]
else:
# PS3
buf[0x24:0x24 + 8] = bytes([0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00])
buf[0x2c:0x2c + _l] = self._configs[disc_num]
fh.write(buf)

# Block #3
Expand Down
Binary file added pspconfigs/Brave Fencer Musashi/SLUS-00726.bin
Binary file not shown.
Binary file added pspconfigs/Colony Wars - Vengeance/SLES-01392.bin
Binary file not shown.
Binary file added pspconfigs/Colony Wars - Vengeance/SLES-01405.bin
Binary file not shown.
Binary file added pspconfigs/Colony Wars - Vengeance/SLES-01406.bin
Binary file not shown.
Binary file added pspconfigs/Colony Wars - Vengeance/SLES-01407.bin
Binary file not shown.
Binary file added pspconfigs/Colony Wars - Vengeance/SLES-01408.bin
Binary file not shown.
Binary file added pspconfigs/Colony Wars - Vengeance/SLUS-00722.bin
Binary file not shown.
Binary file added pspconfigs/Dino Crisis/SLES-02207.bin
Binary file not shown.
Binary file added pspconfigs/Dino Crisis/SLES-02208.bin
Binary file not shown.
Binary file added pspconfigs/Dino Crisis/SLES-02209.bin
Binary file not shown.
Binary file added pspconfigs/Dino Crisis/SLES-02210.bin
Binary file not shown.
Binary file added pspconfigs/Dino Crisis/SLES-02211.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added pspconfigs/Racing Lagoon/SLPS-02038.bin
Binary file not shown.
Binary file added pspconfigs/Road Rash/SLES-00158.bin
Binary file not shown.
Binary file added pspconfigs/Road Rash/SLPS-00243.bin
Binary file not shown.
Binary file added pspconfigs/Road Rash/SLUS-00035.bin
Binary file not shown.
Binary file added pspconfigs/Silent Bomber/SLES-02792.bin
Binary file not shown.
Binary file added pspconfigs/Silent Bomber/SLES-02989.bin
Binary file not shown.
Binary file added pspconfigs/Silent Bomber/SLES-02990.bin
Binary file not shown.
Binary file added pspconfigs/Silent Bomber/SLES-02991.bin
Binary file not shown.
Binary file added pspconfigs/Silent Bomber/SLES-02992.bin
Binary file not shown.
Binary file added pspconfigs/Silent Bomber/SLUS-00902.bin
Binary file not shown.
Binary file added pspconfigs/Silent Hill/SLES-01514.bin
Binary file not shown.
Binary file added pspconfigs/Silent Hill/SLUS-00707.bin
Binary file not shown.
Binary file added pspconfigs/Sled Storm/SLES-02194.bin
Binary file not shown.
Binary file added pspconfigs/Sled Storm/SLUS-00955.bin
Binary file not shown.
Binary file added pspconfigs/Soul Blade/SCES-00577.bin
Binary file not shown.
Binary file added pspconfigs/Soul Blade/SLUS-00240.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added pspconfigs/Vagrant Story/SLES-02754.bin
Binary file not shown.
Binary file added pspconfigs/Vagrant Story/SLES-02755.bin
Binary file not shown.
Binary file added pspconfigs/Vagrant Story/SLES-02756.bin
Binary file not shown.
Binary file added pspconfigs/Vagrant Story/SLUS-01040.bin
Binary file not shown.

0 comments on commit f2f59f7

Please sign in to comment.