diff --git a/patches/Bloodborne.xml b/patches/Bloodborne.xml index 857c7a3..29c9b12 100644 --- a/patches/Bloodborne.xml +++ b/patches/Bloodborne.xml @@ -3461,6 +3461,11 @@ + + + + + diff --git a/scripts/patches.py b/scripts/patches.py index 1e45cbe..d4fcbc0 100644 --- a/scripts/patches.py +++ b/scripts/patches.py @@ -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) diff --git a/tests/test_patches.py b/tests/test_patches.py index c447705..74c6d44 100644 --- a/tests/test_patches.py +++ b/tests/test_patches.py @@ -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('