diff --git a/docs/GameCube Architecture - A Practical Analysis.url b/docs/GameCube Architecture - A Practical Analysis.url new file mode 100644 index 0000000..2bf6dcc --- /dev/null +++ b/docs/GameCube Architecture - A Practical Analysis.url @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=https://classic.copetti.org/writings/consoles/gamecube/ diff --git a/docs/Nintendo GameCube Programming 101.mp3 b/docs/Nintendo GameCube Programming 101.mp3 new file mode 100644 index 0000000..e3ffc41 Binary files /dev/null and b/docs/Nintendo GameCube Programming 101.mp3 differ diff --git a/docs/architecture_overview.pdf b/docs/architecture_overview.pdf new file mode 100644 index 0000000..360e207 Binary files /dev/null and b/docs/architecture_overview.pdf differ diff --git a/docs/images/gx_overview.png b/docs/images/gx_overview.png new file mode 100644 index 0000000..112cc81 Binary files /dev/null and b/docs/images/gx_overview.png differ diff --git a/docs/images/yagcd_logo.png b/docs/images/yagcd_logo.png new file mode 100644 index 0000000..453f0e7 Binary files /dev/null and b/docs/images/yagcd_logo.png differ diff --git a/docs/yet_another_gamecube_doc.html b/docs/yet_another_gamecube_doc.html new file mode 100644 index 0000000..100f2a5 --- /dev/null +++ b/docs/yet_another_gamecube_doc.html @@ -0,0 +1,37184 @@ + + + + + +
Yet Another Gamecube Documentation + + +last modified: Sat, 23 Dec 2006 22:50:31

Yet Another Gamecube Documentation
(but one that's worth printing)

+

images/yagcd_logo.png
 
+this is the result of myself pasting together various freely available +documents aswell as adding some of my own findings. have fun... additions +and corrections welcome :)

THIS IS WORK IN PROGRESS! INFORMATION CONTAINED IN THIS DOCUMENT +MAY BE MISSING, INCOMPLETE OR EVEN PLAIN WRONG! NO F****N' +WARRANTY IMPLIED! IF THE USE OF THE INFORMATION CONTAINED +HERE RESULTS IN ULTRA REALISTIC SMOKE EFFECTS, BRAIN DAMAGE OR LOSS +OF PHYSICAL AND/OR MENTAL HEALTH PLEASE DON'T COME BACK AND SAY YOU +HAVEN'T BEEN WARNED! YOU SHOULDN'T BE USING THIS IN THE FIRST PLACE!

+groepaz/hitmen (groepaz@gmx.net)
+Hitmen-Console http://www.hitmen-console.org + +

+ +Contents +

+ + +
+
index
+

+ +1  Introductional Rant

+
+If you don't know what programming a machine down to the metal is +all about, go away! no really, this document is not for you! if you +are seeking for advice on using existing solutions, such as SDKs or +libraries, you will find little to none information that is of any +use for you and you might only become frustrated by figuring out how +little you know. If you however aren't afraid of numbers and want +to dare jumping into the snake-pit of semi-accurate information based +on guesswork done by a bunch of freaks - feel invited. this was made +to give you what you need in the most compressed and visually pleasing +form possible. Stuff that matters. +
index
+

+ +1.1  Things that are in this document

+
+just about everything explicitly and specifically related to the gamecube +hard- and software internals and its programming. everything inside +the box is subject to be documented, may it be relevant for actual +programming or not. its meant as a reference for everyone who wants +to know in all possible detail what makes this thing tick.

+one more thing: please notice that this is a technical documentation +which is presented for pure educational purposes and higher learning, +and not a moral lesson. i have decided against leaving out any information +since i believe that information by itself should not be crippled +in any way. if you choose to abuse this information for any kind of +illegal activities (PLEASE DON'T!) so be it, but don't bother +me with it. +
index
+

+ +1.2  Things that are not in this document

+
+several things were decided to not being put into this document because +they didn't fit into the 'technical documentation' type of concept. +They may be documented separatly some time but not now and not here. +These things are: + +some of these may be arguable, so if you think they should be here +- probably along the lines of the appendix - don't hesitate to write +the chapter in question and send it to me. i might include it if you +write it, but other than that i won't care (there is still enough +other stuff to complete). +
index
+

+ +1.3  Conventions

+
+
index
+

+ +1.4  legal Babble

+
+Everything in this Document has been reverse-engineered from legally +aquired software (Games), publicly available Patents and Documentation +for the sole purpose of writing interoperable Software. This is explicitly +allowed (almost encouraged :)) by Sect. 1201 (f), Reverse Engineering +exception of the DMCA. +
index
+

+ +2  Gamecube Hardware Introduction

+
+The GameCube is a powerful piece of hardware. The whole system is +based on the IBM PowerPC Gekko processor and the custom ATI Flipper +video system. The PowerPC Gekko processor is really just a PowerPC +750 with a few enhancements. +
index
+

+ +2.1  enhanced PowerPC 750 Specification

+
+The enhanced PowerPC Gekko processor also contains many features for +minimization of processor delays because of data accessing and for +maximization of processing throughput: + +The instruction set of the PowerPC Gekko processor seems to be almost +identical to the one of the PowerPC 750 processor.The only visible +differences at the moment are that the PowerPC Gekko processor has +a few AltiVecSIMD opcodes added to its final instruction +set. +
index
+

+ +2.2  Consumer Units

+
index
+

+ +2.2.1  Nintendo

+
2.2.1.1 +   HW1 +
+
+HW1 was an initial, buggy version of the GameCube hardware that wasnt +sold at retail. +
2.2.1.2 +   HW2 +
+
+HW2 is the first hardware that was sold in stores to the public. +2.2.1.3 +   HW2 'second edition' +The second edition models are missing the "Serial Port 2" +that the first edition had. The plastic cover is still on the bottom +of the cube, where the port used to be, but there's just a metal plate +underneath it, and no connector. +2.2.1.4 +   HW2 'third edition' +The third edition Gamecubes are missing both the "Serial +Port 2", and the Digital A/V connector. +
index
+

+ +2.2.2  Panasonic Q

+
+There is a Gamecube combined with dvd-player manufactured by Panasonic +called 'Panasonic-Q'. It seems to be exactly the same as HW2 for +the Gamecube part, except that the dvd drive is different. +
index
+

+ +2.3  Development Units

+
+Nintendo provides development hardware units to official, licensed +GameCube developers. There are namely two different versions: the +GDEV and the DDH hardware development kit units. These units are the +same as retail GameCube HW2 units with some changes: They have PC +communications features (either through SCSI or USB) and they have +DVD emulation hardware instead of a proprietary mini-DVD drive. GameCube +development units also seem to have slower processor speeds than retail +GameCubes, this clock speed ranges from around 150MHz to 400MHz. Development +GameCubes also seem to contain more RAM than retail ones, namely around +40MB. SNSystems also provides their own development kit,authorized +by Nintendo, called the TDEV. According to specifications directly +from SNSystems, the TDEV development hardware contains twice as much +memory as retail GameCubes for debugging and a direct PC<->TDEV USB +connection for fast uploading of code andor data. +Finally, there is also another proprietary development kit called +the NR-Reader. NR-Reader's contain less debugging capabilities than +the other development kits and are mostly meant for developers to +efficiently get their demosgames to beta testers or +media. However, SNSystems reports that their ProDG development kit +can be used with a special USB adapter of theirs for directly sending +program (debug) code to NR-Reader GameCubes. Also, NR-Reader GameCubes +contain different mini-DVD drives than retail GameCubes, but still +use a proprietary writingreading format which is currently +unknown. The DVD drives of NR-Readers can only read special DVDs that +can only be written correctly with NR-Writer hardware (which is really +just a PanasonicMatshita SW-9501 with modified firmware). +Also, the official debug development kits possibly contain J-TAG support, +which is a method for debugging hardware. If so, there is a possibility +that J-TAG support still remains in retail GameCubes as well, but +this is purely hypothesis. If, in fact, retail GameCubes contain J-TAG +debugging support then it should be possible for (homebrew) code to +be uploaded through a J-TAG cable) directly to a GameCube's RAM and +executed. +
index
+

+ +2.4  Hardware Parts List

+
+
index
+

+ +2.4.1  Connectors

+
+The are 10 different connectors on the GameCube's mother-board. The +following table contains an ID key and a short functional description.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID Description
P1Motherboard Power Connector - MBB - Top Left
P2Digital Video Output Connector - MBU - Bottom Left
P3Controller Pad Board Connector - MBU - Middle Right
P4Memory Card Slot Connector A - MBU - Top Right
P5Memory Card Slot Connector B - MBU - Bottom Right
P6Serial Port Connector 1 - MBB - Top Right
P7Analog Video Output Connector - MBU - Middle Left
P8Serial Port Connector 2 - MBB - Top Right
P9Mini-DVD Drive Port Connector - MBU - Top Right
P10Hi-Speed Parallel Port Connector - MBB - Bottom Left
+
+
2.4.1.1 +   Memory Card Slots (P4,P5) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pinSignal
1EXTIN
2GND
3INT
43.3V
5DO
65V
7DI
83.3V
9CS
10Ground (Shield)
11CLK
12EXTOUT
+
+
2.4.1.2 +   High-speed Port (P8) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pinSignal
13.3V
2GND
3INT
4CLK
5DO
6DI
7CS
8Ground (Shield)
+
+
2.4.1.3 +   SDRAM/Parallel Port (P10) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pinSignal
1VCC
2Ground
3DQ0
4DQ7
5DQ1
6DQ6
7DQ2
8DQ5
9DQ3
10DQ4
11VCC
12Ground
13write enable
14DQM
15CAS
16Clock
17RAS
18A12
19CS (Chip Select)
20A11
21BA0
22A9
23BA1
24A8
25A10
26A7
27A0
28A6
29A1
30A5
31A2
32A4
33A3
34INT
35VCC
36Ground
+
+
2.4.1.4 +   BBA/Modem Connector (P6) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pinSignal
1EXTIN
2Ground (Shield)
3INT
4CLK
512V
6DO
73.3V
83.3V
9DI
10CS
11Ground
12Ground
+
+
2.4.1.5 +   DVD Interface Connector (P9) +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pinSignal
1AISLR (audio bus)
25V
3AISD (audio bus)
45V
5AISCLK (audio bus)
65V
7DIHSTRB
85V
9DIERRB
10Ground
11DIBRK
12DICOVER
13DIDSTBR
14DIRSTB
15DIDIR
16Ground
17DID7
18Ground
19DID6
20Ground
21DID5
22Ground
23DID4
24Ground
25DID3
26Ground
27DID2
28MONI
29DID1
30MONOUT
31DID0
32Ground
+
+
2.4.1.6 +   Power Supply Connector (P1) +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pinSignal
1Ground
2Ground
33.3V
43.3V
5Ground
6Ground
7Ground
8Ground
91.8V
101.8V
111.8V
121.8V
131.55V
141.55V
151.55V
16Ground
17Ground
18Ground
19Thermo detect
2012V
215V
225V
+
+
index
+

+ +2.4.2  Semi-Conductors

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDDescription
U1Customized NEC Flipper Chip - MBU - Middle
U2Customized IBM PowerPC Gekko Chip - MBU - Bottom
U3MoSys (MS3M23B-5 A) 12MB 1-T SRAM - MBU - Top Right
U4MoSys (MS3M23B-5 A) 12MB 1-T SRAM - MBU - Top Right
U5NEC (D4891281G5 0125XU621) 16MB ARAM - MBU - Top Left
U6AV Encoder (AVE N -DOL RS5C5828) - MBB - Middle Left
U7Amplifier? (AMP - DOL 128 124) - MBB - Top Left
U8MX Clock Generator (Part Number?) - MBU - Bottom Left
U9MX Clock Generator (Part Number?) - MBU - Bottom Right
U10MX RTC/IPL (8013108-M RTCN-DOL 1R6022A1)
+
+
2.4.2.1 +   IPL (U10) +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PinSignal
1Clock
2 
3 
4 
5CS
6serial in
7Ground
8 
9serial out
10 
11 
12osc - xtal2
13osc - xtal1
14 
+
+
index
+

+ +2.5  Details on the motherboard buses

+
+The GameCube has three main external buses on its mother-board: the +North-Bridge, the South-Bridge, and the East-Bridge. The fastest bus +is the South-Bridge which connects the two 12MB 1T-SRAM chips to the +Flipper. The South-Bridge bus has a bus-width of 64 bits, and data +is exchanged through it at rates of about 324MHz. The North-Bridge +bus connects the IBM PowerPC Gekko processor to the Flipper and is +another 64 bit bus-width bus, however, it is only half as fast as +the South-Bridge bus and is clocked at around 162MHz. Finally, the +East-Bridge bus connects the 16MB Audio RAM chip to the Flipper chip. +This bus only has a bus-width of 8 bits and is by far the slowest +one, clocked at only 81MHz. +
index
+

+ +2.6  Details on the Macronix (MX) Chips

+
+An outer inspection of the two MX chips does not reveal anything of +much interest. Both chips are TSOP packages containing 14 pins each. +One of the chips has "CLK" inscripted on it, and +the other "RTC". It can be easily inferred that +the "CLK" chip functions as some sort of a clock +controllergenerator and the "RTC" +chip contains the GameCube's Real-Time Clock unit. Two of the RTC +chip's pins are connected to an external crystal which regulates the +RTC's timing rate. Another pin is connected to a battery located on +the controller board. At least two pins are used for both VCC and +GND. That leaves nine unknown pins. The RTC MX chip also contains +the GameCube's BIOS. While 14 pins is not nearly enough for parallel +Flash ROM, EEPROM, mask ROM, etc., it is quite adequate for a serial +connection. +
index
+

+ +2.7  DVD Protection

+
+The DVD Protection is based on a custom data format on an otherwhise +pretty standard dvd. +
index
+

+ +2.7.1  Filesystem

+
+The custom Filesystem (which is described somewhere else in this Document) +by itself is not related to the actual protection mechanism. However, +since it is not standard, that alone would already make it hard to +read (and create) in a regular (pc-) environment. +
index
+

+ +2.7.2  Barcode

+
+The Barcode is used to authenticate the Disc in the Drive. +
index
+

+ +2.7.3  Encryption

+
+The entire content of a Gamecube DVD is XORed with a constant cyphertext +and it is transparently decrypted by the Disc-Controller when reading +from the DVD. +
2.7.3.1 +   Cyphertext algorithm +
+
+todo +
index
+

+ +2.8  IPL/BIOS Encryption

+
+if you XOR an NTSC with a PAL bios (or any other two different ones), +you will notice that because they have different sizes, there are +some obviously zero encoded areas in one files, giving you plaintext +in the other one which proves: + +so we do the math:

+given Ci = ciphertext, Cl = cleartext, K = key

+encoding data goes like:

+Ci1 = Cl1 ^ K
+Ci2 = Cl2 ^ K

+If Cl1 or Cl2 is nothing but zero, the resultant Ci is just K

+decoding it would be:

+Cl = Ci ^ K

+for the areas where Cl is nothing but zeroes in one bios, we know +K
index
+

+ +2.8.1  Flipper decryption logic bug

+
+The hardware decryption logic has a really nasty bug which allows +us to read almost the full Cleartext (and thus a large part of the +cyphertext, by XORing it with encrypted data).

+This, combined with the features of the XOR encryption makea the whole +encryption useless (at least very insecure) and implementing a new +bios is a straight-forward task (provided that "high speed" +(30Mhz) programmable logic with enough memory attached to it is available.). +The Bios chip, which also includes sram and rtc (but that won't matter +here), is attached to the EXI0 bus. The Exi bus (nothing new here, +just to refresh it is an SPI-like bus. SPI is nothing complicated, +just four interesting lines: CS (used mainly for syncing, since you +need a defined start point, and you can easily attach multiple devices +(memory card, ...) to the same bus with seperate CS lines), SI (aka +MOSI, master out, slave in - the CPU is always master, the IPL-chip +is slave. so SI is gamecube -> device), SO (device -> gamecube, tristated +when a device is not active), and CLK (generated by the master). a +transfer is basically:

+- lower CS (it's low active)
+ for every bit do:
+- set SI bit
+- clock
+- read SO bit
+then:
+- put CS high again.

+(the exact timing (WHEN to sample SO, clock polarity) is different +for different SPI modes, and the one descriped here is not necessarily +the one used in the GC. anyway, it doesn't matter here)

+so, based on that, we can transfer n-bit messages in BOTH DIRECTIONS. +technically this is implemented with a 32bit shift register, with +every clock cycle one bit is shifted out (to SI), and one bit is shifted +in (to SO). so after n clock cycles, you have n new bits in the shift +register and shifted n bits out. the used protocol on the Bus is in +most cases very simple but device dependant. In the case of the IPL +chip, it's the following:

+GC -> IPL
+1 bit read/write (0 for read, 1 for write, the latter only valid for +RTC/Sram of course)
+1 unknown bit
+1 bits selection (0 for ROM, 1 for RTC/Sram)
+23 bits address
+6 bits dummy
+after that, the data transfer starts. the 6 dummy cycles are mainly +to give the IPL time to read out the first byte.

+So you send 32 bits of data (the "address"), and +start receiving the ROM bytes. but hey - we said the SPI bus always +transfers 2 bits per clock cycle (in marketing terms), since it's +fullduplex (in technical terms). we transfer one bit TO the device, +and one BACK. we HAVE to. there's no way to NOT send a bit - but it +doesn't matter, since for example the bits send from the IPL to the +GC in the first 32bits are just ignored - they would contain most +probably only zeros, ones, or the bus might be tristate. it's simply +not defined, so there's no data to be expected. the same goes for +the transfer of the data. the IPL chip sets the correct data at the +SO line, but the gamecube - well, sends dummy bits, too. normally +you would send zeros, ones, or whatever. it's ignored by the IPL chip +anyway (unless it's a write, that would turn the whole thing upside +down) now since technically the SPI port is implemented by a shifting +register of 32bit length. after transferring 32bits, we would have +to read out the new value, store it into memory, and "start +the next transfer". but what's about CLEARING the register +before? yes, they didn't. in the next transfer, the last 32bit are +shifted out as dummy bits. well, one might say, it's just the data +just shifted in, so it's completely uninteresting. BUT: the decryption +of the loader is done in hardware. it's a part between the SO line +of the IPL and the DI port of the shift register. (the encryption +is build into the flipper, so no way to intercept the content AFTER +decryption).so because the (decrypted) data just shifted in (and stored +into memory) is shifted out again - we can get the decrypted data. +if you sniff the SI line to the IPL chip, you will get a log like +this:

00 00 40 00 (address written to the IPL, in this case: 0x100) 
FF FF FF FF (well just dummy data) 
xx xx xx xx (the data from the last 4 bytes, decrypted) 
... 
... 
xx xx xx xx (the data from the n-1 transfer, decrypted)

+so in the end you get every 32bit words except one. For every transfered +block you miss 32bits of plaintext data, but you'll get the rest. +This should be enough to decrypt huge parts of the bios, and thus +recover a large part of K. +
index
+

+ +2.8.2  Cyphertext algorithm

+
+todo +
index
+

+ +2.8.3  replacing the IPL

+
+using the above gained knowledge it is possible to create a small +bootrom replacement (using the, yet incomplete, cyphertext), and get +more (most) of the IPL Cleartext.

+The Gekko boots from 0x100, that's what you read in almost any ppc +instruction manual - the reset vector. well, this isn't the complete +truth - it boots from it's exception base + 0x100. And the exception +base is normally zero, BUT, as the ppc manual states: there's a bit +in a HID (i think) register, which turns the exception base to 0xFFF00000. +and this bit is "set usually at boot time". So the +processor starts to fetch instructions at 0xFFF000100. If you read +a bit further, you'll notice that the CPU always reads 64bits at once +for code. The memory at 0xFFF00000 is mapped inside the flipper to +an automated exi transfer (with that shift register), with the decryption +logic active. so the processor starts executing the decrypted instructions, +reading 8 bytes at a time, of which we get 4 bytes in plain - not +much, (although enough to make some funny experiments, but that's +another topic). Luckily, the IPL itself (the cube menu) isn't executed +this way since that wouldn't be possible thanks to the "dumb" +decryption logic The first ~0x800 bytes start to read +data out of the IPL chip and store it to memory (still using the hardware +decryption logic), and jump there. they read 1024 bytes at once. Well +- now we know 1020 bytes of each transfer, enough to have a complete +block of code we can exchange (we have the ciphertext Cl^K += Ci on SO, and the plaintext (delayed by 32bits on SI), and can XOR +them to get Cl^K^Ci = K. now we +can encrypt our code with K). so now we can make a small code which +just dumps the whole IPL - well, to the EXI bus or whereever you can +receive it. Now we have all Cl, and thus we can compute all K, thus +we can get the complete Plaintext of all available IPLs aswell as +encode a larger custom IPL ourselves.

+a small note on why you can not recover the plaintext of the original +loader this way:

+The decryption logic is, whatever it is, a PRNG. It generates a stream +of ciphertext ("K"), which has random properties +(non-repeating, at least not in the range of some MB), but is always +the same. it is incremented with every EXI-transfer. the address is +NOT used in the calculation. thus reading from 0xFFF00100 more than +one time will give you each time another result. the first time you +get Ci(0)^K(0) (the correct result), the second time +you get Ci(0)^K(1) etc., i.e. wrong results. Since +we never get the K(n) for odd n, i see no chance of recovering it +this way, even if we can read at 0xFFF00000+x (and we can do this +if we don't set a specific bit to disable the logic). +
index
+

+ +3  Gekko CPU Overview

+
index
+

+ +3.1  Registers

+
+ + + + +
+ + + + + +
spr9204r/wHID2
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
2 PSE - Paired-Single load and store instructions enabled
1  
0 LSQE - Paired-Single mode enabled
+
+
index
+

+ +3.2  Calling conventions

+
+parameters are passed in r3 (1st) r4 (2nd) and r5 (third) up to r12 +(9th), further parameters are passed through the stack. +
index
+

+ +3.3  PPC Instructions

+
index
+

+ +3.3.1  Integer Instructions

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
addi  
addis  
add  
addo  
subf  
subfo  
addic  
subfic  
addc  
addco  
subfc  
subfco  
adde  
addeo  
subfe  
subfeo  
addme  
addmeo  
subfme  
subfmeo  
addze  
addzeo  
subfze  
subfzeo  
neg  
nego  
mulli  
mullw  
mullwo  
mulhw  
mulhwu  
divw  
divwo  
divwu  
divwuo  
cmpi  
cmp  
cmpli  
cmpl  
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
andi  
andis  
ori  
oris  
xori  
xoris  
and  
or  
xor  
nand  
nor  
eqv  
andc  
orc  
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
extsb  
extsh  
cntlzw  
rlwinm  
rlwnm  
rlwimi  
slw  
srw  
srawi  
sraw  
+
+
index
+

+ +3.3.2  Floating-Point Instructions

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
fadd  
fadds (*)  
fsub  
fsubs (*)  
fmul  
fmuls (*)  
fdiv  
fdivs  
fres (*)  
frsqrte  
fsel (*)  
fmadd  
fmadds (*)  
fmsub  
fmsubs (*)  
fnmadd  
fnmadds (*)  
fnmsub  
fnmsubs (*)  
frsp (*)  
fctiw  
fctiwz  
fcmpu  
fcmpo  
mffs  
mcrfs  
mtfsfi  
mtfsf  
mtfsb0  
mtfsb1  
fmr (*)  
fneg  
fabs  
fnabs  
+
+
+(*) - modified for paired singles +
index
+

+ +3.3.3  Integer Load and Store Instructions

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
lbz  
lbzx  
lbzu  
lbzux  
lhz  
lhzx  
lhzu  
lhzux  
lha  
lhax  
lhau  
lhaux  
lwz  
lwzx  
lwzu  
lwzux  
stb  
stbx  
stbu  
stbux  
sth  
sthx  
sthu  
sthux  
stw  
stwx  
stwu  
stwux  
lhbrx  
lwbrx  
sthbrx  
stwbrx  
lmw  
stmw  
lswi  
lswx  
stswi  
stswx  
+
+
index
+

+ +3.3.4  Floating-Point Load and Store Instructions

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
lfs  
lfsx  
lfsu  
lfsux  
lfd  
lfdx  
lfdu  
lfdux  
stfs  
stfsx  
stfsu  
stfsux  
stfd  
stfdx  
stfdu  
stfdux  
stfiwx  
+
+
index
+

+ +3.3.5  Branch Instructions

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
b unconditional Jump
ba  
bl branch and link
bla  
bc  
bca  
bcl  
bcla  
bclr  
bclrl  
bcctr  
bcctrl  
+
+
index
+

+ +3.3.6  Condition Register Logical Instructions

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
crand  
cror  
crxor  
crnand  
crnor  
creqv  
crandc  
crorc  
mcrf  
+
+
index
+

+ +3.3.7  Misc Instructions

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
twi  
tw  
sc  
rfi  
mtcrf  
mcrxr  
mfcr  
mtmsr  
mfmsr  
mtspr  
mfspr  
lwarx  
stwcx.  
sync  
mftb  
eieio  
isync  
dcbt  
dcbtst  
dcbz  
dcbz_l  
dcbst  
dcbf  
dcbi  
icbi  
eciwx  
ecowx  
mtsr  
mtsrin  
mfsr  
mfsrin  
tlbie  
tlbsync  
+
+
index
+

+ +3.4  additional Gekko Instructions

+
+The Gekko has some additional (and some modified respectivly) instructions +in its Paired-single mode which are useful for fast vector and matrix +calculations and which are analog to Intel (and other x86 series) +processors "streamed instructions", known as SSE. +This extension is unique for the Gekko processor and used to calculate +two single-precision numbers ("floats" in C) in +one clock cycle. The floating-Point Registers of the Gekko (FPRs) +are modified in the following way : one half is used for the first +single number, and other for the second. These parts are named as +"PS0" and "PS1". PS instructionset +is divided into two parts : Load and Store Quantization and Paired-Single +Arithmetic instructions. Load and Store Quantization instructions +are used for fast integer-float type casting and some specific memory +operations, using PS0 and PS1 parts of FPR. If you try to execute +any PS instruction without HID2[PSE] and HID2[LSQE] bit set, an +illegal instruction exception will be generated. +
index
+

+ +3.4.1  FPR format in paired-single mode

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + +
6356554857403932
11111111111111111111111111111111
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
00000000000000000000000000000000
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
32-631PS1
0-310PS0
+
+
index
+

+ +3.4.2  Arithmetic Instructions

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
ps_abs000100 DDDDD 00000 BBBBB 01000 01000 Rabsolute value
ps_add000100 DDDDD AAAAA BBBBB 00000 10101 Radd
ps_cmpo0000100 DDD00 AAAAA BBBBB 00001 00000 0compare ordered high
ps_cmpo1000100 DDD00 AAAAA BBBBB 00011 00000 0compare ordered low
ps_cmpu0000100 DDD00 AAAAA BBBBB 00000 00000 0compare unordered high
ps_cmpu1000100 DDD00 AAAAA BBBBB 00010 00000 0compare unordered low
ps_div000100 DDDDD AAAAA BBBBB 00000 10010 Rdivide
ps_merge00000100 DDDDD AAAAA BBBBB 10000 10000 Rmerge high
ps_merge01000100 DDDDD AAAAA BBBBB 10001 10000 Rmerge direct
ps_merge10000100 DDDDD AAAAA BBBBB 10010 10000 Rmerge swapped
ps_merge11000100 DDDDD AAAAA BBBBB 10011 10000 Rmerge low
ps_mr000100 DDDDD 00000 BBBBB 00010 01000 Rmove register
ps_nabs000100 DDDDD 00000 BBBBB 00100 01000 Rnegate absolute value
ps_neg000100 DDDDD 00000 BBBBB 00001 01000 Rnegate
ps_res000100 DDDDD 00000 BBBBB 00000 11000 Rreciprocal estimate
ps_rsqrte000100 DDDDD 00000 BBBBB 00000 11010 Rreciprocal square root estimate
ps_sub000100 DDDDD AAAAA BBBBB 00000 10100 R substract
ps_madd000100 DDDDD AAAAA BBBBB CCCCC 11101 R multiply and add
ps_madds0000100 DDDDD AAAAA BBBBB CCCCC 01110 Rmultiply and add scalar high
ps_madds1000100 DDDDD AAAAA BBBBB CCCCC 01111 Rmultiply and add scalar low
ps_msub000100 DDDDD AAAAA BBBBB CCCCC 11100 Rmultiply and substract
ps_mul000100 DDDDD AAAAA 00000 CCCCC 11001 Rmultiply
ps_muls0000100 DDDDD AAAAA 00000 CCCCC 01100 Rmultiply scalar high
ps_muls1000100 DDDDD AAAAA 00000 CCCCC 01101 Rmultiply scalar low
ps_nmadd000100 DDDDD AAAAA BBBBB CCCCC 11111 Rnegative multiply and add
ps_nmsub000100 DDDDD AAAAA BBBBB CCCCC 11110 Rnegative multiply and substract
ps_sel000100 DDDDD AAAAA BBBBB CCCCC 10111 Rselect
ps_sum0000100 DDDDD AAAAA BBBBB CCCCC 01010 Rvector sum high
ps_sum1000100 DDDDD AAAAA BBBBB CCCCC 01011 Rvector sum low
+
+
+Note : R opcode field (comparsion of result with zero) is unused. +(=0) +
3.4.2.1 +   PS_ABS +
+
+absolute value +Clear bit 0 of PS0[B] and copy result to PS0[D]
Clear bit 0 of PS1[B] and copy result to PS1[D]
3.4.2.2 +   PS_ADD +
+
+add +PS0[D] = PS0[A] + PS0[B]
PS1[D] = PS1[A] + PS1[B]
3.4.2.3 +   PS_CMPO0 +
+
+compare ordered high +"c" holds result of comparsion
If (PS0[A] is NaN or PS0[B] is NaN) then c = 0001b
Else if (PS0[A] < PS0[B]) then c = 1000b
Else if (PS0[A] > PS0[B]) then c = 0100b
Else c = 0010b
Save result in D field of condition register (CR[D] = c).
3.4.2.4 +   PS_CMPO1 +
+
+compare ordered low +"c" holds result of comparsion
If (PS1[A] is NaN or PS1[B] is NaN) then c = 0001b
Else if (PS1[A] < PS1[B]) then c = 1000b
Else if (PS1[A] > PS1[B]) then c = 0100b
Else c = 0010b
Save result in D field of condition register (CR[D] = c).
3.4.2.5 +   PS_CMPU0 +
+
+compare unordered high +"c" holds result of comparsion
If (PS0[A] is NaN or PS0[B] is NaN) then c = 0001b
Else if (PS0[A] < PS0[B]) then c = 1000b
Else if (PS0[A] > PS0[B]) then c = 0100b
Else c = 0010b
Save result in D field of condition register (CR[D] = c).
3.4.2.6 +   PS_CMPU1 +
+
+compare unordered low +"c" holds result of comparsion
If (PS1[A] is NaN or PS1[B] is NaN) then c = 0001b
Else if (PS1[A] < PS1[B]) then c = 1000b
Else if (PS1[A] > PS1[B]) then c = 0100b
Else c = 0010b
Save result in D field of condition register (CR[D] = c).
These four compare instructions looks same, because I omitted +some
unecessary FPSCR stuff.
3.4.2.7 +   PS_DIV +
+
+divide +PS0[D] = PS0[A] / PS0[B]
PS1[D] = PS1[A] / PS1[B]
3.4.2.8 +   PS_MERGE00 +
+
+merge high +PS0[D] = PS0[A]
PS1[D] = PS0[B]
3.4.2.9 +   PS_MERGE01 +
+
+merge direct +PS0[D] = PS0[A]
PS1[D] = PS1[B]
3.4.2.10 +   PS_MERGE10 +
+
+merge swapped +PS0[D] = PS1[A]
PS1[D] = PS0[B]
3.4.2.11 +   PS_MERGE11 +
+
+merge low +PS0[D] = PS1[A]
PS1[D] = PS1[B]
3.4.2.12 +   PS_MR +
+
+move register +PS0[D] = PS0[B]
PS1[D] = PS1[B]
3.4.2.13 +   PS_NABS +
+
+negate absolute value +Set bit 0 of PS0[B] and copy result to PS0[D]
Set bit 0 of PS1[B] and copy result to PS1[D]
3.4.2.14 +   PS_NEG +
+
+negate +Invert bit 0 of PS0[B] and copy result to PS0[D]
Invert bit 0 of PS1[B] and copy result to PS1[D]
3.4.2.15 +   PS_RES +
+
+reciprocal estimate +PS0[D] = 1 / PS0[B]
PS1[D] = 1 / PS1[B]
3.4.2.16 +   PS_RSQRTE +
+
+reciprocal square root estimate +PS0[D] = 1 / SQRT(PS0[B])
PS1[D] = 1 / SQRT(PS1[B])
3.4.2.17 +   PS_SUB +
+
+subtract +PS0[D] = PS0[A] - PS0[B]
PS1[D] = PS1[A] - PS1[B]
3.4.2.18 +   PS_MADD +
+
+multiply-add +PS0[D] = PS0[A] * PS0[C] + PS0[B]
PS1[D] = PS1[A] * PS1[C] + PS1[B]
3.4.2.19 +   PS_MADDS0 +
+
+multiply-add scalar high +PS0[D] = PS0[A] * PS0[C] + PS0[B]
PS1[D] = PS1[A] * PS0[C] + PS1[B]
3.4.2.20 +   PS_MADDS1 +
+
+multiply-add scalar low +PS0[D] = PS0[A] * PS1[C] + PS0[B]
PS1[D] = PS1[A] * PS1[C] + PS1[B]
3.4.2.21 +   PS_MSUB +
+
+multiply-subtract +PS0[D] = PS0[A] * PS0[C] - PS0[B]
PS1[D] = PS1[A] * PS1[C] - PS1[B]
3.4.2.22 +   PS_MUL +
+
+multiply +PS0[D] = PS0[A] + PS0[C]
PS1[D] = PS1[A] + PS1[C]
3.4.2.23 +   PS_MULS0 +
+
+multiply scalar high +PS0[D] = PS0[A] + PS0[C]
PS1[D] = PS1[A] + PS0[C]
3.4.2.24 +   PS_MULS1 +
+
+multiply scalar low +PS0[D] = PS0[A] + PS1[C]
PS1[D] = PS1[A] + PS1[C]
3.4.2.25 +   PS_NMADD +
+
+negative multiply-add +PS0[D] = - (PS0[A] * PS0[C] + PS0[B])
PS1[D] = - (PS1[A] * PS1[C] + PS1[B])
3.4.2.26 +   PS_NMSUB +
+
+negative multiply-subtract +PS0[D] = - (PS0[A] * PS0[C] - PS0[B])
PS1[D] = - (PS1[A] * PS1[C] - PS1[B])
3.4.2.27 +   PS_SEL +
+
+select +If (PS0[A] >= 0) then PS0[D] = PS0[C] else PS0[D] += PS0[B]
If (PS1[A] >= 0) then PS1[D] = PS1[C] else PS1[D] += PS1[B]
3.4.2.28 +   PS_SUM0 +
+
+vector sum high +PS0[D] = PS0[A] + PS1[B]
PS1[D] = PS1[C]
3.4.2.29 +   PS_SUM1 +
+
+vector sum low +PS0[D] = PS0[C]
PS1[D] = PS0[A] + PS1[B]
index
+

+ +3.4.3  Load and Store Instructions

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
psq_lx000100 DDDDD AAAAA BBBBB WIII 000110 0Paired Singles Quantized Load indexed
psq_lux000100 DDDDD AAAAA BBBBB WIII 100110 0Paired Singles Quantized Load with Update indexed
psq_stx000100 SSSSS AAAAA BBBBB WIII 000111 0Paired Singles Quantized Store indexed
psq_stux000100 SSSSS AAAAA BBBBB WIII 100111 0Paired Singles Quantized Store with Update indexed
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
psq_l111000 DDDDD AAAAA WIII ddddddddddddPaired Singles Quantized Load
psq_lu111001 DDDDD AAAAA WIII ddddddddddddPaired Singles Quantized Load with Update
psq_st111100 SSSSS AAAAA WIII ddddddddddddPaired Singles Quantized Store
psq_stu111101 SSSSS AAAAA WIII ddddddddddddPaired Singles Quantized Store with Update
+
+
3.4.3.1 +   psq_lx +
+
+Paired Singles Quantized Load indexed +
3.4.3.2 +   psq_lux +
+
+Paired Singles Quantized Load with Update indexed +
3.4.3.3 +   psq_stx +
+
+Paired Singles Quantized Store indexed +
3.4.3.4 +   psq_stux +
+
+Paired Singles Quantized Store with Update indexed +
3.4.3.5 +   psq_l +
+
+Paired Singles Quantized Load +
3.4.3.6 +   psq_lu +
+
+Paired Singles Quantized Load with Update +
3.4.3.7 +   psq_st +
+
+Paired Singles Quantized Store +
3.4.3.8 +   psq_stu +
+
+Paired Singles Quantized Store with Update +
index
+

+ +3.4.4  modified floating point instructions

+
+In paired single mode (HID2[PSE] = 1), all the double-precision +floating point instructions are still valid, and execute as in non-paired +single mode. All single-precision floating-point instructions (fadds, +fsubs, fmuls, fdivs, fmadds, fmsubs, fnmadds, fnmsubs, fres, frsp) +switch their meaning and operate on the ps0 operand.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MnemonicOpcodeDescription
fadds  
fsubs  
fmuls  
fdivs  
fmadds  
fmsubs  
fnmadds  
fnmsubs  
fres  
frsp  
fsel  
fmr  
+
+
3.4.4.1 +   fadds +
+
3.4.4.2 +   fsubs +
+
3.4.4.3 +   fmuls +
+
3.4.4.4 +   fdivs +
+
3.4.4.5 +   fmadds +
+
3.4.4.6 +   fmsubs +
+
3.4.4.7 +   fnmadds +
+
3.4.4.8 +   fnmsubs +
+
3.4.4.9 +   fres +
+
3.4.4.10 +   frsp +
+
3.4.4.11 +   fsel +
+
3.4.4.12 +   fmr +
+
index
+

+ +3.5  Programming Tips and additional information

+
index
+

+ +3.5.1  Machine State Register

+
+to do +
index
+

+ +3.5.2  Caches

+
+to do +
index
+

+ +3.5.3  branch unit

+
+to flush branch unit's dynamic prediction logic, you must sequentially +execute 3 branches

        .... 
        b label1 
label1: b label2 
label2: b label3 
label3: 
        .... 
 
index
+

+ +4  Memory Map

+
index
+

+ +4.1  Overview

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x000000000x017fffff24MBPhysical address of the RAM
0x800000000x817fffff24MBLogical address of the RAM, cached
0xC00000000xC17fffff24MBLogical address of the RAM, not cached
0xc8000000 2MBEmbedded Framebuffer (EFB)
0xCC000000  Hardware registers
0xCC000000  CP - Command Processor
0xCC001000  PE - Pixel Engine
0xCC002000  VI - Video Interface
0xCC003000  PI - Processor Interface (Interrupt Interface)
0xCC004000  MI - Memory Interface
0xCC005000  AI - Audio Interface
0xCC006000  DI - DVD Interface
0xCC006400  SI - Serial Interface
0xCC006800  EXI - External Interface
0xCC006C00  Streaming Interface
0xCC008000  GX FIFO (Graphic display lists)
0xe00000000xe0003fff16kL2 Cache
0xfff00000 1MBIPL (mapped here at bootup)
+
+
index
+

+ +4.2  RAM usage

+
+Variables that are marked as B are changed by bootrom or IPL. Variables +marked as A are changed lately in apploader when a game is booting. +Variables, which are marked as O are changed after an OSInit call. +Remember that the IPL also has a hard-linked Dolphin OS inside, so +those variables that are marked as O are also changed in the IPL. +
index
+

+ +4.2.1  Dolphin-OS globals

+
+In PowerPC architectures the lower 256 bytes of main memory are reserved +for internal OS use. This map describes all known OS low memory variables. +Dolphin OS accesses low memory as 0x80000000 + offset (cached). +
4.2.1.1 +   Boot Info +
+

    + 4.2.1.1.1  DVD Disc ID +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startsize description
0x800000000x04BGamecode
0x800000040x02BCompany
0x800000060x01BDisk ID
0x800000070x01BVersion
0x800000080x01BStreaming
    + + + + + + + + + +
0audio streaming off
1audio streaming on
+
0x800000090x01BStreamBufSize
0x8000000a0x0f padding zeros
+
+

    + 4.2.1.1.2  system Info +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startsize description
0x8000001c ADVD magic word
    + + + +
0xc2339f3dNintendo Game Disc
+
0x800000204AMagic word (how did the console boot?)
    + + + + + + + + + + + + + +
valuedescription
0x0D15EA5Enormal boot
0xE5207C22booted from jtag
+
0x800000244AVersion (usually set to 1 by apploader)
0x800000284Bphysical Memory Size
    + + + +
0x0180000024MB on retail console
+
0x8000002C4BConsole type
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
valueDescription
0x00000001Retail1
0x00000002HW2 production board
0x00000003The latest production board
0x00000004Reserved
0x1XXXXXXXDevkits
0x10000000MAC emulator
0x10000001PC Emulator
0x10000002'Arthur'
0x10000003'Minnow'
0x100000041st Devkit HW
0x100000052nd Devkit HW
0x10000006latest Devkit HW
0x10000007Reserved
0x2XXXXXXXTDEV-kits
0x20000005HW2 TDEV system
0x20000006The latest TDEV system
0x20000007Reserved
+
0x800000304OArenaLo (==0x00000000)
0x800000344OArenaHi (==0x817fe8c0)
0x800000384 FST Location in ram (==0x817fe8c0)
0x8000003C4 FST Max Length (==0x00000024)
+
+

4.2.1.2 +   Debugger info +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startsize description
0x800000404Aflag for "debugger present" (used by __OSIsDebuggerPresent)
0x800000444ADebugger Exception mask Bitmap, set to 0 at sdk lib start
0x800000484AException hook destination (physical address)
0x8000004c4ATemp for LR, Return from exception address (to return from hook)
0x8000005016 padding zeros
+
+
4.2.1.3 +   Debugger Hook +
+
.>80000060  38 a0 00 40  li r5,0x40
r5=0x40
+.>80000064  7c 68 02 a6  mflr r3
r3=lr
+.>80000068  90 65 00 0c  stw r3,0x0c(r5)
.>8000006c  80 65 00 08  lwz r3,0x08(r5)
.>80000070  64 63 80 00  oris r3,r3,0x8000
.>80000074  7c 68 03 a6  mtlr r3
lr=r3
+.>80000078  38 60 00 30  li r3,0x30
.>8000007c  7c 60 01 24  mtmsr r3
msr=0x30
+.>80000080  4e 80 00 20  blr
jump (lr)
+ 
4.2.1.4 +   Dolphin OS Globals +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsize description
0x800000840x800000bf  padding zeros
0x800000c0 4OCurrent OS context (physical address)
0x800000C4 4OPrevious OS interrupt mask
0x800000C8 4Ocurrent OS interrupt mask
0x800000CC   TV Mode
     + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
valuedescription
0ntsc
1pal
2debug
3debug pal
4mpal
5pal 60
+
0x800000d0  BARAM size (internal+expansion) in bytes. set by ARAM driver, usually +16mb.
0x800000D4  Ocurrent OS Context (logical address)
0x800000D8  Odefault OS thread (logical address)
0x800000Dc  Oactive Thread queue, head thread (logical address)
0x800000e0  Oactive Thread queue, tail thread (logical address)
0x800000e4  OCurrent OS thread
0x800000e8  ADebug monitor size (in bytes)
0x800000ec  ADebug monitor location (usually at the top of main memory)
0x800000F0  AConsole Simulated Memory Size, 0x01800000 (usually same as physical +memory size)
0x800000F4  ADVD BI2 location in main memory (size of BI2 is 0x2000 bytes)
0x800000F8   Bus Clock Speed, 162 MHz (=0x09a7ec80, 162000000)
0x800000FC   CPU Clock Speed, 486 MHz (=0x1cf7c580, 486000000)
+
+
index
+

+ +4.2.2  Exception Handlers

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x80000100  System Reset Interrupt
0x80000200  Machine Check Interrupt
0x80000300  DSI Interrupt
0x80000400  ISI Interrupt
0x80000500  External Interrupt
0x80000600  Alignment Interrupt
0x80000700  Program Interrupt
0x80000800  FP unavailable Interrupt
0x80000900  Decrementer Interrupt
0x80000C00  System Call Interrupt
0x80000d00  Trace Interrupt
0x80000f00  Performance Monitor Interrupt
0x80001300  IABR Interrupt
0x80001400  reserved
0x80001700  Thermal Interrupt
0x800018000x80002fff unused/reserved (*)
+
+
+(*) note: psoload v2 uses this area to stay resident in memory, +it is unused by Dolphin-OS +
index
+

+ +4.2.3  Dolphin-OS globals

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsize Description
0x80003000   exception handler vectors (from sdk libs & ipl)
     
0x8000303c 4 padding/unused
0x80003040   external interrupt handler vectors (from sdk libs & ipl)
     
0x800030a4   padding/unused
0x800030c0 4 ?
0x800030c4 4 ?
0x800030c8 4 First Module Header Pointer in Module Queue
0x800030cc 4 Last Module Header Pointer in Module Queue
0x800030d0 4 Module String Table Pointer
0x800030d4 4ADOL size (total size of text/data sections), in bytes (*1)
0x800030d8 4BOS system time (set, when console is powered up)
0x800030dc 4 ?
0x800030E0 4 ? (6=production pads ?)
0x800030e4 2 ?
0x800030e6 1 ?
0x800030e7 1 ?
0x800030e8 1Oset by OsInit() (debugger stuff?)
0x800030e9 1Oset by OsInit() (debugger stuff?)
0x800030ea 2 ?
0x800030ec 4 ?
0x800030F0 2 ?
0x800030F2 1 Boot status
     + + + + + + + + + + + + + +
valuedescription
0first boot
1already booted
+
0x800030F3 1 ?
0x800030F4 4 ?
0x800030F8 4 ?
0x800030Fc 4 ?
+
+

+(*1) If FST on DVD is placed after DOL, then BB2 FSTLength is added +to this value. +
index
+

+ +4.2.4  User Memory

+
4.2.4.1 +   user program area +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x80003100  Start of code (usually)
0x80003140  Entry point (early SDK v1.0 applications)
0x81200000  Load Address of the Apploader
0x81300000  Load Address of Bootrom/IPL
+
+
+note: of course the entrypoint of an application can be anything, +those listed here are just some typical examples. Retail game start +dol-files are usually located below the apploader. +
4.2.4.2 +   stack area +
+
+ + + + + + + + + + + + + + + + + + + +
startendsizedescription
  Bottom of Stack
   Top of Stack
+
+
4.2.4.3 +   heap area +
+
+ + + + + + + + + + + + + + + + + + + + + + +
startendsize description
?   OArenaLo - Bottom of Heap
0x817fe8c0  OArenaHi - Top of Heap
+
+
+note: the address of ArenaHi is not a constant, but should be set +to the bottom of the FST which is read from the DVD so its size depends +on the application. the value given here is just an example. +4.2.4.4 +   'high memory' +
+ + + + + + + + + + + + + + + + + + + + + + +
startendsize description
0x817fe8c0 24OFST (used by Dolphin-OS)
0x817fffff   Memory Top
+
+
index
+

+ +5  Hardware Registers

+
index
+

+ +5.1  CP - Command Processor

+
+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0xcc0000000x802
+
+

+ + + +
+ + + + + +
0xCC0000002R/WSR - Status Register
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
5-15 unused/reserved
4 BP (breakpoint?) interrupt
3 GP is idle for commands (1: idle)
2 GP is idle for reading (1: idle)
1 gx fifo underflow (ptr<lo watermark)
0 gx fifo overflow (ptr>hi watermark)
+
+

+ + + +
+ + + + + +
0xCC0000022R/WCR - Control Register
+
+ + + + + + + + + + + + + + +
15870
  ..bl.mig
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
6-15 unused/reserved
5bbp enable
4lgp link enable (enable for linking of cp/pe FIFO)
3 FIFO underflow irq enable (?)
2mFIFO overflow irq enable? / cp irq (clear to acknowledge) ?
1icp irq enable (?) (write 1 to clear bp irq?)
0ggp FIFO read enable
+
+

+ + +
+ + + + + +
0xCC0000042WClear Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
2-15 unused/reserved
1 write 1 to clear FIFO underflow
0 write 1 to clear FIFO overflow
+
+

+ + + + + +
0xCC00000E2R/Wtoken register
+
+

+ + + + + +
0xCC0000102R/Wbounding box - left
+
+

+ + + + + +
0xCC0000122R/Wbounding box - right
+
+

+ + + + + +
0xCC0000142R/Wbounding box - top
+
+

+ + + + + +
0xCC0000162R/Wbounding box - bottom
+
+

+ + + + + +
0xCC0000202R/Wcp FIFO base lo
+
+

+ + + + + +
0xCC0000222R/Wcp FIFO base hi
+
+

+ + + + + +
0xCC0000242R/Wcp FIFO end lo
+
+

+ + + + + +
0xCC0000262R/Wcp FIFO end hi
+
+

+ + + + + +
0xCC0000282R/Wcp FIFO high watermark lo
+
+

+ + + + + +
0xCC00002a2R/Wcp FIFO high watermark hi
+
+

+ + + + + +
0xCC00002c2R/Wcp FIFO low watermark lo
+
+

+ + + + + +
0xCC00002e2R/Wcp FIFO low watermark hi
+
+

+the low and high watermark control the assertion of the CP interrupt

+ + + + + +
0xCC0000302R/Wcp FIFO read/write distance lo
+
+

+ + + + + +
0xCC0000322R/Wcp FIFO read/write distance hi
+
+

+ + + + + +
0xCC0000342R/Wcp FIFO write pointer lo
+
+

+ + + + + +
0xCC0000362R/Wcp FIFO write pointer hi
+
+

+ + + + + +
0xCC0000382R/Wcp FIFO read pointer lo
+
+

+ + + + + +
0xCC00003a2R/Wcp FIFO read pointer hi
+
+

+ + + + + +
0xCC00003c2R/Wcp FIFO bp lo
+
+

+ + + + + +
0xCC00003e2R/Wcp FIFO bp hi
+
+

index
+

+ +5.1.1  Token register

+
+You can insert this dirty marker, at the end of command list, by this +way :

+*(u32 *)GXFIFO = 0x4800XXXX
+*(u32 *)GXFIFO = 0x4700XXXX

+Where XXXX is the token value. When command processor reaches this +stage, it writes XXXX into PE token register (see above), and then +raise "PE TOKEN" interrupt. Thus you can monitor +the completion of your drawing tasks.

+note: its probably a good idea to send a BP 'drawing complete' command +(0x45000002) before the insertion of the token.
index
+

+ +5.2  PE - Pixel Engine

+
+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0xcc0010000x1002
+
+

+ + + +
+ + + + + +
0xcc0010002R/WZ configuration
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
4 Z update enable
1-3 function
0 z-comperator enable
+
+

+ + + +
+ + + + + +
0xcc0010022R/WAlpha configuration
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
12-15 blend operator (?)
11 substractive / additive toggle (?)
8-10 source
5-7 destination
4 alpha update enable
3 color update enable
2 dither enable (?)
1 arithmetic blending enable (?)
0 boolean blending enable (?)
+
+

+ + + +
+ + + + + +
0xcc0010042R/Wdestination alpha
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
8 enable
0-7 alpha
+
+

+ + + +
+ + + + + +
0xcc0010062R/WAlpha Mode
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
8-15 mode
0-7 threshold
+
+

+ + + +
+ + + + + +
0xcc0010082R/WAlpha Read (?)
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
  mode
2 ?
+
+

+ + + +
+ + + + + +
0xcc00100a2R/WInterrupt Status Register
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
3 PE Finish (set to acknowledge)
2 PE Token (set to acknowledge)
1 PE Finish enable (?)
0 PE Token enable (?)
+
+

+ + + +
+ + + + + +
0xcc00100e2R/WPE Token ?
+
+ + + + + + + + + + + + + + +
15870
tttttttttttttttt
+
+ + + + + + + + + + + + +
bit(s) description
0-15tPE Token (asserted from last PE Token Interrupt)
+
+
index
+

+ +5.3  VI - Video Interface

+
+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0xcc0020000x1004
+
+

+ + + + + +
+ + + + + +
0xCC0020002R/WVTR - Vertical Timing Register
+
+ + + + + + + + + + + + + + +
15870
00aaaaaaaaaaeeee
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
4-13aACV - Active Video (in full Lines) ? other source says halflines
0-3eEQU - Equalization pulse in half lines
+
pal50/pal60/ntsc: 0x11F5, 0x0F06, 0x0F06
The value in ACV is double buffered
+

+ + + + +
+ + + + + +
0xCC0020022R/WDCR - Display Configuration Register
+
+ + + + + + + + + + + + + + +
15870
000000ppllttdire
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
 pFMT - Current Video Format
   + + + + + + + + + + + + + + + + + +
0NTSC
1PAL
2MPAL
3Debug
+
 lLE1 - Enables Display Latch 1
   + + + + + + + + + + + + + + + + + +
0Off
1On for 1 field
2On for 2 fields
3Always On
+
 tLE0 - Enables Display Latch 0
   + + + + + + + + + + + + + + + + + +
0Off
1On for 1 field
2On for 2 fields
3Always On
+
 dDLR - Selects 3D Display Mode
 iNIN - Interlace Selector
   + + + + + + + + + +
0Interlaced
1Non-Interlaced, top field drawn at field rate and bottom field is +not displayed
+
 rRST - Reset - Clears all data requests and puts VI into its idle state.
 eENB - Enable - Enables video timing generation and data request.
+
pal50/pal60/ntsc: 0x0101, 0x0001, 0x0001
+

+ + + + +
+ + + + + +
0xCC0020044R/WHTR0 - Horizontal Timing 0
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
0sssssss0eeeeeee0000000wwwwwwwww
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
 sHCS - Horizontal Sync Start to Color Burst Start
 eHCE - Horizontal Sync Start to Color Burst End
 wHLW - Halfline Width (W*16 = Width (720))
+
pal50/pal60/ntsc: 0x4B6A01B0, 0x476901AD, 0x476901AD
+

+ + + + + +
+ + + + + +
0xCC0020084R/WHTR1 - Horizontal Timing 1
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
00000sssssssssseeeeeeeeeewwwwwww
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
 sHBS - Half line to horizontal blanking start
 eHBE - Horizontal Sync Start to horizontal blank end
 wHSY - Horizontal Sync Width
+
pal50/pal60/ntsc: 0x02F85640, 0x02EA5140, 0x02EA5140
Setting bit 0 seems to blackout the screen. (Similar to ViBlack?)
+

+ + + + + +
+ + + + + +
0xCC00200C4R/WVTO - Odd Field Vertical Timing Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
......ssssssssss......rrrrrrrrrr
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
16-25sPSB - Post blanking in half lines
0-9rPRB - Pre-blanking in half lines
+
pal50/pal60/ntsc: 0x00010023, 0x00030018, 0x00030018
This register sets up the pre-blanking and post-blanking interval +of odd fields, PRB and PSB are double-buffered.
+

+ + + + + +
+ + + + + +
0xCC0020104R/WVTE - Even Field Vertical Timing Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
......ssssssssss......rrrrrrrrrr
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
16-25sPSB - post-blanking in halflines
0-9rPRB - pre-blanking in halflines
+
pal50/pal60/ntsc: 0x00000024, 0x00020019, 0x00020019
This register sets up the pre-blanking and post-blanking intervals +of even fields. PRB and PSB are double-buffered.
+

+ + + + +
+ + + + + +
0xCC0020144R/WBBEI - Odd Field Burst Blanking Interval Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
21-31 BE3 - Field 3 start to burst blanking end in halflines
16-20 BS3 - Field 3 start to burst blanking start in halflines
5-15 BE1 - Field 1 start to burst blanking end in halflines
0-4 BS1 - Field 1 start to burst blanking start in halflines
+
pal50/pal60/ntsc: 0x4D2B4D6D, 0x410C410C, 0x410C410C
+

+ + + + +
+ + + + + +
0xCC0020184R/WBBOI - Even Field Burst Blanking Interval Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
21-31 BE4 - Field 4 start to burst blanking end in halflines
16-20 BS4 - Field 4 start to burst blanking start in halflines
5-15 BE2 - Field 2 start to burst blanking end in halflines
0-4 BS2 - Field 2 start to burst blanking start in halflines
+
pal50/pal60/ntsc: 0x4D8A4D4C, 0x40ED40ED, 0x40ED40ED
+

+ + + + + +
+ + + + + +
0xCC00201c4R/WTFBL - Top Field Base Register (L) (External Framebuffer Half 1)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
yyy?zzzzaaaaaaaaaaaaaaaxxxxxxxxx
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
29-31yalways zero (maybe some write only control register stuff?, setting +bit 31 clears bits 31-28 (?))
28 page offset bit (*1)
24-27zXOF - Horizontal Offset of the left-most pixel within the first word +of the fetched picture.
9-23aFBB - bit 23 - bit 9 of XFB Address (*2)
0-8xunused (?)
+
pal50/pal60/ntsc: 0x00435A4E, 0x00435A4E, 0x00435A4E
This register specifies the display origin of the top field of a picture +in 2D mode or for the left picture in 3D mode
+

+(*1) when this bit is set, the framebuffer address is calculated +as (address> >5)
+(*2) if bit 28 is cleared, highest possible Address: 0x80fffe00 +(set register to 0x00fffe00) (aligned to 9bit)

+ + + + + +
+ + + + + +
0xCC0020204R/WTFBR - Top Field Base Register (R) (Only valid in 3D Mode)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
00000000fffffffffffffff000000000
+
+ + + + + + + + + + + + +
bit(s) description
 fFBB - External Memory Address of frame buffer
+
pal50/pal60/ntsc: 0x00000000, 0x00000000, 0x00000000
This register specifies the base address of the top field for the +right picture in 3D mode.
+

+ + + + + +
+ + + + + +
0xCC0020244R/WBFBL - Bottom Field Base Register (L) (External Framebuffer Half 2)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
yyyyyyyyaaaaaaaaaaaaaaaxxxxxxxxx
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
 yalways zero (maybe some write-only control register stuff?)
28 page offset bit (*1)
 aFBB - bit 23 - bit 9 of XFB Address
 xunused (?)
+
pal50/pal60/ntsc: 0x00435A4E, 0x00435A4E, 0x00435A4E
This register specifies the display origin of the bottom field of +a picture in 2D mode or for the left picture in 3D mode
+

+(*1) when this bit is set, the framebuffer address is calculated +as (address> >5)

+ + + + + +
+ + + + + +
0xCC0020284R/WBFBR - Bottom Field Base Register (R) (Only valid in 3D Mode)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
00000000fffffffffffffff000000000
+
+ + + + + + + + + + + + +
bit(s) description
 fFBB - External Memory Address of frame buffer
+
pal50/pal60/ntsc: 0x00000000, 0x00000000, 0x00000000
specifies the base address of the bottom field for the right picture +in 3D mode.
+

+ + + + +
+ + + + + +
0xCC00202C2RDPV - current vertical Position
+
+ + + + + + + + + + + + + + +
15870
00000vvvvvvvvvvv
+
+ + + + + + + + + + + + +
bit(s) description
 vVCT - current vertical Position of Raster beam
+
pal50/pal60/ntsc: 0x013C, 0x0005, 0x0000
+

+ + + + +
+ + + + + +
0xCC00202E2RDPH - current horizontal Position (?)
+
+ + + + + + + + + + + + + + +
15870
00000hhhhhhhhhhh
+
+ + + + + + + + + + + + +
bit(s) description
 hHCT - current horizontal Position of Raster beam (?)
+
pal50/pal60/ntsc: 0x0144, 0x0176, 0x0000
+

+The Horizontal Count is in pixels and runs from 1 to # pixels per +line. It is reset to 1 at the beginning of every line. +The Vertical Count is in lines (on a frame basis) and runs from 1 +to # lines per frame. It is 1 at the beginning of pre-equalization. +This is a frame line count. So for example: for NTSC vcount=264 is +the first (full) line in the second field and vcount=525 is the last +line in the frame (fields being numbered 1-4). For non-interlaced +modes vcount is on a field-by-field basis (for NTSC vcount ranges +from 1-263). +This counting scheme applies the Display Position, Display Interrupt, +and Display Latch registers.

+ + + + +
+ + + + + +
0xCC0020304R/WDI0 - Display Interrupt 0
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
i00e00vvvvvvvvvv000000hhhhhhhhhh
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
31iINT - Interrupt Status (1=Active) (Write to clear)
28eENB - Interrupt Enable Bit
16-25vVCT - Vertical Position
0-9hHCT - Horizontal Position
+
pal50/pal60/ntsc: 0x113901B1, 0x110701AE, 0x110701AE
+

+There are a total of four display interrupt registers (0-3). They +are used to generate interrupts to the main processor at different +positions within a field. Each register has a separate enable bit. +The interrupt is cleared by writing a zero to the status flag (INT). +

+ + + +
+ + + + + +
0xCC0020344R/WDI1 - Display Interrupt 1
+
pal50/pal60/ntsc: 0x10010001, 0x10010001, 0x10010001
Refer to Display Interrupt 0
+

+ + + +
+ + + + + +
0xCC0020384R/WDI2 - Display Interrupt 2
+
pal50/pal60/ntsc: 0x00010001, 0x00010001, 0x00010001
Refer to Display Interrupt 0
+

+ + + +
+ + + + + +
0xCC00203C4R/WDI3 - Display Interrupt 3
+
pal50/pal60/ntsc: 0x00010001, 0x00010001, 0x00010001
Refer to Display Interrupt 0
+

+ + + +
+ + + + + +
0xCC0020404R/WDL0 - Display Latch Register 0
+
+ + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
31 TRG - Trigger Flag
16-26 VCT - Vertical Count
0-10 HCT - Horizontal Count
+
pal50/pal60/ntsc: 0x0000, 0x0000, 0x0000
+

+The Display Latch Register 0 latches the value of the Display Position +Register at the rising edge of the gt0 signal. The trigger flag is +set if a gun trigger is detected. Writing a zero to the register clears +the trigger flag.

+ + +
+ + + + + +
0xCC0020444R/WDL1 - Display Latch Register 1
+
pal50/pal60/ntsc: 0x0000, 0x0000, 0x0000
+

+See the description of Display Latch Register 0. This register is +latched on the rising edge of the gt1 signal.

+ + + + +
+ + + + + +
0xCC0020482R/WHSW - Scaling Width Register
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + +
bit(s) description
0-9 SRCWIDTH - Horizontal Stepping size
+
pal50/pal60/ntsc: 0x2850, 0x2850, 0x2850
+

+This register is the number of source pixels to be scaled. This is +only used when the Horizontal Scaler is enabled. For example, if the +image is to be scaled from 320x240 to 640x240, 320 would be written +into this register.

+ + + + +
+ + + + + +
0xCC00204a2R/WHSR - Horizontal Scaling Register
+
+ + + + + + + + + + + + + + +
15870
000e000vvvvvvvvv
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
12eHS_EN - Enable Horizontal Scaling
0-8vSTP - Horizontal stepping size (U1.8 Scaler Value) (0x160 Works for +320)
+
pal50/pal60/ntsc: 0x0100, 0x0100, 0x0100
+

+This register sets up the step size of the horizontal stepper.

+ + + + + +
+ + + + + +
0xCC00204C4R/WFCT0 - Filter Coefficient Table 0 (AA stuff)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
20-29 T2 - Tap2
10-19 T1 - Tap1
0-9 T0 - Tap0
+
pal50/pal60/ntsc: 0x1AE771F0, 0x1AE771F0, 0x1AE771F0
sets up part of the low-pass filter. Taps 0 to 9 are in the range +(0.0, 2.0)
+

+ + + + +
+ + + + + +
0xcc0020504R/WFCT1 - Filter Coefficient Table 1 (AA stuff)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
20-29 T5 - Tap5
10-19 T4 - Tap4
0-9 T3 - Tap3
+
pal50/pal60/ntsc: 0x0DB4A574, 0x0DB4A574, 0x0DB4A574
+

+ + + + + +
+ + + + + +
0xcc0020544R/WFCT2 - Filter Coefficient Table 2 (AA stuff)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
20-29 T8 - Tap8
10-19 T7 - Tap7
0-9 T6 - Tap6
+
pal50/pal60/ntsc: 0x00C1188E, 0x00C1188E, 0x00C1188E
sets up part of the low-pass filter
+

+ + + + + +
+ + + + + +
0xcc0020584R/WFCT3 - Filter Coefficient Table 3 (AA stuff)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24-31 T12 - Tap12
16-23 T11 - Tap11
8-15 T10 - Tap10
0-7 T9 - Tap9
+
pal50/pal60/ntsc: 0xC4C0CBE2, 0xC4C0CBE2, 0xC4C0CBE2
sets up part of the low-pass filter. Taps 9 to tap 24 are in the Rage +(-0.125, 0.125)
+

+ + + + +
+ + + + + +
0xcc00205c4R/WFCT4 - Filter Coefficient Table 4 (AA stuff)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24-31 T16 - Tap16
16-23 T15 - Tap15
8-15 T14 - Tap14
0-7 T13 - Tap13
+
pal50/pal60/ntsc: 0xFCECDECF, 0xFCECDECF, 0xFCECDECF
+

+ + + + +
+ + + + + +
0xcc0020604R/WFCT5 - Filter Coefficient Table 5 (AA stuff)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24-31 T20 - Tap20
16-23 T19 - Tap19
8-15 T18 - Tap18
0-7 T17 - Tap17
+
pal50/pal60/ntsc: 0x13130F08, 0x13130F08, 0x13130F08
+

+ + + + + +
+ + + + + +
0xcc0020644R/WFCT6 - Filter Coefficient Table 6 (AA stuff)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24-31 T24 - Hardwired to zero
16-23 T23 - Tap23
8-15 T22 - Tap22
0-7 T21 - Tap21
+
pal50/pal60/ntsc: 0x00080C0F, 0x00080C0F, 0x00080C0F
sets up part of the low-pass filter
+

+ + +
+ + + + + +
0xcc0020684R/W? (AA stuff)
+
pal50/pal60/ntsc: 0x00FF0000, 0x00FF0000, 0x00FF0000
+

+ + + + +
+ + + + + +
0xCC00206C2R/WVICLK - VI Clock Select Register
+
+ + + + + + + + + + + + + + +
15870
000000000000000s
+
+ + + + + + + + + + + + +
bit(s) description
 s + + + + + + + + + +
027 MHz video CLK
154 MHz video CLK (used in Progressive Mode)
+
+
pal50/pal60/ntsc: 0x0000, 0x0000, 0x0000
+

+ + + + + +
+ + + + + +
0xCC00206e2R/WVISEL - VI DTV Status Register
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + +
bit(s) description
2 VISEL - don't care
+
pal50/pal60/ntsc: 0x0000, 0x0000, 0x0000
this register allows software to read the status of two i/o pins
+

+ + + +
+ + + + + +
0xCC0020702R/W?
+
Holds 0x280, but has no effect on change (maybe for Progressive ?)
pal50/pal60/ntsc: 0x0280, 0x0280, 0x0280
+

+ + + + +
+ + + + + +
0xCC0020722r/wHBE - Border HBE
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
15 BRDR_EN - Border Enable
0-9 HBE656 - Border Horizontal Blank End
+
pal50/pal60/ntsc: 0x0000, 0x0000, 0x0000
+

+This register (in conjunction with the border HBS) sets up a black +border around the actual active pixels in debug mode. This was done +in order to accommodate certain encoders that only support 720 active +pixels. The border HBE and HBS can be programmed for 720 active pixels +while the regular HBE and HBS can be programmed to the actual active +width. This allows the frame buffer to be of any width without having +to manually set up a border in memory. These registers will only take +effect if enabled and in debug mode.

+ + + + +
+ + + + + +
+0xcc002074 2r/wHBS - Border HBS
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + +
bit(s) description
0-9 HBS656 - Border Horizontal Blank start
+
pal50/pal60/ntsc: 0x0000, 0x0000, 0x0000
+

+ + +
+ + + + + +
+0xcc002076 2?/?? (unused?)
+
pal50/pal60/ntsc: 0x00FF, 0x00FF, 0x00FF
+

+ + +
+ + + + + +
0xcc0020784?/?? (unused?)
+
pal50/pal60/ntsc: 0x00FF00FF, 0x00FF00FF, 0x00FF00FF
+

+ + +
+ + + + + +
0xcc00207c4?/?? (unused?)
+
pal50/pal60/ntsc: 0x00FF00FF 0x00FF00FF, 0x00FF00FF
+
index
+

+ +5.3.1  Video Modes

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ModeTV Norm / RegionFramerateColumnsLines
NTSCntsc (usa, japan)60Hz640480
PALpal (europe)50Hz640574
DEBUG    
DEBUG PAL    
MPALpal (brazil)60Hz640480
PAL60pal60Hz640480
+

+note: other modes may be possible using VGA output, although its unlikely. +
index
+

+ +5.4  PI - Processor Interface

+
+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0xcc0030000x1004
+
+

+ + + +
+ + + + + +
0xCC0030004rINTSR - interrupt cause
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
...............r................
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit  Description
17-31  unused/reserved
16rRSWSTReset Switch State (1 when pressed)
14-15  unused/reserved
13 HSPHigh Speed Port
12 DEBUGExternal Debugger
11 CPCommand FIFO
10 PE FINISHFrame is Ready
9 PE TOKENToken Assertion in Command List
8 VI Video Interface
7 MEMMemory Interface
6 DSPDSP
5 AIStreaming
4 EXIEXI
3 SISerial
2 DIDVD
1 RSWReset Switch
0 ERRORGP runtime error
+
+ 
 
+ + + +
+ + + + + +
0xCC0030044r/wINTMR - interrupt mask
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit  Description
13 HSPHigh Speed Port
12 DEBUGExternal Debugger
11 CPCommand FIFO
10 PE FINISHFrame is Ready
9 PE TOKENToken Assertion in Command List
8 VI Video Interface
7 MEMMemory Interface
6 DSPDSP
5 AIStreaming
4 EXIEXI
3 SISerial
2 DIDVD
1 RSWReset Switch
0 ERRORGP runtime error
+
+

+ + + + + + +
0xCC00300c4r/wFIFO Base Start
+
+
 
+ + + + + + +
0xCC0030104?/?FIFO Base End?
+
+ 
 
+ + + + + + +
0xCC0030144?/?PI (cpu) FIFO current Write Pointer?
+
+ 
 
+ + + + + + +
0xCC0030184?/??
+
+ 
 
+ + + + + + +
0xCC00301c4?/??
+
+ 
 
+ + + + + + +
0xCC0030204?/??
+
+

+ + +
+ + + + + + +
0xCC0030244?/?Reset?
+
Writing anything here seems to cause a complete reset.
+ 
 
+ + + +
+ + + + + + +
0xCC00302c4?/??
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + +
bit(s) Description
28-31 console type (2: hw2)
+
+ 
index
+

+ +5.4.1  Operation

+
5.4.1.1 +   FIFO/Write Gather Pipe +when CPU writes a byte to 0xcc008000, it is written to mem[writeptr], +and writeptr is increased automatically.

+0xcc008000 is the write gather pipe, a way for the CPU to blast sequences +of things of various sizes to memory without having to keep track +of the write pointer and wrapping manually. the gp then reads what +the CPU has written to memory. It is used for Display Lists. it will +disconnect the GP from the writegatherpipe (cc000002 & 0x10 = 0), +and change the write ptr to where it wants to write a display list.. +then use ordinary GX commands to build it. there's a Call Displaylist +GX command.. so it will store render commands for rendering a certain +object (for example) in a display list in memory, then send the CallDL +with the address to the list instead of sending all the vertices over +the FIFO. +
5.4.1.2 +   Interrupts +
+
+Each interrupt has one or more "source" devices. +It means that some kind of device may generate a couple of different +interrupts, represented by a single bit in interrupt registers. To +"enable" interrupt, set bit in mask register. To +ignore all interrupts write 0 to interrupt mask register. Raising +of any interrupt will set corresponding bit in interrupt cause register. +Interrupt cause register resets to 0, when read (i.e. you must read +it to clear pending interrupts).

+Interrupt mask register isn't controlled by hardware logic. Note that +masking of interrupt in INTMR doesn't disable it at all. It is only +causing masked interrupt to be ignored in the software interrupt handler. +You must clear corresponding "source" device registers, +to completely disable interrupt.

5.4.1.3 +   hotreset +
+
+this code snippet will reset the machine almost as if powered off/on

        lis r3,0 
        lis r9,0xCC00 
        sth r3, 0x2000(r9) 
        li r4, 3 
        stw r4, 0x3024(r9) 
        stw r3, 0x3024(r9) 
        nop 
loop__: 
        b loop__ 
index
+

+ +5.5  MI - Memory Interface

+
+Protection can be enabled only for pages (page size is 1024 bytes), +and you can specify only 4 protected regions of memory. External interrupt +will be raised, if CPU try to wrong access in protected region. Because +it's allowed to enable protection for 4 regions only, there are a +total of 4 possible interrupts which are called MEM_0, MEM_1, MEM_2 +and MEM_3.

+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0xcc0040000x804
+
+ 
 
+ + + + + + +
+ + + + + + +
0xCC0040004r/wProtected Region No1
+
+ + + + + + +
0xCC0040044r/wProtected Region No2
+
+ + + + + + +
0xCC0040084r/wProtected Region No3
+
+ + + + + + +
0xCC00400c4r/wProtected Region No4
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
llllllllllllllllhhhhhhhhhhhhhhhh
+
+ + + + + + + + + + + + + + + + +
bit(s) Description
16-31lPage Address Lo
0-15hPage Address Hi
+
+ 
 
note: the page address can be calculated as (physical_address> >10) 
 
+ + + +
+ + + + + + +
0xCC0040102r/wtype of the protection, 4*2 bits
+
+ + + + + + + + + + + + + + +
15870
........33221100
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
  unused/reserved
63Channel 3
   + + + + + + + + + + + + + + + + + +
0access denied
1read only (break on write)
2write only (break on read)
3read / write (no protection, full access)
+
42Channel 2 (see Channel 3)
21Channel 1 (see Channel 3)
00Channel 0 (see Channel 3)
+
+ 
 
+ + + +
+ + + + + + +
0xCC00401c2?/wMI interrupt mask
+
+ + + + + + + + + + + + + + +
15870
...........m3210
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
4mmask all MI interrupts (1 - enable)
33mask MEM3 interrupt (1 - enable)
22mask MEM2 interrupt (1 - enable)
11mask MEM1 interrupt (1 - enable)
00mask MEM0 interrupt (1 - enable)
+
+ 

+ + + +
+ + + + + + +
0xCC00401e2r/winterrupt cause
+
+ + + + + + + + + + + + + + +
15870
...........m3210
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
4mall MI interrupts
33MEM3 interrupt
   + + + + + + + + + + + + + + + + + + + + + +
read0irq has not been requested
 1irq has been requested
write0no effect
 1clear pending irq assertion
+
22MEM2 interrupt
   + + + + + + + + + + + + + + + + + + + + + +
read0irq has not been requested
 1irq has been requested
write0no effect
 1clear pending irq assertion
+
11MEM1 interrupt
   + + + + + + + + + + + + + + + + + + + + + +
read0irq has not been requested
 1irq has been requested
write0no effect
 1clear pending irq assertion
+
00MEM0 interrupt
   + + + + + + + + + + + + + + + + + + + + + +
read0irq has not been requested
 1irq has been requested
write0no effect
 1clear pending irq assertion
+
+
+

+ + + +
+ + + + + + +
0xCC0040202?/??
+
+ + + + + + + + + + + + + + +
15870
..............m.
+
+ + + + + + + + + + + + + + + + +
bit(s) Description
11? (set when MI interrupt has been asserted)
00?
+
+

note: assume to be zero, after init, and should be cleared +by interrupt handler. 
 
+ + + +
+ + + + + + +
0xCC0040222r/?ADDRLO - address which failed protection rules
+
+ + + + + + + + + + + + + + +
15870
................
+
+ + + + + + + + + + + + + + + + +
bit(s) Description
5-15 bit 5-bit 15 of address
0-4 zero
+
+ 

+ + + +
+ + + + + + +
0xCC0040242r/?ADDRHI - address, which failed protection rules
+
+ + + + + + + + + + + + + + +
15870
................
+
+ + + + + + + + + + + + + + + + +
bit(s) Description
14-15 zero
0-13 bit 16-bit 29 of address
+
+

+ + +
+ + + + + + +
0xCC0040322r/?TIMERHI
+
+ + + + + + +
0xCC0040342r/?TIMERLO
+
+

+ + +
+ + + + + + +
0xCC0040362r/?TIMERHI
+
+ + + + + + +
0xCC0040382r/?TIMERLO
+
+

+ + +
+ + + + + + +
0xCC00403a2r/?TIMERHI
+
+ + + + + + +
0xCC00403c2r/?TIMERLO
+
+

+ + +
+ + + + + + +
0xCC00403e2r/?TIMERHI
+
+ + + + + + +
0xCC0040402r/?TIMERLO
+
+

+ + +
+ + + + + + +
0xCC0040422r/?TIMERHI
+
+ + + + + + +
0xCC0040442r/?TIMERLO
+
+

+ + +
+ + + + + + +
0xCC0040462r/?TIMERHI
+
+ + + + + + +
0xCC0040482r/?TIMERLO
+
+

+ + +
+ + + + + + +
0xCC00404a2r/?TIMERHI
+
+ + + + + + +
0xCC00404c2r/?TIMERLO
+
+

+ + +
+ + + + + + +
0xCC00404e2r/?TIMERHI
+
+ + + + + + +
0xCC0040502r/?TIMERLO
+
+

+ + +
+ + + + + + +
0xCC0040522r/?TIMERHI
+
+ + + + + + +
0xCC0040542r/?TIMERLO
+
+

+ + +
+ + + + + + +
0xCC0040562r/?TIMERHI
+
+ + + + + + +
0xCC0040582r/?TIMERLO
+
+

+note: writing anything to the timer register resets it to zero

+ + + +
+ + + + + + +
0xCC00405a2r/??
+
+ + + + + + + + + + + + + + +
15870
.....xxxxxxxxxxx
+
+ + + + + + + + + + + +
bit(s) Description
11-15 unused ?
+
+
index
+

+ +5.6  DSP - Digital Signal Processor Interface

+
+At the heart of the GCN audio hardware is a custom digital signal +processor (DSP) which is largely dedicated to pitch modulation and +the mixing of voices and effects data. The DSP is augmented by a large +quantity of auxiliary RAM (ARAM) which may be used to store audio +samples.The GCN audio hardware features a custom digital signal processor +(DSP) which has the following characteristics: + +
+ + + + + + + + + + + +
Register block BaseSize of Register blockcommon access size
0xCC005000 +0x200 bytes16bit words
+
+ 
 
+ + + + +
+ + + + + + +
0xCC0050002r/wDSP Mailbox High (to DSP)
+
+ + + + + + +
0xCC0050022r/wDSP Mailbox Low (to DSP)
+
bit31 of DSP Mailbox shows mail delivery status. (it will be cleared +when the transfer is done)
to send mail just write data, high word first, with bit31 set.
+ 
 
+ + + +
+ + + + + + +
0xCC0050042rCPU Mailbox High (from DSP)
+
+ + + + + + +
0xCC0050062rCPU Mailbox Low (from DSP)
+
bit31 of CPU Mailbox shows mail delivery status.
+ 
 
+ + + +
+ + + + + + +
0xCC00500a2?/wAI DSP CSR - Control Status Register (DSP Status)
+
+ + + + + + + + + + + + + + +
15870
................
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
11 Reset DSP (?)
10  
9 DSP DMA Int Status
8 DSPINTMSK - DSP interrupt mask (*1)
7 DSPINT
   + + + + + + + + + + + + + + + + + + + + + +
read0no interrupts
 1interrupt is active
write0no effect
 1clear interrupt
+
6 ARINTMSK - ARAM interupt mask (*2)
5 ARINT -
   + + + + + + + + + + + + + + + + + + + + + +
read0no interrupts
 1interrupt is active
write0no effect
 1clear interupt
+
4 AIDINTMASK - AI interrupt mask (*3)
3 AIDINT
   + + + + + + + + + + + + + + + + + + + + + +
read0no interrupts
 1interrupt is active
write0no effect
 1clear interrupt
+
2 HALT - Halt DSP (?)
   + + + + + + + + + + + + + + + + + + + + + +
read0 
 1 
write0unhalt DSP
 1halt DSP (stop task execution)
+
1 PIINT - DSP Interrupt Assertion (?)
   + + + + + + + + + + + + + + + + + + + + + +
read0 
 1 
write0 
 1assert PI DSP interrupt
+
0 RES - Reset DSP (?)
   + + + + + + + + + + + + + + + + + + + + + +
read0 
 1 
write0 
 1reset DSP
+
+
+ 

+(*1) disables only PI interrupt, doesnt effect assertion of DSPINT.
+(*2) disables only PI interrupt, doesnt effect assertion of ARINT.
+(*3) disables only PI interrupt, doesnt effect assertion of AIDINT.

+ + + + + + +
0xCC0050122?/?AR_SIZE
+
+

+ + + + + + +
0xCC0050162?/?AR_MODE
+
+

+ + + + + + +
0xCC00501a2?/?AR_REFRESH
+
+

+ + + + + + +
0xCC0050202?/?AR_DMA_MMADDR_H
+
+

+ + + + + + +
0xCC0050222?/?AR_DMA_MMADDR_L
+
+ 
 
+ + + + + + +
0xCC0050242?/?AR_DMA_ARADDR_H
+
+ 
 
+ + + + + + +
0xCC0050262?/?AR_DMA_ARADDR_L
+
+ 
 
+ + +
+ + + + + + +
0xCC0050282?/?AR_DMA_CNT_H
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
15 type of transfer (0: write to aram 1: read from aram)
0-14 high bits of transfer length
+
+ 
 
+ + + + + + +
0xCC00502a2?/?AR_DMA_CNT_L
+
+ 
 
+ + +
+ + + + + + +
0xCC0050302?/wDMA Start address (High)
+
Start of Audio Data
+ 
 
+ + +
+ + + + + + +
0xCC0050322?/wDMA Start address (Low)
+
Start of Audio Data
+ 
 
+ + + +
+ + + + + + +
0xCC0050362?/wDMA Control/DMA length (Length of Audio Data)
+
+ + + + + + + + + + + + + + +
15870
axxxxxxxxxxxxxxx
+
+ + + + + + + + + + + + + + + + +
bit(s) Description
 a0=stop sample 1=play sample
 xlength/32 (max len is 0x000fffe0)
+
+ 
 
+ + +
+ + + + + + +
0xCC00503a2r/?DMA Bytes left
+
Counts down to zero showing how any bytes are left
+
index
+

+ +5.6.1  internal DSP Registers

+
+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0xffc9 2
+
+

+ + + +
+ + + + + +
0xFFC92r/wDSCR - DSP dma Control Register
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
3-15 unused/reserved
2 DSP DMA busy
   + + + + + + + + + + + + + + + + + + + + + +
read0 
 1Block length counter not yet zero, DMA is still busy
write0no effect ?
 1no effect ?
+
1 DSP source/destination (DMA involved DSP memory)
   + + + + + + + + + +
0DSP data memory
1DSP instruction memory
+
0 transfer direction
   + + + + + + + + + +
0from main memory to DSP memory
1from DSP memory to main memory
+
+
+

+ + + +
+ + + + + +
0xFFCB2r/wDSBL - DSp dma Block Length
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
2-15 block length - This register is used to specify DSP DMA transfer length +from bit 15 to bit 2
0-1 r: 2 bit of its LSBs - The transfer length is a multiple of 4 bytes
+
+

+ + + +
+ + + + + +
0xFFCD2r/wDSPA - DSp dma dsP memory Address High
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
1-15 DSP memory address - This register is used to specify DSP memory starting/current +address from bit 15 to bit 1
0 r: 1 bit of its LSBs - The DSP memory address should be located at +2 word boundary
+
+

+ + + +
+ + + + + +
0xFFCE2r/wDSMAH - DSp dma Main memory Address High
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
10-15 r: 6 bits of its MSBs - This register is used to specify DSP DMA main +memory starting/current address from bit 31 to bit 26, and always +0
0-9 main memory address high word - This register is used to specify DSP +DMA main memory starting/current address from bit 25 to bit 16
+
+

+ + + +
+ + + + + +
0xFFCF2r/wDSMAL - DSp dma Main memory Address Low
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
2-15 main memory address - This register is used to specify DSP DMA main +memory starting/current address from bit 15 to bit 2
0-1 r: 2 bits of its LSBs - The main memory address of this DMA should +be located at 4 byte boundary
+
+

+ + + +
+ + + + + +
0xFFD42r/wACSAH - Accelerator aram Starting Address High
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
11-15 unused/reserved
0-10 wtarting address high-word - Bit 26 to bit 16 of ARAM starting address
+
+

+ + + +
+ + + + + +
0xFFD52r/wACSAL - Accelerator aram Starting Address Low
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + +
bit(s) description
0-15 Starting address low-word - Bit 15 to bit 0 of ARAM starting address
+
+

+ + + +
+ + + + + +
0xFFD62wACEAH - Accelerator aram Ending Address High
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
15-11 unused/reserved
0-10 ending address high-word - Bit 26 to bit 16 of ARAM ending address
+
+

+ + + +
+ + + + + +
0xFFD72wACEAL - Accelerator aram Ending Address Low
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + +
bit(s) description
0-15 ending address low-word - Bit 15 to bit 0 of ARAM ending address
+
+

+ + + +
+ + + + + +
0xFFD82r/wACCAH - Accelerator aram Current Address High
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
15 direction
   + + + + + + + + + +
0accelerator read ARAM
1accelerator write ARAM
+
11-14 unused/reserved
0-10 current address high-word - Bit 26 to bit 16 of ARAM current address
+
+

+ + + +
+ + + + + +
0xFFD92r/wACCAL - Accelerator aram Current Address Low
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + +
bit(s) description
0-15 Bit 15 to Bit 0 of ARAM current address
+
+

+ + + +
+ + + + + +
0xFFEF2r/wAMDM - ARAM-Dma request Mask
+
+ + + + + + + + + + + + + + +
15870
    
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
1-15 unused/reserved
0  + + + + + + + + + +
0DMA request ARAM is unmasked
1DMA request ARAM is masked
+
+
+

index
+

+ +5.6.2  Operation

+
5.6.2.1 +   play raw audio sample +
+
+5.6.2.2 +   transfer from/to ARAM + +
5.6.2.3 +   reset DSP +
+
+
5.6.2.4 +   Boot DSP Task +
+
+
index
+

+ +5.7  DI - DVD Interface

+
+ + + + + + + + + + + +
Register block BaseSize of Register blockcommon access size
0xCC0060000x404
+
+

+ + + +
+ + + + + + +
0xCC0060004r/wDISR - DI Status Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
7-31 reserved
6 BRKINT - Break Complete Interrupt Status (*1)
   + + + + + + + + + + + + + + + + + + + + + +
read0Interrupt has not been requested
 1Interrupt has been requested
write0no effect
 1clear Interrupt
+
5 BRKINTMASK - Break Complete Interrupt Mask. 0:masked, 1:enabled (*2)
4 TCINT - Transfer Complete Interrupt Status (*3)
   + + + + + + + + + + + + + + + + + + + + + +
read0Interrupt has not been requested
 1Interrupt has been requested
write0no effect
 1clear Interrupt
+
3 TCINTMASK - Transfer Complete Interrupt Mask. 0:masked, 1:enabled +(*4)
2 DEINT - Device Error Interrupt Status (*5)
   + + + + + + + + + + + + + + + + + + + + + +
read0Interrupt has not been requested
 1Interrupt has been requested
write0no effect
 1clear Interrupt
+
1 DEINTMASK - Device Error Interrupt Mask. 0:masked, 1:enabled (*6)
0 BRK - DI Break (*7)
   + + + + + + + + + + + + + + + + + + + + + +
read0break not requested or break complete
 1break requested and pending
write0no effect
 1request break
+
+
+

+(*1) On read this bit indicates the current status of the break +complete interrupt. This interrupt is asserted when a Break cycle +has completed (break acknowledge received from mass storage access +device). When a `1` is written to this register, the interrupt is +cleared.
+(*2) Interrupt masking prevents the interrupt from being sent to +the main processor, but does not affect the assertion of DISR[BRKINT]
+(*3) On read this bit indicates the current status of the transfer +complete interrupt. The Transfer Complete interrupt is asserted under +the following conditions: a DMA mode transfer has completed (DMA finished) +or an Immediate mode transfer has completed (transfer to/from DIIMMBUF +has completed). When a `1` is written to this register, the interrupt +is cleared. The assertion of TCIT is delayed until the DIDSTRBb (low) +in order to guarantee the error interrupt occurs before transfer complete +interrupt. If DIERRb is asserted during the current transaction, the +transaction will be halted and TCINT will not be asserted.
+(*4) Interrupt masking prevents the interrupt from being sent to +the main processor, but does not affect the assertion of DISR[TCINT]
+(*5) On read this bit indicates the current status of the mass storage +access device error interrupt. To clear this interrupt, two actions +must occur. When a `1` is written to this register, the internal interrupt +is cleared. To reset the DIERRb signal, a command must be issued to +the external DI device. If error occurs during the command packet, +the drive has to delay the error assertion until the completion of +the 12 bytes command transfer. In immediate mode, if error occurs +during the data packet, the error assertion has to be delayed until +the completion of the 4 bytes data transfer. In DMA mode, it has to +be delayed until the completion of any 32 bytes data transfer.
+(*6) Interrupt masking prevents the interrupt from being sent to +the main processor, but does not affect the assertion of DISR[DEINT]
+(*7) When a `1` is written to this bit, the DI controller interrupts +the current command and sends a break signal to the mass storage access +device. The break signal interrupts the current command on the mass +storage access device. After the break sequence is complete (see TCINT), +a new command may be sent to the mass storage access device. This +bit is cleared after the break command is complete. Note that DI controller +will delay the break signal assertion if it is in the middle of the +command transfer. Hence break can only occur during the data transfer +or when it is idle.

+ + + +
+ + + + + + +
0xCC0060044r/wDICVR - DI Cover Register (status2)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
.............................smc
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
2sCVRINT - Cover Interrupt Status (*1)
   + + + + + + + + + + + + + + + + + + + + + +
read0cover interrupt has not been requested
 1cover interrupt has been requested
write0no effect
 1clear cover interrupt
+
1mCVRINTMASK - Cover Interrupt Mask. 0: masked, 1: enabled (*2)
0cCVR - State of the DICOVER signal. 0: cover closed, 1: cover opened
+
+ 
 
+(*1) On read this bit indicates the current status of the Mass Storage +Device Cover interrupt. When a `1` is written to this register, the +internal interrupt is cleared. The Mass Storage Device Cover Interrupt +is asserted when the status of the DICOVER signal changes (e.g., when +the cover is opened or closed).
+(*2) Interrupt masking prevents the interrupt from being sent to +the main processor, but does not affect the assertion of DISR[CVRINT]. 
 
+ + + +
+ + + + + + +
0xCC0060084r/wDICMDBUF0 - DI Command Buffer 0
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
cccccccc111111112222222222222222
+
+ + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
24-31ccommand
16-231subcommand 1
0-152subcommand 2
+
+
 
+ + + + + + +
0xCC00600c4r/wDICMDBUF1 - DI Command Buffer 1 (offset in 32 bit words)
+
+ 
 
+ + + + + + +
0xCC0060104r/wDICMDBUF2 - DI Command Buffer 2 (source length)
+
+ 
 
+ + + +
+ + + + + + +
0xCC0060144r/wDIMAR - DMA Memory Address Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
26-31 reserved/unused
5-25 DIMAR - Address of source/destination buffer in main Memory
0-4 always zero (Address must be 32 byte aligned)
+
+ 
 
+ + + +
+ + + + + + +
0xCC0060184r/wDILENGTH - DI DMA Transfer Length Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
26-31 reserved/unused
5-25 DILENGTH - length of DMA data transfer in bytes (*1)
0-4 always zero (transfer length must be 32 byte aligned)
+
+ 
 
+(*1) If a DMA command is interrupted by a break cycle, this register +indicates the amount of data that was left to transfer before the +DMA command was interrupted. If the length equals zero, it is a special +case with command transfer only. 
 
+ + + +
+ + + + + + +
0xCC00601c4r/wDICR - DI Control Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
.............................mbe
+
+ + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
2mRW - access mode, 0:read, 1:write
1bDMA - 0: immediate mode, 1: DMA mode (*1)
0eTSTART - transfer start. write 1: start transfer, read 1: transfer +pending (*2)
+
+ 
 
+(*1) The only mass storage device packet command which can use immediate +mode is the `Register Access` command. When in immediate mode, the +DIMAR and DILENGTH registers are ignored. 
 
+(*2) When read this bit represents the current command status. This +bit is also cleared after the break completion and after DIERRb is +asserted. 
 
+ + + +
+ + + + + + +
0xCC0060204r/wDIIMMBUF - DI immediate data buffer (error code ?)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24-31 REGVAL0 - data of register address+0
16-23 REGVAL1 - data of register address+1
8-15 REGVAL2 - data of register address+2
0-7 REGVAL3 - data of register address+3
+
+ 
 
+ + + +
+ + + + + + +
0xCC0060244rDICFG - DI Configuration Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
8-31 reserved/unused
0-7 CONFIG - during reset this register latches DIDD bus (only bit 0 used)
+
+
index
+

+ +5.7.1  Drive Commands

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DICMDBUF0DICMDBUF1DICMDBUF2DIMARDILENGTHDIIMMBUFDICRDescription
0x120000000x000000000x00000020ret: Drive-Info0x00000020-DMA readInquiry
0xa8000000Data-Position> >2Data-Lengthret: Sector-DataData-Length-DMA readread Sector
0xa80000400x000000000x00000020ret: Disc-ID0x00000020-DMA readread Disc ID/Init Drive
0xa8000080???????
0xa80000C0???????
0xab000000Position> >2----imm (read)seek
0xe0000000----ret: Error-Codeimm readrequest error Status
0xe1??0000Stream-Position> >2Stream-Length---imm readplay Audio Stream (?)
0xe2??0000----ret: Status (?)imm readrequest Audio Status
0xe3000000-----imm (read)stop Motor
0xe4000000-----imm (read)DVD Audio disable
0xe4010000-----imm (read)DVD Audio enable
+
+
index
+

+ +5.7.2  Drive Debug Commands

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DICMDBUF0DICMDBUF1DICMDBUF2DIMARDILENGTHDIIMMBUFDICRDescription
0xfe00???????????
0xfe010000offset0x00010000--ret: 32bit valueimm (read)read memory
0xfe010100offset0x00010000--32bit valueimm (write)write memory
0xfe018000offset0xff000000--ret: 32bit valueimm (read)read cache
0xfe018100offset0xff000000--32bit valueimm (write)write cache
0xfe100000??---imm (read)?
0xfe110000 (*)-----imm (read)stop drive
0xfe110100 (*)-----imm (read)start drive
0xfe114000 (*)-----imm (read)accept copy
0xfe118000 (*)-----imm (read)do disc-check
0xfe12000024bit address0x66756e63---imm (read)jsr to address 'func'
0xff0044560x442d47410x4d450300---imm (read)unlock 2 'DVD-GAME'
0xff014d410x545348490x5441024f---imm (read)unlock 1 'MATSHITA'
+
+

+(*) commands can be ORed to perform several actions at once +
index
+

+ +5.7.3  Operation

+
5.7.3.1 +   Drive Info (Inquiry) +
+

    + 5.7.3.1.1  Structure of the Drive Info Data +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizeDescription
0x00000x00010x02revision level
0x00020x00030x02device code
0x00040x00070x04release date
0x00080x001F0x18padding zeros
+
+
5.7.3.2 +   Read Disc ID / Init Disc +
5.7.3.3 +   Read Sector +
+
5.7.3.4 +   Seek +
+
5.7.3.5 +   Request Error +
+

    + 5.7.3.5.1  Error Codes + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
aaaaaaaannnnnnnnnnnnnnnnnnnnnnnn
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
 a + + + + + + + + + + + + + + + + + + + + + + + + + +
0x00ok
0x01lid open
0x02no disc/disc changed
0x03no disc
0x04motor off
0x05disc not initialized/disc id not read
+
 n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0x000000ok
0x020400Motor stopped
0x020401Disk ID not read
0x023A00Medium not present / Cover opened
0x030200No Seek complete
0x031100UnRecoverd read error
0x040800Transfer protocol error
0x052000Invalid command operation code
0x052001Audio Buffer not set
0x052100Logical block address out of range
0x052400Invalid Field in command packet
0x052401Invalid audio command
0x052402Configuration out of permitted period
0x056300End of user area encountered on this track
0x062800Medium may have changed
0x0B5A01Operator medium removal request
+
+
+
5.7.3.6 +   Play Audio Stream +
+
5.7.3.7 +   Request Audio Status +
+
5.7.3.8 +   Stop Motor +
+
5.7.3.9 +   DVD Audio Disable +
+
5.7.3.10 +   DVD Audio Enable +
+
+
5.7.3.11 +   Write Mem debug command +
+
+Note: This command is not really a single command but two commands +in sequence. +This command writes 'length' bytes to the specified address 'address' +in the DVD drive addressable memory. 'length' is specified in bytes +and must be in the range 1 to 12. If more data needs to be written, +several commands need to be issued. 'address' is a 24 bit value, but +a 32 bit value can be safely used. 'length' is a 16 bit value. + +
index
+

+ +5.7.4  DVD-ROM Subsystem

+
+
5.7.4.1 +   Memory Map +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x00008000 4kbinternal (cpu) ram
0x00080000 128kbfirmware rom (*)
0x00400000  internal (controller) ram
+
+ 
 
+(*) note: reading the firmware at its real location is prevented +by the debug commands (imm buffer will not be changed at all). however +you can read its contents from the memory mirrors, ie 0x000a0000-. +
index
+

+ +5.8  SI - Serial Interface

+
+ + + + + + + + + + + +
Register block BaseSize of Register blockcommon access size
0xCC0064000x1004
+
+

+ + + + + + +
+ + + + + + +
0xCC0064004r/wSIC0OUTBUF - SI Channel 0 Output Buffer (Joy-channel 1 Command)
+
+ + + + + + +
0xCC00640c4r/wSIC1OUTBUF - SI Channel 1 Output Buffer (Joy-channel 2 Command)
+
+ + + + + + +
0xCC0064184r/wSIC2OUTBUF - SI Channel 2 Output Buffer (Joy-channel 3 Command)
+
+ + + + + + +
0xCC0064244r/wSIC3OUTBUF - SI Channel 3 Output Buffer (Joy-channel 4 Command)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24-31 unused/reserved
16-23 CMD - (*1)
8-15 OUTPUT0 - (*2)
0-7 OUTPUT1 - (*3)
+
+
 
+This register is double buffered, so main processor writes to the +SIC0OUTBUF will not interfere with the serial interface output transfer. +Internally, a second buffer is used to hold the output data to be +transferred across the serial interface. To check if SIC0OUTBUF has +been transferred to the second buffer, main processor polls the SISR[WRST0] +register. When SICOOUTBUF is transferred, SISR[WRST0] is cleared.

+(*1) This byte is the opcode for the command sent to the controller +during each command/response packet. This is the first data byte sent +from the SI I/F to the game controller in the command/response packet.
+(*2) This is the first data byte of the command packet. It is the +second data byte sent from the SI I/F to the game controller in the +command/response packet.
+(*3) This is the second data byte of the command packet. +It is the third data byte sent from the SI I/F to the game controller +in the command/response packet. 
 
+ + + + + + +
+ + + + + + +
0xCC0064044rJoy-channel 1 Buttons 1
+
+ + + + + + +
0xCC0064104rSIC1INBUFH - SI Channel 1 Input Buffer High (Joy-channel 2 Buttons +1)
+
+ + + + + + +
0xCC00641c4rJoy-channel 3 Buttons 1
+
+ + + + + + +
0xCC0064284rJoy-channel 4 Buttons 1
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
...syxba..LRudrlxxxxxxxxyyyyyyyy
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
31 ERRSTAT - Error Status (*1)
   + + + + + + + + + +
0no error on last transfer
1error on last transfer
+
30 ERRLATCH - Error Latch (*2)
   + + + + + + + + + +
0no error latched
1error latched (check SISR)
+
24-29 bit 0-5 of input byte 0 (bit 6 and 7 are assumed to be 0)
16-23 input byte 1
8-15 input byte 2
0-7 input byte 3
+
+ 

+(*1) This bit represents the current error status for the last SI +polling transfer on this channel. This register is updated after each +polling transfer on this channel.
+(*2) This bit is an error status summary of the SISR error bits +for this channel. If an error has occurred on a past SI transfer (polling +or Com transfer), this bit will be set. To determine the exact error, +read the SISR register. This bit is actually an `or` of the latched +error status bits for this channel in the SISR. The bit is cleared +by clearing the appropriate error status bits latched in the SISR. +The no response error indicates that a controller is not present on +thischannel.

+ + + + + + +
+ + + + + + +
0xCC0064084r/wJoy-channel 1 Buttons 2
+
+ + + + + + +
0xCC0064144r/wJoy-channel 2 Buttons 2
+
+ + + + + + +
0xCC0064204r/wJoy-channel 3 Buttons 2
+
+ + + + + + +
0xCC00642c4rSIC3INBUFL - SI Channel 3 Input Buffer Low (Joy-channel 4 Buttons +2)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
xxxxxxxxyyyyyyyyllllllllrrrrrrrr
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
24-31xinput byte 4
16-23yinput byte 5
8-15linput byte 6
0-7rinput byte 7
+
+ 
 
+SIC0INBUFH and SIC0INBUFL are double buffered to prevent inconsistent +data reads due to main processor conflicting with incoming serial +interface data. To insure data read from SIC0INBUFH and SIC0INFUBL +are consistent, a locking mechanism prevents the double buffer from +copying new data to these registers. Once SIC0INBUFH is read, both +SIC0INBUFH and SIC0INBUFL are `locked` until SIC0INBUFL is read. While +the buffers are `locked`, new data is not copied into the buffers. +When SIC0INBUFL is read, the buffers become unlocked again. 

+ + + +
+ + + + + + +
0xCC0064304r/wSIPOLL - SI Poll Register (Joy-channel Control (?) (Calibration gun +?))
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
........????.???......?.eeee....
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
26-31 unused/reserved
16-25 X - 7 X lines register (*1)
8-15 Y - y times register (*2)
4-7eEN - controller port enable (1 bit per port, 1: enabled) (*3)
0-3 VBCPY - Vblank copy output channel (1 bit per port) (*4)
   + + + + + + + + + +
0copy SICOUTBUF to output buffer after writing
1copy SICOUTBUF to output buffer only on vblank
+
+
+ 

+(*1) 7 X lines register: determines the number of horizontal video +lines between polling (the polling interval). The polling begins at +vsync. 7 is the minimum setting (determined by the time required to +complete a single polling of the controller). The maximum setting +depends on the current video mode (number of lines per vsync) and +the SIPOLL[Y] register. This register takes affect after vsync.
+(*2) This register determines the number of times the SI controllers +are polled in a single frame. This register takes affect after vsync.
+(*3) Enable polling of channel. When the channel is enabled, polling +begins at the next vblank. When the channel is disabled, polling is +stopped immediately after the current transaction. The status of this +bit does not affect communication RAM transfers on this channel.
+(*4) Normally main processor writes to the SIC0OUTBUF register are +copied immediately to the channel 0 output buffer if a transfer is +not currently in progress. When this bit is asserted, main processor +writes to channel 0's SIC0OUTBUF will only be copied to the outbuffer +on vblank. This is used to control the timing of commands to 3D LCD +shutter glasses connected to the VI.

+ + + +
+ + + + + + +
0xCC0064344r/wSICOMCSR - SI Communication Control Status Register (command)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
r?..?ccs.mmmmmmm.nnnnnnneb.....?
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
31rTCINT - Transfer Complete Interrupt Status
   + + + + + + + + + + + + + + + + + + + + + +
read0transfer complete interrupt not requested
 1transfer complete interrupt has been requested
write0no effect
 1clear transfer complete interrupt
+
30 TCINTMSK - Transfer Complete Interrupt Mask (*1)
   + + + + + + + + + +
0interrupt masked
1interrupt enabled
+
29 COMERR - Communication Error
   + + + + + + + + + +
0ok
1error (see SiSr for the cause)
+
28 RDSTINT - Read Status Interrupt Status (*2)
   + + + + + + + + + + + + + + + + + + + + + +
read0Transfer Complete Interrupt not requested
 1Transfer Complete Interrupt has been requested
write0 
 1 
+
27 RDSTINTMSK - Read Status interrupt Mask (*3)
   + + + + + + + + + +
0masked
1enabled
+
25-26cChannel Number (?)
24sChannel Enable (?)
23 unused/reserved
16-22mOUTLNGTH - Communication Channel Output Length (*4)
15 unused/reserved
8-14nINLNGTH - Communication Channel Input Length (*4)
7eCommand Enable (?)
6bcallback enable
   + + + + + + + + + + + + + +
bitDescription
0no callback
1callback enabled
+
1-2 CHANNEL - (*5)
   + + + + + + + + + + + + + + + + + +
00Channel 1
01Channel 2
10Channel 3
11Channel 4
+
0 TSTART - Transfer Start (*6)
   + + + + + + + + + + + + + + + + + + + + + +
read0Command Complete
 1Command Pending
write0Do not start command
 1Start command
+
+
+ 
 
+(*1) Interrupt masking prevents the interrupt from being sent to +the main processor, but does not affect the assertion of SICOMCSR[TCINT] 
+(*2) On read this bit indicates the current status of the Read Status +interrupt. The interrupt is set whenever SISR[RDSTn] bits are set. +The interrupt is cleared when all of the RdSt bits in the SISR are +cleared by reading from the Si Channel Input Buffers. This interrupt +can be used to indicate that a polling transfer has completed and +new data is captured in the input registers
+(*3) Interrupt masking prevents the interrupt from being sent to +the main processor, but does not affect the assertion of SICOMCSR[RDSTINT]
+(*4) Minimum transfer is 1 byte. A value of 0 will transfer 128 +bytes. These bits should not be modified while SICOM transfer is in +progress.
+(*5) These bits should not be modified while SICOM transfer is in +progress.
+(*6) When a `1` is written to this register, the current communication +transfer is executed. The transfer begins immediately after the current +transaction on this channel has completed. When read this bit represents +the current transfer status. Once a communication transfer has been +executed, polling will resume at the next vblank if the channel's +SIPOLL[ENn] bit is set. 
 
+When programming the SICOMCSR after a SICOM transfers has already +started (e.g., SICOMCSR[TSTART] is set), the software should read +the current value first, then and/or in the proper data and then write +the new data back. The software should not modify any of the transfer +parameters (OUTLNGTH, INLNGTH, CHANNEL) until the current transfer +is complete. This is done to prevent a SICOM transfer already in progress +from being disturbed. When writing the data back, the software should +not set the TSTART bit again unless the current transfer is complete +and another transfer is required. 
 
+ + + +
+ + + + + + +
0xCC0064384r/wSISR - SI Status Register (channel select & status2)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
r???aaaa????bbbb????cccc????dddd
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
31rWR - Write SICnOUTBUF Register (*1)
   + + + + + + + + + + + + + + + + + + + + + +
read0buffer copied
 1buffer not copied
write0no effect
 1copy all buffers
+
30 reserved/unused
29 RDST0 - Read Status SIC0OINBUF Register (*2)
   + + + + + + + + + +
0New data available, not read by main processor
1No new data available, already read by main processor
+
28 WRST0 - Write Status SIC0OUTBUF Register (*3)
   + + + + + + + + + +
0Buffer copied
1Buffer not copied
+
27 NOREP0 - No Response Error Channel 0 (*4)
   + + + + + + + + + + + + + + + + + + + + + +
read0No Response Error not asserted
 1No Response Error asserted
write0No effect
 1Clear No Response Error
+
26 COLL0 - Collision Error Channel 0 (*5)
   + + + + + + + + + + + + + + + + + + + + + +
read0Collision Error not asserted
 1Collision Error asserted
write0No effect
 1Clear Collision Error
+
25 OVRUN0 - Over Run Error Channel 0 (*6)
   + + + + + + + + + + + + + + + + + + + + + +
read0Over Run Error not asserted
 1Over Run Error asserted
write0No effect
 1Clear Over Run Error
+
24 UNRUN - Under Run Error Channel 0 (*7)
   + + + + + + + + + + + + + + + + + + + + + +
read0Under Run not asserted
 1Under Run asserted
write0No effect
 1Clear Under Run Error
+
22-23 reserved/unused
16-21bJoy-channel 1 bits
14-15 reserved/unused
8-13cJoy-channel 2 bits
6-7 reserved/unused
0-5dJoy-channel 3 bits
+
+ 
 
+(*1) Write SICnOUTBUF Register: This register controls and indicates +whether the SICnOUTBUFs have been copied to the double buffered output +buffers. This bit is cleared after the buffers have been copied.
+(*2) This register indicates whether the SIC0INBUFs have been captured +new data and whether the data has already been read by the main processor +(read indicated by main processor read of SIC01NBUF[ERRSTAT, ERRLATCH, +INPUT0, INPUT1)]
+(*3) This register indicates whether the SIC0OUTBUFs have been copied +to the double buffered output buffers. This bit is cleared after the +buffers have been copied.
+(*4) This register indicates that a previous transfer resulted in +no response from the controller. This can also be used to detect whether +a controller is connected. If no controller is connected, this bit +will be set. Once set this bit remains set until it is cleared by +the main processor. To clear this bit write `1` to this register.
+(*5) This register indicates data collision between controller and +main unit. Once set this bit remains set until it is cleared by the +main processor. To clear this bit write `1` to this register.
+(*6) This register indicates that the main unit has received more +data than expected. Once set this bit remains set until it is cleared +by the main processor. To clear this bit write `1' to this register.
+(*7) This register indicates that the main unit has received less +data than expected. Once set this bit remain set until it is cleared +by the main processor. To clear this bit write `1` to this register.
 
+ + + + +
+ + + + + +
0xcc00643c4R/WSIEXILK - SI EXI Clock Lock
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
31 LOCK - prevents CPU from setting EXI clock to 32MHz
   + + + + + + + + + +
032MHz EXI clock setting permitted
132MHz EXI clock setting not permitted
+
0-30 unused/reserved (always zero)
+
+ 
 
+ + + + + + +
0xCC0064800x80r/wSI i/o buffer (access by word)
+
+
index
+

+ +5.8.1  Operation

+
5.8.1.1 +   Serial Send Buffer +
+
+
5.8.1.2 +   Serial Get Result +
+
+
index
+

+ +5.9  EXI - External Interface

+
+Upper memory (0xCC000000 and above) can't keep enough data for extra-large +arrays, it's limited up to 0xFFFF bytes (suppose to be). EXI was designed +to remove this limitation. EXI is used for access to big, unmapped +areas of HW memory (such as bootrom or SRAM). This is the main task +of EXI. Put another way, EXI can be used for providing access to slow, +serial devices, such as memory cards. EXI is a complex of different +devices, mapped to a single bus. The EXI bus is divided on 3 channels. +Each channel has 3 unique devices. Each device is defined by its ID, +and has its own address space.

+EXI can be accessed in immediate mode, or via DMA channel. Each EXI +device can generate up to 3 interrupts. They are called EXI, TC and +EXT :

+ + + + + + + + + + + + + + + + + +
  
EXIDevice EXI Interrupt
TCTransfer Completed (any mode)
EXTDevice Attached / Device Detached
+
+

+Each EXI channel have its own register set, 5 32bit Registers each.

+ + + + + + + + + + + +
Register block BaseSize of Register blockcommon access size
0xCC0068000x404
+
+

+ + + + + + +
+ + + + + +
0xCC0068004 EXI0CSR - EXI Channel 0 Parameter Register (Status?)
+
+ + + + + +
0xCC0068144 EXI1CSR - EXI Channel 1 Parameter Register
+
+ + + + + +
0xCC0068284 EXI2CSR - EXI Channel 2 Parameter Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
14-31 unused
13 ROMDIS - (EXI0 only) 1: rom de-scramble logic disabled (*1)
12dEXT - Device Connected Bit (R) 1 if a device is connected on the specific +channel
11xEXTINT - External Insertion Interrupt Status (R) : check to poll EXT +interrupt (or to detect device detach) (*4)
   + + + + + + + + + + + + + + + + + + + + + +
read0External Insertion Interrupt has not been requested
 1External Insertion Interrupt has been requested
write0No effect
 1Clear External Insertion Interrupt
+
10mEXTINTMASK - EXT Interrupt Mask (1 - enable, 0 - disable) (*5)
7-9210CS - devices selected on this channel, each bit selecting one device. +(*)
4-6fCLK - used frequency (0-5)
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0001MHz
0012MHz
0104MHz
0118MHz
10016MHz
10132MHz
110reserved
111reserved
+
3tTCINT - Transfer Complete Interrupt Status
   + + + + + + + + + + + + + + + + + + + + + +
read0Transfer Complete Interrupt has not been requested
 1Transfer Complete Interrupt has been requested
write0No effect
 1Clear Transfer Complete Interrupt
+
2mTCINTMASK - Transfer complete interrupt mask (1 - enable, 0 - disable) +(*2)
1eEXTINT - Interrupt Status (*6)
   + + + + + + + + + + + + + + + + + + + + + +
read0EXI Interrupt has not been requested
 1EXI Interrupt has been requested
write0No effect
 1Clear EXI Interrupt
+
0mEXTINTMASK - EXI interrupt mask (1 - enable, 0 - disable)
+
(*)Only one of these three bits can be set to signify which device +number has been selected on a specific channel.
+

+(*6) This bit indicates the current status of the EXI0 interrupt. +The interrupt is cleared by accessing the expansion device and clearing +the interrupt on the device itself and cleared locally when a `1` +is written to this register. This interrupt input is edge triggered.
+(*1) This bit disables access to the IPL Mask ROM attached to CS1. +Once this bit is enabled, it can only be disabled again by global +reset. The ROM de-scramble logic will become disabled and any reads +to the memory mapped ROM area will return all 0.When de-scrambler +is enabled all EXI0 data will be de-scrambled, so only the IPL ROM +may be accessed through EXI0 until ROMDIS is set to `1'. (this is +usually done by the Bootstrap, see Boot process details)
+(*2) Interrupt masking prevents the interrupt from being sent to +the main processor, but does not affect the assertion of TCINT
+(*3) Interrupt masking prevents the interrupt from being sent to +the main processor, but does not affect the assertion of EXIINT
+(*5) Interrupt masking prevents the interrupt from being sent to +the main processor, but does not affect the assertion of EXICPR[EXTINT]
+(*4) This interrupt indicates than an external EXI device has been +removed from channel 1. To check whether the device has been inserted +or removed, check the EXICPR[EXT] bit. When this bit is set, the +channel's expansion EXI interface outputs go to high.

+ + + + + +
+ + + + + +
0xCC0068044r/wEXI0MAR - EXI Channel 0 DMA Start Address
+
+ + + + + +
0xCC0068184r/wEXI1MAR - EXI Channel 1 DMA Start Address
+
+ + + + + +
0xCC00682c4r/wEXI2MAR - EXI Channel 2 DMA Start Address
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
......ddddddddddddddddddddd.....
+
Physical Startaddress for DMA transfer. Must be aligned to 32 byte +boundary .
+

+(*) The memory address is the destination address when EXICR[RW] +is set to `read` and is the source address when set to `write`.

+ + + + + +
+ + + + + +
0xCC0068084r/wEXI0LENGTH - EXI Channel 0 DMA Transfer Length
+
+ + + + + +
0xCC00681c4 EXI Channel 1 DMA Transfer Length
+
+ + + + + +
0xCC0068304 EXI Channel 2 DMA Transfer Length
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
......ddddddddddddddddddddd.....
+
Size of DMA transfer data in bytes. bits 0-4 are always zero (which +means the size is 32 byte aligned)
+

+ + + + + +
+ + + + + +
0xCC00680c4r/wEXI0CR - EXI Channel 0 Control Register
+
+ + + + + +
0xCC0068204r/wEXI1CR - EXI Channel 1 Control Register
+
+ + + + + +
0xCC0068344r/wEXI2CR - EXI Channel 2 Control Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
..........................llttme
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
6-31.unused
4-5lTLEN - (data length-1) for immediate mode
   + + + + + + + + + + + + + + + + + +
001 byte
012 bytes
103 bytes
114 bytes
+
2-3tRW - transfer type
   + + + + + + + + + + + + + + + + + +
00read
01write
10read and write, invalid for DMA
11undefined
+
1mDMA - transfer mode (0 - immediate, 1 - DMA)
0eTSTART - set, to start transfer. will be cleared after transfer completed.
+
+

+ + + + + +
+ + + + + +
0xCC0068104r/wEXI0DATA - EXI Channel 0 Immediate Data
+
+ + + + + +
0xCC0068244r/wEXI1DATA - EXI Channel 1 Immediate Data
+
+ + + + + +
0xCC0068384r/wEXI2DATA - EXI Channel 2 Immediate Data
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
dddddddddddddddddddddddddddddddd
+
Data for read / write immediate operations (up to 4 bytes long).
+

+The EXICPR must be configured to assert one of the devices CS, before +the read or write operation can be performed. The actual read/write +operation is triggered by the EXI0CR[TSTART] register and EXI0CR[DMA] +set to `0`. Data is sent with MSB (bit 31) first.

index
+

+ +5.9.1  Operation

+
5.9.1.1 +   Initializing the EXI Bus +
+
+If you want to use DMA with EXI, you need your own properly installed +EXI interrupt handlers. There is no need in callbacks and interrupts, +if you are using EXI in immediate mode (just mask all TCs, to prevent +unhandled interrupts). +
5.9.1.2 +   Selecting a Specific EXI Device on an EXI Channel +
+
+
5.9.1.3 +   Deselecting EXI Devices on an EXI Channel +
+
+
5.9.1.4 +   Performing an IMM Operation on a EXI Device +
+

    + 5.9.1.4.1  IMM Read + +
    + 5.9.1.4.2  IMM Write + +
5.9.1.5 +   Performing a DMA Operation on a EXI Device +
+

    + 5.9.1.5.1  DMA Read + +
    + 5.9.1.5.2  DMA Write + +
5.9.1.6 +   Wait for EXI transfer completed +
+
+To detect the end of a transfer on a specific channel either setup +a 'transfer completed' callback (only works with DMA transfer) or +periodically check bit 0 of the EXI Control Register (until cleared). +
index
+

+ +5.10  AI - Audio Streaming Interface

+
+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0xcc006c000x204
+
+

+ + + +
+ + + + + +
0xCC006C00r/w4AICR - Audio Interface Control Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
7-31 reserved/unused
6 DSP Sample Rate
   + + + + + + + + + +
048 kHz sample rate
132 kHz sample rate
+
5 SCRESET Sample Counter Reset: When a `1` is written to this bit the +AISLRCNT register is reset to 0
4 AIINTVLD Audio Interface Interrupt Valid.
  This bit controls whether AIINT is affected by the AIIT register matching +AISLRCNT. Once set, AIINT will hold its last value.
   + + + + + + + + + +
0Match affects AIINT
1AIINT hold last value.
+
3 AIINT Audio Interface Interrupt Status and clear. (*3)
   + + + + + + + + + + + + + + + + + + + + + +
r0Audio Interface Interrupt has not been requested
 1Audio Interface Interrupt has been requested.
w0No effect
 1Clear Audio Interface interrupt
+
2 AIINTMSK Audio interface Interrupt Mask
   + + + + + + + + + +
0interrupt masked
1Interrupt enabled
+
1 AFR: Auxiliary Frequency Register (*1)
   + + + + + + + + + +
048 kHz sample rate
132 kHz sample rate
+
0 PSTAT: Playing Status
   + + + + + + + + + +
0Stop or Pause streaming audio (AISLR clock disabled)
1Play streaming audio (AISLR clock enabled)
+
+
+

+(*3 ) +On read this bit indicates the current status of the audio interface +interrupt. When a `1` is written to this register, the interrupt is +cleared. This interrupt indicates that the AIIT register matches the +AISLRCNT. This bit asserts regardless of the setting of AICR[AIMSK].
+(*1 ) +Controls the sample rate of the streaming audio data. When set to +32 kHz sample rate, the SRC will convert the streaming audio data +to 48 kHz. This bit should only be changed when Streaming Audio is +stopped (AICR[PSTAT] set to 0).
+(*0) +This bit enables the AISLR clock which controls the playing/stopping +of audio streaming. When this bit is 1 AISLRCNT register will increment +for every stereo pair of samples output.

+ + + +
+ + + + + +
0xCC006C04r/w4AIVR - Audio Interface Volume Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................rrrrrrrrllllllll
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
16-31 unused/reserved
8-15rAVRR - Volume Right Channel (0x00 is muted,0xff is max)
0-7lAVRL - Volume Right Channel (0x00 is muted,0xff is max)
+
+

+ + + + + +
0xCC006C08r4AISCNT - Audio Interface Sample Counter
+
+

+Audio interface Sample Counter: This register counts the number of +AIS stereo samples that have been output. It is enabled by AICR[PSTAT]. +It can be cleared by the AICR[SCRESET] register.

+ + + + + +
0xCC006C0Cr/w4AIIT - Audio Interface Interrupt Timing
+
+

+This register indicates the stereo sample count to issue an audio +interface interrupt to the main processor. The interrupt is issued +when the value of the AISLRCNT register matches the content of this +register.
index
+

+ +5.11  GX FIFO (Graphic display lists)

+
+GP have mapped 32-byte FIFO buffer, at 0xCC008000, which is controlled +by write gather pipe (WPAR). when FIFO is filled (or overloaded by +32-bytes), WPAR performs burst transaction of primitive data to GP +command FIFO. WPAR API also keeps watching for wrapping it on 32-buffer. +You can think, that data is always looped and flows like in circle.

+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0xcc0080004any
+
+

+To access FIFO, you should just write data of any size to 0xCC008000, +WPAR will control circularity and gathering automatically. By "data +of any size" are assumed command types, vertices, vertex +attributes etc stuff. All commands and primitive data are sending +through mapped GP FIFO. GP task is only to draw primitives in embedded +frame buffer, and then send it to XFB, for VI rendering. All render +rules are stored in VI. GP can only change some copy rules, using +pixel engine setup.

+GP primitives also can be drawn, using Display List. In that case, +GP FIFO takes only "CALL_DL" command with pointer +to list data, and then GP command FIFO sequentially parsing primitive +data from the main memory. Primitives can contains both direct and +indexed vertexes as well. In first case, vertex attributes are sent +directly using GP FIFO, in the other case the CPU sends only the pointer +to vertex attribute data which is located in main memory.
index
+

+ +5.11.1  internal BP registers

+
+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0x000x1004 (1+3)
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RegisterDescription
0x00GEN_MODE
0x01display copy filter
0x02display copy filter
0x03display copy filter
0x04display copy filter
0x05?
0x06IND_MTXA0
0x07IND_MTXB0
0x08IND_MTXC0
0x09IND_MTXA1
0x0aIND_MTXB1
0x0bIND_MTXC1
0x0cIND_MTXA2
0x0dIND_MTXB2
0x0eIND_MTXC2
0x0fIND_IMASK
0x10IND_CMD0 - tev indirect 0
0x11IND_CMD1 - tev indirect 1
0x12IND_CMD2 - tev indirect 2
0x13IND_CMD3 - tev indirect 3
0x14IND_CMD4 - tev indirect 4
0x15IND_CMD5 - tev indirect 5
0x16IND_CMD6 - tev indirect 6
0x17IND_CMD7 - tev indirect 7
0x18IND_CMD8 - tev indirect 8
0x19IND_CMD9 - tev indirect 9
0x1aIND_CMDA - tev indirect 10
0x1bIND_CMDB - tev indirect 11
0x1cIND_CMDC - tev indirect 12
0x1dIND_CMDD - tev indirect 13
0x1eIND_CMDE - tev indirect 14
0x1fIND_CMDF - tev indirect 15
0x20scissor x0,y0 (0x20156156)
0x21scissor x1,y1 (0x213d5335)
0x22SU_LPSIZE - field mode .. line width - point width
0x23SU Counter (?) (0x23000000)
0x24RAS Counter (?) (0x24000000)
0x25RAS1_SS0 - ind tex coord scale 0
0x26RAS1_SS1 - ind tex coord scale 1
0x27RAS1_IREF
0x28RAS1_TREF0 - tev order 0
0x29RAS1_TREF1 - tev order 1
0x2aRAS1_TREF2 - tev order 2
0x2bRAS1_TREF3 - tev order 3
0x2cRAS1_TREF4 - tev order 4
0x2dRAS1_TREF5 - tev order 5
0x2eRAS1_TREF6 - tev order 6
0x2fRAS1_TREF7 - tev order 7
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RegisterDescription
0x30SU_SSIZE0 - texture offset 0 (Texture Size X, Y ?)
0x31SU_TSIZE0 -
0x32SU_SSIZE1 - texture offset 1
0x33SU_TSIZE1 -
0x34SU_SSIZE2 - texture offset 2
0x35SU_TSIZE2 -
0x36SU_SSIZE3 - texture offset 3
0x37SU_TSIZE3 -
0x38SU_SSIZE4 - texture offset 4
0x39SU_TSIZE4 -
0x3aSU_SSIZE5 - texture offset 5
0x3bSU_TSIZE5 -
0x3cSU_SSIZE6 - texture offset 6
0x3dSU_TSIZE6 -
0x3eSU_SSIZE7 - texture offset 7
0x3fSU_TSIZE7 -
0x40PE_ZMODE set z mode
0x41PE_CMODE0 dithering / blend mode/color_update/alpha_update/set_dither
0x42PE_CMODE1 destination alpha
0x43PE_CONTROL comp z location z_comp_loc(0x43000040)pixel_fmt(0x43000041)
0x44field mask (0x44000003)
0x45PE_DONE - draw done (end of list marker) ?
0x46some clock ? (0x46000000 - (((162000000/500)/4224) - 0x0200))
0x47PE_TOKEN token B (16 bit)
0x48PE_TOKEN_INT token A (16 bit)
0x49EFB source rectangle top left
0x4aEFB source rectangle width, height-1
0x4bXFB target address
0x4c?
0x4dstride ?
0x4eDispCopyYScale
0x4fPE copy clear AR - set clear alpha and red components
0x50PE copy clear GB - green and blue
0x51PE copy clear Z - 24-bit Z value
0x52pe copy execute?
0x53copy filter
0x54copy filter
0x55bounding box (0x550003ff)
0x56bounding box (0x560003ff)
0x57?
0x58? (0x5800000f)
0x59scissor-box offset (0x5902acab)
0x5a?
0x5b?
0x5c?
0x5d?
0x5e?
0x5f?
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RegisterDescription
0x60?
0x61?
0x62?
0x63?
0x64TX_LOADTLUT0
0x65TX_LOADTLUT1
0x66?
0x67metric ? (0x67000000)
0x68field mode
0x69some clock ? (0x69000000 - ((((162000000/500)> >11)&0x00ffffff)) - 0x0400)
0x6a?
0x6b?
0x6c?
0x6d?
0x6e?
0x6f?
0x70?
0x71?
0x72?
0x73?
0x74?
0x75?
0x76?
0x77?
0x78?
0x79?
0x7a?
0x7b?
0x7c?
0x7d?
0x7e?
0x7f?
0x80TX_SETMODE0_I0 - 0x90 for linear
0x81TX_SETMODE0_I1
0x82TX_SETMODE0_I2
0x83TX_SETMODE0_I3
0x84TX_SETMODE1_I0
0x85TX_SETMODE1_I1
0x86TX_SETMODE1_I2
0x87TX_SETMODE1_I3
0x88TX_SETIMAGE0_I0 - texture size ?
0x89TX_SETIMAGE0_I1
0x8aTX_SETIMAGE0_I2
0x8bTX_SETIMAGE0_I3
0x8cTX_SETIMAGE1_I0
0x8dTX_SETIMAGE1_I1
0x8eTX_SETIMAGE1_I2
0x8fTX_SETIMAGE1_I3
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RegisterDescription
0x90TX_SETIMAGE2_I0
0x91TX_SETIMAGE2_I1
0x92TX_SETIMAGE2_I2
0x93TX_SETIMAGE2_I3
0x94TX_SETIMAGE3_I0 - Texture Pointer
0x95TX_SETIMAGE3_I1
0x96TX_SETIMAGE3_I2
0x97TX_SETIMAGE3_I3
0x98TX_LOADTLUT0
0x99TX_LOADTLUT1
0x9aTX_LOADTLUT2
0x9bTX_LOADTLUT3
0x9c?
0x9d?
0x9e?
0x9f?
0xa0TX_SETMODE0_I4
0xa1TX_SETMODE0_I5
0xa2TX_SETMODE0_I6
0xa3TX_SETMODE0_I7
0xa4TX_SETMODE1_I4
0xa5TX_SETMODE1_I5
0xa6TX_SETMODE1_I6
0xa7TX_SETMODE1_I7
0xa8TX_SETIMAGE0_I4
0xa9TX_SETIMAGE0_I5
0xaaTX_SETIMAGE0_I6
0xabTX_SETIMAGE0_I7
0xacTX_SETIMAGE1_I4
0xadTX_SETIMAGE1_I5
0xaeTX_SETIMAGE1_I6
0xafTX_SETIMAGE1_I7
0xb0TX_SETIMAGE2_I4
0xb1TX_SETIMAGE2_I5
0xb2TX_SETIMAGE2_I6
0xb3TX_SETIMAGE2_I7
0xb4TX_SETIMAGE3_I4
0xb5TX_SETIMAGE3_I5
0xb6TX_SETIMAGE3_I6
0xb7TX_SETIMAGE3_I7
0xb8TX_SETTLUT_I4
0xb9TX_SETTLUT_I5
0xbaTX_SETTLUT_I6
0xbbTX_SETTLUT_I7
0xbc?
0xbd?
0xbe?
0xbf?
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RegisterDescription
0xc0TEV_COLOR_ENV_0 - tev op 0
0xc1TEV_ALPHA_ENV_0 - tev op 1
0xc2TEV_COLOR_ENV_1 -
0xc3TEV_ALPHA_ENV_1
0xc4TEV_COLOR_ENV_2 -
0xc5TEV_ALPHA_ENV_2
0xc6TEV_COLOR_ENV_3 -
0xc7TEV_ALPHA_ENV_3
0xc8TEV_COLOR_ENV_4 -
0xc9TEV_ALPHA_ENV_4
0xcaTEV_COLOR_ENV_5 -
0xcbTEV_ALPHA_ENV_5
0xccTEV_COLOR_ENV_6 -
0xcdTEV_ALPHA_ENV_6
0xceTEV_COLOR_ENV_7 -
0xcfTEV_ALPHA_ENV_7
0xd0TEV_COLOR_ENV_8 -
0xd1TEV_ALPHA_ENV_8
0xd2TEV_COLOR_ENV_9 -
0xd3TEV_ALPHA_ENV_9
0xd4TEV_COLOR_ENV_A -
0xd5TEV_ALPHA_ENV_A
0xd6TEV_COLOR_ENV_B -
0xd7TEV_ALPHA_ENV_B
0xd8TEV_COLOR_ENV_C -
0xd9TEV_ALPHA_ENV_C
0xdaTEV_COLOR_ENV_D -
0xdbTEV_ALPHA_ENV_D
0xdcTEV_COLOR_ENV_E -
0xddTEV_ALPHA_ENV_E
0xdeTEV_COLOR_ENV_F -
0xdfTEV_ALPHA_ENV_F
0xe0TEV_REGISTERL_0
0xe1TEV_REGISTERH_0
0xe2TEV_REGISTERL_1
0xe3TEV_REGISTERH_1
0xe4TEV_REGISTERL_2
0xe5TEV_REGISTERH_2
0xe6TEV_REGISTERL_3
0xe7TEV_REGISTERH_3
0xe8Fog Range (0xe8000156)
0xe9?
0xea?
0xeb?
0xec? (guessed: tev_range_adj_c)
0xed? (guessed: tev_range_adj_k)
0xeeTEV_FOG_PARAM_0 (0xee03ce38)
0xefTEV_FOG_PARAM_1 (0xef471c82)
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RegisterDescription
0xf0TEV_FOG_PARAM_2 (0xf0000002)
0xf1TEV_FOG_PARAM_3 (0xf1000000)
0xf2TEV_FOG_COLOR (0xf2000000)
0xf3TEV_ALPHAFUNC - alpha compare (0xf33f0000)
0xf4TEV_Z_ENV_0 - z texture 0
0xf5TEV_Z_ENV_1 - z texture 1
0xf6TEV_KSEL_0 - Tev Swap Mode Table 0 (0xf6018064)
0xf7TEV_KSEL_1 - Tev Swap Mode Table 1 (0xf701806e)
0xf8TEV_KSEL_2 - Tev Swap Mode Table 2 (0xf8018060)
0xf9TEV_KSEL_3 - Tev Swap Mode Table 3 (0xf901806c)
0xfaTEV_KSEL_4 - Tev Swap Mode Table 4 (0xfa018065)
0xfbTEV_KSEL_5 - Tev Swap Mode Table 5 (0xfb01806d)
0xfcTEV_KSEL_6 - Tev Swap Mode Table 6 (0xfc01806a)
0xfdTEV_KSEL_7 - Tev Swap Mode Table 7 (0xfd01806e)
0xfeSS_MASK - BP Mask Register
0xff?
+
+

+ + + +
+ + + + + +
0x004wGEN_MODE
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
19 ZFREEZE
16 NBMP - Number of Bumpmaps
14-15 REJECT_EN - Culling Mode
   + + + + + + + + + + + + + + + + + +
0none
1negative
2positive
3all
+
10 NTEV
9 MS_EN
4 NCOL - Number of Colors
0 NTEX - Number of Texture Coords
+
+

+ + + + + +
0x014wdisplay copy filter
+
+

+ + + + + +
0x024wdisplay copy filter
+
+

+ + + + + +
0x034wdisplay copy filter
+
+

+ + + + + +
0x044wdisplay copy filter
+
+

+ + + + + +
0x054w?
+
+

+ + + + + +
+ + + + + +
0x064wIND_MTXA0
+
+ + + + + +
0x094wIND_MTXA1
+
+ + + + + +
0x0c4wIND_MTXA2
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
22 S
11 MB
0 MA
+
+

+ + + + + +
+ + + + + +
0x074wIND_MTXB0
+
+ + + + + +
0x0a4wIND_MTXB1
+
+ + + + + +
0x0d4wIND_MTXB2
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
22 S
11 MD
0 MC
+
+

+ + + + + +
+ + + + + +
0x084wIND_MTXC0
+
+ + + + + +
0x0b4wIND_MTXC1
+
+ + + + + +
0x0e4wIND_MTXC2
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
22 S
11 MF
0 ME
+
+

+ + + +
+ + + + + +
0x0f4wIND_IMASK
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
0 IMASK
+
+

+ +
+ + + + + + + + + + + + + + + + + + +
+ + + + + +
0x104wIND_CMD0
+
+ + + + + +
0x114wIND_CMD1
+
+ + + + + +
0x124wIND_CMD2
+
+ + + + + +
0x134wIND_CMD3
+
+ + + + + +
0x144wIND_CMD4
+
+ + + + + +
0x154wIND_CMD5
+
+ + + + + +
0x164wIND_CMD6
+
+ + + + + +
0x174wIND_CMD7
+
+ + + + + +
0x184wIND_CMD8
+
+ + + + + +
0x194wIND_CMD9
+
+ + + + + +
0x1a4wIND_CMDA
+
+ + + + + +
0x1b4wIND_CMDB
+
+ + + + + +
0x1c4wIND_CMDC
+
+ + + + + +
0x1d4wIND_CMDD
+
+ + + + + +
0x1e4wIND_CMDE
+
+ + + + + +
0x1f4wIND_CMDF
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
21-23 PAD0 - padding zeros
20 FB - addprev
19 LB - utclod
16-18 TW - Wrap T
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0ITW_OFF
1ITW_256
2ITW_128
3ITW_64
4ITW_32
5ITW_16
6ITW_0
7 
+
13-15 SW - Wrap S
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0ITW_OFF
1ITW_256
2ITW_128
3ITW_64
4ITW_32
5ITW_16
6ITW_0
7 
+
9-12 M - Matrix ID
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0ITM_OFF
1ITM_0
2ITM_1
3ITM_2
5ITM_S0
6ITM_S1
7ITM_S2
9ITM_T0
10ITM_T1
11ITM_T2
+
7-8 BS - Alpha Selection
   + + + + + + + + + + + + + + + + + +
0ITBA_OFF
1ITBA_S
2ITBA_T
3ITBA_U
+
4-6 BIAS
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0ITB_NONE
1ITB_S
2ITB_T
3ITB_ST
4ITB_U
5ITB_SU
6ITB_TU
7ITB_STU
+
2-3 FMT - Format
   + + + + + + + + + + + + + + + + + +
0ITF_8
1ITF_5
2ITF_4
3ITF_3
+
0-1 BT - Indirect Tex Stage ID (0-3)
+
+ + + + +
+ + + + + +
0x204wSU_SCIS0 - Scissorbox Top Left Corner
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
12 X0 - Scissorbox X0 offset + 342
0 Y0 - Scissorbox Y0 offset + 342
+
+

+ + + +
+ + + + + +
0x214wSU_SCIS1 - Scissorbox Bottom Right Corner
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
12 X1 - Scissorbox X1 offset + 342
0 Y1 - Scissorbox Y1 offset + 342
+
+

+ + + +
+ + + + + +
0x224wSU_LPSIZE
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
23 PAD0
22 LINEASPECT
19 PTOFF
   + + + + + + + + + + + + + + + + + + + + + + + + + +
0to 0
1to 16th
2to 8th
3to 4th
4to half
5to 1
+
16 LTOFF
   + + + + + + + + + + + + + + + + + + + + + + + + + +
0to 0
1to 16th
2to 8th
3to 4th
4to half
5to 1
+
8 PSIZE
0 LSIZE
+
+

+ + + + + +
0x234wSU Counter ?
+
+

+ + + + + +
0x244wRAS Counter ?
+
+

+ + + +
+ + + + + +
0x254wRAS1_SS - ind tex coord scale 0
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
12 TS1 - Ind. Tex Stage 1
8 SS1 - Ind. Tex Stage 1
4 TS0 - Ind. Tex Stage 0
0 SS0 - Ind. Tex Stage 0
+
+

+ + + +
+ + + + + +
0x264wRAS1_SS - ind tex coord scale 1
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
12 TS1 - Ind. Tex Stage 3
8 SS1 - Ind. Tex Stage 3
4 TS0 - Ind. Tex Stage 2
0 SS0 - Ind. Tex Stage 2
+
+

+ + + +
+ + + + + +
0x274wRAS1_IREF
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
21 BC3 - Ind. Tex Stage 3 NTexCoord
18 BI3 - Ind. Tex Stage 3 NTexMap
15 BC2 - Ind. Tex Stage 2 NTexCoord
12 BI2 - Ind. Tex Stage 2 NTexMap
9 BC1 - Ind. Tex Stage 1 NTexCoord
6 BI1 - Ind. Tex Stage 1 NTexMap
3 BC0 - Ind. Tex Stage 0 NTexCoord
0 BI0 - Ind. Tex Stage 0 NTexMap
+
+

+ + + + + + + + + + +
+ + + + + +
0x284wRAS1_TREF0
+
+ + + + + +
0x294wRAS1_TREF1
+
+ + + + + +
0x2a4wRAS1_TREF2
+
+ + + + + +
0x2b4wRAS1_TREF3
+
+ + + + + +
0x2c4wRAS1_TREF4
+
+ + + + + +
0x2d4wRAS1_TREF5
+
+ + + + + +
0x2e4wRAS1_TREF6
+
+ + + + + +
0x2f4wRAS1_TREF7
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
22 PAD1
19-21 CC1 - Ind. Tex Stage 1 Channel ID
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0Color0
1Color1
2Alpha0
3Alpha1
4Color0A0
5Color1A1
6ColorZero
7Bump
+
18 TE1 - Ind. Tex Stage 1 TexMap enable
15 TC1 - Ind. Tex Stage 1 TexCoord
12 TI1 - Ind. Tex Stage 1 TexMap
10 PAD0
7 CC0 - Ind. Tex Stage 0 Color ID
6 TE0 - Ind. Tex Stage 0 TexMap enable
3 TC0 - Ind. Tex Stage 0 TexCoord
0 TI0 - Ind. Tex Stage 0 TexMap
+
+

+ + + + + + + + + + +
+ + + + + +
0x304wSU_SSIZE0
+
+ + + + + +
0x324wSU_SSIZE1
+
+ + + + + +
0x344wSU_SSIZE2
+
+ + + + + +
0x364wSU_SSIZE3
+
+ + + + + +
0x384wSU_SSIZE4
+
+ + + + + +
0x3a4wSU_SSIZE5
+
+ + + + + +
0x3c4wSU_SSIZE6
+
+ + + + + +
0x3e4wSU_SSIZE7
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
19 PF - texcoord offset for points enable
18 LF - texcoord offset for lines enable
17 WS - s-cylindrical texcoord wrapping enable
16 BS - s-range bias enable
0 SSIZE - s-scale value -1 (U16)
+
+

+ + + + + + + + + + +
+ + + + + +
0x314wSU_TSIZE0
+
+ + + + + +
0x334wSU_TSIZE1
+
+ + + + + +
0x354wSU_TSIZE2
+
+ + + + + +
0x374wSU_TSIZE3
+
+ + + + + +
0x394wSU_TSIZE4
+
+ + + + + +
0x3b4wSU_TSIZE5
+
+ + + + + +
0x3d4wSU_TSIZE6
+
+ + + + + +
0x3f4wSU_TSIZE7
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
17 WT - t-cylindrical texcoord wrapping enable
16 BT - t-range bias enable
0 TSIZE - t-scale value -1 (U16)
+
+

+ + + +
+ + + + + +
0x404wPE_ZMODE
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
4 MASK - Update enable
1 FUNC - Z-Buffer Compare Function
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0NEVER
1LESS
2EQUAL
3LEQUAL
4GREATER
5NEQUAL
6GEQUAL
7ALWAYS
+
0 ENABLE - Z-Buffer enable
+
+

+ + + +
+ + + + + +
0x414wPE_CMODE0
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
12 LOGICOP
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0CLEAR
1AND
2REVAND
3COPY
4INVAND
5NOOP
6XOR
7OR
8NOR
9EQUIV
10INV
11REVOR
12INVCOPY
13INVOR
14NAND
15SET
+
11 BLENDOP
8 SFACTOR
5 DFACTOR
4 ALPHA_MASK
3 COLOR_MASK
2 DITHER_ENABLE
1 LOGICOP_ENABLE
0 BLEND_ENABLE
+
+

+ + + +
+ + + + + +
0x424wPE_CMODE1
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
8 CONSTANT_ALPHA_ENABLE
0 CONSTANT_ALPHA
+
+

+ + + +
+ + + + + +
0x434wPE_CONTROL
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
7-23 unused ?
6 Z Comp Loc (1: before tex)
3-5 Z Format
   + + + + + + + + + + + + + + + + + +
0linear
1near
2mid
3far
+
0-2 Pixel Format
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0RGB8_ Z24
1RGBA6_Z24
2RGB565_Z16
3Z24
4Y8
5U8
6V8
7YUV420
+
+
+

+ + + +
+ + + + + +
0x444wfield mask ?
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + +
bit(s) description
24 RID
+
+

+ + + +
+ + + + + +
0x454wPE_DONE - draw done
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
1 1=end of list
0 ?
+
+

+ + + +
+ + + + + +
0x464w? (some clock?)
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
9 ? (must be 1)
0 ((162000000/500)/4224)
+
+

+ + + +
+ + + + + +
0x474wPE_TOKEN
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
0 Token
+
+

+ + + +
+ + + + + +
0x484wPE_TOKEN_INT
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
0  
+
+

+ + + +
+ + + + + +
0x494wEFB Address Top Left
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
10 Y coordinate
0 X coordinate
+
+

+ + + +
+ + + + + +
0x4a4wEFB Address Width, Height-1
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
10 Height-1
0 Width
+
+

+ + + +
+ + + + + +
0x4b4wXFB Address
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
0 physical XFB Address > > 5
+
+

+ + + + + +
0x4c4w?
+
+

+ + + + + +
0x4d4wstride ?
+
+

+ + + +
+ + + + + +
0x4e4wDispCopyYScale
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + + + + + + +
bit(s) Description
24 RID
0 YSCALE - ((u32)(256.0/YSCALEIN))&0x1ff
+
+

+ + + +
+ + + + + +
0x4f4wPE copy clear AR - set clear alpha and red components
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
24 RID
8 A
0 R
+
+

+ + + +
+ + + + + +
0x504wPE copy clear GB - green and blue
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
24 RID
8 G
0 B
+
+

+ + + +
+ + + + + +
0x514wPE copy clear Z - 24-bit Z value
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + + + + + + +
bit(s) Description
24 RID
0-23 Z - 24bit Z-Value
+
+

+ + + +
+ + + + + +
0x524wpe copy execute?
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
................................
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
24 RID
14 execute ? (1: to XFB 0: to texture ?!)
12-13 Frame 2 Field Mode
11 clear (1: clear EFB)
10 1: (256-(u32)(256.0/YSCALEIN)) > 0
9 ?
7-8 disp copy gamma
4 target (XFB) pixel format
1 clamp
0 clamp
+
+

+ + + + + +
0x534wcopy filter
+
+

+ + + + + +
0x544wcopy filter
+
+

+ + + + + +
0x554wbounding box
+
+

+ + + + + +
0x564wbounding box
+
+

+ + + + + +
0x574w?
+
+

+ + + + + +
0x584w?
+
+

+ + + +
+ + + + + +
0x594wScissorbox Offset
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
+ + + + +
bit(s) description
24 RID
10 YO - ((Scissorbox Y offset + 342)> >1)
0 XO - ((Scissorbox X offset + 342)> >1)
+
+

+note: regs 0x5a-0x63 are left out (all unknown)

+ + + +
+ + + + + +
0x644wTX_LOADTLUT0
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24- rid
21- pad0
0- tlut base
+
+

+ + + +
+ + + + + +
0x654wTX_LOADTLUT1
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24- rid
21- pad0
10- count
0 tmem offset
+
+

+ + + + + +
0x664w 
+
+

+ + + + + +
0x674wmetric ?
+
+

+ + + + + +
0x684wfield mode
+
+

+ + + +
+ + + + + +
0x694w?
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
10 ? (must be 1)
0 ((162000000/500)> >11)
+
+

+note: regs 0x6a-0x7f are left out (all unknown)

+ + + + + + + + + + +
+ + + + + +
0x804wTX_SETMODE0_I0 - Texture lookup and filtering mode
+
+ + + + + +
0x814wTX_SETMODE0_I1 - Texture lookup and filtering mode
+
+ + + + + +
0x824wTX_SETMODE0_I2 - Texture lookup and filtering mode
+
+ + + + + +
0x834wTX_SETMODE0_I3 - Texture lookup and filtering mode
+
+ + + + + +
0xa04wTX_SETMODE0_I4 - Texture lookup and filtering mode
+
+ + + + + +
0xa14wTX_SETMODE0_I5 - Texture lookup and filtering mode
+
+ + + + + +
0xa24wTX_SETMODE0_I6 - Texture lookup and filtering mode
+
+ + + + + +
0xa34wTX_SETMODE0_I7 - Texture lookup and filtering mode
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
21 LODCLAMP / BIASCLAMP
   + + + + + + + + + +
0off
1on
+
19 MAXANISO
   + + + + + + + + + + + + + + + + + +
01
12 (requires edge LOD)
24 (requires edge LOD)
3unused/reserved
+
9 LODBIAS (s2.5)
8 DIAGLOAD
   + + + + + + + + + +
0edge LOD
1diagonal LOD
+
5 MIN FILTER
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0near
1near mip near
2near mip lin
3unused/reserved
4linear
5lin mip near
6lin mip lin
7unused/reserved
+
4 MAG FILTER
   + + + + + + + + + +
0near
1linear
+
2 WRAP T
   + + + + + + + + + + + + + + + + + +
0clamp
1repeat (*)
2mirror (*)
3unused/reserved
+
0 WRAP S (same as WRAP T)
+
+

+(*) requires the texture size to be a power of two. (wrapping is +implemented by a logical AND (SIZE-1))

+ + + + + + + + + + +
+ + + + + +
0x844wTX_SETMODE1_I0 - LOD Info
+
+ + + + + +
0x854wTX_SETMODE1_I1 - LOD Info
+
+ + + + + +
0x864wTX_SETMODE1_I2 - LOD Info
+
+ + + + + +
0x874wTX_SETMODE1_I3 - LOD Info
+
+ + + + + +
0xa44wTX_SETMODE1_I4 - LOD Info
+
+ + + + + +
0xa54wTX_SETMODE1_I5 - LOD Info
+
+ + + + + +
0xa64wTX_SETMODE1_I6 - LOD Info
+
+ + + + + +
0xa74wTX_SETMODE1_I7 - LOD Info
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
8 MAX LOD (U4.4)
0 MIN LOD (U4.4)
+
+

+ + + + + + + + + + +
+ + + + + +
0x884wSETIMAGE0_I0 - Texture width, height, format
+
+ + + + + +
0x894wSETIMAGE0_I1 - Texture width, height, format
+
+ + + + + +
0x8a4wSETIMAGE0_I2 - Texture width, height, format
+
+ + + + + +
0x8b4wSETIMAGE0_I3 - Texture width, height, format
+
+ + + + + +
0xa84wSETIMAGE0_I4 - Texture width, height, format
+
+ + + + + +
0xa94wSETIMAGE0_I5 - Texture width, height, format
+
+ + + + + +
0xaa4wSETIMAGE0_I6 - Texture width, height, format
+
+ + + + + +
0xab4wSETIMAGE0_I7 - Texture width, height, format
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24- rid
20- format
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0I4
1I8
2IA4
3IA8
4RGB565
5RGB5A3
6RGBA8
7unused/reserved
8C4
9C8
10C14X2
11unused/reserved
12unused/reserved
13unused/reserved
14CMP
15unused/reserved
+
10- height - 1
0- width - 1
+
+

+ + + + + + + + + + +
+ + + + + +
0x8c4wTX_SETIMAGE1_I0 - even LOD address in TMEM
+
+ + + + + +
0x8d4wTX_SETIMAGE1_I1 - even LOD address in TMEM
+
+ + + + + +
0x8e4wTX_SETIMAGE1_I2 - even LOD address in TMEM
+
+ + + + + +
0x8f4wTX_SETIMAGE1_I3 - even LOD address in TMEM
+
+ + + + + +
0xac4wTX_SETIMAGE1_I4 - even LOD address in TMEM
+
+ + + + + +
0xad4wTX_SETIMAGE1_I5 - even LOD address in TMEM
+
+ + + + + +
0xae4wTX_SETIMAGE1_I6 - even LOD address in TMEM
+
+ + + + + +
0xaf4wTX_SETIMAGE1_I7 - even LOD address in TMEM
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
21 IMAGE_TYPE
   + + + + + + + + + +
0cached
1preloaded
+
18 CACHE_HEIGHT
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0unused/reserved
1unused/reserved
2unused/reserved
332kb
4128kb
5512kb
6unused/reserved
7unused/reserved
+
15 CACHE_WIDTH (must be equal to CACHE_HEIGHT)
0 TMEM_OFFSET (address in TMEM > > 5)
+
+

+ + + + + + + + + + +
+ + + + + +
0x904wTX_SETIMAGE2_I0 - odd LOD address in TMEM
+
+ + + + + +
0x914wTX_SETIMAGE2_I1 - odd LOD address in TMEM
+
+ + + + + +
0x924wTX_SETIMAGE2_I2 - odd LOD address in TMEM
+
+ + + + + +
0x934wTX_SETIMAGE2_I3 - odd LOD address in TMEM
+
+ + + + + +
0xb04wTX_SETIMAGE2_I4 - odd LOD address in TMEM
+
+ + + + + +
0xb14wTX_SETIMAGE2_I5 - odd LOD address in TMEM
+
+ + + + + +
0xb24wTX_SETIMAGE2_I6 - odd LOD address in TMEM
+
+ + + + + +
0xb34wTX_SETIMAGE2_I7 - odd LOD address in TMEM
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
18 CACHE_HEIGHT
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0none (if odd LOD is unused)
1unused/reserved
2unused/reserved
332kb
4128kb
5512kb
6unused/reserved
7unused/reserved
+
15 CACHE_WIDTH (must be equal to CACHE_HEIGTH)
0 TMEM_OFFSET - (address in TMEM > > 5)
+
+

+ + + + + + + + + + +
+ + + + + +
0x944wTX_SETIMAGE3_I0 - Address of Texture in main memory
+
+ + + + + +
0x954wTX_SETIMAGE3_I1 - Address of Texture in main memory
+
+ + + + + +
0x964wTX_SETIMAGE3_I2 - Address of Texture in main memory
+
+ + + + + +
0x974wTX_SETIMAGE3_I3 - Address of Texture in main memory
+
+ + + + + +
0xb44wTX_SETIMAGE3_I4 - Address of Texture in main memory
+
+ + + + + +
0xb54wTX_SETIMAGE3_I5 - Address of Texture in main memory
+
+ + + + + +
0xb64wTX_SETIMAGE3_I6 - Address of Texture in main memory
+
+ + + + + +
0xb74wTX_SETIMAGE3_I7 - Address of Texture in main memory
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
0 IMAGE_BASE (physical address > > 5)
+
+

+ + + + + + + + + + +
+ + + + + +
0x984wTX_SETTLUT_0
+
+ + + + + +
0x994wTX_SETTLUT_1
+
+ + + + + +
0x9a4wTX_SETTLUT_2
+
+ + + + + +
0x9b4wTX_SETTLUT_3
+
+ + + + + +
0xb84wTX_SETTLUT_4
+
+ + + + + +
0xb94wTX_SETTLUT_5
+
+ + + + + +
0xba4wTX_SETTLUT_6
+
+ + + + + +
0xbb4wTX_SETTLUT_7
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
10 FORMAT
   + + + + + + + + + + + + + + + + + +
0IA8
1RGB565
2RGB5A3
3reserved/unused
+
0 TMEM_OFFSET (offset of TLUT from start of TMEM high bank > 
+5)
+
+

+ + + + + +
0x9c4w?
+
+

+ + + + + +
0x9d4w?
+
+

+ + + + + +
0x9e4w?
+
+

+ + + + + +
0x9f4w?
+
+

+ + + + + +
0xbc4w?
+
+

+ + + + + +
0xbd4w?
+
+

+ + + + + +
0xbe4w?
+
+

+ + + + + +
0xbf4w?
+
+

+ + + + + + + + + + + + + + + + + + +
+ + + + + +
0xc04wTEV_COLOR_ENV_0
+
+ + + + + +
0xc24wTEV_COLOR_ENV_1
+
+ + + + + +
0xc44wTEV_COLOR_ENV_2
+
+ + + + + +
0xc64wTEV_COLOR_ENV_3
+
+ + + + + +
0xc84wTEV_COLOR_ENV_4
+
+ + + + + +
0xca4wTEV_COLOR_ENV_5
+
+ + + + + +
0xcc4wTEV_COLOR_ENV_6
+
+ + + + + +
0xce4wTEV_COLOR_ENV_7
+
+ + + + + +
0xd04wTEV_COLOR_ENV_8
+
+ + + + + +
0xd24wTEV_COLOR_ENV_9
+
+ + + + + +
0xd44wTEV_COLOR_ENV_A
+
+ + + + + +
0xd64wTEV_COLOR_ENV_B
+
+ + + + + +
0xd84wTEV_COLOR_ENV_C
+
+ + + + + +
0xda4wTEV_COLOR_ENV_D
+
+ + + + + +
0xdc4wTEV_COLOR_ENV_E
+
+ + + + + +
0xde4wTEV_COLOR_ENV_F
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
22 DEST
20 SHIFT
19 CLAMP
18 SUB
16 BIAS
12 SELA
8 SELB
4 SELC
0 SELD
+
+

+SELA - SELD Format:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0x0CC_CPREV
0x1CC_APREV
0x2CC_C0
0x3CC_A0
0x4CC_C1
0x5CC_A1
0x6CC_C2
0x7CC_A2
0x8CC_TEXC
0x9CC_TEXA
0xACC_RASC
0xBCC_RASA
0xCCC_ONE
0xDCC_HALF
0xECC_KONST
0xFCC_ZERO
+

+ + + + + + + + + + + + + + + + + + +
+ + + + + +
0xc14wTEV_ALPHA_ENV_0
+
+ + + + + +
0xc34wTEV_ALPHA_ENV_1
+
+ + + + + +
0xc54wTEV_ALPHA_ENV_2
+
+ + + + + +
0xc74wTEV_ALPHA_ENV_3
+
+ + + + + +
0xc94wTEV_ALPHA_ENV_4
+
+ + + + + +
0xcb4wTEV_ALPHA_ENV_5
+
+ + + + + +
0xcd4wTEV_ALPHA_ENV_6
+
+ + + + + +
0xcf4wTEV_ALPHA_ENV_7
+
+ + + + + +
0xd14wTEV_ALPHA_ENV_8
+
+ + + + + +
0xd34wTEV_ALPHA_ENV_9
+
+ + + + + +
0xd54wTEV_ALPHA_ENV_A
+
+ + + + + +
0xd74wTEV_ALPHA_ENV_B
+
+ + + + + +
0xd94wTEV_ALPHA_ENV_C
+
+ + + + + +
0xdb4wTEV_ALPHA_ENV_D
+
+ + + + + +
0xdd4wTEV_ALPHA_ENV_E
+
+ + + + + +
0xdf4wTEV_ALPHA_ENV_F
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
22 DEST
20 SHIFT
19 CLAMP
18 SUB
16 BIAS
13 SELA
10 SELB
7 SELC
4 SELD
2 TSWAP
0 RSWAP
+
+

+SELA - SELD Format:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0CA_APREV
1CA_A0
2CA_A1
3CA_A2
4CA_TEXA
5CA_RASA
6CA_KONST
7CA_ZERO
+
+

+ + + + + + +
+ + + + + +
0xe04wTEV_REGISTERL_0
+
+ + + + + +
0xe24wTEV_REGISTERL_1
+
+ + + + + +
0xe44wTEV_REGISTERL_2
+
+ + + + + +
0xe64wTEV_REGISTERL_3
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
23 TYPE
   + + + + + + + + + +
0Color (?)
1Constant (?)
+
12 A
0 R
+
+

+ + + + + + +
+ + + + + +
0xe14wTEV_REGISTERH_0
+
+ + + + + +
0xe34wTEV_REGISTERH_1
+
+ + + + + +
0xe54wTEV_REGISTERH_2
+
+ + + + + +
0xe74wTEV_REGISTERH_3
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
23 TYPE
   + + + + + + + + + +
0Color (?)
1Constant (?)
+
12 G
0 B
+
+

+ + + + + +
0x884wFog Range
+
+

+ + + + + +
0x894w 
+
+

+ + + + + +
0x8A4w 
+
+

+ + + + + +
0x8B4w 
+
+

+ + + +
+ + + + + +
0xec (guessed)4wtev_range_adj_c
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
10 CENTER - Screen X Center for range Adjustment
0 ENB - Range-Adjustment enable
   + + + + + + + + + +
0TEV_ENB_DISABLE
1TEV_ENB_ENABLE
+
+
+

+ + + +
+ + + + + +
0xed (guessed)4wtev_range_adj_k
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
0-11 r2k (u4.8) - specifies the range adjustment function
+
+

+range adjustment = sqr((x*x)+(k*k))/k

+ + + +
+ + + + + +
0xee4wTEV_FOG_PARAM_0 - "a" parameter of the screen +to eye space conversion function
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
19 A_SIGN_SHIFT
11 A_EXPN
0 A_MANT (signed 11e8)
+
+

+ + + +
+ + + + + +
0xef4wTEV_FOG_PARAM_1 - the "b" parameter of the z +screen to eye space conversion function
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
0 B_MAG (unsigned 0.24)
+
+

+ + + +
+ + + + + +
0xf04wTEV_FOG_PARAM_2 - amount to pre-shift screen z
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
0-4 B_SHF - equivalent to the value of "b" parameter's +exponent + 1
+
+

+The Z-Screen to Eyespace conversion is defined as:

Ze = A / (B_MAG - (Zs > > B_SHF))

+ + + +
+ + + + + +
0xf14wTEV_FOG_PARAM_3 - fog type
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
21-23 FSEL
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0FSEL_OFF; No fog
1reserved
2FSEL_LIN; linear Fog
3reserved
4FSEL_EXP; Exponential Fog
5FSEL_EX2; Exponential Squared Fog
6FSEL_BXP; Backward Exp Fog
7FSEL_BX2 Backward Exp Squared Fog
+
20 PROJ
   + + + + + + + + + +
0PERSP; Perspective projection
1ORTHO; Orthographic projection
+
19 C_SIGN (*)
11 C_EXPN (*)
0-10 C_MANT (*)
+
+

+(*) Specifies the amount to subtract from eye-space Z after range +adjustment.

+ + + +
+ + + + + +
0xf24wTEV_FOG_COLOR - Value of Fog Color
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
16 R
8 G
0 B
+
+

+ + + +
+ + + + + +
0xf34wTEV_ALPHAFUNC
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
22 LOGIC
   + + + + + + + + + + + + + + + + + +
0AND
1OR
2XOR
3XNOR
+
19 OP1
16 OP0
8 A1
0 A0
+
+

+ + + +
+ + + + + +
0xf44wTEV_Z_ENV_0
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
24 RID -
0-23 ZOFF/BIAS -
+
+

+ + + +
+ + + + + +
0xf54wTEV_Z_ENV_1
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
2-3 OP
   + + + + + + + + + + + + + + + + + +
0disable
1add
2replace
3unused/reserved
+
0-1 TYPE/FORMAT
   + + + + + + + + + + + + + + + + + +
0u8
1u16
2u24
3unused/reserved
+
+
+

+ + + + + + + + + + +
+ + + + + +
0xf64wTEV_KSEL_0
+
+ + + + + +
0xf74wTEV_KSEL_1
+
+ + + + + +
0xf84wTEV_KSEL_2
+
+ + + + + +
0xf94wTEV_KSEL_3
+
+ + + + + +
0xfa4wTEV_KSEL_4
+
+ + + + + +
0xfb4wTEV_KSEL_5
+
+ + + + + +
0xfc4wTEV_KSEL_6
+
+ + + + + +
0xfd4wTEV_KSEL_7
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RID
19 KASEL1
14 KCSEL1
9 KASEL0
4 KCSEL0
2 XGA
0 XRB
+
+

+KCSEL - tev const color sel

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
01
17_8
23_4
35_8
41_2
53_8
61_4
71_8
8 
9 
10 
11 
12K0
13K1
14K2
15K3
16K0_R
17K1_R
18K2_R
19K3_R
20K0_G
21K1_G
22K2_G
23K3_G
24K0_B
25K1_B
26K2_B
27K3_B
28K0_A
29K1_A
30K2_A
31K3_A
+
+

+KASEL - tev const alpha sel

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
01
17_8
23_4
35_8
41_2
53_8
61_4
71_8
8 
9 
10 
11 
12 
13 
14 
15 
16K0_R
17K1_R
18K2_R
19K3_R
20K0_G
21K1_G
22K2_G
23K3_G
24K0_B
25K1_B
26K2_B
27K3_B
28K0_A
29K1_A
30K2_A
31K3_A
+
+

+ + + +
+ + + + + +
0xfe4wSS_MASK - BP Mask Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
********      
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
24*RID
0-23 MASK (*)
+
+

+(*) This Register can be used to limit to which bits of BP registers +is actually written to. the mask is only valid for the next BP command, +and will reset itself.

+ + + + + +
0xff4w?
+
+
index
+

+ +5.11.2  internal CP Registers

+
+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0x200xa04
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Register description
0x20 ?
0x30 MATINDEX_A - Texture Matrix Index 0-3
0x40 MATINDEX_B - Texture Matrix Index 4-7
0x50 VCD_LO - Vertex Descriptor (VCD) low, format 0
0x51 VCD_LO - Vertex Descriptor (VCD) low, format 1
0x52 VCD_LO - Vertex Descriptor (VCD) low, format 2
0x53 VCD_LO - Vertex Descriptor (VCD) low, format 3
0x54 VCD_LO - Vertex Descriptor (VCD) low, format 4
0x55 VCD_LO - Vertex Descriptor (VCD) low, format 5
0x56 VCD_LO - Vertex Descriptor (VCD) low, format 6
0x57 VCD_LO - Vertex Descriptor (VCD) low, format 7
0x60 VCD_HI - Vertex Descriptor (VCD) high, format 0
0x61 VCD_HI - Vertex Descriptor (VCD) high, format 1
0x62 VCD_HI - Vertex Descriptor (VCD) high, format 2
0x63 VCD_HI - Vertex Descriptor (VCD) high, format 3
0x64 VCD_HI - Vertex Descriptor (VCD) high, format 4
0x65 VCD_HI - Vertex Descriptor (VCD) high, format 5
0x66 VCD_HI - Vertex Descriptor (VCD) high, format 6
0x67 VCD_HI - Vertex Descriptor (VCD) high, format 7
0x70 VAT_A - Vertex Attribute Table (VAT) group 0, format 0
0x71 VAT_A - Vertex Attribute Table (VAT) group 0, format 1
0x72 VAT_A - Vertex Attribute Table (VAT) group 0, format 2
0x73 VAT_A - Vertex Attribute Table (VAT) group 0, format 3
0x74 VAT_A - Vertex Attribute Table (VAT) group 0, format 4
0x75 VAT_A - Vertex Attribute Table (VAT) group 0, format 5
0x76 VAT_A - Vertex Attribute Table (VAT) group 0, format 6
0x77 VAT_A - Vertex Attribute Table (VAT) group 0, format 7
0x80 VAT_B - Vertex Attribute Table (VAT) group 1, format 0
0x81 VAT_B - Vertex Attribute Table (VAT) group 1, format 1
0x82 VAT_B - Vertex Attribute Table (VAT) group 1, format 2
0x83 VAT_B - Vertex Attribute Table (VAT) group 1, format 3
0x84 VAT_B - Vertex Attribute Table (VAT) group 1, format 4
0x85 VAT_B - Vertex Attribute Table (VAT) group 1, format 5
0x86 VAT_B - Vertex Attribute Table (VAT) group 1, format 6
0x87 VAT_B - Vertex Attribute Table (VAT) group 1, format 7
0x90 VAT_C - Vertex Attribute Table (VAT) group 2, format 0
0x91 VAT_C - Vertex Attribute Table (VAT) group 2, format 1
0x92 VAT_C - Vertex Attribute Table (VAT) group 2, format 2
0x93 VAT_C - Vertex Attribute Table (VAT) group 2, format 3
0x94 VAT_C - Vertex Attribute Table (VAT) group 2, format 4
0x95 VAT_C - Vertex Attribute Table (VAT) group 2, format 5
0x96 VAT_C - Vertex Attribute Table (VAT) group 2, format 6
0x97 VAT_C - Vertex Attribute Table (VAT) group 2, format 7
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Register description
0xA0 ARRAY_BASE - vertices ptr
0xa1 ARRAY_BASE - normals ptr
0xa2 ARRAY_BASE - color 0 ptr
0xa3 ARRAY_BASE - color 1 ptr
0xa4 ARRAY_BASE - texture 0 coordinate ptr
0xa5 ARRAY_BASE - texture 1 coordinate ptr
0xa6 ARRAY_BASE - texture 2 coordinate ptr
0xa7 ARRAY_BASE - texture 3 coordinate ptr
0xa8 ARRAY_BASE - texture 4 coordinate ptr
0xa9 ARRAY_BASE - texture 5 coordinate ptr
0xaa ARRAY_BASE - texture 6 coordinate ptr
0xab ARRAY_BASE - texture 7 coordinate ptr
0xac ARRAY_BASE - IndexRegA - general purpose array 0 ptr
0xad ARRAY_BASE - IndexRegB - general purpose array 1 ptr
0xae ARRAY_BASE - IndexRegC - general purpose array 2 ptr
0xaf ARRAY_BASE - IndexRegD - general purpose array 3 ptr
0xB0 ARRAY_STRIDE - size of vertices
0xb1 ARRAY_STRIDE - size of normals
0xb2 ARRAY_STRIDE - size of colors 0
0xb3 ARRAY_STRIDE - size of colors 1
0xb4 ARRAY_STRIDE - size of texture 0 coordinates
0xb5 ARRAY_STRIDE - size of texture 1 coordinates
0xb6 ARRAY_STRIDE - size of texture 2 coordinates
0xb7 ARRAY_STRIDE - size of texture 3 coordinates
0xb8 ARRAY_STRIDE - size of texture 4 coordinates
0xb9 ARRAY_STRIDE - size of texture 5 coordinates
0xba ARRAY_STRIDE - size of texture 6 coordinates
0xbb ARRAY_STRIDE - size of texture 7 coordinates
0xbc ARRAY_STRIDE - IndexRegA - general purpose array 0 stride
0xbd ARRAY_STRIDE - IndexRegB - general purpose array 1 stride
0xbe ARRAY_STRIDE - IndexRegC - general purpose array 2 stride
0xbf ARRAY_STRIDE - IndexRegD - general purpose array 3 stride
+
+

+ + + + + +
0x204w?
+
+

+ + + +
+ + + + + +
0x304wMATIDX_REG_A
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 TEX3IDX - Index for Texture 3 matrix
18 TEX2IDX - Index for Texture 2 matrix
12 TEX1IDX - Index for Texture 1 matrix
6 TEX0IDX - Index for Texture 0 matrix
0 POSIDX - Index for Position/Normal matrix
+
+ 
 
+ + + +
+ + + + + +
0x404wMATIDX_REG_B
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
18 TEX7IDX - Index for Texture 7 matrix
12 TEX6IDX - Index for Texture 6 matrix
6 TEX5IDX - Index for Texture 5 matrix
0 TEX4IDX - Index for Texture 4 matrix
+
+ 
 
+ + + + + + + + + + + +
+ + + + + +
0x504R/WVCD_LO - Vertex Descriptor low Format 0
+
+ + + + + +
0x514R/WVCD_LO - Vertex Descriptor low Format 1
+
+ + + + + +
0x524R/WVCD_LO - Vertex Descriptor low Format 2
+
+ + + + + +
0x534R/WVCD_LO - Vertex Descriptor low Format 3
+
+ + + + + +
0x544R/WVCD_LO - Vertex Descriptor low Format 4
+
+ + + + + +
0x554R/WVCD_LO - Vertex Descriptor low Format 5
+
+ + + + + +
0x564R/WVCD_LO - Vertex Descriptor low Format 6
+
+ + + + + +
0x574R/WVCD_LO - Vertex Descriptor low Format 7
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
17-31 unused
15-16 COL1 - Color1 (Specular)
13-14 COL0 - Color0 (Diffused)
11-12 NRM - Normal or Normal/Binormal/Tangent
9-10 POS - Position
8 T7MIDX
7 T6MIDX
6 T5MIDX
5 T4MIDX
4 T3MIDX
3 T2MIDX
2 T1MIDX
1 T0MIDX - Texture Coordinate 0 Matrix Index
0 PMIDX - Position/Normal Matrix Index (*1)
+
+ 
 
(*1) position and normal matrices are stored in 2 seperate +areas of internal XF memory, but there is a one to one correspondence +between normal and position index.If index 'A' is used for the position, +then index 'A' needs to be used for the normal as well. 
 
+ + + + + + + + + + + +
+ + + + + +
0x604R/WVCD_HI - Vertex Descriptor high Format 0
+
+ + + + + +
0x614R/WVCD_HI - Vertex Descriptor high Format 1
+
+ + + + + +
0x624R/WVCD_HI - Vertex Descriptor high Format 2
+
+ + + + + +
0x634R/WVCD_HI - Vertex Descriptor high Format 3
+
+ + + + + +
0x644R/WVCD_HI - Vertex Descriptor high Format 4
+
+ + + + + +
0x654R/WVCD_HI - Vertex Descriptor high Format 5
+
+ + + + + +
0x664R/WVCD_HI - Vertex Descriptor high Format 6
+
+ + + + + +
0x674R/WVCD_HI - Vertex Descriptor high Format 7
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
       ..tt
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
16- unused
14-15  +TEX7 - texture coordinate 7
12-13  +TEX6 - texture coordinate 6
10-11  +TEX5 - texture coordinate 5
8-9  +TEX4 - texture coordinate 4
6-7  +TEX3 - texture coordinate 3
4-5  +TEX2 - texture coordinate 2
2-3  +TEX1 - texture coordinate 1
0-1t +TEX0 - texture coordinate 0
+
+ 
 
+ + + +
vertex descriptor data
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
valueVertex/ColorPos/Tex Matrix Index
0no data presentno data present
1directdirect
2i8 - indirect/8 bit indexn/a
3i16 - indirect/16 bit indexn/a
+
+ 
 
+ + + + + + + + + + +
+ + + + + +
0x704wCP_VAT_REG_A - Format 0
+
+ + + + + +
0x714wCP_VAT_REG_A - Format 1
+
+ + + + + +
0x724wCP_VAT_REG_A - Format 2
+
+ + + + + +
0x734wCP_VAT_REG_A - Format 3
+
+ + + + + +
0x744wCP_VAT_REG_A - Format 4
+
+ + + + + +
0x754wCP_VAT_REG_A - Format 5
+
+ + + + + +
0x764wCP_VAT_REG_A - Format 6
+
+ + + + + +
0x774wCP_VAT_REG_A - Format 7
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
31 NORMALINDEX3 (*1)
   + + + + + + + + + +
0single index per normal
1triple-index per nine-normal
+
30 BYTEDEQUANT (should always be 1)
   + + + + + + + + + +
0shift does not apply to u8/s8 components
1shift applies to u8/s8 components
+
25 TEX0SHFT
22 TEX0FMT
21 TEX0CNT
18 COL1FMT (Specular)
17 COL1CNT (Specular)
14 COL0FMT (Diffused)
13 COL0CNT (Diffused)
10 NRMFMT
9 NRMCNT
4 POSSHFT
1 POSFMT
0 POSCNT
+
+ 
 
(*1) when nine-normals are selected in indirect mode, input +will be treated as three staggered indices (one per triple biased +by components size), into normal table (note: first index internally +biased by 0, second by 1, third by 2) 
 
+ + + + + + + + + + +
+ + + + + +
0x804wCP_VAT_REG_B - Format 0
+
+ + + + + +
0x814wCP_VAT_REG_B - Format 1
+
+ + + + + +
0x824wCP_VAT_REG_B - Format 2
+
+ + + + + +
0x834wCP_VAT_REG_B - Format 3
+
+ + + + + +
0x844wCP_VAT_REG_B - Format 4
+
+ + + + + +
0x854wCP_VAT_REG_B - Format 5
+
+ + + + + +
0x864wCP_VAT_REG_B - Format 6
+
+ + + + + +
0x874wCP_VAT_REG_B - Format 7
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
31 VCACHE_ENHANCE (must always be 1)
28 TEX4FMT
27 TEX4CNT
22 TEX3SHFT
19 TEX3FMT
18 TEX3CNT
13 TEX2SHFT
10 TEX2FMT
9 TEX2CNT
4 TEX1SHFT
1 TEX1FMT
0 TEX1CNT
+
+ 
 
+ + + + + + + + + + +
+ + + + + +
0x904wCP_VAT_REG_C - Format 0
+
+ + + + + +
0x914wCP_VAT_REG_C - Format 1
+
+ + + + + +
0x924wCP_VAT_REG_C - Format 2
+
+ + + + + +
0x934wCP_VAT_REG_C - Format 3
+
+ + + + + +
0x944wCP_VAT_REG_C - Format 4
+
+ + + + + +
0x954wCP_VAT_REG_C - Format 5
+
+ + + + + +
0x964wCP_VAT_REG_C - Format 6
+
+ + + + + +
0x974wCP_VAT_REG_C - Format 7
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
27 TEX7SHFT
24 TEX7FMT
23 TEX7CNT
18 TEX6SHFT
15 TEX6FMT
14 TEX6CNT
9 TEX5SHFT
6 TEX5FMT
5 TEX5CNT
0 TEX4SHFT
+
+ 
 
Vertex Attribute Data Formats 
 
CompCount 
 
+ + + + + + + + + + + + + + + + + + + + + + + +
valuecoordsnormalstex coordscolors
0two (x,y)threeone (s)three (r,g,b)
1three (x,y,z)ninetwo (s,t)four (r,g,b,a)
+
+ 
 
CompSize 
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
valuecoordsnormalscolors
0u8n/a16 bit rgb565
1s8s824 bit rgb888
2u16n/a32 bit rgb888x
3s16s1616 bit rgba4444
4f32f3224 bit rgba6666
5n/an/a32 bit rgba8888
6unusedunusedunused
7unusedunusedunused
+
+ 
 
Shift 
 
+ + + + + + + + + + + + +
coordsnormalscolors
location of decimal pointn/a (byte: 6, short: 14)n/a
+
+ 
 
This shift applies to all s16/u16 components, and all s8/s8 +components when ByteDequant is asserted. 
 
+ + + + + + + + + + + + + + + + + + +
+ + + + + +
0xA04wARRAY_BASE
+
+ + + + + +
0xA14wARRAY_BASE
+
+ + + + + +
0xA24wARRAY_BASE
+
+ + + + + +
0xA34wARRAY_BASE
+
+ + + + + +
0xA44wARRAY_BASE
+
+ + + + + +
0xA54wARRAY_BASE
+
+ + + + + +
0xA64wARRAY_BASE
+
+ + + + + +
0xA74wARRAY_BASE
+
+ + + + + +
0xA84wARRAY_BASE
+
+ + + + + +
0xA94wARRAY_BASE
+
+ + + + + +
0xAA4wARRAY_BASE
+
+ + + + + +
0xAB4wARRAY_BASE
+
+ + + + + +
0xAC4wARRAY_BASE
+
+ + + + + +
0xAD4wARRAY_BASE
+
+ + + + + +
0xAE4wARRAY_BASE
+
+ + + + + +
0xAF4wARRAY_BASE
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
26- unused
0-25 array base addres in main memory
+
+

+ + + + + + + + + + + + + + + + + + +
+ + + + + +
0xB04wARRAY_STRIDE
+
+ + + + + +
0xB14wARRAY_STRIDE
+
+ + + + + +
0xB24wARRAY_STRIDE
+
+ + + + + +
0xB34wARRAY_STRIDE
+
+ + + + + +
0xB44wARRAY_STRIDE
+
+ + + + + +
0xB54wARRAY_STRIDE
+
+ + + + + +
0xB64wARRAY_STRIDE
+
+ + + + + +
0xB74wARRAY_STRIDE
+
+ + + + + +
0xB84wARRAY_STRIDE
+
+ + + + + +
0xB94wARRAY_STRIDE
+
+ + + + + +
0xBa4wARRAY_STRIDE
+
+ + + + + +
0xBb4wARRAY_STRIDE
+
+ + + + + +
0xBc4wARRAY_STRIDE
+
+ + + + + +
0xBd4wARRAY_STRIDE
+
+ + + + + +
0xBe4wARRAY_STRIDE
+
+ + + + + +
0xBf4wARRAY_STRIDE
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
8- unused
0-7 array stride
+
+
index
+

+ +5.11.3  internal XF Memory

+
+Every register in the transform unit is mapped to a unique 32b address. +All addresses are available to the xform register load command (command +0x30).

+The first block is formed by the matrix memory. Its address range +is 0 to 1 k, but only 256 entries are used. This memory is organized +in a 64 entry by four 32b words. Each word has a unique address and +is a single precision floating point number. For block writes, the +addresses auto increment. The memory is implemented in less than 4-32b +rams, then it is possible that the memory writes to this block will +require a minimum write size larger than 1 word.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x0000 32Matrix Ram word 0
0x00010x00ff Matrix Ram word (n)
0x01000x03ff0x300not used
+
+ 
 
0 - position matrix (4*3) 
0xF0 - (texture?) transform matrix (4*3) 
 
+The second block of memory is the normal matrix memory. It is organized +as 32 rows of 3 words. Each word has a unique address and is a single +precision floating point number. Also, each word written is 32b, but +only the 20 most significant bits are kept. For simplicity, the minimum +granularity of writes will be 3 words: 
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x04000x040220Normal Ram words 0,1,2
0x04030x045f Normal Ram word (n)
0x04600x05ff not used
+
+ 
 
0x400 - normal transform matrix (3*3) 
 
+The third block of memory holds the dual texture transform matrices. +The format is identical to the first block of matrix memory. There +are also 64 rows of 4 words for these matrices. These matrices can +only be used for the dual transform of regular textures: 
 
+ + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x0500 32Matrix Ram word 0
0x05010x05ff Matrix Ram word (n)
+
+ 
 
0x5F4 - dual texture transform matrix (4*3) 
 
+The fourth block of memory is the light memory. This holds all the +lighting information (light vectors, light parameters, etc.). Both +global state and ambient state are stored in this memory. Each word +written is 32b, but only the 20 most significant bits are kept. Each +row is 3 words wide. Minimum word write size is 3 words.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x0600  reserved
0x0601  reserved
0x0602  reserved
0x0603 32 bitLight0 - RGBA
0x0604 20 bitLight0A0 - cos atten. A-0
0x0605 20 bitLight0A1 - cos atten. A-1
0x0606 20 bitLight0A2 - cos atten. A-2
0x0607 20 bitLight0K0 - dist atten. A-0
0x0608 20 bitLight0K1 - dist atten. A-1
0x0609 20 bitLight0K2 - dist atten. A-2
0x060a 20 bitLight0Lpx - x light pos, or inf ldir x
0x060b 20 bitLight0Lpy - y light pos, or inf ldir y
0x060c 20 bitLight0Lpz - z light pos, or inf ldir z
0x060d 20 bitLight0Dx/Hx - light dir x, or 1/2 angle x
0x060e 20 bitLight0Dy/Hy - light dir y, or 1/2 angle y
0x060f 20 bitLight0Dz/Hz - light dir z, or 1/2 angle z
0x06100x067f Light(n)data - see Light0 data
0x06800x07ff not used
+
+ 
index
+

+ +5.11.4  internal XF Registers

+
+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0x10000x544
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Register description
0x1000 Error (=0x3f)
0x1001 Diagnostics
0x1002 State0 - Internal State Register 0
0x1003 State1 - Internal State Register 1
0x1004 Xf_clock - Enables Power Saving Mode
0x1005 ClipDisable - clip mode (=0)
0x1006 Perf0 - Performance monitor selects (=0)
0x1007 Perf1 - Xform target performance register
0x1008 InVertexSpec - INVTXSPEC - (=0x01)
0x1009 NumColors - NUMCOLORS - (=0x00)
0x100a Ambient0 - chan Ambient color 0 (=0x00)
0x100b Ambient1- chan Ambient color 1 (=0x00)
0x100c Material0 - chan Material ID 0 (=0xffffffff)
0x100d Material1 - chan Material ID 1 (=0xffffffff)
0x100e COLOR0CNTRL (=0x0401)
0x100f COLOR1CNTRL (=0x0401)
0x1010 ALPHA0CNTRL (=0x0401)
0x1011 ALPHA1CNTRL (=0x0401)
0x1012 DualTexTrans - (=0x01)
0x1013 ?
0x1014 ?
0x1015 ?
0x1016 ?
0x1017 ?
0x1018 MatrixIndex0 - MATINDEX A
0x1019 MatrixIndex1 - MATINDEX B
0x101a ScaleX - Viewport Scale X
0x101b ScaleY - Viewport Scale Y
0x101c Scale Z - Viewport Scale Z
0x101d OffsetX - Viewport Offset X
0x101e OffsetY - Viewport Offset Y
0x101f OffsetZ - Viewport Offset Z
0x1020 ProjectionA - A parameter in projection equations
0x1021 ProjectionB - B parameter in projection equations
0x1022 ProjectionC - C parameter in projection equations
0x1023 ProjectionD - D parameter in projection equations
0x1024 ProjectionE - E parameter in projection equations
0x1025 ProjectionF - F parameter in projection equations
0x1026 ProjectOrtho
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Register description
0x103f NUMTEX - Number of active Textures
0x1040 TEX0
0x1041 TEX1
0x1042 TEX2
0x1043 TEX3
0x1044 TEX4
0x1045 TEX5
0x1046 TEX6
0x1047 TEX7
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Register description
0x1050 DUALTEX0
0x1051 DUALTEX1
0x1052 DUALTEX2
0x1053 DUALTEX3
0x1054 DUALTEX4
0x1055 DUALTEX5
0x1056 DUALTEX6
0x1057 DUALTEX7
+
+

+ + + + + +
0x10004wError
+
+

+ + + + + +
0x10014wDiagnostics
+
+

+ + + + + +
0x10024wState 0 - Internal State Register 0
+
+

+ + + + + +
0x10034wState 1 - Internal State Register 1
+
+

+ + + +
+ + + + + +
0x10044wXf_clock
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + +
bit(s) description
0  + + + + + + + + + +
0no power saving when idle
1enable Power saving when idle
+
+
+

+ + + +
+ + + + + +
0x10054wClipDisable
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
2 when set, disable cpoly clipping acceleration (default==0)
1 when set, disable trivial rejection (default==0)
0 when set, disable clipping detection (default==0)
+
+

+ + + + + +
0x10064wPerf0 - Performance monitor selects
+
+

+ + + +
+ + + + + +
0x10074wPerf1 - Xform target performance Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + +
bit(s) description
0-6 Xform internal target performance (Cycles per Vertex)
+
+

+ + + +
+ + + + + +
0x10084wINVTXSPEC
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
4-7  +HOST_TEXTURES - number of host supplied texture coordinates
   + + + + + + + + + + + + + + + + + +
0no host supplied textures
11 host supplied texture pair (S0, T0)
2-82-8 host supplied texturepairs
9-15reserved/unused
+
2-3  +HOST_NORMAL - host supplied normal
   + + + + + + + + + + + + + +
0no host supplied normal
1host supplied normal
2host supplied normal and binormals
+
0-1  +HOST_COLORS - host supplied color0 usage
   + + + + + + + + + + + + + +
0no host supplied color information
1host supplied color 0
2host supplied color 0 and color 1
+
+
+ 
 
+ + + + +
+ + + + + +
0x10094wNUMCOLORS
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
value description
0 No colors
1  +One color - Xform supplies 1 color (host supplied or computed)
2  +Two colors - Xform supplies 2 colors (host supplied or computed)
+
Selects the number of output colors
+ 
 
+ + + +
+ + + + + +
0x100a4wXF_AMBIENT0 - Ambient color 0 specifications
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RED
16 GREEN
8 BLUE
0 ALPHA
+
+

+ + + +
+ + + + + +
0x100b4wXF_AMBIENT1 - Ambient color 1 specifications
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RED
16 GREEN
8 BLUE
0 ALPHA
+
+ 

+ + + +
+ + + + + +
0x100c4w +XF_MATERIAL0 - global color0 material specification
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RED
16 GREEN
8 BLUE
0 ALPHA
+
+

+ + + +
+ + + + + +
0x100d4w +XF_MATERIAL1 - global color1 material specification
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24 RED
16 GREEN
8 BLUE
0 ALPHA
+
+ 
 
+ + + +
+ + + + + +
0x100e4wCOLOR0CNTRL
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
14  +LIGHT7 - Light 7 is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
13  +LIGHT6 - Light6 is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
12  +LIGHT5 - Light5 is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
11  +LIGHT4 - Light4 is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
10  +ATTENSELECT - Attenuation Select function
   + + + + + + + + + +
0Select specular (N.H) attenuation
1Select diffuse spotlight (L.Ldir) attenuation
+
9  +ATTENENABLE - Attenuation Enable function
   + + + + + + + + + +
0Select 1.0
1Select Attenuation fraction
+
7-8  +DIFFUSEATTEN - Diffuse Attenuation function
   + + + + + + + + + + + + + + + + + +
00Select 1.0
01Select N.L, signed
10Select N.L clamped to [0,1.0]
11 
+
6  +AMBIENT_SRC - Ambient source
   + + + + + + + + + +
0Use register Ambient0 register
1Use CP supplied vertex color 0
+
5  +LIGHT3 - Light3 is source
   + + + + + + + + + +
0Do not use light
1Use light
+
4  +LIGHT2 - Light2 is source
   + + + + + + + + + +
0Do not use light
1Use light
+
3  +LIGHT1 - Light1 is source
   + + + + + + + + + +
0Do not use light
1Use light
+
2  +LIGHT0 - Light0 is source
   + + + + + + + + + +
0Do not use light
1Use light
+
1  +LIGHTFUNC - Color0 Light Function
   + + + + + + + + + +
0Use 1.0
1Use Illum0
+
0  +MATERIAL_SRC - Color0 Material source
   + + + + + + + + + +
0Use register (Material 0)
1Use CP supplied Vertex color 0
+
+
+ 
 
+ + + +
+ + + + + +
0x100f4wCOLOR1CNTRL
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
14  +LIGHT7 - Light 7 is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
13  +LIGHT6 - Light6 is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
12  +LIGHT5 - Light5 is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
11  +LIGHT4 - Light4 is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
10  +ATTENSELECT - Attenuation Select function
   + + + + + + + + + +
0Select specular (N.H) attenuation
1Select diffuse spotlight (L.Ldir) attenuation
+
9  +ATTENENABLE - Attenuation Enable function
   + + + + + + + + + +
0Select 1.0
1Select Attenuation fraction
+
7-8  +DIFFUSEATTEN - Diffuse Attenuation function
   + + + + + + + + + + + + + + + + + +
00Select 1.0
01Select N.L, signed
10Select N.L clamped to [0,1.0]
11 
+
6  +AMBIENT_SRC - Ambient source
   + + + + + + + + + +
0Use register Ambient1 register
1Use CP supplied vertex color 1
+
5  +LIGHT3 - Light3 is source
   + + + + + + + + + +
0Do not use light
1Use light
+
4  +LIGHT2 - Light2 is source
   + + + + + + + + + +
0Do not use light
1Use light
+
3  +LIGHT1 - Light1 is source
   + + + + + + + + + +
0Do not use light
1Use light
+
2  +LIGHT0 - Light0 is source
   + + + + + + + + + +
0Do not use light
1Use light
+
1  +LIGHTFUNC - Color1 Light Function
   + + + + + + + + + +
0Use 1.0
1Use Illum1
+
0  +MATERIAL_SRC - Color1 Material source
   + + + + + + + + + +
0Use register (Material 1)
1Use CP supplied Vertex color 1
+
+
+ 
 
+ + + +
+ + + + + +
0x10104wALPHA0CNTRL
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
14  +LIGHT7 - Light 7 alpha is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
13  +LIGHT6 - Light6 alpha is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
12  +LIGHT5 - Light5 alpha is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
11  +LIGHT4 - Light4 alpha is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
10  +ATTENSELECT - Attenuation Select function
   + + + + + + + + + +
0Select specular (N.H) attenuation
1Select diffuse spotlight (L.Ldir) attenuation
+
9  +ATTENENABLE - Attenuation Enable function
   + + + + + + + + + +
0Select 1.0
1Select Attenuation fraction
+
7-8  +DIFFUSEATTEN - Diffuse Attenuation function
   + + + + + + + + + + + + + + + + + +
00Select 1.0
01Select N.L, signed
10Select N.L clamped to [0,1.0]
11 
+
6  +AMBIENT_SRC - Ambient source
   + + + + + + + + + +
0Use register Ambient0 alpha register
1Use CP supplied vertex color 0 alpha
+
5  +LIGHT3 - Light3 alpha is source
   + + + + + + + + + +
0Do not use light
1Use light
+
4  +LIGHT2 - Light2 alpha is source
   + + + + + + + + + +
0Do not use light
1Use light
+
3  +LIGHT1 - Light1 alpha is source
   + + + + + + + + + +
0Do not use light
1Use light
+
2  +LIGHT0 - Light0 alpha is source
   + + + + + + + + + +
0Do not use light
1Use light
+
1  +LIGHTFUNC - Color0 alpha Light Function
   + + + + + + + + + +
0Use 1.0
1Use Illum0
+
0  +MATERIAL_SRC - Color0 alpha Material source
   + + + + + + + + + +
0Use register (Material 0 alpha)
1Use CP supplied Vertex color 0 alpha
+
+
+ 
 
+ + + +
+ + + + + +
0x10114wALPHA1CNTRL
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
14  +LIGHT7 - Light 7 alpha is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
13  +LIGHT6 - Light6 alpha is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
12  +LIGHT5 - Light5 alpha is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
11  +LIGHT4 - Light4 alpha is source
   + + + + + + + + + +
0Do not use Light
1Use light
+
10  +ATTENSELECT - Attenuation Select function
   + + + + + + + + + +
0Select specular (N.H) attenuation
1Select diffuse spotlight (L.Ldir) attenuation
+
9  +ATTENENABLE - Attenuation Enable function
   + + + + + + + + + +
0Select 1.0
1Select Attenuation fraction
+
7-8  +DIFFUSEATTEN - Diffuse Attenuation function
   + + + + + + + + + + + + + + + + + +
00Select 1.0
01Select N.L, signed
10Select N.L clamped to [0,2.0]
11 
+
6  +AMBIENT_SRC - Ambient source
   + + + + + + + + + +
0Use register Ambient1 alpha register
1Use CP supplied vertex color 1 alpha
+
5  +LIGHT3 - Light3 alpha is source
   + + + + + + + + + +
0Do not use light
1Use light
+
4  +LIGHT2 - Light2 alpha is source
   + + + + + + + + + +
0Do not use light
1Use light
+
3  +LIGHT1 - Light1 alpha is source
   + + + + + + + + + +
0Do not use light
1Use light
+
2  +LIGHT0 - Light0 alpha is source
   + + + + + + + + + +
0Do not use light
1Use light
+
1  +LIGHTFUNC - Color0 alpha Light Function
   + + + + + + + + + +
0Use 1.0
1Use Illum0
+
0  +MATERIAL_SRC - Color0 alpha Material source
   + + + + + + + + + +
0Use register (Material 0 alpha)
1Use CP supplied Vertex color 0 alpha
+
+
+ 

+ + + +
+ + + + + +
0x10124wDualTexTrans
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + +
bit(s) description
0  + + + + + + + + + +
0disable dual texture transform feature
1enable dual transform for all texture coordinates
+
+
+

+ + + + + +
0x10134w?
+
+

+ + + + + +
0x10144w?
+
+

+ + + + + +
0x10154w?
+
+

+ + + + + +
0x10164w?
+
+

+ + + + + +
0x10174w?
+
+

+ + + +
+ + + + + +
0x10184wMatrixIndex0
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24-29 Tex3 matrix index
23-18 Tex2 matrix index
12-17 Tex1 matrix index
6-11 Tex0 matrix index
0-5 Geometry matrix index
+
+

+ + + +
+ + + + + +
0x10194wMatrixIndex1
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
18-23 Tex7 matrix index
12-17 Tex6 matrix index
6-11 Tex5 matrix index
0-5 Tex4 matrix index
+
+

+ + + + + + + + + +
+ + + + + +
0x101A4wViewport
+
+ + + + + +
0x101B4wViewport
+
+ + + + + +
0x101C4wViewport
+
+ + + + + +
0x101D4wViewport
+
+ + + + + +
0x101E4wViewport
+
+ + + + + +
0x101F4wViewport
+
Viewport Matrix
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  description
0x101Af32wd / 2
0x101Bf32-ht / 2
0x101Cf32ZMAX * (farZ - nearZ)
0x101Df32xOrig + wd / 2 + 342
0x101Ef32yOrig + ht / 2 + 342
0x101Ff32ZMAX * farZ
+
ZMAX is 16777215.0 (maximum 24-bit Z buffer value, or 'infinite')
+

+ + + + + + + + +
+ + + + + +
0x10204wProjection Matrix
+
+ + + + + +
0x10214wProjection Matrix
+
+ + + + + +
0x10224wProjection Matrix
+
+ + + + + +
0x10234wProjection Matrix
+
+ + + + + +
0x10244wProjection Matrix
+
+ + + + + +
0x10254wProjection Matrix
+
Projection Matrix
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  orthogonalperspective
0x1020f322.0 / (r - l)(1.0f / tanf(fovy * 0.5F)) / aspect
0x1021f32-(r+l) / (r-l)0
0x1022f322.0 / (t-b)(1.0f / tanf(fovy * 0.5F))
0x1023f32-(t+b)/(t-b)0
0x1024f32-1.0/(f-n)-n * 1.0f / (f-n)
0x1025f32-(f)/(f-n)-(f*n) * 1.0f / (f-n)
+
+

+ + + + +
+ + + + + +
0x10264wProjectOrtho
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + +
bit(s) description
+
If set selects orthographic otherwise non-orthographic (Zh or 1.0 +select)
+

+note: regs 0x1027-0x103e skipped (all unknown)

+ + + + + +
0x103f4wNUMTEX - Number of active Textures
+
+

+ + + + + + + + + + +
+ + + + + +
0x10404wTEX0
+
+ + + + + +
0x10414wTEX1
+
+ + + + + +
0x10424wTEX2
+
+ + + + + +
0x10434wTEX3
+
+ + + + + +
0x10444wTEX4
+
+ + + + + +
0x10454wTEX5
+
+ + + + + +
0x10464wTEX6
+
+ + + + + +
0x10474wTEX7
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
15-17  +EMBOSS_LIGHT - Bump mapping source light (*1)
12-14  +EMBOSS_SOURCE - bump mapping source texture (*2)
7-11  +SOURCE_ROW - regular texture source row (*3)
   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0GEOM_INROW -
1NORMAL_INROW -
2COLORS_INROW -
3BINORMAL_T_INROW -
4BINORMAL_B_INROW -
5TEX0_INROW -
6TEX1_INROW -
7TEX2_INROW -
8TEX3_INROW -
9TEX4_INROW -
aTEX5_INROW -
bTEX6_INROW -
cTEX7_INROW -
d 
e 
f 
+
4-6 TEXGEN_TYPE
   + + + + + + + + + + + + + + + + + +
0REGULAR - Regular transformation (transform incoming data)
1EMBOSS_MAP - texgen bump mapping
2COLOR_STRGBC0 - Color texgen: (s,t)=(r,g:b) (g and b are concatenated), +color 0
3COLOR_STRGBC1 - Color texgen: (s,t)=(r,g:b) (g and b are concatenated), +color 1
+
3 reserved/unused
2  +INPUT_FORM - format of source input data for regular textures
   + + + + + + + + + +
0AB11 - (A, B, 1.0, 1.0) (used for regular texture source)
1ABC1 - (A, B, C, 1.0) (used for geometry or normal source)
+
1 PROJECTION
   + + + + + + + + + +
0ST - (s,t): texmul is 2x4
1STQ - (s,t,q): texmul is 3x4
+
0 reseved/unused
+
+ 
 
+(*1) n: use light #n for bump map direction source (10 to 17)
+(*2) n: use regular transformed tex(n) for bump mapping source
+(*3) Specifies location of incoming textures in vertex (row specific) +(i.e.: geometry is row0, normal is row1, etc . . . ) for regular transformations 
 
+note: regs 0x1048-104f skipped (all unknown) 
 
+ + + + + + +
+ + + + + +
0x10504wDUALTEX0
+
+ + + + + +
0x10514wDUALTEX1
+
+ + + + + +
0x10524wDUALTEX2
+
+ + + + + +
0x10534wDUALTEX3
+
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
        
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
8  +NORMAL_ENABLE - specifies if texture coordinate should be +normalized before send transform.
6-7 unused
0-5  +DUALMTX - base row of the dual transform matrix for regular +texture coordinate0 (63 max, simelar to 0x1018/0x1019)
+
+ 
index
+

+ +5.11.5  GP packet description

+
+The first thing in a GP Packet is the command type (8 bit).Next follows +actual primitive data. It may vary on each opcode type.
5.11.5.1 +   Command Type +
+
+ + +
+ + + + + + + + + + +
70
ooooovvv
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
 oOpcode
 vVertex Attribute Table Index (VAT)
+
+

    + 5.11.5.1.1  opcodes +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
opcodeDescription
0x00NOP - No Operation
0x08Load CP REG
0x10Load XF REG
0x20Load INDX A
0x28Load INDX B
0x30Load INDX C
0x38Load INDX D
0x40CALL DL - Call Displaylist
0x48Invalidate Vertex Cache
0x61Load BP REG (SU_ByPassCmd)
0x80QUADS - Draw Quads (*)
0x90TRIANGLES - Draw Triangles (*)
0x98TRIANGLESTRIP - Draw Triangle Strip (*)
0xA0TRIANGLEFAN - Draw Triangle Fan (*)
0xA8LINES - Draw Lines (*)
0xB0LINESTRIP - Draw Line Strip (*)
0xB8POINTS - Draw Points (*)
+
+
+(*) all draw opcodes must be Or-ed with used VAT index (0...7)

5.11.5.2 +   Drawing Commands +
+
+ + + + + + + + + + + +
8 bits16 bitsn
opcodenumber of verticesvertex data
+
+

+Vertex data may be in one of many formats. The VCD tells wether data +for a component exists (and if yes, if it is direct or indexed) and +the VAT tells the actual format of the respective component. Each +individual component may or may not exist, but the order is fixed +as follows: +
    +
  1. PNMTXIDX - Position/Normal Matrix Index +
  2. +
  3. TEX0MTXIDX - Texture 0 Matrix Index +
  4. +
  5. TEX1MTXIDX - Texture 1 Matrix Index +
  6. +
  7. TEX2MTXIDX - Texture 2 Matrix Index +
  8. +
  9. TEX3MTXIDX - Texture 3 Matrix Index +
  10. +
  11. TEX4MTXIDX - Texture 4 Matrix Index +
  12. +
  13. TEX5MTXIDX - Texture 5 Matrix Index +
  14. +
  15. TEX6MTXIDX - Texture 6 Matrix Index +
  16. +
  17. TEX7MTXIDX - Texture 7 Matrix Index +
  18. +
  19. POS - Position Vector +
  20. +
  21. NRM - Normal or NBT - Binormal vector (T, B) +
  22. +
  23. CLR0 - Color0 (Diffused) +
  24. +
  25. CLR1 - Color1 (Specular) +
  26. +
  27. TEX0 - Texture 0 data +
  28. +
  29. TEX1 - Texture 1 data +
  30. +
  31. TEX2 - Texture 2 data +
  32. +
  33. TEX3 - Texture 3 data +
  34. +
  35. TEX4 - Texture 4 data +
  36. +
  37. TEX5 - Texture 5 data +
  38. +
  39. TEX6 - Texture 6 data +
  40. +
  41. TEX7 - Texture 7 data +
  42. +
+Notice that the Position/Normal and Texture Matrix Indices are different +from the other data in that they are 8 bit and must always be sent +as direct data. +
    + 5.11.5.2.1  Quads +draws a series of non planar quads, using v0,v1,v2,v3 then v4,v5,v6,v7 +and so on. (the quad is actually drawn using 2 triangles so the 4 +vertices do not have to be coplanar). The minimum number of vertices +is 4. +
    + 5.11.5.2.2  Triangles +draws a series of triangles, from v0,v1,v2 then v3,v4,v5 and so on. +The number of vertices should be a multiple of 3 +
    + 5.11.5.2.3  Trianglestrip +draws a series of triangles, from v0,v1,v2 then v1,v3,v2, then v2,v3,v4 +amd so on. The number of vertices must be at least 3. +
    + 5.11.5.2.4  TriangleFan +draws a series of triangles, from v0,v1,v2 then v0,v2,v3 and so on. +The number of vertices must be at least 3. +
    + 5.11.5.2.5  Lines +draws a series of unconnected lines, from v0 to v1, then from v2 to +v3 and so on. The number of vertices should be a multiple of 2 +
    + 5.11.5.2.6  Linestrip +draws a series of connected lines, from v0 to v1, then from v1 to +v2 and so on. If n vertices are drawn, n-1 lines are drawn +
    + 5.11.5.2.7  Points +draws a Point at each of the n vertices +5.11.5.3 +   NOP - No Operation +Use it to pad primitive data to 32-byte boundaries and to terminate +a display list. +5.11.5.4 +   CALL DL - Call Display List +used to call one display list from another.

+ + + +
+ + + + +
8 bits
+ + + + + + + + + + +
70
01000000
+
opcode == 0x40
+
+ + + + +
32 bits
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
0000000.........................
+
list address
+
+ + + + +
32 bits
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
0000000.........................
+
list size in bytes (32 bit words?)
+
+
5.11.5.5 +   Invalidate Vertex Cache +
+
+ + + +
8 bits
opcode == 0x48
+
+

5.11.5.6 +   BP command (Bypass Raster State Registers) +
+
+ + + + + + + + + + + +
8 bits8 bits24 bits
opcode == 0x61reg. addr.reg. value
+
+

5.11.5.7 +   CP command (Command Processor Registers) +
+
+ + + + + + + + + + + +
8 bits8 bits32 bits
opcode == 0x08reg. addr.reg. value
+
+
5.11.5.8 +   XF command (Transform Unit Registers) +
+
+ + + + + + + + + + + + + +
8 bits16 bits16 bits32 bits * length
opcode == 0x10length - 11st addr.reg. value(s)
+
+

+note : "length" is limited to 16.

5.11.5.9 +   Indexed XF command +
+
+ + + + + + + + + + + + + +
8 bits16 bits4 bits12 bits
opcode index valuelength-11st address
+
+

+note : "length" is limited to 16.

+There are 4 different XF index units, which are typically used as +follows: A: pos. mtx's B: nrm. mtx's C: tex. mtx's D: light obj's.
index
+

+ +6  Exception and Interrupt Processing

+
index
+

+ +6.1  Hardware Exception Sources

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Handler StartException
0x80000100System Reset Interrupt
0x80000200Machine Check Interrupt
0x80000300DSI Interrupt
0x80000400ISI Interrupt
0x80000500External Interrupt
0x80000600Alignment Interrupt
0x80000700Program Interrupt
0x80000800FP unavailable Interrupt
0x80000900Decrementer Interrupt
0x80000C00System Call Interrupt
0x80000d00Trace Interrupt
0x80000f00Performance Monitor Interrupt
0x80001300IABR Interrupt
0x80001700Thermal Interrupt
+
+
index
+

+ +6.1.1  System Reset Interrupt

+
+Triggered at a system reset +
index
+

+ +6.1.2  Machine Check Interrupt

+
index
+

+ +6.1.3  DSI Interrupt

+
+Triggered if an attempt to store or read data from/to an illegal address +was made +
index
+

+ +6.1.4  ISI Interrupt

+
+Triggered if an attempt to fetch an instruction from an illegal address +was made. +
index
+

+ +6.1.5  External Interrupt

+
+14 sources, triggered by external chips (you may look at it as the +traditional IRQ). +
6.1.5.1 +   Setup +
+
+
6.1.5.2 +   Handling +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit Description
13HSPHigh Speed Port
12DEBUGExternal Debugger
11CPCommand FIFO
10PE FINISHFrame is Ready
9PE TOKENToken Assertion in Command List
8VI Video Interface
7MEMMemory Interface
6DSPDSP
5AIAudio Streaming
4EXIEXI
3SISerial
2DIDVD
1RSWReset Switch
0ERRORGP runtime error
+
+
index
+

+ +6.1.6  Alignment Interrupt

+
index
+

+ +6.1.7  Program Interrupt

+
+Triggered if the instruction that was about to execute is invalid. +
index
+

+ +6.1.8  FP unavailable Interrupt

+
index
+

+ +6.1.9  Decrementer Interrupt

+
+Triggered by an underflow of the decrementer register. +
index
+

+ +6.1.10  System Call Interrupt

+
+Triggered when the PowerPC instruction 'sc' is executed. +
index
+

+ +6.1.11  Trace Interrupt

+
index
+

+ +6.1.12  Performance Monitor Interrupt

+
index
+

+ +6.1.13  IABR Interrupt

+
index
+

+ +6.1.14  Thermal Interrupt

+
index
+

+ +6.2  External Interrupt Sources

+
index
+

+ +6.2.1  HSP - High Speed Port

+
+3 Sources +
6.2.1.1 +   TX Mailbox Interrupt +
+
6.2.1.2 +   RX Mailbox Interrupt +
+
6.2.1.3 +   ID Interrupt +
+
index
+

+ +6.2.2  Debug

+
+1 Source +
index
+

+ +6.2.3  CP - Command Processor

+
+2 Sources (read/write pointer watermark over- and underflow) check +bit 0 and bit 1 of 0xcc000000
6.2.3.1 +   FIFO underflow +
+

    + 6.2.3.1.1  setup + +
    + 6.2.3.1.2  handling + +
6.2.3.2 +   FIFO overflow +
+

    + 6.2.3.2.1  setup + +
    + 6.2.3.2.2  handling + +
index
+

+ +6.2.4  PE - Pixel Engine Finished

+
+1 Source (Frame finished) +
6.2.4.1 +   setup +
+
+
6.2.4.2 +   handling +
+
+
index
+

+ +6.2.5  PE - Pixel Engine Token

+
+1 Source (Token in GP Command List) +
6.2.5.1 +   setup +
+
+
6.2.5.2 +   handling +
+
+
index
+

+ +6.2.6  VI - Video Interface

+
+4 Sources, check (0xcc002030) (0xcc002034) (0xcc002038) +(0xcc00203c) for flags +
6.2.6.1 +   Setup +
+
+
6.2.6.2 +   Handling +
+
+
index
+

+ +6.2.7  Memory Interface

+
+4 sources (4 regions of memory can be protected independently) +
6.2.7.1 +   protection fault +
+

    + 6.2.7.1.1  Setup + +
    + 6.2.7.1.2  Handling + +
index
+

+ +6.2.8  DSP Interface

+
+3 Sources, check (0xcc00500a) for flags +
6.2.8.1 +   Audio DMA finished +
+
+asserted when audio DMA transfer has been completed. +
    + 6.2.8.1.1  Setup + +
    + 6.2.8.1.2  Handling + +
6.2.8.2 +   ARAM transfer complete +
+
+asserted when a transfer from/to auxiliary ram has been completed. +
6.2.8.3 +   DSP +
+
index
+

+ +6.2.9  Audio Streaming Interface

+
+1 Source, check (0xcc006c00) for flag. asserted based on +the disk streaming sample counter. +
index
+

+ +6.2.10  EXI

+
+3 Sources each EXI Channel (TCINT,EXTINT,EXIIRQ), making 9 total, +check (0xcc006800) (0xcc006814) (0xcc006828) +for flags. +6.2.10.1 +   DMA Transfer finished (TCINT channel 0, channel 1) +
6.2.10.2 +   Ethernet Adapter (EXIIRQ channel 2) +
+

    + 6.2.10.2.1  setup +
    + 6.2.10.2.2  handling + +6.2.10.3 +   Memory Card removed (EXTINT channel 0, channel 1) +
    + 6.2.10.3.1  setup +
    + 6.2.10.3.2  handling + +
index
+

+ +6.2.11  Serial Interface

+
index
+

+ +6.2.12  DVD Interface

+
+4 Sources (Break Complete, DMA finished, Device Error, Cover state +changed), check (0xcc006000)(0xcc006004) for flags. +
6.2.12.1 +   Break Complete +
+
6.2.12.2 +   DMA finished +
+
6.2.12.3 +   Device Error +
+
6.2.12.4 +   Cover State changed +
+
index
+

+ +6.2.13  Reset Button

+
+1 Source (Reset Button pressed) +
6.2.13.1 +   setup +
+
+
6.2.13.2 +   handling +
+
+
index
+

+ +6.2.14  Error

+
+1 Source (GP runtime error) +
index
+

+ +7  Video Processing

+
index
+

+ +7.1  Used VI terms

+
+The external framebuffer resides in main memory and can be directly +displayed by the video processor. +
index
+

+ +7.2  init VI

+
index
+

+ +7.2.1  Videomodes

+
index
+

+ +7.3  render to XFB

+
index
+

+ +7.4  vertical retrace

+
index
+

+ +7.5  set XFB Address

+
index
+

+ +8  3D Graphics Processing

+
images/gx_overview.png
index
+

+ +8.1  basic operations

+
index
+

+ +8.1.1  load BP Register

+
+
index
+

+ +8.1.2  load CP Register

+
+
index
+

+ +8.1.3  load XF Register

+
+
index
+

+ +8.1.4  load XF Register Indexed

+
+
index
+

+ +8.2  example processing loop

+
gx_init(); 
while(running) 
{ 
    gx_begin(); 
    drawframe(); 
    gx_end(); 
    waitvsync(); 
} 
gx_close();
index
+

+ +8.2.1  init GX

+
8.2.1.1 +   setup the fifos +
+
+
8.2.1.2 +   enable gx command processing +
+
+while (mfwpar () & 1); +PI[3] = 0x100000; +PI[4] = 0x110000; +PI[5] = 0x100000; +mtwpar(0xC008000); // GXFIFO physical address +mtspr(920, mfspr(920) - 0x40000000); +
8.2.1.3 +   send setup frame +
+
+after setting up and enabling gx command processing it is recommended +to send a first initial 'frame' to setup the various internal registers +to useful values. +
    + 8.2.1.3.1  Videomodes +remember that depending on the videomode some things must be setup +differently (such as the scissor, viewport, ...) +
index
+

+ +8.2.2  begin frame

+
index
+

+ +8.2.3  draw frame

+
index
+

+ +8.2.4  end frame

+
+
8.2.4.1 +   copy EFB to XFB +
+
+#define XY(x, y) (((y) < < 10) - (x))
+GX_LOAD_BP_REG(0x4000001f); // set z mode +GX_LOAD_BP_REG(0x410004bc); // set color mode 0 +GX_LOAD_BP_REG(0x49000000 - XY(0, 0)); // set source top left +GX_LOAD_BP_REG(0x4a000000 - XY(639, 479)); // set source bottom +right +GX_LOAD_BP_REG(0x4d000028); // stride? (0x1280> >5
+... 640*2 ; 320*YuYv +GX_LOAD_BP_REG(0x4b000000 - (0xC00000 > > 5))
+// xfb target address +GX_LOAD_BP_REG(PE_COPY_CLEAR_AR - 0x0000); +GX_LOAD_BP_REG(PE_COPY_CLEAR_GB - 0x0000); +GX_LOAD_BP_REG(PE_COPY_CLEAR_Z - 0xFFFFFF); +GX_LOAD_BP_REG(0x52004803); // do it (efb copy execution command?) +
8.2.4.2 +   copy EFB to Texture +
+
+simelar to copying EFB to XFB, setup BP registers 0x4a,0x4a,0x4d,0x4b +and then (0x52000003|(format< <4))
index
+

+ +8.2.5  close GX

+
index
+

+ +9  Joy-Bus Devices

+
index
+

+ +9.1  ID and Device List

+
+The device ID can be read by sending the SI Command 0x00, and then +reading 3 bytes from the respective device. The response-data looks +like this:

+first comes a 16bit device id:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDDevice
0x0500? N64 Controller
0x0001? N64 Microphone
0x0002? N64 Keyboard
0x0200? N64 Mouse
0x0004GBA
0x0800GBA (n/a)
0x0900GC Standard Controller
0xe960? GC Wavebird Receiver
0xe9a0? GC Wavebird
0xa800? GC Wavebird
0xebb0? GC Wavebird
0x0820GC Keyboard
0x0800? GC Steering Wheel
0x0900DKongas (same as std Controller)
?Resident Evil4 Chainsaw
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
15 wireless (1: wireless Controller)
14 wireless receive (0: not wireless 1: wireless)
13 Rumble Motor (0: available 1: not available)
12 Type of Controller (always 0 ?)
11 Type of Controller (0: N64 1: Dolphin)
10 wireless type (0:IF 1:RF)
9 wireless state (0: variable 1: fixed)
8 0: non standard Controller 1: Dolphin Standard Controller
7  
6  
5 wireless origin (0:invalid 1:valid)
4 wireless fix id (0:not fixed 1:fixed)
3 wireless type - 0:normal 1: non-controller (?)
2 wireless type - 0:normal 1: lite controller
1 wireless type -
0 wireless type -
+
+ 
 
+the device id is followed by 8 status bits: 
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
7 ?
6 ?
5 ?
4 ?
3 ? rumble motor running
2 ?
1 ?
0 ?
+
+
index
+

+ +9.2  standard Controller

+
index
+

+ +9.2.1  Init

+
+Command Word +0x00400000 - enable polling +0x00000300 - ? +0x00000100 - ? +0x00000001 - enable rumble motor

+Commands: +0x00 - get id+status +0x40 - ? +0x41 - get origins +0x42 - calibrate ? +
index
+

+ +9.2.2  Read Controller Status

+
+ + + +
first input word
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
31 ERRSTAT - (assumed 0)
30 ERRLATCH - (assumed 0)
29 unused (?)
28sStart Button
27yY Button
26xX Button
25bB Button
24aA Button
23 unused (?)
22LL Trigger
21RR Trigger
20 Z Trigger
19uD-Pad Up
18dD-Pad Down
17rD-Pad Right
16lD-Pad Left
8-15xAnalog Stick X (8bit unsigned, ~32...128...~224)
0-7yAnalog Stick Y (8bit unsigned, ~32...128...~224)
+
+

+ + +
second input word
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
24-31xAnalog C Stick X (8bit unsigned, ~32...128...~224)
16-23yAnalog C Stick Y (8bit unsigned, ~32...128...~224)
8-15lL Trigger Analog (8bit unsigned, ~32...~224)
0-7rR Trigger Analog (8bit unsigned, ~32...~224)
+
+
index
+

+ +9.2.3  rumble Motor On

+
+*(volatile unsigned long*)0xCC006400 = 0x00400001; +*(volatile unsigned long*)0xCC006438 = 0x80000000; +
index
+

+ +9.2.4  rumble Motor Off

+
+*(volatile unsigned long*)0xCC006400 = 0x00400000; +*(volatile unsigned long*)0xCC006438 = 0x80000000; +
index
+

+ +9.3  Keyboard

+
index
+

+ +9.3.1  Types

+
9.3.1.1 +   ASCII +
+
+Official Nintendo/SEGA keyboard for the GameCube. It has 80 keys plus +an Fn key, some of the keys have Japanese labelings. It has an LShift +and an RShift key, but only a single Ctrl and Alt key. The Fn key +is internal to the keyboard. It makes the keyboard send different +scancodes if it is pressed, and an Fn keypress alone cannot be detected. +
9.3.1.2 +   Datel +
+
+A British IBM PS/2 keyboard that ships with an adapter. +
9.3.1.3 +   Tototek Adapter +
+
+Converts the IBM PS/2 protocol to the GameCube SI protocol and also +converts the PS/2 scancodes into GameCube scancodes. The keys that +have Japanese labelings on the ASCII keyboard get mapped to keys like +PrintScreen and Pause. + +
index
+

+ +9.3.2  Scancodes

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 .0.1.2.3.4.5.6.7
0.      HomeEnd
1.ABCDEFGH
2.QRSTUVWX
         
3.7890-_ ()=+PrntScrn Pause/SysReq
 NP 7NP 8NP 9NP 0NP - NP /NP *
4.F1F2F3F4F5F6F7F8
5.BackspaceTab CapsLockLShift (*54) LCtrl (*56)LAlt (*57)
6. Enter      
  NP Enter      
 .8.9.A.B.C.D.E.F
0.PgUpPgDnScrollLock     
1.IJKLMNOP
2.YZ123456
   NP 1NP 2NP 3NP 4NP 5NP 6
3.[{;: "]},<.> /? -
  NP + (*39)   NP .  
4.F9F10F11F!2ESCInsDel`~
5.LWinspaceRWinMenuLeftDownUpRight
6.        
   NumLock (*6a)     
+
+

+(*39) Tototek adapter: makes only sence for japenese ASCII labeling
+(*54) Tototek adapter sends this code for LShift and RShift
+(*56) Tototek adapter sends this code for LCtrl and RCtrl
+(*57) Tototek adapter sends this code for LAlt and RAlt
+(*6a) Tototek adapter: undefined for GameCube +
index
+

+ +9.3.3  Init

+
+Command Word +0x00540000 - enable polling +
index
+

+ +9.3.4  Read Keyboard

+
+ + +
first input word
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
31 ERRSTAT - (assumed 0)
30 ERRLATCH - (assumed 0)
24-29 ?
16-23 ?
8-15 ?
0-7 ?
+
+

+ + +
second input word
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
24-31 key1
16-23 key2
8-15 key3
0-7 ?
+
+
index
+

+ +9.4  GBA

+
+to do +
index
+

+ +9.5  Wavebird

+
+to do +
index
+

+ +9.6  steering wheel

+
+to do +
index
+

+ +9.7  DKongas

+
+These work exactly like the standard controllers from the programmers +point of view, and they even have the same ID. +
index
+

+ +9.7.1  Read Controller Status

+
+ + + +
first input word
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
31 ERRSTAT - (assumed 0)
30 ERRLATCH - (assumed 0)
29 unused (?)
28sStart Button
27yleft Konga, top/left (Y Button)
26xright Konga, top/left (X Button)
25bleft Konga, bottom/right (B Button)
24aright Konga, bottom/right (A Button)
23 unused (?)
22Lunused (L Trigger)
21Runused ? (R Trigger)
20 unused (Z Trigger)
19uunused (D-Pad Up)
18dunused (D-Pad Down)
17runused (D-Pad Right)
16lunused (D-Pad Left)
8-15xunused (Analog Stick X)
0-7yunused (Analog Stick Y)
+
+

+ + +
second input word
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
24-31xunused (Analog C Stick X)
16-23yunused (Analog C Stick Y)
8-15lunused (L Trigger Analog)
0-7rMicrophone (R Trigger Analog) (8bit unsigned, ~16...?)
+
+
index
+

+ +9.8  Resident Evil4 Chainsaw

+
+to do +
index
+

+ +10  EXI Devices

+
index
+

+ +10.1  EXI Channel and Device List

+
+The following table shows the GameCube devices which use the EXI bus +and their channel and device numbers, the EXI frequency commonly used +with them and their virtual offset in EXI mapping.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
channeldevicefreqoffsetDescription
004 Memory Card (Slot A)
0130x00000000Mask ROM
0130x20000000Real-Time Clock (RTC)
0130x20000100SRAM
01 0x20010000UART
104 Memory Card (Slot B)
20  AD16 (trace step)
02  Serial Port 1
025 Ethernet Adapter (SP1)
+
+

+Note: The Real-Time Clock (RTC), SRAM, and Mask ROM are actually one +device mapped to different address offsets. The SRAM should only be +accessed by the IPL and contains non-volatile system data. The Mask +ROM contains the IPL itself (encrypted) and the system font data. +
index
+

+ +10.2  Retrieving the ID of an EXI Device

+
+To retrieve the ID of an EXI Device, an EXI IMM write operation must +be used to send the ID command (0x0000) and an EXI IMM read operation +should follow it to read the actual 4 byte ID.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDDevice
0x00000004Memory Card 59
0x00000008Memory Card 123
0x00000010Memory Card 251
0x00000020Memory Card 507
0x00000040Memory Card 1019
0x00000080Memory Card 2043
0x01010000USB Adapter
0x01020000NPDP GDEV
0x05070000IS Viewer
0x04120000AD16
0x03010000Marlin (?)
0x02020000Modem
0x04020200Ethernet Adapter
+
+
index
+

+ +10.3  Mask ROM

+
+Mask ROM also referred as bootrom or IPL. Total size of bootrom is +2 MB. +
index
+

+ +10.3.1  Memory Map (Europe/PAL)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StartEndSizeDescription
0x000000000x000000ff0x00000100Copyright message (*1)
0x000001000x001aeee80x001aede8BIOS data (*2)
0x001AFF000x001FA0E00x0004D000'Yay0' - ROM Fonts #1 (SJIS)
   0x61 bytes of 0xFF, 0x62 , followed by zeros until 0x1FCF00
0x001FCF000x001FF4740x00003000'Yay0' - ROM Fonts #2 (ANSI)
0x001FF4740x001FFEF0 filled with 0x00
0x001FFF00 0x001FFFFFfilled with 0xff
+
+

+(*1) "(C) 1999-2001 Nintendo. All rights reserved.(C) 1999 +ArtX Inc. All rights reserved.PAL Revision 1.0 " and zeros +up to 0x100.
+(*2) encrypted by an XOR cyphertext which is generated by a yet +unknown algorithm (probably not a single LFSR)
index
+

+ +10.3.2  Memory Map (USA/NTSC)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StartEndSizeDescription
0x000000000x0015ee400x0015ee40BIOS data (*1)
0x001AFF00 0x0004D000ROM Fonts #1 (SJIS)
0x001FCF00 0x00003000ROM Fonts #2 (ANSI)
0x001FFF00 0x001FFFFFfilled with 0x00
+
+

+(*1) encrypted by an XOR cyphertext which is generated by a yet +unknown algorithm (probably not a single LFSR)

+note: all unused space is filled with 0x00, no pieces with 0xFF. +
index
+

+ +10.3.3  Memory Map (Japenese/NTSC)

+
index
+

+ +10.3.4  Memory Map (Japenese/NTSC - Panasonic Q)

+
index
+

+ +10.3.5  Font Encoding

+
+The 'Yay0' data is compressed similar to the the Zelda 64 'Yaz0' compression. +Besides the Raw Font data it also contains some information about +the Font. +
index
+

+ +10.3.6  Font Layout

+
10.3.6.1 +   SJIS Font (ROM Font #1) +10.3.6.2 +   ANSI Font (ROM Font #2) +The ANSI Font is a 512x512 Pixel Texture in I4 Format. It consists +of 21 colums and 11 rows of characters which are in a 24x24 pixel +grid.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 !'#$%&´()*+,-./01234
56789:;<=>?@ABCDEFGHI
JKLMNOPQRSTUVWXYZ[ ]^
_'abcdefghijklmnopqrs
tuvwxyz              
                     
                     
                     
                     
                     
                     
+
+
index
+

+ +10.3.7  Operation

+
10.3.7.1 +   read +
+
+max offset is 2*1024*1024, max block len is ? +
index
+

+ +10.4  RTC (Real-Time Clock)

+
+Real-Time Clock (RTC) is 32-bit value, counting time intervals in +seconds. To get the real time (seconds since January 1st, 2000 12am) +add the counter bias saved in SRAM. +
index
+

+ +10.4.1  Operation

+
10.4.1.1 +   read +
+
+Since it is uncertain if the hardware prevents fragmented reads of +the time interval (eg byte 1 from tick n and byte 2-4 from tick n+1) +it is recommended to repeatedly retrieve the value until there is +no difference between two consecutive reads. +
10.4.1.2 +   write +
+
+
index
+

+ +10.5  SRAM

+
+SRAM is battery backed memory, used for saving some non volatile settings. +Size of SRAM is 64 bytes. +
index
+

+ +10.5.1  Memory Map

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
offsetendsizeDescription
0x00 2Checksum 1
0x02 2Checksum 2
0x04 4ead 0
0x08 4ead 1
0x0c 4counter Bias (add to RTC value to get actual time)
0x10 1display offset H (signed value, -32...32)
0x11 1ntd
0x12 1language
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
valueDescription
0english
1german
2french
3spanish
4italian
5dutch
+
0x13 1flags
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
7 ? (=0)
6 ? (=0)
5 ? (=1)
4 ? (=0)
3 ? (=1)
2 0: mono 1: stereo
1 ? (=0)
0 ? (=0)
+
0x14 2*12Flash ID
0x2c 4wireless Keyboard ID
0x30 4*2wireless PAD ID
0x38 1last DVD Errorcode
0x39 1padding/unused/reserved
0x3a 2*2Flash ID checksum
0x3e 2padding/unused/reserved
+
+
index
+

+ +10.5.2  Operation

+
10.5.2.1 +   read +
+
+
10.5.2.2 +   write +
+
+
index
+

+ +10.5.3  Checksums

+
+the SRAM data is protected against corruption by a simple additive +checksum which is calculated like this:

void checksums (unsigned short *buf, unsigned short *c1, +unsigned short *c2) 
{ 
int i; 
    *c1 = 0; *c2 = 0; 
    for (i = 0;i<4;++i) 
    { 
        *c1 += buf[0x06 + i]; 
        *c2 += (buf[0x06 + i] ^ +0xFFFF); 
    } 
} 
index
+

+ +10.6  AD16

+
+AD16 is on channel 2, as device 0. Probably its used for debugging +purposes. AD16 is the 32-bit register, keeping bootrom "trace-step". +
index
+

+ +10.6.1  Operation

+
10.6.1.1 +   init +
+
+
10.6.1.2 +   write +
+
+
10.6.1.3 +   read +
+
+
index
+

+ +10.6.2  Trace-Step Values

+
10.6.2.1 +   BS +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
0x01000000AD16 Inited, cache lines 320, 340,360, 380, 3a0 prefetched
0x02000000cache line 0x3e0 prefetched
0x03000000rest of cachelines prefetched
0x04000000ramtest passed
0x05000000ramtest error
0x06000000ramtest error
+
10.6.2.2 +   BS2 +
+
+ + + + + + + + + + + + + + + + + + + + +
0x00000800System Init
0x00000900DVD Init
0x00000a00Card Init
0x00000b00video init
0x00000c00final before menu
+
index
+

+ +10.7  Memory Cards

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ProductBlocksMega bitsMega bytesVendorChip
Memory Card 596440.5NintendoMacronix MX25L4001 Serial Flash ROM
Action Replay memory card6440.5Datel Macronix MX25L4004 4M-Bit(4Mx1) Serial Flash ROM
Memory Card '4 Mega'6440.53rd PartyWINBOND 512K*8 CMOS flash memory (Winbond,W29C040P-90,215275901,216GJRA)
Memory Card 12312881Nintendo (*) 
Memory Card '8 Mega'128813rd Party 
Memory Card 251256162Nintendo 
Memory Card 507512324Nintendo (*) 
Memory Card 10191024648Nintendo 
Memory Card '64 Mega'10246483rd Party 
USB Memory Adaptor 64M / 1019 blocks1024648EMS 
Memory Card 2043204812816Nintendo (*) 
+
+
+(*) never seen those, appearently supported but never manufactured.

+as you can see the products are named in reference to their useable +capacity in blocks or total size in mega bits. The theoretical maximum +size for a memory card is 128 mega bits (16 mega bytes, 2048 blocks). +
index
+

+ +10.7.1  Commands

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandlenindatalenoutdatalenDescription
0x85002--ID2get ID
0x83002--Status1get Card Status
0x891----clear Card Status
0x521offset, 0x000000008Block Data<=0x200read Block
0xf400003----erase Card
0xf11Sector2--erase Sector
0xf21Block offset4Block Data<=0x80write Block
+
+

index
+

+ +10.7.2  Operation

+
10.7.2.1 +   unlocking +
+
+original memory cards (those manufactured by nintendo) need to be +'unlocked' before they can be accessed. this is appearently done +by a small dsp program.

+to do +
10.7.2.2 +   get ID +
+
+
    + 10.7.2.2.1  Card IDs +
10.7.2.3 +   get Status +
+
+
    + 10.7.2.3.1  Status Bits + + + + +
+ + + + + + + + + + +
70
x......r
+
+ + + + + + + + + + + + + + + + + +
bit(s) description
7x1: erase in Progress (?)
0r1: Card ready (?)
+
+
10.7.2.4 +   clear Status +
+
+
10.7.2.5 +   read Block +
+
+max offset is 16*1024*1024, max block len is 512 bytes.
10.7.2.6 +   erase Card +
+
+
10.7.2.7 +   erase Sector +
+
+
10.7.2.8 +   write Block +
+
+
index
+

+ +10.8  Ethernet Adapter

+
+The Macronix chip found in the ethernet adapter (mx98730ec) seems +to be a reenginered version of the mx98726 or mx98728 (or the ec type +respectivly). +
index
+

+ +10.8.1  registers

+
+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0x000x10001
+
+

+These are the actual Chip Registers which match with the descriptions +in MXs documents.

+ + + + +
+ + + + + + +
0x001r/wNCRA - Network Control Register A (0x08 ?)
+
+ + + + + + + + + + +
70
?????ep?
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
7 INTCLK - must be 0 for normal operation.
6 INTMODE - Interrupt Mode: Set for the active high interrupt, reset +for the active low interrupt case.
5 LB1 - Loopback mode
4 LB0
   + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LB1LB0description
00Mode0 - Normal mode
01Mode1 - internal FIFO Loopback
10Mode2 - internal NWAY Loopback
11Mode3 - internal PMD Loopback
+
3 SR - Start Receive : Enable the MAC to receive packets. Default is +disabled.
2eST1 - Start Transmit Command/Status
1pST0
0 RESET - Software reset.
+
bit 1 and bit 2 will get cleared after a packet has been sent
+

+ + + +
+ + + + + + +
0x011r/wNCRB - Network Control Register (0x11, 0x12 ?)
+
+ + + + + + + + + + +
70
  
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
6-7 RXINTC - Recieve Interrupt Counter
5 HBD - Heart Beat Check Disable
4 AB - "pass all broadcast frames"
3 PB - "pass bad frames"
2 PM - "pass all multicast"
1 CA - capture effect mode
0 PR - promiscuous mode
+
+

+ + +
+ + + + + + +
0x021r/wGMAC Test Register A : TRA
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
7 SB - Start/Stop Back-off counter
6 FC - Forced Collision
5 RWD - Receive Watchdog Disable
4 RWR - Recieve Watchdog Release
1-3 TMODE - Test Moder Select bits
0 TEST - Test mode enable
+
+

+ + +
+ + + + + + +
0x031r/wGMAC Test Register B : TRB
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
7 BFSTATUS
6 BFS1
5 BKCNTLB
4 BFS0
3 COLCNTCB
2 RDNCNTSB
1 RDNCNTCB
0 FKD - Flaky Oscillator Disable
+
+

+ + +
+ + + + + + +
0x041r/wLTPS - Last Transmitted Packet Status (transmit error code ?)
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
7 TERR - Transmit Error
6 OWC - Out of Window Collision
5 UF - TX FIFO Underflow
4 CRSLOST - Carrier Sense Lost
3 CC3 - Collision Count Bit 3
2 CC2
1 CC1
0 CC0
+
+

+ + +
+ + + + + + +
0x051r/wLRPS - Last Recieved Packet Status
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
7 RERR - Recieve Error
6 RF - Runt Frame
5 MF - Multicast Frame address
4 RW - Recieve Watchdog
3 FO - FIFO Overrun
2 FAE - Frame Alignment Error
1 CRC - CRC error
0 BF - RX Packet Buffer Full Error
+
+

+ + +
+ + + + + + +
0x061r/wMPCL - Missed Packet Counter
+
+ + + + + + + + + + + +
bit(s) Description
0-7 MISSCNT - Miss Packet Counter LSB
+
+

+ + +
+ + + + + + +
0x071r/wMPCL - Missed Packet Counter
+
+ + + + + + + + + + + +
bit(s) Description
0-7 MISSCNT - Miss Packet Counter MSB
+
+

+ + +
+ + + + + + +
0x081r/wIMR - Interrupt Mask Register (IRQ Mask)
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
7 RBFIM - RX Buffer Full Interrupt Mask
6 BUSEIM - Bus Error Interrupt Mask
5 FIFOEIM - FIFO Error Interrupt Mask
4 TEIM - Transmit Error Interrupt Mask
3 REIM - Receive Error Interrupt Mask
2 TIM - Transmit Interrupt Mask
1 RIM - Recieved Interrupt Mask
0 FRAGIM - Fragment Counter Interrupt Mask
+
+

+ + + +
+ + + + + + +
0x091r/wIR - Interrupt Register (irq status)
+
+ + + + + + + + + + +
70
???tesr?
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
7 RBFI - RX Buffer Full Interrupt
6 BUSEI - Bus Error Interrupt
5 FIFOEI - FIFO Error Interrupt
4tTEI - Transmit Error Interrupt (1: transmit error)
3eREI - Recieve Error Interrupt (1: receive error ?)
2sTI - Transmit OK Interrupt (1: packet sent ?)
1rRI - Receive OK Interrupt (1: packet received ?)
0 FRAGI - Fragment Counter Interrupt
+
+

+ + + + + + +
0x0a2r/wBP - Boundary Page Pointer Register (0x0100 ?)
+
+

+ + + + + + +
0x0c2r/wTLBP - TX Low Boundary Page Pointer Register
+
+

+ + + + + + +
0x0e2r/wTWP - Transmit Buffer Write Page Pointer Register
+
+

+ + + + + + +
0x102?/?unused/reserved
+
+

+ + + + + + +
0x122r/wTRP - Transmit Buffer Read Page Pointer Register
+
+

+ + + + + + +
0x142r/wRXINTT - Receive Interrupt Timer
+
+

+ + + + + + +
0x162r/wRWP - Receive Buffer Write Page Pointer Register
+
+

+ + + + + + +
0x182r/wRRP - Receive Buffer Read Page Pointer Register
+
+

+ + + + + + +
0x1a2r/wRHBP - RX High Boundary Page Pointer Register (0x0f00 ?)
+
+

+ + +
+ + + + + + +
0x1c1r/wEEPROM Interface Register:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
6-7 unused/reserved
5 EELD -
4 EESEL -
3 EEDO - Serial Data Output from external EEPROM clock device
2 EEDI - Serial Data Input to external EEPROM clock device
1 EECK - Serial Clock output to external EEPROM clock device (< 1 MHz)
0 EECS - Chip Select output to external EEPROM clock device
+
+

+ + + + + + +
0x1d1r/wBICT - Bus Integrity Check Timer
+
+

+ + + + + + +
0x1e2r/?IORDP - IO Data Port Page Pointer Register
+
+

+ + + + + + +
0x206r/wPAR0-PAR5 Network Address Filtering Registers - Physical (MAC) Address
+
+

+ + + + + + +
0x268r/wMAR0-PAR7 Network Address Filtering Registers - Hash Table Register
+
+ 
 
+ + +
+ + + + + + +
0x2e1r/wANALOG - Transceiver Control Register
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
6-7 unused/reserved (must be 0)
5 RST100 - Reset for NORMAL mode
4 RSQ - Reduced SQuelch Enable
3 PWD100 - Reset for NORMAL mode
2 PWD10B - Set for NORMAL mode
1 DS130 - Must be 1 for NORMAL mode with auto-compensation
0 DS120 - Must be 1 for NORMAL mode with auto-compensation
+
+ 
 
+ + + + + + +
0x2f1r/wDINTVAL - DMA Interval Timer
+
+

+ + +
+ + + + + + +
0x301r/wNWAYC - NWAY Configuration Register
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) Description
7 LTE - Link Test Enable
6 NTTEST - reserved
3-5 ANS - Autonegotiation Status
2 ANE - Autonegotiation Enable
1 PS100/10 - Port Select 100/10 Mbit
0 FD - Full Duplex Mode
+
+

+ + +
+ + + + + + +
0x311r/-NWAYS - NWAY Status Register
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
7 10TXH - NWAY 10 TX Half duplex Mode
6 10TXF - NWAY 10 TX Full duplex Mode
5 100TXH - NWAY 100 Half duplex Mode
4 100TXF - NWAY 100 TX Full duplex Mode
3 ANCLPT - Auto-negotiation Completion
2 LPNWAY - Link Partner NWAY Status
1 LS100 - Physical Link Status of 100Mbps TP
0 LS10 - Physical Link Status of 10 Mbps TP
+
+

+ + +
+ + + + + + +
0x321r/wGCA - GMAC Configuration A Register (0x08 ?)
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
7 unused/reserved (must be 0)
6 TXFIFOCNTEN
5 AUTOPUB - Auto Page Update option
4 unused/reserved
3 ARXERRB - Accept RX packet with error
2 SLOWSRAM
1 PBW - Packet Buffer Data Width
0 BPSCRM - Bypass Scrambler
+
+

+ + +
+ + + + + + +
0x331r/wGCB - GMAC Configuration B Register
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
4-7 unused/reserved
2-3 RTHD - Recieve FIFO Threshold
0-1 TTHD - Transmit FIFO Threshold
+
+ 
 
+ + + + + + +
0x344-/wTWD - IO Mapped Data Port
+
+
 
+ + + + + + +
0x382-/-unused/reserved
+
+ 
 
+ + + +
+ + + + + + +
0x3a1r/wHost Interface Protocol Register (0x08 ?)
+
+ + + + + + + + + + +
70
  
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
2 DREQB - DREQB-pin status bit
1 STIORD/RRDYB - (no data available ?)
0 WRDYB - Write Packet Memory Ready Bar Status Indication
+
+ 
 
+ + + + + + +
0x3b1r/-LPC - Link Partner Link Code Register
+
+ 
 
+ + + + + + +
0x3c1r/wTX/RX DMA Status Register
+
+ 
 
+ + + + + + +
0x3d1r/wMISC1 - MISC Control Register 1
+
+ 
 
+ + + + + + +
0x3e2r/wTXFIFOCNT - TX FIFO Byte Counter
+
+ 
 
+ + + + + + +
0x404r/-RRD - RX Burst Read Data Port
+
+ 
 
+ + + + + + +
0x442r/-ID1 - 'MX'
+
+ 
 
+ + + + + + +
0x462r/-ID2 - '0001'
+
+ 
 
+ + + + + + +
0x484wWRTXFIFOD - Write TX FIFO Data Port Register (output queue)
+
+ 

+ + + + + + +
0x4c4r/-IORD - IO Read Data Port Register
+
+ 

+ + + + + + +
0x501r/wMISC2 - MISC Control Register 2 (0x80 ?)
+
+

+ + + + + + +
0x511?(?)
+
+ 
 
+note: register 0x51 is not documented in mx98728 datasheet 
 
+ + + + + + +
0x522r/-HRPKTCNT - Host Recieve Packet Counter
+
+ 
 
+ + + + + + +
0x543r/wFRAGCNT - Host DMA Fragment Counter
+
+ 
 
+note: 0x56 is the last reg of a mx98726 and mx98728
 
+ + + + + + +
0x5b??/?(?)
+
+ 
 
+ + +
+ + + + + + +
0x5c??/?(?)
+
0x36 = disconnect network
+ 

+ + + + + + +
0x5e??/?(0x01 ?)
+
+

+ + + + + + +
0x60??/?(0x00 ?)
+
+

+ + + +
+ + + + + + +
0x1000xf00?/winput queue (?)
+
- select for reading
- IMM read block
+
index
+

+ +10.8.2  command-registers

+
+
+ + + + + + + + + + + +
Registerblock BaseSize of Registerblockcommon access size
0x000x101
+
+

+These Registers are related to the EXI Interface on the Ethernet-Adapter, +not to the actual Ethernet Chip.

+ + + +
+ + + + + + +
0x00??/?EXI id
+
- select register for reading
- IMM read 4 bytes (0x04,0x02,0x02,0x00)
+ 
 
+ + + + + + +
0x01??/??
+
+ 
 
+ + + + + + +
0x02??/?irq mask
+
+ 
 
+ + + +
+ + + + + + +
0x03??/?irq status
+
+ + + + + + + + + + +
70
r??ph???
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
7rirq from MX chip
6?'killing' irq (should not get this one)
5?command error
4pchallange/response request
3hchallange/response status
+
+ 
 
+ + + +
+ + + + + + +
0x04??/?? (revid_eth)
+
- select register for writing
- IMM write 0xd1,0x07 (16bit)
+ 
 
+ + + + + + +
0x05??/?? (0x4e ?)
+
+ 
 
+ + + + + + +
0x06??/??
+
+ 
 
+ + + + + + +
0x07??/??
+
+ 
 
+ + + +
+ + + + + + +
0x08??/?Challenge
+
- select for reading
- IMM read 4 bytes
+ 
 
+ + + +
+ + + + + + +
0x09??/?Response
+
- select for writing
- IMM write 4 bytes
+ 
 
+ + + + + + +
0x0a??/??
+
+ 
 
+ + + +
+ + + + + + +
0x0b??/?Status
+
1: challenge/response ok
2: challenge/response failed
+ 
 
+ + + + + + +
0x0c??/??
+
+ 
 
+ + + + + + +
0x0d??/??
+
+ 
 
+ + + + + + +
0x0e??/??
+
+ 
 
+ + + + + + +
0x0f??/?? (0x00 ?)
+
+ 
index
+

+ +10.8.3  Operation

+
10.8.3.1 +   selecting a register for reading +
+
+
10.8.3.2 +   selecting a register for writing +
+
+10.8.3.3 +   selecting command-register for reading + +10.8.3.4 +   selecting command-register for writing + +
10.8.3.5 +   init +
+
+10.8.3.6 +   challenge/response calculation +  
 
u32 ETHChallResp(u32 val,u32 revid_0,u32 revid_eth_0,u32 +revid_eth_1)
{
    u32 c0,c1,c2,c3;
 
    c0=(
          ( ((val&0xff000000)> >24) ++
            ((val&0x00ff0000)> >16) +* 0xc1 + 0x18 + revid_0 )
        ^ ( ((val&0x000000ff) * +((val&0x0000ff00)> >8)) + 0x90 )
       ) & 0xff;
+  +    c1=(
          ( ((val&0x00ff0000)> >16) ++ ((val&0x0000ff00)> >8) + 0x90 )
        ^ ( c0 + ((val&0xff000000)> >24) +- 0xc1 )
       ) & 0xff;
+  +    c2=(
          ( ((val&0x0000ff00)> >8) ++ 0xc8 )
        ^ ( c0 + ((revid_eth_0 ++ revid_0 * 0x23) ^ 0x19) )
       ) & 0xff;
+  +    c3=(
          ( ((val&0xff000000)> >24) ++ 0xc1 )
        ^ ( (val&0x000000ff) + ((revid_eth_1 ++ 0xc8) ^ 0x90) )
       ) & 0xff;
+  +    return ((c0 < < 24) | (c1 < < +16) - (c2 < < 8) - (c3));
} 
10.8.3.7 +   send packet (outside interrupt) +
+
+
10.8.3.8 +   poll received packets (outside interrupt) +
+
+
10.8.3.9 +   received packet format +
+
+first 4 bytes of a received packet contains a descriptor about the +packet that has been received

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
........yyyy....xxxxxxxx........
+
+ + + + + + + + + + + + + + + + +
bit(s) Description
20-23ylength of received packet lo bits (shift 4 down)
8-15xlength of received packet hi bits (shift 4 up and OR with lo bits)
+
length is inclusive the 4 byte descriptor!
+
index
+

+ +10.9  UART

+
+(note: the existance of an UART is highly speculative and was never +proved for a fact) +to do +
index
+

+ +10.10  SD Cards

+
+SD cards support an SPI mode, which is essentially the same hardware +protocol that official memory cards use. Notice the use of the word +hardware, not software. SD cards uses the MMC command set for communication +and data transfer, while Nintendo memory cards use a custom Macronix +command set. This means that you should not waste your time trying +to get standard GC programs to recognize the SD card as a normal memory +card, because it will not work without specific code to access the +SD card. Even if you make the raw sector data on the SD card the same +as the Nintendo memory card, the low-level commands to access the +sectors differ between the two. However, since the hardware bus and +protocol are the same, an SD adapter can essentially be made with +straight-through connections from the EXI bus to the SD card signals. +to do +
index
+

+ +10.11  Viper 'Modchip'

+
+this is a 3rd-Party 'modchip' used to override the IPL with a custom +program. +todo +
index
+

+ +10.12  Ripper III GC 'Modchip'

+
+todo +
index
+

+ +10.13  Qoob 'Modchip'

+
+todo +
index
+

+ +10.14  NinjaMOD 'Modchip'

+
+todo +
index
+

+ +10.15  Mario Party Microphone

+
+todo +
index
+

+ +11  HSP Devices

+
+HSP devices seem to be accessable through the ARAM interface with +offsets beyond 16MB. +
index
+

+ +11.1  GB Player

+
+to do
index
+

+ +12  Memory Card Structure

+
index
+

+ +12.1  Overview

+
+one "block" on memcard equals 0x2000 bytes, the +first 5 blocks are used for the filesystem (0xa000 bytes).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetSizeDescription
0x00000x2000Header
0x20000x2000Directory
0x40000x2000Directory backup (*)
0x60000x2000Block Allocation Map
0x80000x2000Block Allocation Map backup (*)
0xa000 file(s) data
+
+

+(*) If a change is to be made that will alter the Master File Table, +such as moving or deleting a file, copying a file from another memory +card, or creating a new save game file, the GameCube will first backup +the Master File Table to this location. Presumably, if the operation +fails for certain reasons, the GameCube will restore the Backup File +Table to the Master File Table. +
index
+

+ +12.2  Header

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetSizeDescription
0x0000 ?
0x000c8time of format (OSTime value)
0x0014 unique card id (?)
0x00202padding zeroes
0x00222size of memcard in Mbits
0x00242encoding (ASCII or japanese)
0x0026 unused (0xff)
0x01fa2update Counter (?, probably unused)
0x01fc2Checksum 1 (?)
0x01fe2Checksum 2 (?)
0x02000x1e00unused (0xff)
+
+
index
+

+ +12.3  Directory

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetSizeDescription
0x0000 Directory Entries (max 127)
0x0ffa2update Counter
0x0ffc2Checksum 1
0x0ffe2Checksum 2
+
+
index
+

+ +12.3.1  Directory Entries

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
offsetlengthdescription
0x000x04Gamecode
0x040x02Makercode
0x060x01reserved/unused (always 0xff, has no effect)
0x070x01banner gfx format and icon animation (Image Key)
   + + + + + + + + + + + + + + + + + + +
bit(s)description
2Icon Animation 0: forward 1: ping-pong
10: No Banner 1: Banner present
0Banner Color 0: RGB5A3 1: CI8
+
0x080x20filename
0x280x04Time of file's last modification in seconds since 12am, January 1st, +2000
0x2c0x04image data offset
0x300x02icon gfx format (2bits per icon)
   + + + + + + + + + + + + + + + + + + + + + +
bitsDescription
00no icon
01CI8 with a shared color palette after the last frame
10RGB5A3
11CI8 with a unique color palette after itself
+
0x320x02animation speed (2bits per icon) (*1)
   + + + + + + + + + + + + + + + + + + + + + +
bitsDescription
00no icon
01Icon lasts for 4 frames
10Icon lasts for 8 frames
11Icon lasts for 12 frames
+
0x340x01file-permissions
   + + + + + + + + + + + + + + + + + + + + + +
bitpermissionDescription
4no moveFile cannot be moved by the IPL
3no copyFile cannot be copied by the IPL
2publicCan be read by any game
+
0x350x01copy counter (*2)
0x360x02block no of first block of file (0 == offset 0)
0x380x02file-length (number of blocks in file)
0x3a0x02reserved/unused (always 0xffff, has no effect)
0x3c0x04Address of the two comments within the file data (*3)
+
+

+(*1) Clearly, the animation rate is unimportant when there is only +one frame of icon data; nevertheless, a value for that one frame must +still be set, or that one frame will not be shown. It is illegal to +specify that a frame does not exist if it does; a value of 00 indicates +that no frame exists, and should not be mistaken for meaning that +this frame should not be shown. If you specify blank frames to slow +the frame rate, these also cannot be 00.

+(*2) This byte contains an 8-bit integer that indicates how many +times the file has been copied from one memory card to another.

+(*3) Each file has two 32 character strings which the IPL displays +at the bottom of the memory card screen, next to the banner. The two +strings (64 bytes) must fit within one block (8192 bytes), they are +not allowed to cross sector boundaries.
12.3.1.1 +   Image Data +
+
+Image data consists of a banner image and an icon. The banner image +is not required, dependant on the value of the Image Key. If the banner +image is not present, the icon image is displayed where the banner +image would be displayed (centered horizontally). The icon image is +required, and immediately follows the banner if present. Otherwise, +it is located at the start of the image data. +
    + 12.3.1.1.1  Banner Image +The banner size is 96*32 pixels, making 3072 pixels in total (= +0x0c00 bytes in 8bit, 0x1800 bytes in 16bit mode). If the Banner is +in CI8 mode, the palette follows immediately after the banners pixel +data. +
    + 12.3.1.1.2  Icon Image +Immediately following the banner (if present) is the Icon Image. This +can have a variable number of frames (up to eight), each 32*32 pixels, +making 1024 pixels per frame in total. (= 0x0400 bytes in 8bit, 0x0800 +byte in 16bit mode). If the Icon is in CI8 mode, its palette either +follows immediately after its pixel data or after the pixel data of +all 8 icons, depending on the icon gfx format field. +
    + 12.3.1.1.3  Palettes +Palettes in the image data are in RGB5A3 pixel format, and are 0x100 +entries large. (= 0x200 bytes) +
index
+

+ +12.4  Block Allocation Map

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetSizeDescription
0x00002Checksum 1
0x00022Checksum 2
0x00042update Counter
0x00062free Blocks
0x00082last allocated Block
0x000a0x1ff8Map of allocated Blocks
+
+

+This is an array of 0x0ffc 16 bit values, each holding info about +one allocated block on the memory card. (thus the maximum memcard +size is limited to 2048 blocks (16 Megabytes, 128Mbit))

+each 16 bit value at position X in the array has the following meaning:

+ + + + + + + + + + + + + + + + + +
valueDescription
0x0000block is not allocated (ie, free)
0xfffflast allocated block of a file
any otherallocated block, usually equals (x+1) (==next block of file)
+
+

+scan through a file like this:

thisblock=firstblock;
do
{
    // process block
    // next block
    thisblock=((unsigned short*)0x6000)[thisblock];
}
while (thisblock!=0xffff); 
 
+note:

+although this scheme could do it, i have never stumbled about a file +yet that is NOT linear on the memcard anyway. from this point of view +using this allocation map seems to be a bit stupid...more testing +needed :) +
index
+

+ +12.5  Checksums

+
+The Checksums for the Directory and Block Allocation Map are simple +16bit additive checksums (ie nothing fancy or particular safe) which +can be easily calculated like this:

void checksums(unsigned short *buf, int num, unsigned short +*c1, unsigned short *c2)
{
    int i;
    *c1 = 0;*c2 = 0;
    for (i = 0; i < num; ++i)
    {
        *c1 += buf[i];
        *c2 += (buf[i] ^ 0xffff);
    }
    if (*c1 == 0xffff)
    {
        *c1 = 0;
    }
    if (*c2 == 0xffff)
    {
        *c2 = 0;
    }
}
index
+

+ +13  DVD Structure

+
+total capacity of disc data is 1,459,978,240 bytes (1.5 GB approx.). +that's exactly 712880 DVD raw sectors (each 2048 bytes).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizeDescription
0x00000000 0x0440Disk header ("boot.bin")
0x00000440 0x2000Disk header Information ("bi2.bin")
0x00002440 (0x2000 ?)Apploader ("appldr.bin")
   FST ('fst.bin')
+
+
index
+

+ +13.1  Disk header

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizeDescription
0x00000x00030x0004Game Code
    + + + + + + + + + + + + + +
1Console ID
2Gamecode
1Country Code
+
0x00040x00050x0002Maker Code
0x0006 0x0001Disk ID
0x0007 0x0001Version
0x0008 0x0001Audio Streaming
0x0009 0x0001Stream Buffer Size
0x000a0x001b0x0012unused (zeros)
0x001c0x001f0x0004DVD Magic Word (0xc2339f3d)
0x00200x03ff0x03e0Game Name
0x04000x04030x0004offset of debug monitor (dh.bin) ?
0x04040x04070x0004addr (?) to load debug monitor ?
0x04080x041f0x0018unused (zeros)
0x04200x04230x0004offset of main executable DOL (bootfile)
0x04240x04270x0004offset of the FST ("fst.bin")
0x04280x042B0x0004size of FST
0x042C0x042F0x0004maximum size of FST (usually its same as FST size) (*)
0x04300x04330x0004user position (?)
0x04340x04370x0004user length (?)
0x04380x043b0x0004(?)
0x043c0x043f0x0004unused (zeros)
+
+

+(*) multiple DVDs must use it, to properly reside all FSTs.
index
+

+ +13.2  Disk header Information

+
+this is loaded to the Address in 0x800000f4 when a disc is +initialized by the IPL

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
offsetendsizeDescription
0x0000 4Debug-monitor Size
0x0004 4Simulated Memory Size
0x0008 4Argument offset
0x000c 4Debug flag
0x0010 4Track Location
0x0014 4Track size
0x0018 4Countrycode
0x001c 4?
+
+
index
+

+ +13.3  Apploader

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
offsetendsizeDescription
0x00000x0009 Date (version) of the apploader in ASCII
0x000A0x000F padding (0)
0x00100x00134Apploader entrypoint
0x00140x00174size of the apploader (32 bit) (usually 0x2000)
0x00180x001b4trailer size
0x0020  Apploader code (loaded to 0x81200000 in RAM)
+
+
index
+

+ +13.4  Format of the FST

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizeDescription
0x000x0c0x0cRoot Directory Entry
0x0c...0x0cmore File- or Directory Entries
.........String table
+
+
index
+

+ +13.4.1  Format of a File Entry

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizeDescription
0x00 1flags; 0: file 1: directory
0x01 3filename, offset into string table
0x04 4file_offset or parent_offset (dir)
0x08 4file_length or num_entries (root) or next_offset (dir)
+
+
index
+

+ +14  general File Formats

+
index
+

+ +14.1  BNR (Banner file format)

+
+this is the format of the file 'opening.bnr' (file size: always +6.496 bytes) found in the root directory of every Gamecube disc. This +file is the little image that is displayed in the cube menu when inserting +a disc into the gamecube, when in menu mode.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizeDescription
0x00000x00030x0004Magic Word "BNR1" (US/JP) or 'BNR2' (EU)
0x00040x001f padding zeroes
0x00200x181f0x1800Graphical Data (Pixel-format is RGB5A1)
0x18200x183f0x0020Gamename (*)
0x18400x185f0x0020Company/Developer (*)
0x18600x189f0x0040Full Game Title (*)
0x18a00x18df0x0040Company/Developer Full name, or description (*)
0x18e00x195f0x0080Game Description (*)
+
+

+(*) All Text is all stored in either SHIFT-JIS or ASCII, depending +on the region of the Game.

+note: In the filesystem of european Games with multi-lingual text +there may be several .bnr files (opening.bnr, openingUS.bnr, openingEU.bnr, +openingJP.bnr). The opening.bnr is a BNR2 file, it is just like a +regular BNR file, except that the metadata at the end repeats several +times in different languages. 0x1820 through 0x1960 are the first, +and it continues in blocks of 0x0140. +
index
+

+ +14.2  DOL (Gamecube Executable)

+
+This is a custom GameCube program file format, which is directly booted +by GameCubes' BIOS (to be exact, by the apploader on retail discs. +a different apploader could well load a binary in whatever different +format.).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x00000x001B Text[0..6] sections File Positions
0x001C0x0047 Data[0..10] sections File Positions
0x00480x0063 Text[0..6] sections Mem Address
0x00640x008F Data[0..10] sections Mem Address
0x00900x00AB Text[0..6] sections Sizes
0x00AC0x00D7 Data[0..10] sections Sizes
0x00D8 0x04BSS Mem address
0x00DC 0x04BSS Size
0x00E0 0x04Entry Point
0x00e4 0x1cunused
0x0100  Start of sections data (body)
+
+
index
+

+ +14.3  ELF (Executable and linkable Format)

+
+The ELF format is a standard, known format for debugging target specific +code, etc. GCC targeted for the PPC 750 processor or even for the +specialized Gekko processor has a final output of ELF format files. +The exact GameCube ELF file format details are currently unknown, +but they should be similar to the standard specification. +
index
+

+ +14.4  GCB (QOOB Flash Files)

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x000x034ID, indicates whats in the block
    + + + + + + + + + + + + + + + + + +
0x28432920'(C) ' - qoob bios file
0x454c4600'ELF0' - ELF File
0x42494e00(not yet) 'BIN0'
0x444f4c00(not yet) 'DOL0'
+
0x040xf7 description, will be shown in boot menu (by the qoob bios)
0xf80xfb4reserved
0xfc0xff4size of block
0x100... data
+
+ 
index
+

+ +14.5  GCM (Gamecube Disc Image)

+
+These files are always 1.4GB's exactly and each contains a complete +binary image of a proprietary format GameCube DVD. This file format +is used for the NR-Writer DVD writing software which writes special +DVDs that can only be read by NR-Reader GameCubes. The GCM file format +can probably be closely compared to the ISO file format for CDs in +its purpose. +
index
+

+ +14.6  GCI (Gamecube Game Save)

+
+Used by the EMS Memory Adapter.

+64 byte header (equal to FST entry on memcard), followed by the file +data (as on memory card) +
index
+

+ +14.7  GCP (Gamecube Memorycard Image)

+
+Used by the EMS Memory Adapter.

+this is a raw image of all blocks of a memory card. +
index
+

+ +14.8  TGC

+
+a proprietary image format found on demo discs and eg the zelda n64 +emu

+note: there seem to be tgc files on european discs that follow a different +layout (no header). +
index
+

+ +14.8.1  Header

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x00000x00030x0004TGC-Magic (0xae0f38a2)
0x00040x00070x0004? (=0x00000000)
0x00080x000b0x0004TGC-Header Size (=0x00008000)
0x000c0x000f0x0004? (=0x00100000)
0x00100x00130x0004Offset to FST inside embedded GCM
0x00140x00170x0004FST Size
0x00180x001b0x0004max FST Size
0x001c0x001f0x0004Offset to Boot-DOL inside embedded GCM
0x00200x00230x0004Boot-DOL Size
0x00240x00270x0004?
0x00280x002b0x0004?
0x002c0x002f0x0004Offset to Banner inside embedded GCM ?
0x00300x00330x0004Banner Size ?
0x00340x00370x0004?
+
+
index
+

+ +14.8.2  embedded GCM

+
+usually starts at offset 0x00008000 (after the TGC Header) +and follows exactly the same layout as a GCM file, with the following +exceptions: + +
index
+

+ +14.9  VGC (Viper Flash Files)

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x000x034Viper Magic ('VIPR')
0x04 1Configuration Flags
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s)description
7GC_FLASH_ACCESS - allows access to the flashrom
6?
5?
4?
3COMMAND_MODE - enables modchip command mode (requires extended mode)
2EXTENDED_MODE - allows reading of original IPL
1COBRA_ENCRYPTION - enables additional encryption mode
0DISABLE_CHIP - disables the modchip
+
0x05 1Lid Sensor Status at Boot Time (*2)
    + + + + + + + + + + + + + +
0LID_OPEN
1LID_CLOSED
2LID_PASSTHROUGH
+
0x060x0f10padding (zeros)
0x100x1f16BIOS Name in Ascii
0x20... Encrypted (*1) BIOS, loaded to 0x81300000 +
+
+ 
 
+(*1) encrypted with the IPL XOR-Stream +(*2) original docs state that the default value is 0xff, +however actually using this value seems to cause problems. +
index
+

+ +15  Game File Formats

+
+This Section contains information about files used in, or produced +by the official SDK, and thus is primarily useful for those who are +hacking retail games. +
index
+

+ +15.1  AFC (audio stream)

+
index
+

+ +15.2  AST (audio stream)

+
+like afc but with tags? +
index
+

+ +15.3  ARC (RARC Archive)

+
+This file is an archive file and contains several other files. +
index
+

+ +15.3.1  Header

+
+The file starts with an Rarc-Header: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
  4type - 'RARC'
  4size, size of the file
  4unknown
  4dataStartOffset, where does the actual data start? You have to add +0x20 to this value.
  16unknown
  4numNodes
  8unknown
  4fileEntriesOffset
  4unknown
  4stringTableOffset, where is the string table stored? You have to add +0x20 to this value.
  8unknown
+
+
index
+

+ +15.3.2  Nodes

+
+Next are RarcHeader.numNodes Node structures: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
  4type
  4filenameOffset, directory name, offset into string table
  2unknown
  2numFileEntries, how many files belong to this node?
  4firstFileEntryOffset
+
+
+Each RARC file contains at least one Node, the 'ROOT' node. For each +subdirectory in the archive, there's another Node (so each Node represents +a directory). Each Node contains files and directories, represented +by FileEntry structures: +
index
+

+ +15.3.3  File Entries

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
  2id, file id. If this is 0xFFFF, then this entry is a subdirectory +link
  2unknown
  2unknown
  2filenameOffset, file/subdir name, offset into string table
  4dataOffset, offset to file data (for subdirs: index of Node representing +the subdir)
  4dataSize, size of data
  4zero, seems to be always '0'
+
+
+To read the archive, you read the root node and its file entries. +For each subdir in the root node's fileentries, you read the corresponding +node and its file entries. For each file in the fileentries, you dump +its data. +
index
+

+ +15.4  ARC (audio stuff)

+
+if a .arc file doesnt start with 'RARC' it may contain audio data +
index
+

+ +15.5  ASN

+
+audio related, contains strings +
index
+

+ +15.6  AW ("audio wave"?)

+
index
+

+ +15.7  BAS ("audio script" ?)

+
+seems to have to do with audio (check mkdd file names...) +
index
+

+ +15.8  BCA

+
+looks very similar to a .col file, only with some tags in it +
index
+

+ +15.9  BCK (animation of a .bmd skeleton)

+
index
+

+ +15.10  BDL

+
+same as .bmd +
index
+

+ +15.11  BFN (font)

+
+images of characters + mapping from character code to corresponding +image part +
index
+

+ +15.12  BIN (binary file)

+
+scene.bin in sms contains scene layout +
index
+

+ +15.13  BLO (screen layout for dialog screens)

+
index
+

+ +15.14  BMD (3d model with texture and skeleton)

+
index
+

+ +15.15  BMG

+
+messages, subtitles, ... (text) +
index
+

+ +15.16  BMP (window bitmap (!))

+
index
+

+ +15.17  BMT

+
+seems to contain a MAT3 block of a .bmd file +
index
+

+ +15.18  BCK ("Pack" file)

+
index
+

+ +15.19  BRK

+
+animation stuff? rotation keys? +
index
+

+ +15.20  BTI

+
+Note: some .bti files are Yaz0-compressed (if the first 4 bytes are +'Yaz0'), if this is the case you have to uncompress them first. +A .bti file stores a single image, but can store several mipmaps. +The file starts with a texture-header (which is used in the TEX! section +of bmd/bdl and jpa files to store textures aswell): +
index
+

+ +15.20.1  Texture Header

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x00 1format
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0I4 (4 bit intensity, 8x8 tiles)
1I8 (8 bit intensity, 8x4 tiles)
2IA4 (4 bit intensity with 4 bit alpha, 8x4 tiles)
3IA8 (8 bit intensity with 8 bit alpha, 4x4 tiles)
4RGB565 (4x4 tiles)
5RGB5A3 (*) (4x4 tiles)
6RGBA8 (4x4 tiles in two cache lines - first is AR and second is GB)
8CI4 (4 bit color index, 8x8 tiles)
9CI8 (8 bit color index, 8x4 tiles)
10CI14X2 (14 bit color index, 4x4 tiles)
14CMP (S3TC compressed, 2x2 blocks of 4x4 tiles)
+
0x01 1unknown
0x020x032width
0x040x052height
0x060x072unknown
0x08 1unknown
0x09 1Palette Format
    + + + + + + + + + + + + + +
0IA8
1RGB565
2RGB5A3 (*)
+
0x0a0x0b2Palette Entries - number of entries in the Palette
0x0c0x0f4Palette Offset - offset to Palette Data
0x100x134unknown
0x140x152unknown
0x160x172unknown
0x18 1mipmap count
0x19 1unknown
0x1a0x1b2unknown
0x1c0x1f4Data Offset - offset to image Data
+
+ 
 
+(*) RGB5A3 is RGB5 if color value is negative and RGB4A3 otherwise. +Offsets are relative to the Texture Header (this is important in bmd/bdl +files). +
index
+

+ +15.21  BTP

+
+99% sure that this contains texture animation (NOT texture coordinate +animation) +
index
+

+ +15.22  BTK

+
+(curves??? kinematics??) translation keys? probably some material +animation as well (texture coord anim?) +
index
+

+ +15.23  COL (collision triangles)

+
index
+

+ +15.24  DZB

+
+collision data ? +
index
+

+ +15.25  H4M

+
+a proprietary Movie Format found on some Gamecube Game DVDs. Probably +related to the HVQ (Hirarchical Vector Quantization) format developed +by Hudson. +
index
+

+ +15.26  JPA (particle data)

+
+(TEX1 section contains .bti images) +
index
+

+ +15.27  JPC

+
+collection of .jpa files ("Particle paCk"?) +
index
+

+ +15.28  MTH ('Mute thp?')

+
+video format, has the same video frame format as thp, but headers +are a bit different +
index
+

+ +15.29  PAD

+
+recorded controller data? +
index
+

+ +15.30  PRM ('Parameters?')

+
index
+

+ +15.31  REL (relocatable module)

+
+some kind of .dll or similar, contains text and data sections and +relocation info +
index
+

+ +15.32  SB

+
+?, contains a stringtable +
index
+

+ +15.33  SZS (packed RARC Archive)

+
+This is a Yaz0-compressed RARC archive +
index
+

+ +15.34  THP (video format)

+
+.thp is a video format on the gamecube. The video frames are independent +"quasi-jpegs", and if audio frames are present, +they are in an adpcm format (described below). +
index
+

+ +15.34.1  Header data

+
+The file starts with a thp header: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x000x034Magic Bytes, 0x54485000 ('THP0')
0x040x074Version
    + + + + + + + + + +
0x00010000v1.0
0x00011000v1.1
+
0x080x0b4maxBufferSize - maximal buffer size needed for one complete frame +(header + video + audio)
0x0c0x0f4maxAudioSamples - != 0 if sound is stored in file, maximal number +of samples in one frame.
0x100x134FPS (float value)
    + + + + + + + + + +
0x41efc28f~29; NTSC
  
+
0x140x174numFrames - number of frames in the thp file
0x180x1b4firstFrameSize - size of first frame (header + video + audio)
0x1c0x1f4dataSize - size of all frames (not counting the thp header structures)
0x200x234componentDataOffset - ThpComponents stored here (see below)
0x240x274offsetsDataOffset - if != 0, offset to table with offsets of all frames?
0x280x2b4firstFrameOffset - offset to first frame's data
0x2c0x2f4lastFrameOffset - offset to last frame's data
+
+
index
+

+ +15.34.2  Components structure

+
+At ThpHeader.componentDataOffset, a ThpComponents structure is stored: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x000x034numComponents - usually 1 or 2 (video or video + audio)
0x040x1316componentTypes - each byte specifies the type of one component as +follows:
    + + + + + + + + + + + + + +
0x00video
0x01audio
0xffno component
+
+
+
+The first ThpComponents.numComponents entries of ThpComponents.componentTypes +are valid. For each component, an information structure is stored +after the ThpComponents struct. +
index
+

+ +15.34.3  VideoInfo Structure

+
+Component type 0 is video, a ThpVideoInfo struct looks like this: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x000x034width
0x040x074height
0x080x0b4unknown (only v1.1 files)
+
+
index
+

+ +15.34.4  AudioInfo Structure

+
+Component type 1 is audio (not always included), a ThpAudioInfo struct +looks like this: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x000x034numChannels
0x040x074frequency
0x080x0b4numSamples
0x0c0x0f4numData (only for v1.1 files) - amount of audio blocks stored after +each video block
+
+
index
+

+ +15.34.5  Frame data

+
+A frame is made up of a frame header followed by a video frame followed +by ThpAudioInfo.numData audio frames (only if the video contains sound). +The frame header consists of 3 (or 4, if the video contains sound) +32bit values: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x000x034nextTotalSize - total size of NEXT frame (frame header, video and +audio)
0x040x074prevTotalSize - total size of PREVIOUS frame
0x080x0b4imageSize - size of image frame of THIS frame
0x0c0x0f4audioSize - size of one audio frame of THIS frame (only if the file +contains audio)
+
+
+Directly after the frame header FrameHeader.imageSize bytes video +information follow. Directly after the video information, ThpAudioInfo.numData +audio frames follow, each Frameheader.audioSize bytes large (only +if the file contains audio). +
index
+

+ +15.34.6  Video Frames

+
+A video frame is more or less a jpeg image. A jpeg file is structured +by several markers. A marker is a two-byte code, the first of the +two bytes is 0xff. The jpeg standard states that if you want +to store the value 0xff, you have to store it as 0xff +0x00 (else it would be confused with a marker). This is NOT the case +in .thp files, the value 0xff is stored simply as 0xff +in the image data. So if you want to use jpeglib to read the frame, +you have to convert the thp "quasi-jpeg" to a real +jpeg by converting 0xff values to 0xff 0x00 in the +image data. You have to be careful that you don't convert the terminating +End-Of-Image marker, though. +- search for Start-Of-Image marker (0xff 0xda) +- search for End-Of-Image marker (0xff 0xd9) (start search +at end of buffer and search backwards!) +- convert each 0xff between image data start and image data +end to 0xff 0x00
+- the resulting buffer can be passed to jpeglib to let it decode the +image for you +
index
+

+ +15.34.7  Audio Frames

+
+An audio frame starts with a ThpAudioFrameHeader (total size is 80 +bytes) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x000x034channelSize - size of one channel in bytes (*1)
0x040x074numSamples - number of samples/channel
0x080x2732table for first channel (*2)
0x280x4732table for second channel (stored for one channel videos as well) (*2)
0x480x492signed value, channel1Prev1
0x4a0x4b2signed value, channel1Prev2
0x4c0x4d2signed value, channel2Prev1
0x4e0x4f2signed value, channel2Prev2
+
+
+(*1) audio frame size = sizeof(ThpAudioFrameHeader) + ThpAudioInfo.numChannels +* ThpAudioFrameHeader.channelSize
+(*2) tables stored as 16bit signed 5.11 fixed point numbers +Directly after the ThpAudioFrameHeader ThpAudioFrameHeader.channelSize +bytes follow for the first channel, and if the video is stereo (ThpAudioInfo.numChannels += 2), that many bytes follow for the second channel. +The audio data is made up of small packets of 8 byte, each packet +contains 14 samples. Some kind of adpcm coding is used. A sample is +calculated like this: +newSample = previousSample*factor1 + sampleBeforePreviousSample*factor2 ++ (sampleData * 2^exponent);
+For each packet, the first byte stores factor1, factor2 and exponent: +u8 index = (firstByte > > 4) & 0x7; //highest +bit of byte is ignored
u8 exponent = firstByte & 0xf;
float factor1 = ThpAudioFrameHeader.table[2*index]/pow(2.f, +11);
float factor2 = ThpAudioFrameHeader.table[2*index + 1]/pow(2.f, +11);
+The following 7 bytes store 14 sampleData (each 4 bit, interpreted +as a signed two's complement number). +
index
+

+ +15.35  TPL (Texture Palette)

+
+Another custom GameCube file format that holds texture and texture +palette data. Many textures can be stored in one TPL file format, +and it is commonly used by the SDK to hold texture data for GameCube +games.

+note: appearently there are different formats of .TPL files, the following +applies only to those with the magic 0x00,0x20,0xaf,0x30.

+TPL Header

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x00000x00034Magic (0x00, 0x20, 0xAF, 0x30)
0x00040x00074ntextures - Number of Textures in File
0x00080x000b4size of Header (always 0x0c in files with this structure)
+
+

+TPL Texture

+After the header goes 'ntextures' times the TPLTexture structure:

+ + + + + + + + + + + + + + + + + + + + +
startendsizedescription
  4Texture Header Offset
  4Texture Palette Offset (0 if no palette)
+
+

+TPL Texture Header

+For every texture at position 'Texture Header Offset' there is the +TPL Texture Header:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
  2height
  2width
  4format
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0I4 (4 bit intensity, 8x8 tiles)
1I8 (8 bit intensity, 8x4 tiles)
2IA4 (4 bit intensity with 4 bit alpha, 8x4 tiles)
3IA8 (8 bit intensity with 8 bit alpha, 4x4 tiles)
4RGB565 (4x4 tiles)
5RGB5A3 (*) (4x4 tiles)
6RGBA8 (4x4 tiles in two cache lines - first is AR and second is GB)
8CI4 (4 bit color index, 8x8 tiles)
9CI8 (8 bit color index, 8x4 tiles)
10CI14X2 (14 bit color index, 4x4 tiles)
14CMP (S3TC compressed, 2x2 blocks of 4x4 tiles)
+
  4offset to Texture Data
  4wrap s
  4wrap t
  4min filter
  4mag filter
  4lod bias (float value)
  1edge lod
  1min lod
  1max lod
  1unpacked
+
+

+TPL Palette Header

+For every palette (not every texture has one) there is the TPL Palette +Header:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
  2nitems
  1unpacked
  1pad
  4format
    + + + + + + + + + + + + + +
0IA8
1RGB565
2RGB5A3 (*)
+
  4offset to Palette Data
+
+ 
 
+(*) RGB5A3 is RGB5 if color value is negative and RGB4A3 otherwise. +
index
+

+ +15.36  YMP (height map)

+
index
+

+ +16  Compression Formats

+
index
+

+ +16.1  Yay0

+
+This format is used to store the fonts in the BIOS/IPL. It is compressed +similar to the the Zelda 64 'Yaz0' compression.
index
+

+ +16.1.1  compression

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x0000 4'Yay0' signature
0x0004 4size of decoded data in bytes
0x0008 4offset to link table
0x000c 4offset to non-linked chunks and count modifiers table
0x0010  packed data (32 bit words)
+
+ 
 
+The packed data is a bitstream (padded to a multiple of 32bits), with +each bit having the following meaning:

+ + + + + + + + + +
0linked chunk, copy block from the link table (offset 0x0008)
1non linked chunk, copy next byte from non-linked chunks and count +modifiers table (offset at 0x000c)
+
+

+todo +
index
+

+ +16.1.2  de-compression Code

+
void Decode(void *s, void *d) 
{ 
u32 i, j, k; 
u32 p, q; 
u32 cnt; 
    i = r21 = *(u32 *)(s + 4); // size of decoded +data 
    j = r29 = *(u32 *)(s + 8); // link table 
    k = r23 = *(u32 *)(s + 12); // byte chunks and +count modifiers 
    q = r31 = 0; // current offset in dest buffer 
    cnt = r28 = 0; // mask bit counter 
    p = r24 = 16; // current offset in mask table 
    do 
    { 
        // if all bits are done, get next mask 
        if(cnt == 0) 
        { 
            // read word from mask data block 
            r22 = *(u32 *)(s + p); 
            p += 4; 
            cnt = 32; // bit counter 
        } 
        // if next bit is set, chunk is non-linked 
        if(r22 & 0x80000000) 
        { 
            // get next byte 
            *(u8 *)(d + q) = *(u8 *)(s ++ k); 
            k++; q++; 
        } 
        // do copy, otherwise 
        else 
        { 
            // read 16-bit from link table 
            r26 = *(u16 *)(s + j); 
            j += 2; 
            // 'offset' 
            r25 = q - (r26 & 0xfff); 
            // 'count' 
            r30 = r26 > > 12; 
            if(r30 == 0) 
            { 
                // get 'count' modifier 
                r5 = *(u8 *)(s + k); 
                k++; 
                r30 = r5 + 18; 
            } 
            else r30 += 2; 
            // do block copy 
            r5 = d + r25; 
            for(i=0; i<r30; i++) 
            { 
                *(u8 *)(d + q) = *(u8 +*)(r5 - 1); 
                q++; r5++; 
            } 
        } 
        // next bit in mask 
        r22 < <= 1; 
        cnt--; 
    } while(q < i); 
} 
 
index
+

+ +16.1.3  Font Data

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
startendsizedescription
0x0000 2Font Type
0x0002 2first Character in Font
0x0004 2last Character in Font
0x0006 2Character to use for substituting invalid Characters
0x0008 2ascent Units
0x000a 2descent Units
0x000c 2width of widest Character
0x000e 2leading Space
0x0010 2Cell width
0x0012 2Cell Height
0x0014 4Texture Size
0x0018 2Texture Format
0x001a 2Texture Columns
0x001c 2Texture Rows
0x001e 2Texture Width
0x0020 2Texture Height
0x0022 2offset to Character-width Table
0x0024 4offset to Tile-Data
0x0028 4Tile-Data Size
+
+
index
+

+ +16.2  Yaz0

+
+Yaz0 compression is reportedly used in quite a few Nintendo datafiles. +I have seen it in SuperMario Sunshine's .szs files for example, and +I heard that it is used in Windwaker and Majoras Mask as well. +The first 16 bytes of a Yaz0-compressed data block are the data header. +The first 4 bytes of the header are 'Y', 'a', 'z', '0', so you can +easily see in your hex editor that there's a Yaz0 block waiting for +you :-) The second 4 bytes are a single uint32 (big-endian of course) +that tells you the size of the decompressed data, so you know how +large your working buffer has to be. The next 8 bytes are always zero. +Next comes the actual compressed data. Yaz0 is some kind of RLE compression. +You decode it as follows: First you read a "code" +byte that tells you for the next 8 "read operations" +what you have to do. Each bit of the "code" byte +represents one "read operation" (from left to right, +that is, 0x80 first, 0x01 last). If the bit is 1, copy one byte from +the input buffer to the output buffer. Easy. If the bit is 0, things +are a little bit more complicated, RLE compressed data is ahead. You +have to read the next two bytes to decide how long your run is and +what you should write to your output buffer. + + + + + + + + + + + + + +
15870
ab  
+
+The upper nibble of the first byte (a) contains the information you +need to determine how many bytes you're going to write to your output +buffer for this "read operation". if a == 0, then +you have to read a third byte from your input buffer, and add 0x12 +to it. Otherwise, you simply add 2 to a. This is the number of bytes +to write ("count") in this "read operation". +byte2 and the lower nibble of byte1 (b) tell you from where to copy +data to your output buffer: you move (dist = (b < &lt
+8) - byte2 + 1) bytes back in your outputBuffer and copy "count" +bytes from there to the end of the buffer. Note that count could be +greater than dist which means that the copy source and copy destination +might overlap. +
index
+

+ +16.2.1  de-compression Code

+
//src points to the yaz0 source data (to the "real" +source data, not at the header!) 
//dst points to a buffer uncompressedSize bytes large (you +get uncompressedSize from 
//the second 4 bytes in the Yaz0 header). 
 
void decode(u8* src, u8* dst, int uncompressedSize) 
{ 
int srcPlace = 0, dstPlace = 0; //current read/write positions 
u32 validBitCount = 0; //number of valid bits left in "code" +byte 
u8 currCodeByte; 
    while(dstPlace < uncompressedSize) 
    { 
        //read new "code" byte if +the current one is used up 
        if(validBitCount == 0) 
        { 
            currCodeByte = src[srcPlace]; 
            ++srcPlace; 
            validBitCount = 8; 
        } 
        if((currCodeByte & 0x80) != 0) 
        { 
            //straight copy 
            dst[dstPlace] = src[srcPlace]; 
            dstPlace++; 
            srcPlace++; 
        } 
        else 
        { 
            //RLE part 
            u8 byte1 = src[srcPlace]; 
            u8 byte2 = src[srcPlace + 1]; 
            srcPlace += 2; 
            u32 dist = ((byte1 & 0xF) < < +8) - byte2; 
            u32 copySource = dstPlace - (dist ++ 1); 
            u32 numBytes = byte1 > > +4; 
            if(numBytes == 0) 
            { 
                numBytes = src[srcPlace] ++ 0x12; 
                srcPlace++; 
            } 
            else 
                numBytes += 2; 
            //copy run 
            for(int i = 0; i < numBytes; ++i) 
            { 
                dst[dstPlace] = dst[copySource]; 
                copySource++; 
                dstPlace++; 
            } 
        } 
        //use next bit from "code" +byte 
        currCodeByte < <= 1; 
        validBitCount-=1;  
    } 
} 
 
index
+

+ +17  Graphic Formats

+
index
+

+ +17.1  YCbYCr

+
+This is the Format used for image data in the external framebuffer +(XFB). It exploits the fact that the resolution of color on a PAL/NTSC +screen is lower than the resolution of luminance (brightness), and +thus stores only separate luminance info for each pixel and combines +the color information of two pixels each, saving 2 bytes versus traditional +RGB-per-pixel framebuffers. This means that in XFB you cant modify +the color of a single pixel without affecting its neighbour. (you +can however, seperatly modify its luminance/brightness). It also means +that you can not accurately convert one single pixel into XFB framebuffer +format, you will always have to convert two pixels at once.

+To convert two pixels to YCbYCr, first average their RGB values

R = (R1+R2)/2 
G = (G1+G2)/2 
B = (B1+B2)/2

+now calculate the luminance portion of each pixel

Y1 = (77/256)R1 + (150/256)G1 + (29/256)B1 
Y2 = (77/256)R2 + (150/256)G2 + (29/256)B2

+then calculate the combined color portion

Cb = -(44/256)R -  (87/256)G + (131/256)B + 128 
Cr = (131/256)R - (110/256)G -  (21/256)B + 128 

+now a 32 bit value to be written to XFB (to a 32 bit aligned address +of course) can be made up like this

+ + +
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
11111111bbbbbbbb22222222rrrrrrrr
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24-311Y1 - luminance Portion of first Pixel
16-23bCb - combined color
8-152Y2 - luminance Portion of first Pixel
0-7rCr - combined color
+
+

+converting a single pixel back to RGB looks like this

R = Y + 1.371(Cr - 128) 
G = Y - 0.698(Cr - 128) - 0.336(Cb - 128) 
B = Y + 1.732(Cb - 128) 
index
+

+ +17.2  I4 (4bit indexed)

+
index
+

+ +17.3  IA4 (4bit indexed with alpha)

+
index
+

+ +17.4  I8 (8bit indexed)

+
index
+

+ +17.5  IA8 (8bit indexed with alpha)

+
index
+

+ +17.6  CI4 (compressed 4bit indexed)

+
index
+

+ +17.7  CIA4 (compressed 4bit indexed with alpha)

+
index
+

+ +17.8  CI8 (compressed 8bit indexed)

+
+Used for Icons and Banners on Memory Card. This Format uses a palette +in RGB5A1 Format, the Pixel data is stored in 8x4 pixel tiles. +
index
+

+ +17.9  CIA8 (compressed 8bit indexed with alpha)

+
index
+

+ +17.10  RGB4A3

+
+Used for Icons and Banners on Memory Card. This Format uses no palette +and is stored in 4x4 pixel tiles. +
index
+

+ +17.10.1  RGB4A3 Pixel Format

+
+ + +
+ + + + + + + + + + + + + + +
15870
.tttrrrrggggbbbb
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
15 unused (?)
12-14ttransparency
8-11rred channel
4-7ggreen channel
0-3bblue channel
+
+
index
+

+ +17.11  RGB5A1

+
+Used for Icons and Banners on Memory Card. This Format uses no palette +and is stored in 4x4 pixel tiles. +
index
+

+ +17.11.1  RGB5A1 Pixel Format

+
+ + +
+ + + + + + + + + + + + + + +
15870
trrrrrgggggbbbbb
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
15ttransparency
10-14rred channel
5-9ggreen channel
0-4bblue channel
+
+

index
+

+ +17.12  RGB565

+
index
+

+ +17.12.1  RGB565 Pixel Format

+
+ + +
+ + + + + + + + + + + + + + +
15870
rrrrrggggggbbbbb
+
+ + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
11-15rred channel
5-10ggreen channel
0-4bblue channel
+
+

index
+

+ +17.13  RGBA8

+
index
+

+ +17.13.1  RGBA8 Pixel Format

+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + +
3124231615870
rrrrrrrrggggggggbbbbbbbbaaaaaaaa
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
bit(s) description
24-31rred channel
16-23ggreen channel
8-15bblue channel
0-7aalpha channel
+
+

index
+

+ +17.14  S3TC

+
+WARNING: this section is screwed! any advice/corrections/help/etcblabla +welcomed! (thanx to Aaron Kaluszka for pointing this out) +

+S3TC is a compression method for textures, developed by S3 and licenced +by Nintendo for the Gamecube (and also by Microsoft for DirectX 6.0). +It basically gives you one more MIP level for free, with relatively +small quality loss and a simple implementation in hardware. You basically +store 2 colour values and then you have a few bits per pixel to interpolate +between them. It works in blocks of 4x4 pixel.

+There are 5 variants:

+DXT1 allows one bit of alpha
+DXT2/3 allows 4 bits of alpha
+DXT4/5 stores 2 alpha values and has 3 bits to interpolate between +them

+The difference between DXT2/3 and 4/5 is, if colour values are pre-multiplied +with alpha. The blending equation is normally (c*(1-a))+(t*a)), +so with pre-multiplied alpha the texture contains (t*a) in each +colour channel and the blending becomes (c*(1-a) + t).

+Each image is made up of tiles placed linearly from left to right +then top to bottom.

+Each tile is made up of 4 blocks

+0 1
+2 3

+Each block is made up of 8 words.  These 8 words represent 16 pixels +using S3TC compression.

+RRRRRGGG - GGGBBBBB - rrrrrggg - gggbbbbb - 00112233 - 44556677 - +8899UUVV- WWXXYYZZ

+R = Color 0 Red
+G = Color 0 Green
+B = Color 0 Blue
+r = Color 3 Red
+g = Color 3 Green
+b = Color 3 Blue
+0 - 9, U - Z = Pixel color (2-bits each)
+Colors 1 and 2 are interpolated from colors 0 and 3

+The tiles are 32 bytes each. Depending on the image format the width +and height of the tiles will differ. A 16bit format (ie RGB5 or RGB4A3) +will have a 4x4 pixel tile since 4 * 4 * 2 bytes = 32. An 8bit +format (ie Color Indexed) will have a 8x4 pixel tile since 8 * 4 +* 1 byte = 32.

+So a 32x32 image (like a memory card icon) that is in RGB5 format +would be 8 tiles across and 8 tiles down.

index
+

+ +17.14.1  CMPR

+
+Like a usual texture, a CMPR-texture is divided on tiles, each 32-bytes +to fit a texture cache line. Every tile is sub-tiled into four parts, +in zigzag order : + + + + + + + + + +
01
23
+
+The format of the sub-tiles is pretty simple, and looks like DXT1. +First two base colors in RGB565, followed by 16 sub-tile texels. Every +texel is 2-bit wide, to lookup from four colors : 00, 01, 10 and 11. +First two are given already, and last two are interpolated from first +ones, by the following rule : + +
index
+

+ +18  Appendix

+
index
+

+ +18.1  GCC Quick How To

+
index
+

+ +18.1.1  compile ASM to object:

+
<DEVKITCUBE>/bin/powerpc-eabi-elf-as -c
-I <DEVKITCUBE>/powerpc-eabi-elf/include -I <additional includes> +
testasm.s -o testasm.o
index
+

+ +18.1.2  compile C to object:

+
<DEVKITCUBE>/bin/powerpc-eabi-elf-gcc -c
-I <DEVKITCUBE>/powerpc-eabi-elf/include -I <additional includes> +
-nostdlib testc.c -o testc.o
index
+

+ +18.1.3  compile C++ to object:

+
<DEVKITCUBE>/bin/powerpc-eabi-elf-g++ -c
-I <DEVKITCUBE>/powerpc-eabi-elf/include -I <additional includes> +
-nostdlib -fno-exceptions testcpp.cpp -o testcpp.o
index
+

+ +18.1.4  link objects

+
<DEVKITCUBE>/bin/powerpc-eabi-elf-ld -T ppc-ngcbin.x -o test.elf +crt0.o
<DEVKITCUBE>/lib/gcc-lib/powerpc-eabi-elf/3.3/crtbegin.o
<DEVKITCUBE>/lib/gcc-lib/powerpc-eabi-elf/3.3/crtend.o
testasm.o testc.o testcpp.o -lg -lstdc++ -lm -lc -lnosys 
 
+you only need to link against crtbegin.o/crtend.o if you are using +c++, and you only need -lg,-lstdc++,-lc,-lm if you are actually using +these libraries (of course:)). however if you do so, linking against +-lnosys as well is essential. +
index
+

+ +18.1.5  remove unneeded sections (debug info etc) from object

+
<DEVKITCUBE>/bin/powerpc-eabi-elf-strip -s test.elf
index
+

+ +18.1.6  convert object to plain binary

+
<DEVKITCUBE>/bin/powerpc-eabi-elf-objcopy -O binary test.elf +test.bin
index
+

+ +18.1.7  convert absolute address into filename/line number/function

+
+compile with "-g" flag, then use

<DEVKITCUBE>/bin/powerpc-eabi-elf-addr2line -f -e test.elf +0x80003100
index
+

+ +18.1.8  Building a Crosscompiler

+
+configure options:
--target=powerpc-eabi-elf
--with-cpu=750
--disable-threads
--enable-languages=c
--disable-shared
--disable-nls
--with-newlib
index
+

+ +18.1.9  Linker Script

+
+to do +
index
+

+ +18.1.10  Startup Code

+
+to do +
index
+

+ +18.2  Boot Process Details

+
+The IPL (Initial Program Loader), or Bootrom, is located inside one +Macronix chip (near Flipper, U10) and connected to the EXI bus. When +the Gamecube is powered on, bit 25 (IP) in the Machine State Register +is set, which means the system exception vector offset is 0xfff00000. +Then a small (about 0x0700 bytes) program called 'BS' will be mapped +to 0xfff00100 (the hardware reset vector) and control will +be returned to the Gamecube like after a normal reset, which means +'BS' will be started. +
index
+

+ +18.2.1  BS - Bootstrap 1

+
+
index
+

+ +18.2.2  BS2 - Bootstrap 2

+
+BS2 is the Program that loads the game or shows the menus when the +gamecube has been powered on without a game inserted. It was written +in C, using official SDK libraries, probably earlier than 1.0. __start.c +seems to be same as usual, except that there is no OSInit() call (old +versions must call OSInit() in main, instead of __start).

+note: this has been reversed from a PAL gamecube and looks different +on a NTSC one.
18.2.2.1 +   short description of start() routine. +
+
 
// 81300000
__start:
    __init_registers() // set stack pointer and static +bases (r2, r13)
    __init_hardware() // paired-singles and cache init
    __init_data() // clear bss ?
    . // here goes Debug Monitor stuff
    .
    .
    DBInit() // debug monitor init :)
    __init_user() // cpp init
    main() // that's actually, IPL (BS2) code
    jmp exit() // halt CPU
18.2.2.2 +   IPL main() reversing +
+
 
// 813006D4
main()
{
    BS2Init();
    OSInit();
    AD16Init();
    AD16WriteReg(0x800);
    DVDInit();
    AD16WriteReg(0x900);
    CARDInit();
    AD16WriteReg(0xa00);
    0x81302104(); // SRAM, real-time clock (check ?)
    __VIInit(0);
    VIInit();
    AD16WriteReg(0xb00);
    0x813004e4(); // setup performance. monitor
    0x8130222c(); // update time-base by SRAM clock
    0x813022c0(); // perform initial DVD actions and fall +back into menu
    PADSetSpec(5); // sed PAD type ('spec') to 'production'
    PADInit();
    AD16WriteReg(0xc00);
    BS2Menu(); // here goes intro and main menu... (BIG +one!)
    OSPanic(__FILE__, __LINE__, "BS2 +ERROR > > > SHOULD NEVER REAC
+HERE");

}
float NaN;
// 8130045C
void BS2Init()
{
    // clear LoMem and OSMem
    memset(0x80000000, 0, 256);
    memset(0x80003000, 0, 256);
    BATInit();
    // set memory size to 24MB
    *0x80000028 = 0x01800000;
    // set console type to default retail 1
    *0x8000002c = 1;
    // upgrade retail
    *0x8000002c += *0xcc00302c > > +28;
    (u32)NaN = -1;
    FPUInit();
}
// 813003A0
void BATInit()
{
    __asm
    {
        isync
        li r4, 0
        mtspr DBAT2L, r4
        mtspr DBAT2U, r4
        mtspr DBAT3L, r4
        mtspr DBAT3U, r4
        mtspr IBAT1L, r4
        mtspr IBAT1U, r4
        mtspr IBAT2L, r4
        mtspr IBAT2U, r4
        mtspr IBAT3L, r4
        mtspr IBAT3U, r4
        isync
    }
}
// 813003D8
void FPUInit()
{
    // FPU already initialized in __start(),
    // so just invalidate all FPRs.
    __asm
    {
    lfs f0, NaN
    fmr f1, f0
    fmr f2, f0
    fmr f3, f0
    . e
    . t
    . c
    fmr f31, f0
    }
}
// maybe later
0x81302104()
{
    __OSLockSram();
    __OSCheckSram();
    __OSGetRTC();
    OSTickToCalendarTime();
    memset();
    __OSUnlockSram();
    __OSSyncSram();
}
// maybe later
0x813004e4()
{
    OSDisableInterrupts();
    OSGetTick();
    OSGetTick();
    OSGetTick();
    __div2i();
    __div2i();
    PPCMtpmc1();
    PPCMtmmcr0();
    OSGetTick();
    OSGetTick();
    PPCMtmmcr0();
    PPCMfpmc1();
    __div2i();
    __div2i();
    __div2i();
    OSRestoreInterrupts();
}
// maybe later
0x8130222c()
{
    __OSLockSram();
    __OSGetRTC();
    __OSSetTime();
    __OSUnlockSram();
}
static int BS2State = 0;
// just layer..
0x813022c0()
{
    BS2State = BS2Mach();
}
// 81300A70
// located in __FILE__ = "BS2Mach.c"
int BS2Mach()
{
    static int state = 0;
    BOOL level = OSDisableInterrupts();
    switch(state)
    {
        case 0:
            [r13 - 0x7dc8] = 0x800030d4;
            state = 1;
        case 1:
            __OSGetSystemTime();
... some checks
            if(fail) break;
            state = 2;
        // Install DVD cover callback
        case 2:
            if([r13 - 0x7da8] == 0)
            {
                    r3 = [r13 - 0x7dc8]
                    [r3] = 0
                    [r13 - 0x7dc4] = +0
                    [r13 - 0x7dac] = +1
                    DVDLowSetResetCoverCallback(0);
                    DVDReset();
                    [r13 - 0x7da8] = +1
                    (s64)[r13 - 0x7d9c] += __OSGetSystemTime();
                break;
            }
            __OSGetSystemTime();



            if(fail) break;
            DVDLowSetResetCoverCallback(0x813007d8);
            DVDReset();
            state = 3;
        // Read Disk information (ID)
        case 3:
            DVDReadDiskID(0x8145e620 + 64, 0x80000000, +0x813007e4);
            state = 4;
        break;
.
.
.
        // Leave immediately ?
        case 16:
            break;
        default:
            OSPanic(__FILE__, __LINE__, +"BS2 ERROR > > UNKNOWN STATE");
    }
    OSRestoreInterrupts(level);
    return (DVDLowGetCoverStatus() == 1) ? 19 : step;
}
// 81301154
void BS2Menu()
{
    BS2InitAlloc();
}
static OSHeapHandler BS2Heap;
// 81307EA8
void BS2InitAlloc()
{
    u8 *arenaLo;
    u8 *arenaHi;
    u8 *arenaNew;
    arenaLo = OSGetArenaLo();
    arenaLo = (void *)OSRoundUp32B(arenaLo);
    arenaHi = OSGetArenaHi();
    arenaHi = (void *)OSRoundDown32B(arenaHi);
    arenaNew = OSInitAlloc(0x80800000, arenaHi, 2);
    OSSetArenaLo(arenaHi);
    BS2Heap = OSCreateHeap(arenaLo, arenaHi);
    OSSetCurrentHeap(BS2Heap);
    OSAddToHeap(BS2Heap, arenaNew, 0x81100000);
    BS2CheckAlloc();
}
// 81307F34
void BS2CheckAlloc()
{
    OSCheckHeap(BS2Heap);
}
// 81307F58
void *OSAlloc(long size)
{
    void *ptr;
    if((ptr = OSAlloc(size)) == 0)
    {
        OSPanic(?);
    }
    return ptr;
} 
18.2.2.3 +   Map of IPL Library code +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AddressNameLibray
0x813014C8DEMOInit (*)DEMO
0x81307F58OSAlloc (*)OS
0x813327BCPPCMtmmcr0 
0x813327C4PPCMfpmc1 
0x813327CCPPCMtpmc1 
0x81332814OSInitOS
0x81332EF0OSInitAlarmOS
0x81332F3COSCreateAlarm 
0x81333688OSAllocFromHeap 
0x81333784OSSetCurrentHeap 
0x81333794OSInitAlloc 
0x81333804OSCreateHeap 
0x81333870OSAddToHeap 
0x813338D0OSCheckHeap 
0x813344C0OSGetStackPointer 
0x8133491COSReport 
0x8133499COSPanic 
0x81334AA4PPCHalt 
0x81334D4CEXIImmEXI
0x81335134EXISync 
0x813353C8EXIProbeReset 
0x8133570CEXISelect 
0x81335838EXIDeselect 
0x81335D6CEXILock 
0x81335E60EXIUnlock 
0x81335F54AD16Init 
0x81336090AD16WriteReg 
0x813361B0OSDisableInterrupts 
0x813361C4OSEnableInterrupts 
0x813361D8OSRestoreInterrupts 
0x81336DD8__OSGetRTC 
0x813372B0__OSLockSram 
0x81337658__OSUnlockSram 
0x813376A0__OSSyncSram 
0x813376B0__OSCheckSram 
0x81338504OSInitThreadQueue 
0x8133939COSGetTick 
0x813393B8__OSSetTime 
0x8133943C__OSGetSystemTime 
0x8133963COSTicksToCalendarTime 
0x8133AC50DVDLowGetCoverStatusDVD
0x8133AB18DVDLowReset 
0x8133ABD4DVDLowSetResetCoverCallback 
0x8133B5F0DVDInit 
0x8133CD18DVDReadDiskID 
0x8133D0ECDVDReset 
0x8133DBE0__VIInitVI
0x8133DDC8VIInit 
0x8133E6C0VIConfigure 
0x8133F0B4VIGetTvFormat 
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AddressNameLibray
0x8134052cPADInitPAD
0x8134092cPADSetSpec 
0x81343114CARDInit 
0x813480D4GXInit 
0x81349148GXInitFifoBase 
0x81349230GXSetCPUFifo 
0x81349340GXSetGPFifo 
0x813494B8__GXFifoInit 
0x8134B0AC__GXPEInit 
0x8135A178__div2i gcc
0x8135A394__mod2igcc
0x8135B494vprintfstdlib
+
+
+(*) these functions were slightly modified for the IPL. +
index
+

+ +18.2.3  Apploader

+
+The Apploader provides functions to the bootrom that load the game +(using bootrom read DVD functions). The bootrom calls the Init function, +then the Main function in a loop, then the Closing function. At first, +the BIOS calls the Apploader entrypoint with r3, r4, and r5 pointing +to a free space for a 32 bit value.

// info based on Luigi Mansion appldr.bin file
// (built date is 17 Dec 2001).
// Apploader Entrypoint
// Input values :
// r3 = Address where to put the address of the Init function
// r4 = Address where to put the address of the Main Loading +function
// r5 = Address where to put the address of the Closing function
// Return values :
// none
//
// file:[0010-0013] = 0x81200288 (apploader entrypoint)
void Entrypoint(r3, r4, r5)
{
    [r3] = 0x81200290 // Init
    [r4] = 0x81200580 // Main
    [r5] = 0x81200D50 // Close
}
// Init function
// Input values :
// ?
// Return values :
// none
void Init(void (*OSReport)(char *fmt, ...))
{
    // clear some important memory areas
    memset(OSAppLdr + 32, 0, 32);
    memset(&OSAppLdr.DolImage, 0, sizeof(DolImage));
    [+0x140] = 0
    OSAppLdr.pass = 0
    [+0x148] = 0
    OSAppLdr.OSReport = OSReport // save report callback
    OSAppLdr.OSReport("Apploader Initialized. $ +Revision: 28 $n");
    OSAppLdr.OSReport("This Apploader built %s +%sn", __DATE__, __TIME__);
}
// Main Loader function
//
// Input values :
// r3 = Address where to put the Memory destination of the +disk read
// r4 = Address where to put the Size of the disk read
// r5 = Address where to put the Starting position of the +disk read
//
// Return value:
// r3 = 0 if everything is already loaded
// = 1 (or !=0) if main function should be called again
//
// at 0x81200580
// helper functions (below)
u32 DOLSize(void);
// 0x812013E0 seems to be a big structure, like that :
struct OSAppLdr
{
    // untouched
    u32 SecondTimeForThePart;
    u8 [28]
    u8 [32] // "BB2" structure ?
    DolImage DolImage; // main DOL executable header
    // flags or something
    u32 +0x140
    u32 pass; // 0...12
    u32 +0x148
    // report routine itself is placed somewhere in bootrom
    void (*OSReport)(char *fmt, ...);
    // flags or something
    u32 +0x150
    u32 +0x154
    u32 +0x158
    u32 +0x15C
    u8 [32]
} OSAppLdr; // 0x174 total
int Main(r3, r4, r5)
{
    int pass = OSAppLdr.pass;
    if(pass <= 12)
    {
        switch(pass)
        {
            // read "BB2" structure +(DVD offset at 0x0420)
            case 0:
            case 1:
                // "BB2" +structure ?
                // 0420-0424 offset of main +executable DOL
                // 0424-0427 offset of the +FST
                // 0428-042B size of FST
                // 042C-042F maximum size +of FST
                [r3] = OSAppLdr + 32
                [r4] = 32
                [r5] = 0x420
                OSAppLdr.pass = 2
                DCInvalidateRange([r3], +[r4])
            break;
            // check "BB2" structure +FST sizes
            case 2:
                FSTLength = [OSAppLdr + +32 + 8]
                FSTMaxLength = [OSAppLdr ++ 32 + 12]
                if(FSTLength > FSTMaxLength)
                {
                    OSAppLdr.OSReport(
                    "APPLOADER +ERROR > > > FSTLength(%d) i
+BB2 is greater

                    than FSTMaxLength(%d)n", +FSTLength, FSTMaxLength);
                    PPCHalt();
                }
                [r3] = OSAppLdr + 0x160
                [r4] = 32
                [r5] = 0x440
                OSAppLdr.pass = 3
                DCInvalidateRange([r3], +[r4])
            break;
            case 3:
                [0x800000E8] = [OSAppLdr ++ 0x160] // word
            break;
            case 4:
            // load main DOL header (256 bytes)
            case 5:
                [r3] = &OSAppLdr.DolImage
                [r4] = 256
                [r5] = [OSAppLdr + 32] +// from BB2
                OSAppLdr.pass = 6
                DCInvalidateRange([r3], +[r4])
            break;
            case 6:
                totalSize = DOLSize();
                maxSize = [[800000F4] ++ 0x28]; // PadSpec ?
                if((totalSize > maxSize) && +maxSize)
                {
                    OSAppLdr.OSReport(
                    "APPLOADER +ERROR > > > Total size of text/dat
+sections

                    of the dol file are +too big (%d(0x%08x) bytes). Currently
                    the limit is set as +%d(0x%08x) bytesn", totalSize, maxSize);
                    PPCHalt();
                }
.
.
.
            case 7:
            case 8:
            case 9:
            case 10:
            case 11:
            case 12:
                if(SecondTimeForThePart == +TRUE)
                {
                    OSAppLdr.OSReport(
                    "Failed assertion +SecondTimeForThePart == TRUE");
                    PPCHalt();
                }
.
.
.
            break;
            }
        return 1;
    }
    else
    {
        return 0;
    }
}
// helper functions
// at 0x81200338
u32 DOLSize(void)
{
    DolImage *dol = &OSAppLdr.DolImage;
    u32 totalBytes = 0;
    int i;
    for(i=0; i<DOL_MAX_TEXT; i++)
    {
        if(dol->textData[i])
        {
        // aligned to 32 byte boundary
        totalBytes += (dol->textLen[i] + 31) & +~31;
        }
    }
    for(i=0; i<DOL_MAX_DATA; i++)
    {
        if(dol->dataData[i])
        {
            // aligned to 32 byte boundary
            totalBytes += (dol->dataLen[i] + +31) & ~31;
        }
    }
    return totalBytes;
}
// Closing function
//
// Return value: r3 = entry point
//
// at 0x81200D50
u32 Close(void)
{
    // provide entrypoint of main DOL executable to IPL
    return OSAppLdr.DolImage.entry;
}
index
+

+ +18.2.4  Main DOL executable

+
index
+

+ +18.3  Game and Maker Codes

+
index
+

+ +18.3.1  Gamecodes

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
offsetsizeDescription
11System ID
   + + + + + + + + + + + + + + + + + + + + + +
valueidDescription
0x47GGamecube (standard value)
0x44D + + + +
used by Legend Of Zelda: Ocarina Of Time (Master Quest)
Might be a indicator for emulated/ported/promotional titles.
+
0x55Uused by GBA-Player Boot CD
+
2-32Game ID/serial Number
41Country/Region Code
   + + + + + + + + + + + + + + + + + + + + + + + + + + +
valueidCountry
0x45EUSA/NTSC
0x50PEurope/PAL
0x4aJJapan/NTSC
0x55Uused by the European version of The Legend Of Zelda: Ocarina Of Time +(Master Quest)
+
+
+
index
+

+ +18.3.2  Game Serial ID

+
+ + + + + + + + + + + + + + + + + + + + + +
CharactersDescription
3System ID 'DOL'
4Gamecode
3Country ID
  + + + + + + + + + + + + + + + + + + + + + +
IDCountry
USAguess what :)
NOENintendo of Europe
NOANintendo of America
JPNJapan
+
+
+

+for example + +
index
+

+ +18.3.3  Makercodes

+
+The ID (2 Bytes ASCII) belongs to the publisher, not the developer. +Hence, even though Rare developed Star Fox Adventures, and Retro Studios +developed Metroid Prime, they both have the Vendor ID of Nintendo +(01).
+It is unknown how vendor IDs are allocated; However, all IDs thus +far seem to be alphanumeric. If this is accurate, then as a result +the maximum number of unique vendors is 1,296. Vendor IDs seem to +be region-independent.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDVendor
01Nintendo
08Capcom
41Ubisoft
4FEidos
51Acclaim
52Activision
5DMidway
5GHudson
64Lucas Arts
69Electronic Arts
6STDK Mediactive
8PSega
A4Mirage Studios
AFNamco
B2Bandai
DATomy
EMKonami
+
+
index
+

+ +18.4  Macronix Chip IDs

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 MX ff t mm b p r s
MXMX', vendor id
ff2 digits, device family
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
17auto focus controller
23mask rom
25spi serial flash memory
26mtp eeprom
27eeprom
28flash memory
29flash memory (single voltage)
53memory card (smc)
67flash memory
69flash memory + sram (stacked chip)
88digital camera/flat panel display controller
89flat panel display controller
92sound generator
93single chip answering machine/digital recorder controller
97isdn controller
98network
99bluetooth
+
t1 character, device type
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ccmos
fflash
llow-voltage
wsrw
v2.2v
u1.8v
x1.5v
vw2.25v+srw
+
mm2 to 4 digits, mode/density
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0044M, x8 Boot Block
0404M, x8 Equal Sector
4004M, x8/x16 Boot Block
  
  
  
  
  
  
  
  
  
+
b1 character, bootblock type (rom only)
  + + + + + + + + + +
ttop
bbottom
+
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 MX ff t mm b p r s
p1 character, package type
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pplastic dip
mplastic sop
qplastic plcc
ttsop normal
dqeramic dip
x80.8mm ball pitch, bga, csp
xcsp
+
r1 character, temperature range
  + + + + + + + + + + + + + +
ccommercial
iindustrial
mmilitary
+
s1 character, speed
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
4545ns
5555ns
7070ns
8585ns
9090ns
10100ns
12120ns
15150ns
20200ns
25250ns
+
+
+
index
+

+ +18.5  chip simelarities

+
+
index
+

+ +18.6  Easter Eggs

+
+
index
+

+ +18.7  Terms and Acronyms

+
+
index
+

+ +19  References

+
+
index
+

+ +19.1  Sources

+
+
index
+

+ +20  Credits

+
+besides freely available datasheets and patents, this document was +created based on information provided by the following people. if +you think you are missing in this list, please keep me informed so +i can add you immediately.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
titanik/crazy nation 
 'Gamecube Low-level Info' in CZN 'Gamecube Source pack #1'
duke/napalmduke@napalm-x.com
 initial "gcinfo.txt"
 some invaluable information (you know who you are)
costis costis@gbaemu.com, gcdev.com http://www.gcdev.com
 hardware introduction text (posted on some website...uhm :))
 gcspec.html
 additional info in sram checksum, video regs
org kvzorganic@mail.ru
 additional apploader info / apploader RE
 IPL RE, boot process details
 info on Gekko specific opcodes
 tons of other info (cheers mate)
torlus 
 gcc config
???www.gc-nfo.com
 some file-format info
Crowtrobo 
 ctr-snd.txt
 memory card info
Azimerhttp://www.apollo64.com
 some additional VI info
tmbincdebugmo.de http://debugmo.de +
 released some sources that helped to close the one or other gap
 driving force behind GX reversing
 IPL encryption reversing/IPL replacement info
shagkurshagkur@gmx.net
 GX reversing, additional sources/infos
Timothy Wilsontheimp@iinet.net.au
 compiled some valuable info concerning memory cards
Authors of GClibgclib.sf.net
 cross-checking against the Source helped to make sure no bad errors +sneaked in
GC-Linux Teamgc-linux.sf.net
 another valueable source for code that has been cross-checked against
Aaron Kaluszkamegabyte@kontek.net
 some image format info
Monkmonk@mad.scientist.com
 TPL Fileformat details
Steven Loomansteven@krx.nl
 keyboard scancodes, comments on adapters
thakishttp://www.amnoid.de/gc/
 lots of additonal fileformat info, proofreading&spellchecking
Alexander Wold (micropal)http://cube.iu.hio.no/~s104086/
 additional rtc/ipl pinout info
+
+
+moreover, many thanks must go to everyone who helped making this document +more consistant and error free by proofreading and pointing out mistakes, +in particular tmbinc, org, hubb, Aaron Kaluszka, Skywalker, Jihad, +xor37h, costis, CrowTrobo, mist, ionic, Briii, Desktopman, Spike Grobstein, +Steven Looman, Anders Montonen, Monk, Josiah "afnom" +Burroughs, Scream - CT, thakis ... (please check the changelog for details)


+
+ + diff --git a/docs/yet_another_gamecube_doc.pdf b/docs/yet_another_gamecube_doc.pdf new file mode 100644 index 0000000..eb0675d Binary files /dev/null and b/docs/yet_another_gamecube_doc.pdf differ