In 2020 and 2021 numerous secret files have been leaked from Nintendo thanks to Zammis Clark. Included in these files were source code for a variety of Wii internal applications such as a Diagnostic tool known as DIAG4.
This post will cover the Low Level Wii SDK created by ATI/ArtX for the Wii/Gamecube which was included as part of the DIAG4 source code.
In order to develop the Wii Operating System (IOS) and other internal diagnostic tools (e.g DIAG4) an SDK was created to abstract the low level hardware in a C/C++ library.
In the 2021 Nintendo Leak an archive was released called DIAG4RVL.7Z, if you extract this archive and go to the path DIAG/include
In here you will find a folder for each version artx and ati.
It was used internally at Nintendo to make it easier to write hardware diagnostic tests for use in the DIAG4 tool. It was presumably also used for development of the Wii Operating System known as IOS.
The ArtX version is the original and was created for the Gamecube and used in the Diagnostics tool for Gamecube and potentially the Gamecube Operating System.
The ATI version is a fork of the ArtX version which has been updated for the Wii console.
This folder contains Gamecube header files provided by the Company ArtX, the company later changed its name to ATI during the development of the wii.
This folder is provided for use in the Gamecube DIAG tests and there is an updated version of this folder with Wii support in the ati folder.
Since most of the files in this folder have a more up to date version in the ati folder, they will not be documented here as it would be very repetitive. So check out the section on the ATI folder below instead.
For more information you can take a diff of the two folders if you are especially interested in the differences but overall it is not of much interest to most users.
This folder contains the C header files that provide low level access to the wii hardware. This library was originally written for the gamecube and then updated for the Wii, it was created by ATI (formally ArtX).
This library was not provided to third party developers in the official SDK and so was only used for internal tools and software such as the Wii Operating system known as IOS.
Most of the include files are at the top level but there are also a few sub-directories:
We have provided descriptions for the files at the root level of this folder in the table below:
File Name | Extension | Description |
---|---|---|
acr | .h | Include file for declaring ? |
aes | .h | Include file for declaring ? |
aesreg | .h | Include file for declaring a few AES pre-processor constants such as AES_BASE_REG it was written by BroadOn |
ahb | .h | Include file for declaring a few functions for accessing the AHB (Advanced High-performance Bus) bus |
ahbdbg | .h | Include file for declaring a debug AHB function called ahbdbgInit |
ai | .h | Include file for declaring a function to initialise the Audio Interface aiInit |
ar_priv | .h | Include file for declaring ARAM pre-processor constants |
aram | .h | Include file for declaring ARAM related functions such as __ARReadDMA |
arch | .h | Include file for declaring constants related to the hardware architecture it is running on ORCA/NDEV/DRIP such as BUSSPEED_DEFAULT |
args | .h | Include file for declaring ? |
assert | .h | Include file for declaring a simple assert function for debugging |
ati_usb | .h | Include file for declaring low level USB interface functions |
atidiag | .h | Include file for including lots of other header files for hardware components such as ai.h |
ax_types | .h | Include file for declaring common standard types for ArtX code such as AXint8 |
ax_ver | .h | Include file for declaring constants for the different hardware versions e.g DOLPHIN_REV_A |
axdbg | .h | Include file for declaring a few debug functions |
axmc | .h | Include file for declaring ? |
big_endian | .h | Include file for declaring macros that convert to big endian format |
boot | .h | Include file for declaring two strings BOOT_BLK and AUTOBOOT_BLK |
busclient | .h | Include file for declaring ? |
casm | .inc | |
crc | .h | Include file for declaring ? |
dbg_viai_setup | .h | Include file for declaring ? |
dbgcomm | .h | Include file for declaring |
dbgint | .h | Include file for declaring |
dcbz_basic | .h | Include file for declaring |
di | .h | Include file for declaring |
diag | .h | Include file for declaring |
diagerr | .h | Include file for declaring |
dma_basic | .h | Include file for declaring |
dolcnt | .h | Include file for declaring |
dsp | .h | Include file for declaring |
dspfix | .h | Include file for declaring |
dspmxic | .h | Include file for declaring |
dvd | .h | Include file for declaring |
dvdfs | .h | Include file for declaring |
ehci | .h | Include file for declaring |
ehci-hcd | .h | Include file for declaring |
ela | .h | Include file for declaring |
exi | .h | Include file for declaring |
eximdm | .h | Include file for declaring |
fifo | .h | Include file for declaring |
filerand | .h | Include file for declaring |
filerandom | .h | Include file for declaring |
flash | .h | Include file for declaring |
font | .h | Include file for declaring |
gecko_dma | .h | Include file for declaring |
generic | .h | Include file for declaring |
getopt | .h | Include file for declaring |
gfxbu | .h | Include file for declaring |
gfxoldbu | .h | Include file for declaring |
gpioexi | .h | Include file for declaring |
hcd | .h | Include file for declaring |
hidutil | .h | Include file for declaring |
hub | .h | Include file for declaring |
i2c | .h | Include file for declaring |
irq | .h | Include file for declaring |
lib | .h | Include file for declaring |
little_endian | .h | Include file for declaring |
lomem | .h | Include file for declaring |
mc | .h | Include file for declaring |
mem | .h | Include file for declaring |
ml | .h | Include file for declaring |
mrexi | .h | Include file for declaring |
n64cnt | .h | Include file for declaring |
ntd_regs | .h | Include file for declaring |
nvram | .h | Include file for declaring |
os | .h | Include file for declaring |
reset | .h | Include file for declaring |
sdi | .h | Include file for declaring |
serrx | .h | Include file for declaring |
sfx | .h | Include file for declaring |
sha | .h | Include file for declaring |
si | .h | Include file for declaring |
snake | .h | Include file for declaring |
standio | .h | Include file for declaring |
swab | .h | Include file for declaring |
types | .h | Include file for declaring |
usb | .h | Include file for declaring |
usb-ohci | .h | Include file for declaring |
usb_bitops | .h | Include file for declaring |
usb_input | .h | Include file for declaring |
usb_list | .h | Include file for declaring |
usb_mem | .h | Include file for declaring |
usb_other | .h | Include file for declaring |
usb_scsi | .h | Include file for declaring |
usb_spin | .h | Include file for declaring |
usb_timer | .h | Include file for declaring |
usb_wait | .h | Include file for declaring |
util | .h | Include file for declaring |
vi | .h | Include file for declaring |
vi_conexant | .h | Include file for declaring |
video | .h | Include file for declaring |
Interestingly the file arch.h mentions a platform called DRIP along with NDEV and ORCA. NDEV is the Wii development kit hardware and ORCA is the Gamecube one but not sure what DRIP is.
The file boot.h refers to two BLK files used at boot time, but not sure what they are used for:
The file generic.h is actually from the Linux Kernel (linux/byteorder_generic.h), so technically if this is linked into any distributed Wii software it could be a GPL violation.
This folder contains interfaces for direct access to PowerPC registers, including Broadway specific ones. Judging by the name of this folder it is maily for testing that the PowerPC CPU is correctly handling the different register values in tests written for DIAG4RVL.
File Name | Extension | Description |
---|---|---|
PPCArch | .h | Include file for declaring pre-processor constants for PowerPC such as IBAT4U which is a Broadway register |
model/unshared | .h | Include file for declaring a bunch of powerPX functions for getting and setting register values such as ppcHID0Set |
This folder contains a subset of the header files copied from the GX folder, basically identical copies without the gxreg.h file. No idea why these would be used instead of the standard ones under the GX folder..
Check the next section for the description of the GX files for information on them, no point in duplicating the descriptions in this section.
This folder contains C header files automatically generated from a tool called fiddle that takes in Field description language .fdl files and returns a C header file with lots of pre-processor constants.
The original fiddle files have already been documented in the Emerald leak, so if you are interested check out our page on that leak.
Nintendo Emerald Leak
For more information on the Emerald leak check out this post.
File Name | Extension | Description |
---|---|---|
ahb_fdl_defs | .h | Include file for declaring ? |
bp_reg | .h | Include file for declaring Blitting Processor details |
cp_reg | .h | Include file for declaring Command processor details |
dsp_reg | .h | Include file for declaring Digital Signal Processor details |
gen_if | .h | Include file for declaring ? |
gen_reg | .h | Include file for declaring ? |
io_reg | .h | Include file for declaring ? |
mem_reg | .h | Include file for declaring ? |
pe_misc | .h | Include file for declaring Pixel engine details |
pe_reg | .h | Include file for declaring Pixel engine register details |
pi_reg | .h | Include file for declaring Processor Interface |
ra_gen | .h | Include file for declaring ? |
ras2_tev_if | .h | Include file for declaring ? |
ras_reg | .h | Include file for declaring ? |
su_reg | .h | Include file for declaring Setup Unit details |
tev_reg | .h | Include file for declaring Texture Color Combiner details |
tx_reg | .h | Include file for declaring Texture registers |
vi_reg | .h | Include file for declaring Video Interface registers |
xf_cmds | .h | Include file for declaring XF (Transform unit) commands |
xf_mem | .h | Include file for declaring ? |
xf_state | .h | Include file for declaring ? |
xf_ucode | .h | Include file for declaring ? |
Not exactly sure what the Gamecube/Wii XF hardware is but seems to be able to read commands and microcode (ucode).
This folder contains the C-Header files used for Graphics development using the Gamecube/Wii GPU known as Flipper/Broadway.
File Name | Extension | Description |
---|---|---|
gx | .h | Include file for declaring all the Graphics related structures and functions such as GXInitTexObj |
gxfifo | .h | Include file for declaring a simulation of the Graphics FIFO pipeline in software |
gxreg | .h | Include file for declaring a simulation of the Graphics hardware Registers in software |
vertex | .h | Include file for declaring pre-processor defines related to vertices such as GXTexCoord2bv |
This folder contains the header file for the GXU library which is similar to GLU if you have ever used OpenGL, it contains Graphical utility functions for reading textures and setting up view Matrices.
File Name | Extension | Description |
---|---|---|
gxu | .h | Include file for declaring all the Utility functions provided by the GXU library |
This folder only contains one file called compiler.h which defines certain pre-processor constants based on which compiler has been used.
Compilers supported are:
The pre-processor constants defined are used for purposes such as calling conventions (AX_CDECL) or to mark certain arguments or variables as unused in the code (ATI_VARIABLE_NOT_USED).
This folder contains miscellaneous files related to debugging the low level hardware components, presumably this was just meant for internal use at ATI themselves.
File Name | Extension | Description |
---|---|---|
common | .h | Include file for including all the other files in the private folder |
fdl_assert | .h | Include file for declaring the FDL_ASSERT macro |
gxdebug | .h | Include file for declaring a few pre-processor based Graphic Debug functions such as DbgPrintf |
gxreg | .h | Include file for declaring low level graphics hardware debug functions such as GXWriteXFRegs |
gxtypes | .h | Include file for declaring useful graphical stuctures and functions such as __GXTexRegionInt_struct |