Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug console emulation #5357

Merged
merged 5 commits into from
Dec 30, 2018
Merged

Debug console emulation #5357

merged 5 commits into from
Dec 30, 2018

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Nov 21, 2018

  • Add missing 0 cases allocation granularity size flag for sys_mmapper_allocate_shared_memory_x, treat them as 1m (like sys_memory_allocate) . testcase, the testcase tries 0 flag on shared memory allocation, tries to map it with an area with 1m page flags, returns CELL_OK.

  • Fix sys_vm_memory_map address base when vsize is less than 256mb, allocate the block as 256mb in size. testcase, the testcase tries to call sys_vm_memory_map twice with 32 mb vsize, the address returned of the second map is 0x40000000. (0x32000000 on master)

  • Change total amount of memory returned with sdk version:
    I've tested this using a self file that I've changed its sdk version with an hex editor, to get the location of the sdk I've searched for the magic number of process_param_t and added 8 bytes from it.
    The results are changes spotted and tracked down between different sdk versions, I've tested this with alot more versions but when memory size didnt change, I didnt include that. I've tested sdk ranges from 0.00.000 (fake minimum) to 4.75.001 (latest). .vesrion samples were taken from http://www.psdevwiki.com/ps3/SCEI_PS3_SDK. I've set the DECR to "console mode" to fake available memory on a retail console.

This was the first attempt to fix Pirates of the Caribbean: At World's End as it tests availablle memory size and compares it with 192mb : above that it assumes its on a DECR console and can use much more memory than he can, which leads to an access violation.
Unfortunatly, this wasnt not enough, even though it was really close, work needs to be done for the memory stats to get lower enough for the test to pass successfuly. (e.g decreasing available memory size with sys_prx module loading, stack allocations etc).
So: I've started to think going with this the other way around: what if we give the same amounts of memory as the DECR gives? I've grabbed again the testcase and set the DECR to "debug tool mode", which makes the available 512mb ram of the console available to the user. In this case the memory size added to original memory size was anywhere from 192mb (0.00) to 194mb (4.75.001) so I've simply added 192mb to the total memory size and guess what, it booted like magic. Which led me to add a setting for it as mentioned below. with this setting enabled, its possible for the game to boot.

  • Add debug console emulation mode

Nothing -> Intro
image

@elad335 elad335 changed the title [Testers Needed] Debug console emulation Debug console emulation Nov 22, 2018
@elad335
Copy link
Contributor Author

elad335 commented Nov 24, 2018

Loadable -> intro

image

image

@HexyFify
Copy link
Contributor

HexyFify commented Nov 25, 2018

Correction: Ingame!
https://cdn.discordapp.com/attachments/272035812277878785/516074416623452162/unknown.png

@elad335 elad335 force-pushed the memory-accuracy branch 2 times, most recently from 8fbd345 to eefb2ac Compare December 17, 2018 03:02
Added cases 0 for allocation granularity size,
alike sys_memory_allocate, the alignment of this case is 1mb.
@AniLeo AniLeo merged commit 483ee5e into RPCS3:master Dec 30, 2018
@elad335 elad335 deleted the memory-accuracy branch December 30, 2018 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants