Add shared cheats and target discovery tools#83
Merged
Conversation
|
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds a shared cheat system to
native32emu-coreand exposes it through both supported frontends: standalone CLI rules and RetroArch's emulator-handled cheat interface. The PR also adds standalone-only target discovery/filtering tools, verifies game-specific codes for EBBLADE, EGUNFIRE, EMETAL, and ESTORM, and reorganizes the frontend documentation around complete standalone and RetroArch guides.Implementation
Shared cheat engine
CheatManager, indexed cheat slots, rule parsing, enable/disable state, reset behavior, and per-frame application innative32emu-core.var:<name>=<value>for VM variables.sprite:<name>.<field>=<value>andmovie:<name>.<field>=<value>forx,y,depth,frame,visible, andplaying.frame:goto=<n>for main-timeline jumps.frame:playing=<bool>for main-timeline play/pause state.1/0,true/false,on/off, andyes/nofor boolean fields.Standalone integration
--cheat <RULE>arguments.--debug-cheatsto periodically list the current timeline, VM variables, and sprite targets.--cheat-debug-interval <N>with a default interval of 30 frames.--cheat-debug-filter <GLOB>to filter variable names with case-sensitive*and?matching, for examplep_*.RetroArch integration
retro_cheat_setwith indexed slots and enabled state.retro_cheat_resetto clear all core-managed cheats.Target discovery
Verified game codes
EBBLADE (Blades of Red / 赤刃) was tested with player-variable filtering.
p_hpwas observed dropping from 96 to 88 after damage, then remaining at 96 when this rule was enabled:EGUNFIRE (Gun Fire / 枪火) was tested by directly loading
NA32SSL/ENGLISH/GUNFIRE/GUNF1.SSLfor target discovery.he_lwas observed dropping from 104 to 100 without cheats, then remaining at 104 through 720 ticks when this rule was enabled:The score rule was also verified through debug output and displayed score sprites:
EMETAL (Metal Storm / 钢铁风暴) target discovery found
pl_hpinNA32SSL/ENGLISH/METAL/MSPLAY10.SSL. The documented rule keeps the player health variable at its observed maximum:ESTORM (Storm / 风暴之翼) was tested through
NA32SSL/ENGLISH/STORM/STPLAY10.SSL. Target discovery identified player health, lives, bombs, and score variables; the enabled rules kept these values fixed through the verification run:The verified codes are recorded in
docs/Cheat-Codes.md. Cheat codes are shared by the standalone emulator and RetroArch core; only target discovery is standalone-only.Documentation
docs/Standalone-Emulator.mddocs/RetroArch-Core.mddocs/Cheat-Codes.mdfocused on verified codes grouped by game for future expansion.Validation
cargo test --allcargo clippy -- -D warningscargo fmt -- --checkcargo check -p native32emucargo check -p native32emu-libretrocargo run -p native32emu -- --helpvar:p_hp=96lock verificationvar:he_l=104lock verification, andvar:he_score=999999score verificationvar:pl_hp=60var:p_hp=9,var:p_life=9,var:p_bomb=9,var:p_score=999999verification