Main » Ace Attorney » AAT Patch Tool

AAT Patch Tool

Written by: Dant Created: May 01, 2017 Updated: August 18, 2022

AAT Patch Tool allows to install all sorts of modifications on Ace Attorney Trilogy for Nintendo 3DS. AAT Patch Tool also makes it possible to change the in-game music.

It is highly advised to read this manual before attempting any changes.

General information

AAT Patch Tool allows you to install all sorts of patches (mods) on Ace Attorney Trilogy for Nintendo 3DS. It also makes possible to change the in-game music in all three games.

In order to install patches you will need a decrypted ROM of the game. If the input ROM is decrypted, a message will appear in the console. A tutorial on how to dump a ROM could be found here. A tutorial on how to decrypt a ROM could be found below.

In order to run modified ROMs you will need a Nintendo 3DS with a custom firmware (CFW). Sky3DS should theoretically work, but it has not been tested. Modified ROMs also work with the Citra emulator.

The partition containing AAT Patch Tool has to have 5Gb of free HDD space.

Make a ROM backup before applying any patches in case anything goes wrong.

AAT Patch Tool has not been thoroughly tested, so it might contain some bugs.

Patch information

The program already has one patch that allows you to change the voice-over (undub) in all three games. The other patches can be found here.

After downloading a patch archive, unpack it to any place you like, and then copy its content (folder) to *path to AATPatchTool.exe*\patch.

Some patches are region-locked (particularly, translation patches). There are also region-free patches (mostly music mods);

Patch designations:
  • [T-XXX] (XXX denotes language) — translation patch;
  • [Music] — music modification;
  • [VO] — voice-over;
  • [Graphics] — graphics modification;

Supported ROM formats

AAT Patch Tool accepts the following ROM formats as input:

  • .3dsSky3DS flash-carts, Citra;
  • .cia — Custom Firmware (CFW), some Citra builds; Citra;
  • .cxi — a pure ROM that contains only the game, Citra;

The following formats are supported for output:

  • .3ds — only if the input ROM format is .3ds;
  • .cia — available for all input formats;
  • .cxi — available for all input formats;

AAT Patch Tool has only partial support for .3ds format. Proper work is not guaranteed. After applying a patch to a .3ds ROM its size will increase to 512mb (3dstool bug?).

How to decrypt Nintendo 3DS ROM

Recently the process of decrypting Nintendo 3DS ROMs became much simpler, and now it can be done on a PC — there is no need to use a console anymore. Supported ROM formats: .3ds, .cia. All credits go to b2071988 from romshepherd.com.

1. Download the following archive (mirror), then unpack it anywhere you want.
2. Copy the encrypted ROM to the folder "decrypt_v2".
3. Drag&Drop the encrypted ROM onto "decrypt.exe" to engage the decryption process. After the job is done, at least two new files will appear in the same folder:
rom_name.0.ncch — a CXI ROM that contains only the game;
rom_name.1.ncch — user manual;
4. Change the "rom_name.0.ncch" extension from .ncch to .cxi or otherwise it will not be visible in AAT Patch Tool.

How to install patches

1. Step 1: Original ROM: Specify the path to the old ROM. The ROM format could be changed in "File Format" at the bottom of the dialog. If the input ROM is encrypted, an appropriate message will appear in the console on the right. If the old ROM is decrypted, its Product Code and region will appear in the console.
2. Step 2: New ROM: Specify the path to the new ROM. The output ROM format could be set in "File Format" at the bottom of the dialog.
3. Step 3: Patch: choose which mod you want to install. After selecting a patch its description will appear in "Patch Description" on the right. If the patch has a voice-over, the "Character voice-over" box will become enabled. Note: the patch list will contain mods that match the old ROM region. For example, if you have a EUR ROM, the list will only contain the EUR and region-free patches.
4. Character voice-over (optional): select an appropriate voice-over. This box is enabled only if the patch has the necessary files, otherwise it is disabled.
5. Change Music (optional): a detailed description on how to use this feature could be found in section 5.
6. At the end press "Install". The installation process will be displayed in the console. It will take some time, depending on your HDD performance. If an error occurs, you will see a message in the console. If the installation is successful, the following message will appear in the console:
"Patch has been installed. ROM saved to [*new ROM path*]".

General information about music mods

AAT Patch Tool allows you to change the in-game music and to add new tracks through mods.

If the input ROM is decrypted and output ROM is specified, the "Change Music" button becomes active. Upon pressing it you will see a new window with all the chosen tracks listed in a table. Columns denote games, rows - tracks. Each track contains a year in its title. It corresponds to the year that is specified in the title of each game and to the official Gyakuten Saiban OSTs (since OSTs were never released outside Japan, the English titles are unofficial).

In order to change the track, highlight it with the mouse. An arrow will appear at the right side of the box. By pressing it you will reveal a drop down list containing all the available tracks.

Note: Ace Attorney 2 and Ace Attorney 3 share the same track for "Logic and Trick".

The menu contains two options:

Show same style tracks: if this box is checked, the drop down list will contain only the tracks corresponding to the row title at the left. If it is unchecked the drop down list will contain all available tracks. This option does not affect the drop down list in "Main Menu Theme"

Apply changes to the old ROM instead: If this box is checked, upon pressing the 'Save' button, any changes made to the current track list will be written directly to the old ROM. In this case, there is no need to press the "Install" button. Warning: If you are about to install the patch that adds new music, do not tick this box, otherwise the new ROM will not work.

How to change default music

Note: you can change the music even if the "patch" folder does not contain any patches.

1. Specify the path to the old ROM.
2. Specify the path to the new ROM.
3. In "Step 3" choose "None" or any patch that does not add new music tracks.
4. Press "Change Music" and change the music as you like. You can tick the "Apply changes to the old ROM instead" box - after pressing "Save" all the track list changes will be applied to the old ROM. If you want to leave the old ROM as is, do not tick it and proceed to the next step.
5. After everything is done press "Save", then "Install" and wait until the installation is finished.

How to install music mods

Warning: music mods add new files to the ROM and increase its size. It is not possible to delete them with AAT Patch Tool, so always make a backup before applying any patches.

Note: Music mods are denoted as [Music].

1. Specify the path to the old ROM.
2. Specify the path to the new ROM.
3. In "Step 3" choose any music mod. I'll use the "Ace Attorney 4 Suite v.1.0 [Music]" mod as an example. The new tracks to be added are listed in the patch description.
4. Press "Change Music" and change the music as you want. In this example new tracks will look like this - [new track title] 2007 (Courtroom Lounge 2007, Court Begins 2007, etc).
Warning: if the patch is installed for the first time do not tick the "Apply changes to the old ROM instead" box, otherwise the new ROM will not work.
5. After everything is done press "Save", then "Install" and wait until the installation is finished.

How to change already installed music

Let's assume that the old ROM already has the "Ace Attorney 4 Suite v.1.0 [Music]" mod from the previous section applied to it, and we want to change its track list.

1. Specify the path to the ROM that has been created in the previous section.
2. Specify the path to the new ROM.
3. In "Step 3" choose the "Ace Attorney 4 Suite v.1.0 [Music]" mod. If you choose some other patch, the new tracks will not be properly displayed in the "Change Music" menu. They will have BGMXXX as their title (where XXX is a number).
4. Press "Change Music". The track list will show all the changes that you made. Once again change the music as you want. This time it is OK to check the "Apply changes to the old ROM instead" box, since the old ROM already has the new tracks from this patch.
5. After everything is done press "Save". You don't have to press "Install" if the "Apply changes to the old ROM instead" box was checked. Otherwise, press it and wait until the installation is finished.

How to install another music mod onto same ROM

You can apply several music mods on the same ROM. In this case, the installation steps are the same as in section 7 "How to install music mods". The only difference is that the tracks that were added by other patches will not be properly displayed in the "Change Music" menu. They will have BGMXXX as their title (where XXX is a number). They will work as long as you do not change them.

How to create custom music mods

In order to create your own music mod you will need a tool called BrawlCrate and any audio editor of your liking. In this guide I will use Audacity which comes completely free of charge. Before we start you need to understand how looped music is stored in the game.

