Patches: start online at the title when online play is on

Skip Online/Offline Choice answers the title's dialog with PLAY
OFFLINE, so the game's own online session only started after Log In,
and the Kin and Bloodlust Bells stayed greyed out until then (the Linux
fork's issue #9). With online play on (BB_ONLINE=1), a variant now
answers PLAY ONLINE: the same dialog builder returns what the PLAY
ONLINE item returns (operator() at 0x1b49eb0), which differs from PLAY
OFFLINE's only in the online flag. Offline, 0.7's patch stays.
tests/test_patches.py checks both against the builder's items. From
the Linux fork.
This commit is contained in:
ayozetr committed 2026-11-01 01:01:36 +00:00
1 parent 64f7962cac
commit cfc63a6766
3 files changed
+36 -3

No files matched your search

+5
View File
@@ -3461,6 +3461,11 @@
<Line Type="bytes" Address="0x01f39030" Value="554889e5534883ec184889fb488d05ed2d80034889042448897424084889e6e87c0c01004889d84883c4185b5dc3"/>
</PatchList>
</Metadata>
<Metadata Title="Bloodborne" Name="Skip Online/Offline Choice: Online" Author="bbport" Note="As Skip Online/Offline Choice, with PLAY ONLINE: the dialog builder returns what its PLAY ONLINE item returns (operator() at 0x1b49eb0, item functor vtable 0x533be80), which differs from PLAY OFFLINE's only in the online flag it passes on (1, not 0). The game then starts its online session at the title as on a PS4, without Log In. Used when online play is on." PatchVer="1.0" AppVer="01.09" AppElf="eboot.bin" isEnabled="false">
<PatchList>
<Line Type="bytes" Address="0x01f39030" Value="554889e5534883ec184889fb488d053d2e80034889042448897424084889e6e85c0e01004889d84883c4185b5dc3"/>
</PatchList>
</Metadata>
<Metadata Title="Bloodborne" Name="Larger GX Per-Frame Command Heap" Author="bbport" Note="Each GX swap-chain command buffer gets a 1 MiB per-frame heap instead of 256 KiB, covering the unchecked NULL command allocations at guest 0x2199310 and 0x21d5b40 (#162, PR #224)." PatchVer="1.0" AppVer="01.09" AppElf="eboot.bin" isEnabled="false">
<PatchList>
<Line Type="bytes" Address="0x02595c0a" Value="00001000"/>
+13 -3
View File
@@ -81,8 +81,17 @@ def intel_cpu(cpuinfo='/proc/cpuinfo'):
SKIP_NETWORK_CHOICE='Skip Online/Offline Choice'
# With online play on (BB_ONLINE=1) the game starts online, as PLAY ONLINE on a PS4: offline, its
# online session only started with Log In, and the co-op bells stayed grey until then (the Linux
# fork's issue #9).
SKIP_NETWORK_CHOICE_ONLINE='Skip Online/Offline Choice: Online'
def skip_network_choice(env=os.environ):
return env.get('BB_SKIP_NETWORK_CHOICE','1')!='0'
"""The patch that answers the dialog, or None to show it."""
if env.get('BB_SKIP_NETWORK_CHOICE','1')=='0':
return None
return SKIP_NETWORK_CHOICE_ONLINE if env.get('BB_ONLINE')=='1' else SKIP_NETWORK_CHOICE
# Two per-frame GX command heaps: the game writes through NULL when a 256 KiB heap fills (#162).
@@ -519,8 +528,9 @@ def main():
names+=[n for n in effect_patches(read_settings(a.settings)) if n not in names]
if intel_tonemap_fix() and INTEL_TONEMAP not in names:
names.append(INTEL_TONEMAP)
if skip_network_choice() and SKIP_NETWORK_CHOICE not in names:
names.append(SKIP_NETWORK_CHOICE)
skip=skip_network_choice()
if skip and not {SKIP_NETWORK_CHOICE,SKIP_NETWORK_CHOICE_ONLINE}&set(names):
names.append(skip)
if gx_command_heap() and GX_COMMAND_HEAP not in names:
names.append(GX_COMMAND_HEAP)
names=validate_patch_requirements(names,a.game_dir)
+18
View File
@@ -93,6 +93,24 @@ class NativeUiTests(unittest.TestCase):
self.assertIsNone(scaled_sizes({'output_res': '1280x720', 'upscaler': 'taa', 'preset': '3'}))
class NetworkChoiceTests(unittest.TestCase):
def test_online_play_answers_play_online(self):
self.assertEqual(patches.skip_network_choice({}), patches.SKIP_NETWORK_CHOICE)
self.assertEqual(patches.skip_network_choice({'BB_ONLINE': '1'}),
patches.SKIP_NETWORK_CHOICE_ONLINE)
self.assertIsNone(patches.skip_network_choice({'BB_SKIP_NETWORK_CHOICE': '0',
'BB_ONLINE': '1'}))
(at, offline), = compile_patches(XML, [patches.SKIP_NETWORK_CHOICE], '01.09', SEGMENTS)
(at2, online), = compile_patches(XML, [patches.SKIP_NETWORK_CHOICE_ONLINE], '01.09',
SEGMENTS)
self.assertEqual(at, at2)
# The same builder: the PLAY ONLINE item's vtable (0x533be80) and operator() (0x1b49eb0).
lea = lambda code: at + 0x13 + struct.unpack_from('<i', code, 0xf)[0]
call = lambda code: at + 0x24 + struct.unpack_from('<i', code, 0x20)[0]
self.assertEqual((lea(offline), call(offline)), (0x533be30, 0x1b49cd0))
self.assertEqual((lea(online), call(online)), (0x533be80, 0x1b49eb0))
class LoadingPatchTests(unittest.TestCase):
def test_bbhost_loading_patches_on_unless_turned_off(self):
on = ['Quick Re-entry', 'Fast Run-time Deflate']