libretro / pcsx_rearmed

ARM optimized PCSX fork
GNU General Public License v2.0
168 stars 120 forks source link

GameShark joker (button activation) codes always evaluating as true #808

Closed vaguerant closed 11 months ago

vaguerant commented 11 months ago

PCSX-ReARMed Version

r23l 74aa9af3

Your device

Wii U

Operating System of your device

Other (consoles, etc.)

CPU architecture

Other

Issue description

It seems like joker/button activation codes, code type D4, always return true instead of returning true only when the matching buttons are being pressed.

EDIT: https://github.com/libretro/pcsx_rearmed/blob/2c843d964027089a747453afc0b07d0eac5835d9/libpcsxcore/cheat.h#L100-L117

It looks like the D4 codetype is simply not implemented in pcsx-reARMed.

Step-by-step reproduction and logs

I'm using this cheat code on Namco Museum Vol. 4 (Japan). The same code should also work on the USA release:

cheats = 1

cheat0_desc = "Hold Up While Loading to Play Assault Plus"
cheat0_code = "D4000000 1000+80010A00 0002"
cheat0_enable = true

The D4 codetype checks currently pressed buttons (0x1000 is D-pad Up) and executes the next line if it evaluates true. Address 0x80010A00 is used by Namco Museum Vol. 4 to store which revision you want to load. The game Assault in this collection has three revisions: 0 (original recipe), 1 (second ROM revision) and 2 (updated Assault Plus version). By default, the game will boot version 1. With this code, you should be able to boot version 2 by holding Up while loading the game, but instead, the code is always triggering.

  1. Boot up game, skip FMV (Start), press Start again on title screen
  2. Press D-pad Down once to navigate to Games, confirm selection (O on Japan version, X on USA)
  3. Press D-pad Up twice to highlight Assault and confirm selection

At this point, the game should boot into Assault (version 1). However, pcsx-reARMed is booting into Assault Plus (version 2) even though the Up button is not being held to force it. The same code works correctly on DuckStation.

notaz commented 11 months ago

I've added a few codes, give it a try. Duckstation has lots of "Extension opcodes" that are not listed in the wiki you linked, so unclear where they are coming from. They also look rather complicated, I'll probably leave those for someone else to implement.

notaz commented 11 months ago

As this report was for D4 specifically I consider this fixed.