A looped track is a single continuous stream that contains two offsets - a Loop Start and Loop End. The game starts playing the track from the start of the file, and when it reaches the Loop End offset it seamlessly jumps to the Loop Start offset, making the playback infinite. Since the game always exits the loop by fading the playback out, the looped tracks do not contain an outro - a segment that follows the loop segment. Thus the Loop End offset always points to the end of the file.

AAT Patch Tool allows to replace only a limited number of themes - the main court suite and two investigation tracks. However you can add as many tracks as you want for a given theme. In other words, your patch may contain as many Objection, Pursuit, etc tracks to choose from as you want. Also, you do not necessary have to add music for every theme - you may add replacements for just one or several themes.

1. Open your audio editor and load the audio file you want to convert for use in the game.
2. Switch the timecode/timeline of your editor into the "Sample" mode. In Audacity those options are found at the bottom of the editor's window:
3. Now comes the trickiest part: you have to find (or make) the loop segment. If you are using tracks from other games in the series, it wouldn't be hard, since they already have loops - you just have to find where they start and end. But if you are working with something like orchestrated music, you would have to go extra mile to create a loop. In the end you will need to find such a segment, which, when looped, will play back seamlessly without any noticeable gaps or distortions.

First start by playing the audio several times. Try to detected by ear which part of the track contains a repeating pattern. Then make a ballpark selection by holding the left mouse button. Press Ctrl+B to create a Label Track (it will appear below your main music track). The label selection has knobs - dragging them will change its boundaries (you have to place the cursor at "arrows" rather then "points" to be able to move the boundaries around). To reselect the selection again press Alt+Left/Right. To playback the selection in loop mode press Shift+Space. To take a closer look at the audio wave press Ctrl+1 to zoom in and Ctrl+3 to zoom out.

At the end of this this step you need to have a selection that produces a perfect loop segment:
4. Most likely your loop segment will contain extra audio on its right side. Since the game never uses it, we can safely delete it. To remove it, place the cursor at the right bound of your loop - a vertical yellow line should appear (it means you are over the loop boundary). Click on it with the left mouse button and then press Ctrl+I - the track will be split into two parts. Double click on the right part and press the Delete button on the keyboard.
5. (This step is optional, but if you do not hear any audio after installing your patch, try it out.) Reduce the frequency of your track to 32728hz. Go to Tracks - Resample and input 32728.
6. Save your audio as WAV file (File - Export - Export as WAV), but do not close the audio editor yet.
7. Launch BrawlCrate and go to File - New - BRSTM Audio Stream, then select the WAV file you have created in the previous step - a Brstm Import window will appear:
8. If you have removed the extra audio part, you will only need to set the Loop Start offset - the Loop End offset will be automatically set up by the tool. Reopen Audacity and click on the start of your loop (its leftmost boundary). The Audio Position at the bottom will indicate the current sample position - input this value into the Loop Start field and then press Enter. To confirm your loop works as intended, tick the Loop checkbox and playback your track. If you are satisfied with the results, move to the next step, otherwise readjust your loop settings in the audio editor or Brstm Import window.
9. In the Brstm Import window press the OK button, wait for the encoding process to finish, then go to File - Save as and save the file as bcstm audio.
10. If you have other tracks you want to insert into the game, convert them the same way you did the first one. When you have all the files you want to add in bcstm format, proceed to the next step.
11. Create a folder on your hard drive - it will contain your future patch. Give it some meaningful description, for example Ace Attorney 6 Suite [Music]. Make sure to put [Music] at the end of the name.
12. Inside your new patch folder create a folder called romfs. Inside the romfs folder create a folder called sound. Inside the sound folder create a folder called stream. Eventually you should end up with the following folder structure: <patch folder>/romfs/sound/stream/
13. Download the English.dsc file and put it into your patch folder. Open it with any text editor and fill the Title and Description fields. Leave the Region field empty. If you want to add support for another language, make a copy of English.dsc, rename it into whatever language you want and fill the aforementioned fields.
14. Download the Tracklist.tls file and put it into your patch folder. Open it with any text editor.
15. At the top of Tracklist.tls you will find this line:

TrackCount:35

