Skip to content

Instantly share code, notes, and snippets.

@emiyl
Last active July 11, 2024 16:12
Show Gist options
  • Save emiyl/1435ce18a6b1e0a5c2a74e15c19f4884 to your computer and use it in GitHub Desktop.
Save emiyl/1435ce18a6b1e0a5c2a74e15c19f4884 to your computer and use it in GitHub Desktop.
Phoenix Wright Trilogy Save Data Research

Save File Size

  • PC: 1,496,880 Bytes (16D730)
  • Switch: 1,492,008 Bytes (16C428)
  • No other devices have been tested

Chapters

(Tested on PC)

Game One: 0x12C4 Game Two: 0x12C5 Game Three: 0x12C6

To unlock chapters, change the first half of the byte to 0x1 to 0x5. The number you input will indicate how many chapters you've unlocked, from 1 to 5. The last half of the byte doesn't seem to change anything.

Save Games

Each save game has a date and timed starting at 0x1E4, which takes up 19 bytes and repeats for all 7 save files every 0x30 bytes. The section of the game that the save is on is stored starting at 0x210 and then also repeats every 0x30 for all save files.

Please keep in mind that you cannot use that value for changing where you are in the game, it will only affect the text when you load the game from the menu.

Actually altering where you are in the game will take time. Here's what I have so far:

Scenarios

You can somewhat skip through the game by editing the string of text that is stored at 0x26C10? Decoded to UTF-8 it looks something like GS1/scenario/sc1_1_text_u.mdt, mostly likely something stored in the games files which I'll have to take a look at.

Changing that value seemed to drop me off at unexpected points, such as halfway through a cross-examination or a conversation. I also found it's slightly awkward to be dropped in the middle of a trial where you're missing half the evidence.

Evidence

