Skip to content

cellSaveData improvements #5792

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

Merged
11 commits merged into from
Apr 19, 2019
Merged

cellSaveData improvements #5792

11 commits merged into from
Apr 19, 2019

Conversation

knight4u32
Copy link
Contributor

@knight4u32 knight4u32 commented Apr 5, 2019

  • Write vblank semaphore.
  • Remove reader lock on current texture invalidation task check for every instruction RSX FIFO, replace it with optimistic check instead (optimistic that it won't lock).
  • Fix a few verification failures with sys_lwcond/mutex HLE while closing the emulator. (regarding mutex state)
  • Fix race on ::emu_requested flip flag when native ui is activated, fixes Cars: Race-O-Rama - Cannot load game saves #5458.
  • Reschedule in cellMsgDialogOpen2.
  • Fix sys_spu group id base and step.

SaveData fixes:

@@ -459,6 +459,7 @@ error_code sys_rsx_context_attribute(s32 context_id, u32 package_id, u64 a3, u64

case 0xFED: // hack: vblank command
// todo: this is wrong and should be 'second' vblank handler and freq, but since currently everything is reported as being 59.94, this should be fine
vm::_ref<u32>(render->ctxt_addr + 0x30) = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, meant to implement this at some point before vsh stuff was merged.

@knight4u32 knight4u32 force-pushed the hle_fixes branch 3 times, most recently from 52f5363 to ba34955 Compare April 5, 2019 15:50
@AniLeo AniLeo added Bugfix Enhancement Firmware: HLE Savedata Anything that involves cellSaveData labels Apr 5, 2019
@AniLeo
Copy link
Member

AniLeo commented Apr 5, 2019

Fixes LOTR: Conquest savedata regression, and it no longer complains about current savedata being corrupted when loading it.

@uaqlover
Copy link

uaqlover commented Apr 9, 2019

@elad335 with your pr i test it Cars: Race-O-Rama #5458 still Cannot load game saves

here the video

https://drive.google.com/file/d/1htp_JVeL0F3Mimn19DEkzFKpBqkqfU4y/view?usp=sharing

and log file

RPCS3 cars.log.gz

@knight4u32
Copy link
Contributor Author

ah I see, atleast you can start a new save now.

reader_lock lock(m_mtx_task);

if (m_invalidated_memory_range.valid())
if (atomic_storage<u32>::load(m_invalidated_memory_range.end) != 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Missed this one.

@knight4u32 knight4u32 force-pushed the hle_fixes branch 2 times, most recently from 71d166d to 2d17801 Compare April 9, 2019 20:35
@CesarAxe
Copy link

CesarAxe commented Apr 9, 2019

This PR fix the problem when loading the saved data in SAW 2 when native ui option is enabled.

@knight4u32 knight4u32 force-pushed the hle_fixes branch 2 times, most recently from 70ba944 to 935fcfc Compare April 12, 2019 09:49
@ghost
Copy link

ghost commented Apr 16, 2019

STOP 1 has nothing to do with STOP 0 hack. It's an instruction for disgaea patches.

In general, I'm against merging last 2 commits (regarding sys_spu_thread_group_terminate and STOP hack removal). There is an order in doing things like hack removal and I don't see an explicit problem with them being as is.

@AniLeo
Copy link
Member

AniLeo commented Apr 16, 2019

Is everything else ok? I suggest moving the other two commits to a newer PR then for further discussion and merging the rest as is, the savedata fixes are well needed

Use optimistic double check instead, use one load instruction for the check to be atomic

+ Read emu status once every FIFO iteration
Fixes a few verification failures while closing the emulator with HLE liblv2
TODO: There are probably more spots where we should yield.
A little more at the start because PacketRead is called twice.
Dont use sys_timer_usleep because it will just call this_thread::yield() repeatedly.
* Check directory existence if setParam is NULL (dont create directory)
* Fix mask for reCreateMode
* Check a few setParam fields including reserved buffers.
* Fix sizeKb when the dir is empty except from PARAM.SFO
* Fix error checking when CELL_SAVEDATA_RECREATE_YES is specified but setParam is NULL (Doesnt do anything, simply errors)
@AniLeo AniLeo requested a review from a user April 17, 2019 00:28
@ghost ghost merged commit ae5a4b6 into RPCS3:master Apr 19, 2019
{
rsx->sync_point_request = true;
const u32 addr = get_address(method_registers.semaphore_offset_406e(), method_registers.semaphore_context_dma_406e());
if (vm::read32(addr) == arg) return;

#ifdef IS_LE_MACHINE
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to complain... That's not a sort of loop to benefit from removing one 1-cycle byteswap op, especially with so much code madness.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants