Difference between revisions of "3DS Virtual Console"

From 3dbrew
Jump to navigation Jump to search
m (→‎Footer: added magic)
Line 19: Line 19:
  
 
=GBA VC=
 
=GBA VC=
GBA VC is run by [[FIRM|AGB_FIRM]]. RomFS isn't used for GBA VC titles, but can be found empty within GBA VC titles. The NCCH [[ExeFS]] contains the same files as a normal application. The [[ExeFS]]:/.code contains the GBA VC ROM followed by a 0x360 footer.
+
GBA VC is run by [[FIRM|AGB_FIRM]]. RomFS isn't used for GBA VC titles, but can be found empty within GBA VC titles. The NCCH [[ExeFS]] contains the same files as a normal application. The [[ExeFS]]:/.code contains the GBA VC ROM followed by a 0x360 byte long footer.
  
 
===Footer===
 
===Footer===
All values in the GBA VC Footer are Little Endian.
+
All values in the GBA VC footer are little-endian.
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 34: Line 34:
 
|-
 
|-
 
| 0x008
 
| 0x008
| 0x2
+
| 0x4
| Unknown
+
| Save type (see below)
 +
|-
 +
| 0x020
 +
| 0x1
 +
| Manufacturer info select (see below)
 
|-
 
|-
| 0x02A
+
| 0x024
| 0x2FA
+
| 0x300
| Unknown
+
| Unknown, three different types of this data have been observed.
 
|-
 
|-
 
| 0x338
 
| 0x338
Line 55: Line 59:
 
| 0x35A
 
| 0x35A
 
| 0x2
 
| 0x2
| GBA ROM Filesize per MB
+
| High two bytes of GBA ROM file size
 
|}
 
|}
 +
 +
Save types:
 +
* EEPROM (various sizes, IDs specified in footer): 0x2
 +
* SRAM/FRAM (128k): 0xE
 +
* Flash (512k): 0x9
 +
 +
Support for RTC and 1m-flash chips is not implemented in AGB_FIRM.
 +
 +
Manufacturer info:
 +
GBA games' SDK-provided save code only supports a range of manufacturers from which Nintendo was buying memory from around the time of that game's development. As such, most games don't support a generic emulated storage chip. This byte appears to select a manufacturer info set to emulate. This has been observed to be 0x90, 0xC0, and (in one EEPROM-based game), 0x80.
 +
* SRAM games up to and including V111 use 0xC0. Above use 0x90.
 +
* FRAM V103 uses 0xC0. V104+ don't exist, and lower versions also likely use 0xC0.
 +
* Flash V124 was observed 0x90, V131 was observed 0xC0.
 +
* EEPROM-based games vary wildly, since they can likely specify chip info in the 0x10-region of the footer.

Revision as of 06:44, 2 June 2015

There's two types of VC titles: regular VC titles, and dedicated GBA VC titles.

Regular VC

Regular VC titles: an emulator application + VC ROM in the NCCH RomFS(among other things in the RomFS). The emulator build includes support for all supported VC platforms, not specific to just the included ROM platform.

This emulator includes GBA support, however the GBA emulation for this this is somewhat slow. This was presumably implemented before AGB_FIRM was.

Unlike Wii VC, the 3DS VC ROMs for NES use the "TNES" header.

RomFS

  • "rom:/rom/" This directory contains the ROM file(s). Filenames used under here don't matter: the filename is determined by the emulator app by doing a directory read.
  • "rom:/shaders/" This directory contains GPU shaders used by the emulator app: .shbin, .csdr, and .obj.
  • "rom:/VCM/" This directory contains graphics, audio, and text used by the emulator app.
  • "rom:/agb.bin" GBA BIOS.
  • "rom:/buildtime.txt" Emulator app build timestamp.
  • "rom:/config.ini" Emulator configuration .ini, contains sections for all supported 3DS VC platforms.
  • "rom:/<rom_name>.patch" rom_name = filename from the rom directory. This .ini contains patches for the ROM.
  • "rom:/shader.shbin" GPU shader.

GBA VC

GBA VC is run by AGB_FIRM. RomFS isn't used for GBA VC titles, but can be found empty within GBA VC titles. The NCCH ExeFS contains the same files as a normal application. The ExeFS:/.code contains the GBA VC ROM followed by a 0x360 byte long footer.

Footer

All values in the GBA VC footer are little-endian.

START SIZE DESCRIPTION
0x004 0x4 GBA ROM Filesize
0x008 0x4 Save type (see below)
0x020 0x1 Manufacturer info select (see below)
0x024 0x300 Unknown, three different types of this data have been observed.
0x338 0x4 GBA ROM Filesize
0x344 0x4 GBA ROM Filesize
0x350 0x4 Magic '.CAA'
0x35A 0x2 High two bytes of GBA ROM file size

Save types:

  • EEPROM (various sizes, IDs specified in footer): 0x2
  • SRAM/FRAM (128k): 0xE
  • Flash (512k): 0x9

Support for RTC and 1m-flash chips is not implemented in AGB_FIRM.

Manufacturer info: GBA games' SDK-provided save code only supports a range of manufacturers from which Nintendo was buying memory from around the time of that game's development. As such, most games don't support a generic emulated storage chip. This byte appears to select a manufacturer info set to emulate. This has been observed to be 0x90, 0xC0, and (in one EEPROM-based game), 0x80.

  • SRAM games up to and including V111 use 0xC0. Above use 0x90.
  • FRAM V103 uses 0xC0. V104+ don't exist, and lower versions also likely use 0xC0.
  • Flash V124 was observed 0x90, V131 was observed 0xC0.
  • EEPROM-based games vary wildly, since they can likely specify chip info in the 0x10-region of the footer.