Change its value by adding the total number of your bcstm files to it. For example, if you have 8 bcstm files in total, add 8 to 35 to get:

TrackCount:43
16. Now you have to specify every track that you will include into your patch. As you can see all the tracks are grouped by themes (a small snippet of what you will see in Tracklist.tls):

BGM008:"Courtroom Lounge 2001":1
BGM077:"Courtroom Lounge 2002":1
BGM117:"Courtroom Lounge 2004":1

BGM013:"Court Begins 2001":2
BGM069:"Court Begins 2002":2
BGM118:"Court Begins 2004":2


Each track is comprised of three fields: the first one is BGM index, the second one is Track Name that will be shown in the Change Music editor of AAT Patch Tool, and the third one is Group Index which allows AAT Patch Tool to group tracks according to themes (if you have ticked the appropriate checkbox in the Change Music editor).

Let's say you want to add a new "Courtroom Lounge" theme. To do this, copy one of the existing "Courtroom Lounge" lines and add it at the bottom of the group, then rename it however you see fit (make sure the quotes are present on either side):

BGM008:"Courtroom Lounge 2001":1
BGM077:"Courtroom Lounge 2002":1
BGM117:"Courtroom Lounge 2004":1
BGM117:"Khura'in Courtroom Lounge 2016":1


Now you have to give your track a unique BGM index. There are two ranges which you can use. The first starts from BGM157 and ends at BGM199. The second range starts at BGM201 and most likely ends at BGM999 or even higher (BGM200 is used by the "Main Menu" theme). Those indices are what makes it possible to have several music patches installed into the same ROM. As of now there are three music patches available at this site. They use the BGM157 - BGM192 range. If you want to make your patch compatible with those patches, or if you plan to make your patch publicly available, use ranges BGM201 - BGM999, otherwise index your tracks starting from BGM157 (but do not use BGM200). In the end it doesn't matter what range you use - the most important thing is that each track you add must have a unique index. An example of what you might have if you add three new tracks:

BGM008:"Courtroom Lounge 2001":1
BGM077:"Courtroom Lounge 2002":1
BGM117:"Courtroom Lounge 2004":1
BGM201:"Khura'in Courtroom Lounge 2016":1

BGM008:"Court Begins 2001":2
BGM077:"Court Begins 2002":2
BGM117:"Court Begins 2004":2
BGM202:"Court Begins 2016":2
BGM203:"Court Begins Abroad 2016":2

17. After this you need to rename all your bcstm files according to their BGM index you set in Tracklist.tls. In the example above "Khura'in Courtroom Lounge 2016" was given index BGM201, so its track file should be named BGM201.dspadpcm.bcstm, "Court Begins 2016" should be named BGM202.dspadpcm.bcstm and "Court Begins Abroad 2016" - BGM203.dspadpcm.bcstm.
18. Move all your renamed bcstm files into the <patch folder>/romfs/sound/stream/ folder.
19. If you are going to make you patch public, create a readme.txt file, fill it with some description and put it into your patch folder.
20. Move your patch folder into the <AAT Patch Tool folder>/patch/ folder and try it out. Reassign the tracks in the Change Music editor and install the patch. If everything was done right, you will hear your new tracks in the game.

How to translate AAT Patch Tool

The "lang" folder contains language files. Make a copy of English.lng and rename it to your language (for example, Deutsch.lng) - you can use language specific symbols, since AAT Patch Tool supports unicode.
Then open the new file in any text editor and translate all the strings.

You can then switch the language using "Language interface" drop down list.

Credits

  • AAT Patch Tool — Dant

Uses TntWare Delphi Unicode Controls
Copyright (c) 2002-2007, Troy Wolbrink (www.tntware.com)

External tools:

  • CtrTool — Neimod & 3DSGuy
  • Makerom — 3DSGuy
  • 3dstool — dnasdw & QuChao
  • xdelta — jmacd

Version History

AAT Patch Tool v.0.7.1

  • Now the program will properly work with file paths that contain a space character;
  • Changed 'Old MD5' and 'New MD5' console messages to 'Orig MD5' and 'This MD5' respectively;
  • Other small fixes;

AAT Patch Tool v.0.7.0

  • Initial release;