Line 1:
Line 1:
−
GameCube Disc Format aka NROM(Read-only) or NR-Disc(Rewritable), based on DVD tech.
+
GameCube Disc Format aka NROM(Read-only) or NR-Disc(Recordable)
Please Note this is a work in progress doc.
Please Note this is a work in progress doc.
−
DVD Sector Scrambling(XOR) is done using Disk ID(gamecode + makercode), it is 6 bytes and of 16 Random Numbers to pick from to scramble the DVD sectors, done by the Disc Drive Firmware, it is stored on a on-chip ROM, however for the MN102 Firmware it is stored on a on-board ROM chip that stores the firmware it is 128KB
+
DVD Sector Scrambling(XOR) is done using Disk ID(8 bytes) and a Random Number by the Disk Controller Firmware, it is stored on a 128KB on-chip ROM
+
System Controller firmware uses a ROM 128KB chip.
−
Panasonic MN103S (32 bit) is the Disk Controller(ECC, Servo Control, Descramble, XADPCM Decoding)
+
Panasonic MN103S (32bit), 54MHz is the Disk Controller(ECC, EFM\EFM+, Drive IC Control, Descrambler, XADPCM Decoding)
−
Panasonic MN102H (16 bit) is the System Controller(Manager, Checks Copy protection, Handles Commands, Checks Disc Type, Etc.)
+
Panasonic MN102H (16bit), 33Mhz is the System Controller(System Manager, Copy protection, Handles Commands)
The development tools used to develop for these Panasonic microcontrollers is called Debug Factory 3, it comes with a toolchain that has compiler, linker, assembler.
The development tools used to develop for these Panasonic microcontrollers is called Debug Factory 3, it comes with a toolchain that has compiler, linker, assembler.
Line 16:
Line 17:
It's also does the BCA copy protection check.
It's also does the BCA copy protection check.
−
==Data Types==
+
== Data Types ==
u8 = unsigned char (1 byte) or string
u8 = unsigned char (1 byte) or string
−
s8 = signed char (1 byte) or string
+
s8 = signed char (1 byte)
u16 = unsigned short (2 bytes)
u16 = unsigned short (2 bytes)
s16 = signed short (2 bytes)
s16 = signed short (2 bytes)
Line 26:
Line 27:
s64 = signed long long (8 bytes)
s64 = signed long long (8 bytes)
−
==Data Frame==
+
== Data Frame ==
u32 id; // PSN(Physical Sector Number)
u32 id; // PSN(Physical Sector Number)
u16 ied; // ID Error Detection Code, CRC16
u16 ied; // ID Error Detection Code, CRC16
Line 34:
Line 35:
// 2064B
// 2064B
−
==Random Numbers==
+
== Random Number Table ==
0: 3
0: 3
1: 48
1: 48
Line 52:
Line 53:
15: 15
15: 15
−
==DiscId==
+
== DiskId ==
char gamecode[4];
char gamecode[4];
char makercode[2];
char makercode[2];
Line 62:
Line 63:
u32 magic;
u32 magic;
−
==Burst Cutting Area==
+
== Burst Cutting Area ==
// UserData(unencrypted), 64B
// UserData(unencrypted), 64B
u8 optionalInfo[52];
u8 optionalInfo[52];
Line 72:
Line 73:
u8 discNumber[3];
u8 discNumber[3];
// SecureData(unencrypted), 12B
// SecureData(unencrypted), 12B
−
u8 key[8]; // used to xor scramble the 6 sector locations data
+
u8 key[8];
u8 id[4];
u8 id[4];
// AuthenticationData(encrypted), 48B
// AuthenticationData(encrypted), 48B
Line 84:
Line 85:
};
};
−
==Disc Physical Format==
+
== Disc Physical Format ==
// Leadin Area
// Leadin Area
PhysicalFormatInfo pfi;
PhysicalFormatInfo pfi;
Line 90:
Line 91:
PhysicalFormatInfo
PhysicalFormatInfo
−
u8 reserved[6];
+
u8 reversed[6];
u8 discMagic; // value is -1.
u8 discMagic; // value is -1.
u8 discSizeMinTransferRate; // The value is fixed on 16.
u8 discSizeMinTransferRate; // The value is fixed on 16.
Line 113:
Line 114:
DataAreaAllocation dataAreaAllocation;
DataAreaAllocation dataAreaAllocation;
u8 bcaDescriptor; // The value is fixed on 128.
u8 bcaDescriptor; // The value is fixed on 128.
−
u8 reserved2[1983];
+
u8 reversed2[1983];
−
u8 reserved3[6];
+
u8 reversed3[6];
DataAreaAllocation
DataAreaAllocation
−
u8 reserved;
+
u8 reversed;
u16 startSector;
u16 startSector;
−
u8 reserved2;
+
u8 reversed2;
u16 endSector;
u16 endSector;
−
u8 reserved3[3];
+
u8 reversed3[3];
// 12 Bytes
// 12 Bytes
−
==Disc Image Format==
+
== Disc Image Format ==
BootHeader m_header;
BootHeader m_header;
BootHeaderInfo m_bi;
BootHeaderInfo m_bi;
AppLoader m_apploader;
AppLoader m_apploader;
FileSystemTable m_fst;
FileSystemTable m_fst;
−
u8* userdata; // application is stored here, including boot file
+
u8 userdata[0]; // application is stored here, including boot file
BootHeader
BootHeader
Line 149:
Line 150:
u32 junkId;
u32 junkId;
u8 unused_3[488];
u8 unused_3[488];
−
u32 apploaderSize;
+
u32 ApploaderSize;
−
u32 apploaderInit;
+
u32 ApploaderInit;
−
u32 apploaderMain;
+
u32 ApploaderMain;
−
u32 apploaderExit;
+
u32 ApploaderExit;
u8 unused_4[16];
u8 unused_4[16];
u32 bootOffset;
u32 bootOffset;
Line 158:
Line 159:
u32 fstSize;
u32 fstSize;
u32 maxFstSize;
u32 maxFstSize;
−
u32 fstAddress;
+
u32 fstAddress; // debug fstOffset
−
u32 userPos;
+
u32 userPos; // disc data offset
−
u32 userLength;
+
u32 userLength; // disc data size
u32 unused_5;
u32 unused_5;
BootHeaderInfo
BootHeaderInfo
u32 debugMonSize; // debug monitor size
u32 debugMonSize; // debug monitor size
−
u32 simMemSize; // size of simulator memory
+
u32 simMemSize; // simulator memory size
u32 argOffset;
u32 argOffset;
u32 debugFlag;
u32 debugFlag;
Line 179:
Line 180:
AppLoader
AppLoader
−
char date[16];
+
char date[16]; // date string
u32 entryAddress;
u32 entryAddress;
u32 size;
u32 size;