Software Created To Operate On Cge: Example; Program Specifications - Nintendo GAME BOY Programming Manual

Hide thumbs Also See for GAME BOY:
Table of Contents

Advertisement

Game Boy Programming Manual
6. SOFTWARE CREATED TO OPERATE ON CGB: EXAMPLE
When creating software for CGB, a CGB support code is set in the ROM data area, and
processing branches according to the hardware used internally by the program. For more
information, see the flowchart in Part 1 of Section 6.3 of this chapter. Limiting the functions used,
as shown below, allows the same processing to be used for different units without branching. For
more information, see the flowchart in Part 2 of Section 6.3 of this chapter.
The following example describes how to create a program that operates on both CGB and DMG
and allows display of 56 colors when running on CGB . Such means can be used to maintain
compatibility with earlier hardware (DMG) while using CGB functions.

6.1 Program Specifications

! Only bank 0 is used as the character data area.
! Only the bits that specify the color palette (bits 0-2 of bank 1) are used for BG attributes.
8000h
9800h
9C00h
9FFFh
! Both the color palette and DMG-mode palette are set as attribute flags in the OAM
register.
OAM Register
! None of the other expanded CGB functions are used.
Bank 0
Character Data
BG CHR Code
BG CHR Code
7
0
Fixed at 0
7
6
5
4
3
0
132
Bank 1
Character Data
BG attribute
BG attribute
6
5
4
3
2
0
0
0
Specify Color Palette
2
1
0
Attributes
Color Palette
DMG-Mode Palette
1
0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents