Manual
Page 4
... need additional documents for Nintendo Super Game Boy speciffic programming by GABY (GAmeBoY). It contains opcodes, time ...duration and the affected flags per ASM command and the. Have fun! you programming the Game BoyTM Classic, Game BoyTM Pocket, Super Game BoyTM and Game... by Pan of three major parts. See paragraph 3. Foreword Game BoyTM CPU Manual 1. The documents consists of Anthrox, Marat Fayzullin... a typical read and write operation on a real Game Boy can be found in paragraph 2. Information on how ...
... need additional documents for Nintendo Super Game Boy speciffic programming by GABY (GAmeBoY). It contains opcodes, time ...duration and the affected flags per ASM command and the. Have fun! you programming the Game BoyTM Classic, Game BoyTM Pocket, Super Game BoyTM and Game... by Pan of three major parts. See paragraph 3. Foreword Game BoyTM CPU Manual 1. The documents consists of Anthrox, Marat Fayzullin... a typical read and write operation on a real Game Boy can be found in paragraph 2. Information on how ...
Manual
Page 5
... higher learning. 2.2. Terms GB = Original GameBoy (GameBoy Classic) GBP = GameBoy Pocket/GameBoy Light GBC = GameBoy Color SGB = Super GameBoy by Nintendo Co., LTD. GameBoy is copyrighted by DP Page 5 Hardware specifications 2.1. Any reference to copyrighted material is presented to inform a user on the hand-held game machine known as Game Boy, manufactured and designed by Nintendo Co., LTD. This info is not...
... higher learning. 2.2. Terms GB = Original GameBoy (GameBoy Classic) GBP = GameBoy Pocket/GameBoy Light GBC = GameBoy Color SGB = Super GameBoy by Nintendo Co., LTD. GameBoy is copyrighted by DP Page 5 Hardware specifications 2.1. Any reference to copyrighted material is presented to inform a user on the hand-held game machine known as Game Boy, manufactured and designed by Nintendo Co., LTD. This info is not...
Manual
Page 6
... • Power: DC6V 0.7W (DC3V 0.7W for GB Pocket) Nintendo documents describe the CPU & instructions speed in machine cycles while this document describes them in clock cycles. 2.3. Game Boy Specs Game BoyTM CPU Manual 2.3. Here is more similar to the Z80, some instructions Page 6 V 1.01 In many ways the processor is the translation: 1 machine cycle...
... • Power: DC6V 0.7W (DC3V 0.7W for GB Pocket) Nintendo documents describe the CPU & instructions speed in machine cycles while this document describes them in clock cycles. 2.3. Game Boy Specs Game BoyTM CPU Manual 2.3. Here is more similar to the Z80, some instructions Page 6 V 1.01 In many ways the processor is the translation: 1 machine cycle...
Manual
Page 11
Game BoyTM CPU Manual Locations 2.5.4. Reserved Memory 0104-0133 Scrolling Nintendo graphic: CE ED 66 66 CC 0D 00 0B 03 73...GB 0144 Ascii hex digit, high nibble of licensee code (new). 0145 Ascii hex digit, low nibble of the game in UPPER CASE ASCII. If it is less than 16 characters then the remaining bytes are normally $00 if [$014B...] $33.) 0146 GB/SGB Indicator (00 = GameBoy, 03 = Super GameBoy functions) (Super GameBoy functions won't work if $03.) 0147 Cartridge type: 0-ROM ONLY 12-ROM+MBC3+RAM 1-ROM+MBC1 ...
Game BoyTM CPU Manual Locations 2.5.4. Reserved Memory 0104-0133 Scrolling Nintendo graphic: CE ED 66 66 CC 0D 00 0B 03 73...GB 0144 Ascii hex digit, high nibble of licensee code (new). 0145 Ascii hex digit, low nibble of the game in UPPER CASE ASCII. If it is less than 16 characters then the remaining bytes are normally $00 if [$014B...] $33.) 0146 GB/SGB Indicator (00 = GameBoy, 03 = Super GameBoy functions) (Super GameBoy functions won't work if $03.) 0147 Cartridge type: 0-ROM ONLY 12-ROM+MBC3+RAM 1-ROM+MBC1 ...
Manual
Page 12
Konami (Super GameBoy function won't work if $33.) 014C Mask ROM Version number (Usually $00) Page 12 V 1.01 Hudson HuC-1 10-ROM+MBC3+TIMER+RAM+BATT 11-ROM+MBC3 0148 ROM size: 0 - 256Kbit = 32KByte = 2 banks 1 - 512Kbit = 64KByte = 4 banks 2 - 1Mbit = 128KByte = 8 ...= 72 banks $53 - 10Mbit = 1.2MByte = 80 banks $54 - 12Mbit = 1.5MByte = 96 banks 0149 RAM size: 0 - Non-Japanese 014B Licensee code (old): 33 - Reserved Memory Locations Game BoyTM CPU Manual F-ROM+MBC3+TIMER+BATT FF - None 1 - 16kBit = 2kB = 1 bank 2 - 64kBit = 8kB = 1 bank 3 - 256kBit = 32kB = 4 banks 4 - 1MBit ...
Konami (Super GameBoy function won't work if $33.) 014C Mask ROM Version number (Usually $00) Page 12 V 1.01 Hudson HuC-1 10-ROM+MBC3+TIMER+RAM+BATT 11-ROM+MBC3 0148 ROM size: 0 - 256Kbit = 32KByte = 2 banks 1 - 512Kbit = 64KByte = 4 banks 2 - 1Mbit = 128KByte = 8 ...= 72 banks $53 - 10Mbit = 1.2MByte = 80 banks $54 - 12Mbit = 1.5MByte = 96 banks 0149 RAM size: 0 - Non-Japanese 014B Licensee code (old): 33 - Reserved Memory Locations Game BoyTM CPU Manual F-ROM+MBC3+TIMER+BATT FF - None 1 - 16kBit = 2kB = 1 bank 2 - 64kBit = 8kB = 1 bank 3 - 256kBit = 32kB = 4 banks 4 - 1MBit ...
Manual
Page 13
...and point to 16Mbit ROM/8KByte RAM mode on Super GB, however, if incorrect.) 014E-014F Checksum (higher byte first) produced by DP Page 13 Game BoyTM CPU Manual Locations 2.5.4. The MBC1 defaults to ROM bank 1. Writing a value (XXXXXXXS - Writing a value (XXXBBBBB - S = 0 selects... 16/8 mode. S = 1 selects 4/32 mode. Values of the result. (GameBoy ignores this value.) 2.6. Cartridge Types The following define the byte at 4000-7FFF. X = Don't cares, B = bank select bits) into 6000-7FFF area will...
...and point to 16Mbit ROM/8KByte RAM mode on Super GB, however, if incorrect.) 014E-014F Checksum (higher byte first) produced by DP Page 13 Game BoyTM CPU Manual Locations 2.5.4. The MBC1 defaults to ROM bank 1. Writing a value (XXXXXXXS - Writing a value (XXXBBBBB - S = 0 selects... 16/8 mode. S = 1 selects 4/32 mode. Values of the result. (GameBoy ignores this value.) 2.6. Cartridge Types The following define the byte at 4000-7FFF. X = Don't cares, B = bank select bits) into 6000-7FFF area will...
Manual
Page 14
...a value (XXXXXXBB - Unlike the MBC1 which uses external RAM, MBC2 has 512 x 4 bits of the GameBoy. (NOTE: Nintendo suggests values $0A to enable and $00 to disable RAM bank!!) If memory model is set to enable it...like the MBC1 controller with the following exceptions: MBC2 will select an appropriate RAM bank at 4000-7FFF. Cartridge Types Game BoyTM CPU Manual Rom bank 0 is not provided. X = Don't cares, B = bank select bits) into... false writes during power down of Page 14 V 1.01 Writing a value (XXXXBBBB - X = Don't care, B = bank select bits) into 0000-1FFF area.
...a value (XXXXXXBB - Unlike the MBC1 which uses external RAM, MBC2 has 512 x 4 bits of the GameBoy. (NOTE: Nintendo suggests values $0A to enable and $00 to disable RAM bank!!) If memory model is set to enable it...like the MBC1 controller with the following exceptions: MBC2 will select an appropriate RAM bank at 4000-7FFF. Cartridge Types Game BoyTM CPU Manual Rom bank 0 is not provided. X = Don't cares, B = bank select bits) into... false writes during power down of Page 14 V 1.01 Writing a value (XXXXBBBB - X = Don't care, B = bank select bits) into 0000-1FFF area.
Manual
Page 15
....) • MBC5 (Memory Bank Controller 5): This controller is the first MBC that is similar to MBC1 except it appears the other MBC's run in GameBoy Color double-speed mode but it accesses all 16mbits of the upper address byte must be one to enable/disable cart RAM: 0000-00FF, 0200...-02FF, 0400-04FF, ..., 1E00-1EFF. For example the following addresses can be used to select a ROM bank. Game BoyTM CPU Manual 2.6. by DP Page 15 enable/disable is in GBC double speed mode as well. Cartridge Types RAM which is 0000-00FF. The...
....) • MBC5 (Memory Bank Controller 5): This controller is the first MBC that is similar to MBC1 except it appears the other MBC's run in GameBoy Color double-speed mode but it accesses all 16mbits of the upper address byte must be one to enable/disable cart RAM: 0000-00FF, 0200...-02FF, 0400-04FF, ..., 1E00-1EFF. For example the following addresses can be used to select a ROM bank. Game BoyTM CPU Manual 2.6. by DP Page 15 enable/disable is in GBC double speed mode as well. Cartridge Types RAM which is 0000-00FF. The...
Manual
Page 17
... above checks pass then the internal ROM is a not a zero, then the GameBoy will stop doing anything. Special modi 2.7.1. Again, the cartridge locations $104 to...least significant byte of a Nintendo logo on the internal speaker. This program is added to compare, then the GameBoy stops comparing bytes and ... GB Pocket: Next, the GameBoy starts adding all operations. A value of the screen. Power Up Sequence When the GameBoy is powered up, a 256 ...with a table in a ROM inside the GameBoy. Two musical notes are compared with the following register values: AF=$01-GB/SGB, $FF-GBP, $11-...
... above checks pass then the internal ROM is a not a zero, then the GameBoy will stop doing anything. Special modi 2.7.1. Again, the cartridge locations $104 to...least significant byte of a Nintendo logo on the internal speaker. This program is added to compare, then the GameBoy stops comparing bytes and ... GB Pocket: Next, the GameBoy starts adding all operations. A value of the screen. Power Up Sequence When the GameBoy is powered up, a 256 ...with a table in a ROM inside the GameBoy. Two musical notes are compared with the following register values: AF=$01-GB/SGB, $FF-GBP, $11-...
Manual
Page 19
... the GameBoy processor and screen until an interrupt...power consumption of the GameBoy emulators tend to value $00 on a real GameBoy contains random data.... Power Up Sequence It is not a good idea to reduce power consumption & extend the life of the batteries. Please note that the HALT instruction be used whenever possible to assume the above values will only contain known data if the GameBoy... code initializes it is recommended that GameBoy internal RAM on reset rather than these registers on power up contains random data. A later version GameBoy...
... the GameBoy processor and screen until an interrupt...power consumption of the GameBoy emulators tend to value $00 on a real GameBoy contains random data.... Power Up Sequence It is not a good idea to reduce power consumption & extend the life of the batteries. Please note that the HALT instruction be used whenever possible to assume the above values will only contain known data if the GameBoy... code initializes it is recommended that GameBoy internal RAM on reset rather than these registers on power up contains random data. A later version GameBoy...
Manual
Page 20
...register to occur on the GB,GBP, and SGB as 76 halt Page 20 V 1.01 This instruction skipping doesn't occur when interrupts are disabled (DI) on how much CPU time is required by a game, the HALT instruction can extend battery life anywhere from Martin Korth who documented this problem...: (assuming interrupts disabled for one instruction on the GameBoy Color even in regular GB mode. ($143=$00) EXAMPLES from 5 to...
...register to occur on the GB,GBP, and SGB as 76 halt Page 20 V 1.01 This instruction skipping doesn't occur when interrupts are disabled (DI) on how much CPU time is required by a game, the HALT instruction can extend battery life anywhere from Martin Korth who documented this problem...: (assuming interrupts disabled for one instruction on the GameBoy Color even in regular GB mode. ($143=$00) EXAMPLES from 5 to...
Manual
Page 22
Low-Power Mode Game BoyTM CPU Manual ; **** V-Blank Interrupt Routine **** Vblnk: push af push bc push de push hl...displayed in the left upper corner of 32 bytes each ). Only 160x144 pixels can be displayed. 2.7.3. Tiles The main GameBoy screen buffer (background) consists of background to be displayed on the opposite side.) An area of VRAM known as 32 ...rows of the screen. Each byte contains a Page 22 V 1.01 Do sprite updates ld a,1 ld (VblnkFlag),a pop hl pop de pop bc pop af reti 2.8. Registers SCROLLX and SCROLLY ...
Low-Power Mode Game BoyTM CPU Manual ; **** V-Blank Interrupt Routine **** Vblnk: push af push bc push de push hl...displayed in the left upper corner of 32 bytes each ). Only 160x144 pixels can be displayed. 2.7.3. Tiles The main GameBoy screen buffer (background) consists of background to be displayed on the opposite side.) An area of VRAM known as 32 ...rows of the screen. Each byte contains a Page 22 V 1.01 Do sprite updates ld a,1 ld (VblnkFlag),a pop hl pop de pop bc pop af reti 2.8. Registers SCROLLX and SCROLLY ...
Manual
Page 25
... 8x8 or in the Sprite Attribute Table (OAM - Object Attribute Memory) at $8000-8FFF and have priority and appear above any others. highest, $FE04 - Sprites GameBoy video controller can be displayed per scan line. When sprites with different x coordinate values overlap, the one with the same x coordinate values overlap, they are... of the sprite pattern number is ignored and treated as tiles, but they have the same format as 0. Sprite patterns have priority according to a sprite. Game BoyTM CPU Manual 2.8.2.
... 8x8 or in the Sprite Attribute Table (OAM - Object Attribute Memory) at $8000-8FFF and have priority and appear above any others. highest, $FE04 - Sprites GameBoy video controller can be displayed per scan line. When sprites with different x coordinate values overlap, the one with the same x coordinate values overlap, they are... of the sprite pattern number is ignored and treated as tiles, but they have the same format as 0. Sprite patterns have priority according to a sprite. Game BoyTM CPU Manual 2.8.2.
Manual
Page 27
Game BoyTM CPU Manual 2.8.2. Sprites Bit4 Palette number Sprite colors are taken from OBJ1PAL if this bit is in the GameBoy hardware that causes trash to be written to 1 and from OBJ0PAL otherwise. 2.8.3. Sprite RAM Bug There is a flaw in the range of $FE00 to $FEFF: inc xx dec xx (xx = bc,de, or hl) ldi a,(hl) ldd a,(hl) ldi (hl),a ldd (hl),a Only sprites 1 & 2 ($FE00 & $FE04) are used while their 16-bit content is set to OAM RAM if the following commands are not affected by DP Page 27 by these instructions.
Game BoyTM CPU Manual 2.8.2. Sprites Bit4 Palette number Sprite colors are taken from OBJ1PAL if this bit is in the GameBoy hardware that causes trash to be written to 1 and from OBJ0PAL otherwise. 2.8.3. Sprite RAM Bug There is a flaw in the range of $FE00 to $FEFF: inc xx dec xx (xx = bc,de, or hl) ldi a,(hl) ldd a,(hl) ldi (hl),a ldd (hl),a Only sprites 1 & 2 ($FE00 & $FE04) are used while their 16-bit content is set to OAM RAM if the following commands are not affected by DP Page 27 by these instructions.
Manual
Page 28
... terminals. By initializing sound 3, it starts it's function. 2.9. Voluntary wave patterns from wave RAM. When overflow occurs at all times while producing sound. Page 28 V 1.01 GameBoy circuitry allows producing sound in four different ways: Quadrangular wave patterns with envelope functions. When setting the initial value of the OFF mode must be... wave patterns with sweep and envelope functions. Sound registers may be routed to 1. When the Sound OFF flag for each of both output terminals. Sound Game BoyTM CPU Manual 2.9. White noise with an envelope function.
... terminals. By initializing sound 3, it starts it's function. 2.9. Voluntary wave patterns from wave RAM. When overflow occurs at all times while producing sound. Page 28 V 1.01 GameBoy circuitry allows producing sound in four different ways: Quadrangular wave patterns with envelope functions. When setting the initial value of the OFF mode must be... wave patterns with sweep and envelope functions. Sound registers may be routed to 1. When the Sound OFF flag for each of both output terminals. Sound Game BoyTM CPU Manual 2.9. White noise with an envelope function.
Manual
Page 30
... that require periodic or percise updates. It is then loaded with the contents of 4096, 16384, 65536, or 262144 Hertz. 2.10. The timer in the GameBoy has a selectable frequency of Timer Modulo (TMA). Timer Sometimes it generates an interrupt. When it overflows, it 's useful to 262144 Hertz Page 30...
... that require periodic or percise updates. It is then loaded with the contents of 4096, 16384, 65536, or 262144 Hertz. 2.10. The timer in the GameBoy has a selectable frequency of Timer Modulo (TMA). Timer Sometimes it generates an interrupt. When it overflows, it 's useful to 262144 Hertz Page 30...
Manual
Page 31
... shift is shifted in at a rate of transfer. If internal clock is selected and serial interrupt is selected, it drives the clock pin on the Gameboy is a very simple setup and is set to 0 at the completion of 8192Hz (122 microseconds) per bit. The rate of $FF02. If internal, ... significant bit is internal or external. This bit may be more creative when using this bit is crude compared to clock in and out first. Game BoyTM CPU Manual 2.11. Serial I/O The serial I /O 2.11. After this port. This by whether the clock source is shifted in /out each bit. Serial I ...
... shift is shifted in at a rate of transfer. If internal clock is selected and serial interrupt is selected, it drives the clock pin on the Gameboy is a very simple setup and is set to 0 at the completion of 8192Hz (122 microseconds) per bit. The rate of $FF02. If internal, ... significant bit is internal or external. This bit may be more creative when using this bit is crude compared to clock in and out first. Game BoyTM CPU Manual 2.11. Serial I/O The serial I /O 2.11. After this port. This by whether the clock source is shifted in /out each bit. Serial I ...
Manual
Page 32
... into $FF01: ld a,$75 ld ($FF01),a ld a,$81 ld ($FF02),a 2.12. 2.11. Serial I/O Game BoyTM CPU Manual allows a certain amount of the output line until another transfer takes place. The following 3 steps... are performed. 3. Interrupts 2.12.1. When an interrupt is set . 2. Page 32 V 1.01 Reset the IME flag and prevent all interrupts. It is generated, the IF flag will be set by... bit shifted out determines the state of synchronization with internal clock is performed and no external GameBoy is set, the following code causes $75 to be shifted out the serial port and ...
... into $FF01: ld a,$75 ld ($FF01),a ld a,$81 ld ($FF02),a 2.12. 2.11. Serial I/O Game BoyTM CPU Manual allows a certain amount of the output line until another transfer takes place. The following 3 steps... are performed. 3. Interrupts 2.12.1. When an interrupt is set . 2. Page 32 V 1.01 Reset the IME flag and prevent all interrupts. It is generated, the IF flag will be set by... bit shifted out determines the state of synchronization with internal clock is performed and no external GameBoy is set, the following code causes $75 to be shifted out the serial port and ...
Manual
Page 61
... Generally The GameBoy has instructions & registers similar to GameBoy. 3.2. Game BoyTM CPU Manual 3. Foreword Since books on the Z80 are getting harder & harder to find, hopefully the information here might be helpful to those trying to understand assembly language specific to the Intel 8080, Intel 8085, & Zilog Z80 microprocessors. CPU Registers 3.2.1. Game Boy command overview...
... Generally The GameBoy has instructions & registers similar to GameBoy. 3.2. Game BoyTM CPU Manual 3. Foreword Since books on the Z80 are getting harder & harder to find, hopefully the information here might be helpful to those trying to understand assembly language specific to the Intel 8080, Intel 8085, & Zilog Z80 microprocessors. CPU Registers 3.2.1. Game Boy command overview...
Manual
Page 63
... assembly language for use by the programmer of a stack pointer. The GameBoy Stack Pointer is put onto the stack, the stack grows downward in RAM... the stack. Stack Pointer A big key to locate the Stack Pointer at this point on the GameBoy is initialized to subroutines, and various other uses that has been allocated for other processors helps greatly as...The Program Counter from this location in assembly language on is executed. Program Counter On power up, the GameBoy Program Counter is understanding the concept of the ROM cart. 3.2.4. The instructions POP, RET, and RETI all...
... assembly language for use by the programmer of a stack pointer. The GameBoy Stack Pointer is put onto the stack, the stack grows downward in RAM... the stack. Stack Pointer A big key to locate the Stack Pointer at this point on the GameBoy is initialized to subroutines, and various other uses that has been allocated for other processors helps greatly as...The Program Counter from this location in assembly language on is executed. Program Counter On power up, the GameBoy Program Counter is understanding the concept of the ROM cart. 3.2.4. The instructions POP, RET, and RETI all...