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

USIO: Save Game Settings - Full Implementation (Supplement to #12686) #12714

Merged
merged 1 commit into from
Sep 28, 2022
Merged

USIO: Save Game Settings - Full Implementation (Supplement to #12686) #12714

merged 1 commit into from
Sep 28, 2022

Conversation

brian218
Copy link
Contributor

This PR implemented permanent USIO game data saving, serving as a supplement to #12686.

rpcs3/Emu/Io/usio.cpp Outdated Show resolved Hide resolved
rpcs3/Emu/Io/usio.cpp Outdated Show resolved Hide resolved
rpcs3/Emu/Io/usio.cpp Outdated Show resolved Hide resolved
rpcs3/Emu/Io/usio.cpp Outdated Show resolved Hide resolved
rpcs3/Emu/Io/usio.cpp Outdated Show resolved Hide resolved
@Nekotekina
Copy link
Member

I suppose it should be written to file immediately once any changes are made

@brian218
Copy link
Contributor Author

I suppose it should be written to file immediately once any changes are made

Wouldn't this cause performance compromise during the game?
The game writes data to these two buffers (backup_memory and last_game_status) frequently no matter whether a change is made by a player.

@RipleyTom
Copy link
Contributor

I suppose it should be written to file immediately once any changes are made

Wouldn't this cause performance compromise during the game? The game writes data to these two buffers (backup_memory and last_game_status) frequently no matter whether a change is made by a player.

You could just compare size and content and if it changes write to file?

@brian218
Copy link
Contributor Author

brian218 commented Sep 28, 2022

I suppose it should be written to file immediately once any changes are made

Wouldn't this cause performance compromise during the game? The game writes data to these two buffers (backup_memory and last_game_status) frequently no matter whether a change is made by a player.

You could just compare size and content and if it changes write to file?

@RipleyTom The sizes of backup_memory(0xB8) and last_game_status(0x28) are constant, so the total size is always 0xE0(0xB8 + 0x28).
We cannot discriminate changes by comparing their sizes.

As for the content, since a timestamp is included, the game changes the content and writes it to the endpoints frequently.

@Nekotekina
Copy link
Member

Hmm, perhaps a memory mapped file can be used as an alternative.

@brian218
Copy link
Contributor Author

Hmm, perhaps a memory mapped file can be used as an alternative.

@Nekotekina Could you suggest an example? Thank you.
By the way, if frequent writing to the backup file won't compromise the performance during the game, I can of course make it write changes to the backup file each time any change is made by the game.

@elad335
Copy link
Contributor

elad335 commented Sep 28, 2022

File writes can be async if this function changes content so frequently.

@Nekotekina
Copy link
Member

Actually nevermind, it would need quite a bit of work. I can implement it later. PR can be merged as is.

@brian218
Copy link
Contributor Author

Actually nevermind, it would need quite a bit of work. I can implement it later. PR can be merged as is.

@Nekotekina Thanks!

@Nekotekina Nekotekina merged commit 926496b into RPCS3:master Sep 28, 2022
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.

4 participants