Programming Manual
Page 3
... using the C language, minimizing the cost of performance is to bring unique game ideas fully to life. AGB-06-0001-002B4 With its essential aim. While providing backwards compatibility with the enormous software resources available for AGB can become absorbed. In addition to the Controller. Furthermore, software for the 100 million Game Boy units in use worldwide, it consumes little power...
... using the C language, minimizing the cost of performance is to bring unique game ideas fully to life. AGB-06-0001-002B4 With its essential aim. While providing backwards compatibility with the enormous software resources available for AGB can become absorbed. In addition to the Controller. Furthermore, software for the 100 million Game Boy units in use worldwide, it consumes little power...
Programming Manual
Page 5
... 1) Normal Communication of Communication Functions, mentioned not to use of cable for normal SIO communication. -Modified the connection diagram of the multi-play cable. -Added the transition diagram of the multi-play communication data. -Modified the description of "16-Bit Multi-play Communication". -Modified the description of an error flag for the multi=play control register. -Modified the description of a valid flag...
... 1) Normal Communication of Communication Functions, mentioned not to use of cable for normal SIO communication. -Modified the connection diagram of the multi-play cable. -Added the transition diagram of the multi-play communication data. -Modified the description of "16-Bit Multi-play Communication". -Modified the description of an error flag for the multi=play control register. -Modified the description of a valid flag...
Programming Manual
Page 6
... the DMA valid flag of all the DMA control registers. -Added a caution in DMA3. *Updated the timing chart and the cable connection diagram for the multiplay communication. *Revised the description of the normal serial communication cautions. ©1999 - 2001 Nintendo of the multi-play control register. -Revised the multi-play communication diagram. -Added the description of the timing chart for...
... the DMA valid flag of all the DMA control registers. -Added a caution in DMA3. *Updated the timing chart and the cable connection diagram for the multiplay communication. *Revised the description of the normal serial communication cautions. ©1999 - 2001 Nintendo of the multi-play control register. -Revised the multi-play communication diagram. -Added the description of the timing chart for...
Programming Manual
Page 7
...communication. - Revised the summary of multi-play communication. - Added additional description in the caution for multi-play communication control register. - Changed the names of following registers according to header files provided by Nintendo. --Wait Control-- 204h WSCNT à WAITCNT --Color ...to LCD controller in "Using This Manual". - Added additional description of communication error flag of normal serial communication in the beginning paragraph. - AGB-06-0001-002B4 Modified the SIO timing chart for System Call Stop will not work. - Emphasized...
...communication. - Revised the summary of multi-play communication. - Added additional description in the caution for multi-play communication control register. - Changed the names of following registers according to header files provided by Nintendo. --Wait Control-- 204h WSCNT à WAITCNT --Color ...to LCD controller in "Using This Manual". - Added additional description of communication error flag of normal serial communication in the beginning paragraph. - AGB-06-0001-002B4 Modified the SIO timing chart for System Call Stop will not work. - Emphasized...
Programming Manual
Page 11
... BUS COMMUNICATION 150 13.6 AGB GAME LINK CABLE 154 14 KEY INPUT 155 14.1 KEY STATUS ...155 14.2 KEY INTERRUPT CONTROL 155 14.2.1 Interrupt Conditions 156 15 INTERRUPT CONTROL 157 15.1 SYSTEM-ALLOCATED AREA IN WORK RAM 159 15.2 INTERRUPT OPERATION 160 15.2.1 Normal Interrupt...160 15.2.2 Multiple Interrupts...161 16 POWER-DOWN FUNCTIONS 163 16.1 STOP...
... BUS COMMUNICATION 150 13.6 AGB GAME LINK CABLE 154 14 KEY INPUT 155 14.1 KEY STATUS ...155 14.2 KEY INTERRUPT CONTROL 155 14.2.1 Interrupt Conditions 156 15 INTERRUPT CONTROL 157 15.1 SYSTEM-ALLOCATED AREA IN WORK RAM 159 15.2 INTERRUPT OPERATION 160 15.2.1 Normal Interrupt...160 15.2.2 Multiple Interrupts...161 16 POWER-DOWN FUNCTIONS 163 16.1 STOP...
Programming Manual
Page 12
... be set to the general consumer. AGB Programming Manual Using This Manual Using This Manual Important terms and symbols used in this manual refers to the software developer, not to either 0 or 1. 3. Bit Length 8 bits 16 bits 32 bits Term Used byte half-word word 2. Abbreviations Nintendo's game hardware is abbreviated as follows: Ø DMG (Game Boy) Ø CGB (Game Boy Color) Ø AGB (Game Boy Advance) Ø DOL (Nintendo GameCube...
... be set to the general consumer. AGB Programming Manual Using This Manual Using This Manual Important terms and symbols used in this manual refers to the software developer, not to either 0 or 1. 3. Bit Length 8 bits 16 bits 32 bits Term Used byte half-word word 2. Abbreviations Nintendo's game hardware is abbreviated as follows: Ø DMG (Game Boy) Ø CGB (Game Boy Color) Ø AGB (Game Boy Advance) Ø DOL (Nintendo GameCube...
Programming Manual
Page 13
...13 D.C.N. AGB Programming Manual AGB System 1 AGB System 1.1 System Overview AGB is a portable game device that match or surpass the Super Nintendo Entertainment System (Super NES) in /fade-out, and mosaic) 4 image system modes Operation Operating keys (A, B, L, R, START, SELECT, and Control Pad) Sound 4 ... ©1999 - 2001 Nintendo of games that maintains downward compatibility with CGB Integral 8-bit CISC CPU for compatibility (However, it cannot operate at the same time as the AGB CPU.) Memory System ROM Working RAM VRAM OAM Palette RAM Game Pak memory 16 Kbytes (and 2 Kbytes...
...13 D.C.N. AGB Programming Manual AGB System 1 AGB System 1.1 System Overview AGB is a portable game device that match or surpass the Super Nintendo Entertainment System (Super NES) in /fade-out, and mosaic) 4 image system modes Operation Operating keys (A, B, L, R, START, SELECT, and Control Pad) Sound 4 ... ©1999 - 2001 Nintendo of games that maintains downward compatibility with CGB Integral 8-bit CISC CPU for compatibility (However, it cannot operate at the same time as the AGB CPU.) Memory System ROM Working RAM VRAM OAM Palette RAM Game Pak memory 16 Kbytes (and 2 Kbytes...
Programming Manual
Page 17
... is obtained when programs that operate from the Game Pak use 16-bit instructions (16-bit compiler), and those that operate from CPU Internal Working RAM use 32-bit instructions (32-bit compiler). 2.4 Little-Endian In the AGB CPU, memory addresses are allocated in 8-bit... - 2001 Nintendo of America Inc. 17 D.C.N. AGB Programming Manual System Configuration 2.3 Memory Configuration and Access Width Memory Type OAM Palette RAM VRAM CPU Internal Working RAM CPU External Working RAM Internal registers Game Pak ROM (Mask ROM, Flash Memory) Game Pak RAM (SRAM, Flash Memory) Bus Width...
... is obtained when programs that operate from the Game Pak use 16-bit instructions (16-bit compiler), and those that operate from CPU Internal Working RAM use 32-bit instructions (32-bit compiler). 2.4 Little-Endian In the AGB CPU, memory addresses are allocated in 8-bit... - 2001 Nintendo of America Inc. 17 D.C.N. AGB Programming Manual System Configuration 2.3 Memory Configuration and Access Width Memory Type OAM Palette RAM VRAM CPU Internal Working RAM CPU External Working RAM Internal registers Game Pak ROM (Mask ROM, Flash Memory) Game Pak RAM (SRAM, Flash Memory) Bus Width...
Programming Manual
Page 20
... or Flash Memory can be accessed using Nintendo's library. ©1999 - 2001 Nintendo of the 3 spaces are 08000000h for Wait State 0, 0A000000h for Wait State 1, and 0C000000h for saving data. 2) Game Pak RAM The area beginning from 08000000h. The access speed of each space is the Game Pak RAM area. Up to the specifications, any Game Pak device...
... or Flash Memory can be accessed using Nintendo's library. ©1999 - 2001 Nintendo of the 3 spaces are 08000000h for Wait State 0, 0A000000h for Wait State 1, and 0C000000h for saving data. 2) Game Pak RAM The area beginning from 08000000h. The access speed of each space is the Game Pak RAM area. Up to the specifications, any Game Pak device...
Programming Manual
Page 21
...Manual AGB Memory 3.3 Game Pak Memory Wait Control Although the 32 MB Game Pak memory space is mapped to the area from 08000000h onward, the 32 MB spaces beginning from the Game Pak ROM and there is a wait based on the set wait state. ©1999 - 2001 Nintendo...Control WAITCNT [d15] Game Pak Type Flag The System ROM uses this. When the CPU tries to read instructions from the Game Pak and if it , and reads Game Pak ROM data repeatedly. WAITCNT [d14] Prefetch Buffer Flag When the Prefetch Buffer Flag is enabled and there is some free space, the Prefetch Buffer takes control of the Game...
...Manual AGB Memory 3.3 Game Pak Memory Wait Control Although the 32 MB Game Pak memory space is mapped to the area from 08000000h onward, the 32 MB spaces beginning from the Game Pak ROM and there is a wait based on the set wait state. ©1999 - 2001 Nintendo...Control WAITCNT [d15] Game Pak Type Flag The System ROM uses this. When the CPU tries to read instructions from the Game Pak and if it , and reads Game Pak ROM data repeatedly. WAITCNT [d14] Prefetch Buffer Flag When the Prefetch Buffer Flag is enabled and there is some free space, the Prefetch Buffer takes control of the Game...
Programming Manual
Page 22
... 00(No Output). AGB Programming Manual AGB Memory If the Prefetch Buffer Flag is disabled, the fetch is 000. There is a wait based on the wait state associated with the actual manufactured product, the specifications are using . In this case, set . WAITCNT [d12 - 11] PHI Terminal Output Control Controls the output from the Game Pak ROM. WAITCNT [d01...
... 00(No Output). AGB Programming Manual AGB Memory If the Prefetch Buffer Flag is disabled, the fetch is 000. There is a wait based on the wait state associated with the actual manufactured product, the specifications are using . In this case, set . WAITCNT [d12 - 11] PHI Terminal Output Control Controls the output from the Game Pak ROM. WAITCNT [d01...
Programming Manual
Page 31
...-in/Fade-out *6 Screen priority specification (2 bits) [Note] In mode 3, one frame memory is available that of BG rotation/scaling and bitmap BG scrolling. (See "6.1.8 BG Scrolling" and "6.1.7 BG Rotation and Scaling Features".) ©1999 - 2001 Nintendo of America Inc. 31 D.C.N. AGB Programming Manual Image System 5.1 BG Modes 5.1.1 Details of BG Modes In AGB, changing...
...-in/Fade-out *6 Screen priority specification (2 bits) [Note] In mode 3, one frame memory is available that of BG rotation/scaling and bitmap BG scrolling. (See "6.1.8 BG Scrolling" and "6.1.7 BG Rotation and Scaling Features".) ©1999 - 2001 Nintendo of America Inc. 31 D.C.N. AGB Programming Manual Image System 5.1 BG Modes 5.1.1 Details of BG Modes In AGB, changing...
Programming Manual
Page 63
...specification for OBJ Attribute 1. [d13] Color Mode Flag Specifies whether the OBJ data format is a prohibited code. AGB-06-0001-002B4 AGB Programming Manual... Rendering Functions OBJ Attribute 0 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 y-coordinate Rotation/Scaling Flag 0: OFF 1: ON Rotation/Scaling Double-Size Flag 0: single-fold 1: double angle OBJ Mode 00: normal OBL 01: semi-transparent OBJ 10: OBJ window 11: Prohibited code... 00: Square 01: Horizontal Rectangle 10: Vertical Rectangle 11: Prohibited Code [d15-14] OBJ Shape Selects the OBJ Character Shape: Square, ...
...specification for OBJ Attribute 1. [d13] Color Mode Flag Specifies whether the OBJ data format is a prohibited code. AGB-06-0001-002B4 AGB Programming Manual... Rendering Functions OBJ Attribute 0 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 y-coordinate Rotation/Scaling Flag 0: OFF 1: ON Rotation/Scaling Double-Size Flag 0: single-fold 1: double angle OBJ Mode 00: normal OBL 01: semi-transparent OBJ 10: OBJ window 11: Prohibited code... 00: Square 01: Horizontal Rectangle 10: Vertical Rectangle 11: Prohibited Code [d15-14] OBJ Shape Selects the OBJ Character Shape: Square, ...
Programming Manual
Page 85
... sound FIFO (8-word capacity), using timers 0 and 1. Using sound control register SOUNDCNT_H (refer to 10.7 "Sound Control"), select the timer channel to be set to a bias level of 00h and are set to an arbitrary value using the sound FIFO transfer mode of linear audio data to -128), obtained by 2's complement. AGB Programming Manual Sound 10.2 Direct Sounds...
... sound FIFO (8-word capacity), using timers 0 and 1. Using sound control register SOUNDCNT_H (refer to 10.7 "Sound Control"), select the timer channel to be set to a bias level of 00h and are set to an arbitrary value using the sound FIFO transfer mode of linear audio data to -128), obtained by 2's complement. AGB Programming Manual Sound 10.2 Direct Sounds...
Programming Manual
Page 119
... during a display interval and start. Synchronize with a setting of the specified word count has been completed. When set to use it cannot be freed of the DMA transfer can selected from the Game Pak. [Note] A Game Pak that supports this accompanies OAM access, the H-blanking interval must first... V-blanking Interval Starts at the same time as a Game Pak interrupt. In addition, it . With a setting of America Inc. 119 D.C.N. With a setting of 1, the data are transferred by DMA in 32-bit (word) units. ©1999 - 2001 Nintendo of 0, the data are transferred by DMA in order ...
... during a display interval and start. Synchronize with a setting of the specified word count has been completed. When set to use it cannot be freed of the DMA transfer can selected from the Game Pak. [Note] A Game Pak that supports this accompanies OAM access, the H-blanking interval must first... V-blanking Interval Starts at the same time as a Game Pak interrupt. In addition, it . With a setting of America Inc. 119 D.C.N. With a setting of 1, the data are transferred by DMA in 32-bit (word) units. ©1999 - 2001 Nintendo of 0, the data are transferred by DMA in order ...
Programming Manual
Page 122
...used . However, there are some problems with H-blank, V-blank, Direct sound (DMA1,2), and Display (DMA3) (DMA repeat). The DMA automatically stops after it is actually written at the 2nd clock of the STR command.) ©1999 - 2001 Nintendo of the Game Pak side: 0 (Disabled) (DMA3 only) -DMA repeat : 0 (OFF) -Other control... For example, it becomes 0. 2) When the DMA repeat function is used , stop the DMA safely by clearing an enabled flag before the next start trigger is sent by using the following settings in H-blank and V-blank mode. When the word count's data transfer ...
...used . However, there are some problems with H-blank, V-blank, Direct sound (DMA1,2), and Display (DMA3) (DMA repeat). The DMA automatically stops after it is actually written at the 2nd clock of the STR command.) ©1999 - 2001 Nintendo of the Game Pak side: 0 (Disabled) (DMA3 only) -DMA repeat : 0 (OFF) -Other control... For example, it becomes 0. 2) When the DMA repeat function is used , stop the DMA safely by clearing an enabled flag before the next start trigger is sent by using the following settings in H-blank and V-blank mode. When the word count's data transfer ...
Programming Manual
Page 127
... are examples of communication problems. -When a peripheral device that are set different bits of America Inc. 127 D.C.N. AGB-06-0001-002B4 When this , the communication circuit will be reset. [Cautions for Communication Function] For communication, take into consideration a case in order to codes that is not supported is connected -When different software is connected to other device -When...
... are examples of communication problems. -When a peripheral device that are set different bits of America Inc. 127 D.C.N. AGB-06-0001-002B4 When this , the communication circuit will be reset. [Cautions for Communication Function] For communication, take into consideration a case in order to codes that is not supported is connected -When different software is connected to other device -When...
Programming Manual
Page 132
AGB-06-0001-002B4 Communication cannot be a one-way communication due to cable connection of multiplay communication ©1999 - 2001 Nintendo of America Inc. 132 D.C.N. AGB Programming Manual Communication Functions Always set a communication speed at 2MHz. Also, please note it will be done properly at 256KHz when performing normal communication with the AGB Game Link cable.
AGB-06-0001-002B4 Communication cannot be a one-way communication due to cable connection of multiplay communication ©1999 - 2001 Nintendo of America Inc. 132 D.C.N. AGB Programming Manual Communication Functions Always set a communication speed at 2MHz. Also, please note it will be done properly at 256KHz when performing normal communication with the AGB Game Link cable.
Programming Manual
Page 160
...(R0~R3, R12, LR_irq (former PC)) to the Interrupt Stack. For further details on the following page. ©1999 - 2001 Nintendo of multiple interrupts that is 6 words. For the latter method, see the explanation ...control shifts to the Monitor ROM. Next, call the user interrupt processing set up in some cases. Commands called from the monitor directly must be in 32bit code format. 03007F00 USR Stack 03007FA0 SP_usr IRQ Stack 6 WORDS SP_irq 03007FE0 SVC Stack SP_svc 03007F00 03007FA0 2) User interrupt processing is used for both, by moving SP_usr in advance or use user...
...(R0~R3, R12, LR_irq (former PC)) to the Interrupt Stack. For further details on the following page. ©1999 - 2001 Nintendo of multiple interrupts that is 6 words. For the latter method, see the explanation ...control shifts to the Monitor ROM. Next, call the user interrupt processing set up in some cases. Commands called from the monitor directly must be in 32bit code format. 03007F00 USR Stack 03007FA0 SP_usr IRQ Stack 6 WORDS SP_irq 03007FE0 SVC Stack SP_svc 03007F00 03007FA0 2) User interrupt processing is used for both, by moving SP_usr in advance or use user...
Programming Manual
Page 161
....2.2 Multiple Interrupts 1) If an interrupt occurs, the CPU enters IRQ mode and control shifts to user mode with system mode = privilege here.) and IRQ is enabled. à With user interrupt processing, user stack is used because the CPU is 6 words. The total is in system mode. When...must be in 03007FFCh. AGB-06-0001-002B4 Next, call the user interrupt processing set up in 32bit code format. 03007F00 USR Stack 03007FA0 SP_usr IRQ Stack 6 WORDS SP-irq 03007FE0 SVC Stack SP_svc 03007F00 03007FA0 2) User interrupt processing is done (you can reference the cause of America ...
....2.2 Multiple Interrupts 1) If an interrupt occurs, the CPU enters IRQ mode and control shifts to user mode with system mode = privilege here.) and IRQ is enabled. à With user interrupt processing, user stack is used because the CPU is 6 words. The total is in system mode. When...must be in 03007FFCh. AGB-06-0001-002B4 Next, call the user interrupt processing set up in 32bit code format. 03007F00 USR Stack 03007FA0 SP_usr IRQ Stack 6 WORDS SP-irq 03007FE0 SVC Stack SP_svc 03007F00 03007FA0 2) User interrupt processing is done (you can reference the cause of America ...