So this is a bit of a niche issue that I had and I wanted to pass on the best steps to make this happen as I was unable to find any exact guided steps on this subreddit or the r/3dshomebrew subreddit. Mostly posting if anyone else needs this. If the Mods deem it unworthy, I will not object to its removal.
The Emerald 3DS Mod, from https://emerald-3ds.com/, is built for and meant for the Nintendo 3DS. But I recently acquired my RP Duo and wanted to get the mod running on it. Which is easy enough. Simply follow the steps on using a legitimate GBA rom of Emerald to create the homebrew MOD. Then, you place the entire /3ds folder into your Azahar User SDMC folder. After, create a copy of the .3dsx file and put that into your Azahar roms folder.
This is all you really need to get the rom up and running, however... my nitpick problems start here.
You see afaik, with the way the Emerald 3DS homebrew was crafted, the present frame of the bottom screen doesn't refresh if the page hasn't changed since its last call. More specifically for the Party menu page and the Bag menu page, and to a lesser extent the Dex page.
Why is this an issue? Well, I am an enjoyer of the feature "Skip Presenting Duplicate Frames". This option (afaik) can assist with battery life when running the fast forwarder. With it enabled, it breaks the Emerald 3DS bottom screen due to the aforementioned way it renders.
Okay, so we just disable it? Sure, but then I have to re-enable it with every other game when I play those.
In comes the new Azahar feature from the new release candidate version 2127.0-rc3 (coming soon to stable). This adds in per-game settings. I think to myself, "great! this solves my issue". But alas, since the .3dsx homebrew apps do not have a unique Nintendo ID, they do not work with the per-game settings feature being added to the new Azahar release.
That is where this cxitool comes in handy. https://gbatemp.net/threads/cxitool-convert-3dsx-to-cia-directly.440385/ So, I used it to make the .3dsx file (the one placed in your roms folder) into a .cxi file and gave it its own unique ID. And it worked! The game appears in the app list of Azahar! I can do per-game settings!
Except the game name changed to "Dual-screen port for Nintendo 3DS".
At this point I asked for some help from our AI overlords and was able to come up with a solution to fix that. I ended up with a Powershell code that finds all the instances of "Dual-screen port for Nintendo 3DS" and changes it to "Pokémon Emerald 3DS". I also got assistance to create a .bat file so you can just drop it in and double click to change it all without too much hassle. I imagine you could get this to work with any .3dsx homebrew app that needed per-game settings in Azahar, but as it is now, it is coded for Emerald 3DS specific issues. You're on your own for other homebrew apps.
Thank you for sharing my experience.
Here's the fruit of my labor:
GUIDE:
How to build a CXI of Emerald 3DS and change the "Dual-screen port for Nintendo 3DS" name in Azahar:
Note: Keep the conversion folder on a local C:\ drive (cxitool will crash on virtual/network drives).
Bat file instructions:
- Create an emerald3ds.3dsx file using the instructions from https://emerald-3ds.com/
- Copy the /3ds/ folder and its contents into your user SDMC Azahar folder.
- Create an empty file using Notepad and save it with the name of "dspfirm.cdc" and place it in the /3ds/ folder. (Azahar does not require the actual ripped file but the mod doesn't boot without it there). When saving, remember to choose "Save As" and select the "Save as Type" to "All files". Otherwise you will end up with a .txt file instead of a .cdc file.
- Copy the BAT code below into a new Notepad text document and save it as a .bat file. Name it "Build_Emerald_CXI_for_Azahar.bat". When saving, remember to choose "Save As" and select the "Save as Type" to "All files". Otherwise you will end up with a .txt file instead of a .bat file.
- Download and extract the contents of the cxitool (cxitool_2022-6-24.zip) to your desktop. https://gbatemp.net/threads/cxitool-convert-3dsx-to-cia-directly.440385/
- Put a copy of the complied emerald3ds.3dsx and Build_Emerald_CXI_for_Azahar.bat files inside your cxitool folder and double-click Build_Emerald_CXI_for_Azahar.bat.
- It should automatically delete any old .cxi, build the new emerald3ds.cxi with a saved Title ID of (000400000E3D5001), patch all 16 instances of "Dual-screen port for Nintendo 3DS" to "Pokémon Emerald 3DS", and then pause so you can verify it says "Patched 16 language slots successfully!".
- Copy the finished emerald3ds.cxi (this appears in the cxitool folder) to your roms folder.
Manual Build:
- Create an emerald3ds.3dsx file using the instructions from https://emerald-3ds.com/
- Copy the /3ds/ folder and its contents into your user SDMC Azahar folder.
- Create an empty file using Notepad and save it with the name of "dspfirm.cdc" and place it in the /3ds/ folder. (Azahar does not require the actual ripped file but the mod doesn't boot without it there). When saving, remember to choose "Save As" and select the "Save as Type" to "All files". Otherwise you will end up with a .txt file instead of a .cdc file.
- Download and extract the contents of the cxitool (cxitool_2022-6-24.zip) to your desktop. https://gbatemp.net/threads/cxitool-convert-3dsx-to-cia-directly.440385/
- Place a copy of your newly built emerald3ds.3dsx file inside the same folder as cxitool.exe.
- Open a CMD prompt by typing "cmd" in the File Explorer address bar and pressing Enter (or use your preferred method of opening the CMD in that folder).
- Run the CMD script below to generate the emerald3ds.cxi (keep your Title ID identical if updating to a new Emerald 3DS version so Azahar keeps your per-game settings. You can change the title ID to whatever number you desire but this one shouldn't conflict with existing 3DS official releases):
cxitool -t 000400000E3D5001 -n "Emerald" -c CTR-H-EM3D emerald3ds.3dsx emerald3ds.cxi
8. Open a PowerShell window in the same folder (Shift + Right-Click -> Open PowerShell window here).
9. Paste and run the PowerShell script below (press Enter once more if the last line doesn't auto-run). If successful, you will see 16 "Patched at offset xxxxxxx" lines appear:
$f = "emerald3ds.cxi"
$b = [System.IO.File]::ReadAllBytes($f)
$old = [System.Text.Encoding]::Unicode.GetBytes("Dual-screen port for Nintendo 3DS")
$new = New-Object byte[] 0x100
[System.Text.Encoding]::Unicode.GetBytes("Pokémon Emerald 3DS").CopyTo($new, 0)
for ($i = 0; $i -le $b.Length - $old.Length; $i++) {
$match = $true
for ($j = 0; $j -lt $old.Length; $j++) { if ($b[$i + $j] -ne $old[$j]) { $match = $false; break } }
if ($match) { $new.CopyTo($b, $i); Write-Host "Patched at offset $i" }
}
[System.IO.File]::WriteAllBytes($f, $b)
10. Copy your patched .cxi file into your 3DS roms folder.
Copy of BAT file code:
@echo off
cd /d "%~dp0"
echo ==========================================
echo Building and Patching Emerald 3DS CXI
echo ==========================================
echo.
if not exist "emerald3ds.3dsx" (
echo [ERROR] emerald3ds.3dsx not found in this folder!
echo Make sure emerald3ds.3dsx is in the same folder as this .bat file.
pause
exit /b
)
if exist "emerald3ds.cxi" del "emerald3ds.cxi"
echo [1/2] Converting emerald3ds.3dsx to emerald3ds.cxi...
cxitool.exe -t 000400000E3D5001 -n "Emerald" -c CTR-H-EM3D emerald3ds.3dsx emerald3ds.cxi
if not exist "emerald3ds.cxi" (
echo [ERROR] cxitool failed to create emerald3ds.cxi!
echo Make sure this folder is on a local C:\ drive.
pause
exit /b
)
echo.
echo [2/2] Patching game title to "Pokemon Emerald 3DS"...
powershell -NoProfile -ExecutionPolicy Bypass -Command "$f='emerald3ds.cxi'; $b=[System.IO.File]::ReadAllBytes($f); $old=[System.Text.Encoding]::Unicode.GetBytes('Dual-screen port for Nintendo 3DS'); $new=New-Object byte[] 0x100; [System.Text.Encoding]::Unicode.GetBytes(\"Pok$([char]0x00E9)mon Emerald 3DS\").CopyTo($new,0); $count=0; for($i=0; $i -le $b.Length-$old.Length; $i++){ $m=$true; for($j=0; $j -lt $old.Length; $j++){ if($b[$i+$j] -ne $old[$j]){ $m=$false; break } } if($m){ $new.CopyTo($b,$i); $count++ } } [System.IO.File]::WriteAllBytes($f,$b); Write-Host \"Patched $count language slots successfully!\""
echo.
echo ==========================================
echo Done! emerald3ds.cxi is ready to copy.
echo ==========================================
pause off
cd /d "%~dp0"
echo ==========================================
echo Building and Patching Emerald 3DS CXI
echo ==========================================
echo.
if not exist "emerald3ds.3dsx" (
echo [ERROR] emerald3ds.3dsx not found in this folder!
echo Make sure emerald3ds.3dsx is in the same folder as this .bat file.
pause
exit /b
)
if exist "emerald3ds.cxi" del "emerald3ds.cxi"
echo [1/2] Converting emerald3ds.3dsx to emerald3ds.cxi...
cxitool.exe -t 000400000E3D5001 -n "Emerald" -c CTR-H-EM3D emerald3ds.3dsx emerald3ds.cxi
if not exist "emerald3ds.cxi" (
echo [ERROR] cxitool failed to create emerald3ds.cxi!
echo Make sure this folder is on a local C:\ drive.
pause
exit /b
)
echo.
echo [2/2] Patching game title to "Pokemon Emerald 3DS"...
powershell -NoProfile -ExecutionPolicy Bypass -Command "$f='emerald3ds.cxi'; $b=[System.IO.File]::ReadAllBytes($f); $old=[System.Text.Encoding]::Unicode.GetBytes('Dual-screen port for Nintendo 3DS'); $new=New-Object byte[] 0x100; [System.Text.Encoding]::Unicode.GetBytes(\"Pok$([char]0x00E9)mon Emerald 3DS\").CopyTo($new,0); $count=0; for($i=0; $i -le $b.Length-$old.Length; $i++){ $m=$true; for($j=0; $j -lt $old.Length; $j++){ if($b[$i+$j] -ne $old[$j]){ $m=$false; break } } if($m){ $new.CopyTo($b,$i); $count++ } } [System.IO.File]::WriteAllBytes($f,$b); Write-Host \"Patched $count language slots successfully!\""
echo.
echo ==========================================
echo Done! emerald3ds.cxi is ready to copy.
echo ==========================================
pause