You can edit the evidence in your Court Record at 0x26D1C. Every 4 bytes there is a new entry. The remaining three bytes must be filled with zeros. (e.g. 17 00 00 00 for the Attorney's Badge)

You cannot have more than 1 of each evidence.

Values

Taken from Chapter 2 of the first game. Some or all values may be specific to this chapter only.

  • 17 Attorney's Badge
  • 18 Mia's Autopsy Report
  • 19 Maya's Memo
  • 1A Maya's Cell Phone
  • 1B Glass Shards
  • 1C The Thinker
  • 1D The Thinker
    • This one has a different description
  • 1E Receipt
    • This one has a bloody note on it
  • 1F Receipt
  • 20 Wiretap
  • 21 Bellboy's Affidavit
  • 22 Photograph (Misty Fey)
  • 23 Photograph (Redd White)
  • 24 Newspaper Clipping
  • 25 Floor plans
  • 26 May Testimony
  • 27 Mia's Autopsy Report (Vague)
  • 28 Mia's Memo
  • 29 safe
    • This is just a camera which has title "safe" and has no description
    • Not entirely sure what it is, definitely not in the game normally

Scene

You can temporarily edit the background image that displays, until you have to move a room. Tested in case 2 of game 1, the address was 0x26cf0 and gave the following results:

00 Crime scene 01 Office at day 02 Outside courtroom 03 Defence stand 04 Prosecution stand 05 Witness stand 06 Whole courtroom view 07 View of where Maya usually stands 08 Judge's seat 09 Downstairs office 0A Maya by Mia's corpse 0B Steel samurai studios? 0C More steel samurai? What's it doing in Chapter 2? 0D Rough sketch of Mia's death, used to show angles in court 0E Another angle of the scene mentioned above

I didn't test any other scenes, I imagine they will change depending on the case you're in.

Settings

Background Music Volume

Addresses

  • PC/Switch: 0x12C8
  • No other devices have been tested, assume 0x12C8 too

Values

  • 01 0% Volume
  • 02 25% Volume
  • 03 50% Volume
  • 04 75% Volume
  • 05 100% Volume

Sound Effects Volume

Addresses

  • PC/Switch: 0x12CA
  • No other devices have been tested, assume 0x12CA too

Values

  • 01 0% Volume
  • 02 25% Volume
  • 03 50% Volume
  • 04 75% Volume
  • 05 100% Volume

Text Skip

Addresses

  • PC/Switch: 0x12CC
  • No other devices have been tested, assume 0x12CC too

Values

  • 00 Off
  • 01 Single Box Skip
  • 02 Full Auto-Skip

Screen Shake

Addresses

  • PC/Switch: 0x12CE
  • No other devices have been tested, assume 0x12CE too

Values

  • 00 Off
  • 01 On

Vibration

Addresses

  • PC/Switch: 0x12D0
  • No other devices have been tested, assume 0x12D0 too

Values

  • 00 Off
  • 01 On

Text Box Transparency

Addresses

  • PC/Switch: 0x12D2
  • No other devices have been tested, assume 0x12D2 too

Values

  • 00 Off
  • 01 Low
  • 02 High

Language

Addresses

  • PC/Switch: 0x12D4
  • No other devices have been tested, assume 0x12D4 too

Values

  • 00 Japanese
  • 01 English
  • 02 French
  • 03 German
  • 04 Korean
  • 05 Chinese (Simplified)
  • 06 Chinese (Traditional)

Resolution (PC)

Addresses

  • Width: 0x12D8, 0x12D9
  • Height 0x12DC, 0x12DD

Values

  • 00 05 D0 02 1280x720
  • 40 06 84 03 1600x900
  • 80 07 34 04 1920x1080
  • 00 0A A0 05 2560x1440
  • 00 0F 70 08 3840x2160

To create a custom resolution, take your resolution (e.g. 1280x720), convert each number to hexidecimal (e.g. 05 00, 02 D0), and then flip the pair (e.g. 00 05, D0 02).

Note: The resolution must be in 16:9 aspect ratio, or the game will default back to 1280x720.

Fullscreen (PC)

Address: 12D6

Addresses

  • 00 Windowed
  • 01 Fullscreen

Vertical Sync

Address: 12E0

Values (PC)

  • 00 Off
  • 01 On

Keys (PC)

Addresses

  • Confirm: 0x12E4
    • 0x12EA also changes but I have no clue what it does?
  • Present: 0x12E8
  • Court Record: 0x12F2
  • I give up at this point because it has barely any importance and it was getting confusing and inconsistent

Values

All values can be taken from Windows Virtual-Key Codes

@WorstAquaPlayer
Copy link

Not sure if this is active anymore, but regarding the scene section, the game actually can use all the assets of the entire game the save is, that explains why you saw 2 studios scenes in chapter 2. I'm not sure if you can load another chapters evidence into the save file, but that "safe" that you found is an unused evidence leftover since the original DS release.

@lukas0x1
Copy link

lukas0x1 commented Nov 23, 2023

Composition of the most significant parts of the savefile if people still care. You can read the savefile into SystemData and edit it if you want to. Feel free to ask if anybody wants to do something with it and needs me to elaborate on anything. I know how everything works but I won't bother to do a writeup unless someone actually still cares about it.

` struct SaveData{
char time[41];
unsigned short title;
unsigned short scenario;
unsigned short in_data;
};

struct SaveSlotData{
    SaveData save_data[100]; //0 - 9 Japanese, 10 - 19 English
};

struct OpenScenarioData{
    std::byte GS1_Scenario_enable;
    std::byte GS2_Scenario_enable;
    std::byte GS3_Scenario_enable;
};

struct OptionWork{
    unsigned short bgm_value;
    unsigned short se_value;
    unsigned short skip_type;
    unsigned short shake_type;
    unsigned short vibe_type;
    unsigned short window_type;
    unsigned short language_type;
    std::byte window_mode;
    unsigned int resolution_w;
    unsigned int resolution_h;
    std::byte vsync;
    unsigned short key_config[30];
};

struct OptionWork_Android{
    unsigned short bgm_value;
    unsigned short se_value;
    unsigned short skip_type;
    unsigned short shake_type;
    unsigned short vibe_type;
    unsigned short flash_type;
    unsigned short window_type;
    unsigned short language_type;
};



struct TrophyWork{
    int message_flag[96];
};

struct ReserveWork{
    int reserve[200];
};

struct SystemData{
    int save_ver;
    SaveSlotData slot_data;
    OpenScenarioData sce_data;
    OptionWork option_work;
    TrophyWork trophy_work;
    ReserveWork reserve_work;
};

struct SystemData_Android{
    int game_ver;
    int save_ver;
    SaveSlotData slot_data;
    OpenScenarioData sce_data;
    OptionWork_Android option_work;
    TrophyWork trophy_work;
    ReserveWork reserve_work;
};`

@Counta
Copy link

Counta commented Jan 1, 2024

On Android version(v1.00.01)

Because I don’t know the English name of the game, I can only use Game 1 to represent it, and the Chinese name is also included for identification.The following content has been tested in the Simplified Chinese language game. Other languages are unknown but should be the same.

The chapter address would be 0x12C8 for Game 1(《逆转裁判 复苏的逆转》)

By analogy, Game 2(《逆转裁判 2》) is 0x12C9 and Game 3(《逆转裁判 3》) is 0x12CA.

The value of 0x12C9 cannot be 50 or greater, because an empty chapter bug will occur like this.
117f8a43f0cd87c978469b30b35168e4

The date of saved file No. 1 is located at address 00096800, and more content has not been explored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment