Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Add support for read-only and read-write databases. #14

Merged
merged 20 commits into from Apr 14, 2019

Conversation

root670
Copy link
Owner

@root670 root670 commented Apr 14, 2019

Originally the path to a single read/write database was set with the database setting in CheatDevicePS2.ini. If a game, cheat, or code line was created, modified, or deleted in Cheat Device, the entire database needed to be rewritten.

Now there can be a read-only database in addition to a read/write one, specified by the databaseReadOnly and databaseReadWrite settings, respectively. Cheats and codelines from the read-only database cannot be modified after being loaded. Games from the read-only database cannot be deleted or renamed either, but additional cheats can be added.

Any changes made to the in-memory database will be written to the read/write database rather than rewriting the whole database, as was the old behavior. The read-only database won't be written to by Cheat Device; it is designed to be managed outside of Cheat Device.

Originally the path to a single read/write database was set with the "database" setting. If a game, cheat, or code line was created, modified, or deleted, the entire database was rewritten.

Now there can be a read-only database in addition to a read/write one, specified by the "databaseReadOnly" and "databaseReadWrite" settings, respectively. If a game, cheat, or code line is created, modified, or deleted, it is written to the read/write database rather than rewriting the whole database. The read-only database won't be written to by CheatDevice.

Loading works, still need to implement saving only modified games/cheats to the read/write database.
Add preliminary menu awareness for read/write vs. read-only games. Idealy if a read-only game is currently highlighted in the mnu, the context menu will only have the "Add Game" and "Cancel" options. The context menus for cheats and code lines of read-only games would behave similarly.
If a cheat is read-only, its title and code lines cannot be modified. If a game is read-only, its title and read-only cheats cannot be modified. You can, however, add additional cheats.
If a game only has read-only cheats, its game title won't be written.

Draw progress bar less often.
Fix "(null)" from being written by fprintf() when a database path is NULL.
Use lookup-table to decode hex string. It seems to be a little faster than before.
…aded, add the new cheats to the existing game. Otherwise, create a new game.
This format has been made obsolete by zipped txt files.
@root670 root670 self-assigned this Apr 14, 2019
@root670 root670 merged commit 08890d0 into master Apr 14, 2019
@root670 root670 deleted the read-only-database branch April 14, 2019 22:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant