Game Boy#

Game Boy Specifications#

Lifespan

1989-2003

Media

ROM cartridge

CPU

Sharp SM83 (custom 8-bit, similar to a Z80) @ 4.19 MHz

Memory

8K video RAM, 8K work RAM, 160 bytes sprite RAM

Display

160x144 pixels, 4 shades of gray (monochrome model)

Sound

4-channel programmable sound generator (2 square, 1 wave, 1 noise)

Controllers

D-pad, A/B buttons, Start/Select

Best-selling game

Tetris (bundled) / Pokémon Red and Blue

Game Boy (by Evan-Amos, public domain)

History#

The Game Boy was released by Nintendo in 1989, designed by Gunpei Yokoi’s team. It was the successor to the Game & Watch series of handheld LCD games, and followed Nintendo’s success with the NES home console.

The Game Boy was not the most technically advanced handheld of its era - the Atari Lynx and Sega Game Gear both had color screens and more powerful processors - but its combination of long battery life, a durable design, and a strong library of games made it the dominant handheld console. The bundled Tetris game helped make the system a mass-market success.

The Game Boy Color was released in 1998 as a successor. It was backward-compatible with original Game Boy cartridges and added a color display, a faster CPU, and more memory. The 8bitworkshop IDE supports both the original Game Boy (DMG) and Game Boy Color (CGB) variants.

Hardware#

The Game Boy uses a custom Sharp SM83 CPU, which combines the 8-bit register architecture of the Intel 8080 with the Z80’s instruction set (but omitting the alternate register set and IX/IY index registers).

The system is built around several custom chips:

  • CPU : Sharp SM83 @ 4.19 MHz

  • Video : “Dot Matrix Game” (DMG) LCD controller, producing a 160x144 display with 4 grays

  • Sound : 4-channel PSG (pulse 1, pulse 2, wave, noise)

  • Video RAM : 8 KB

  • Work RAM : 8 KB

  • High RAM : 127 bytes (fast on-chip memory)

  • Cartridge ROM : 32 KB to 8 MB, banked via Memory Bank Controllers (MBC)

Video#

The display is 160x144 pixels, refreshed at ~59.7 fps. The picture is built from 8x8 pixel tiles:

  • 384 tile patterns (each 8x8 pixels, 2 bits per pixel), addressed via two overlapping 256-tile windows

  • Two 32x32 tile maps (background and window)

  • 40 sprite OAM entries (8x8 or 8x16 sprites), max 10 per scanline

  • 4 background/object priority layers

The original DMG model displays 4 shades of gray. The Game Boy Color interprets the same 2-bit tile data as one of 32,768 possible colors (15-bit RGB), and can display 56 colors simultaneously. GBC also doubles the VRAM to 16 KB (two banks) and adds 7 additional switchable 4 KB work RAM banks.

Sound#

The Game Boy has four sound channels:

  • Channel 1 - square wave with frequency sweep and envelope

  • Channel 2 - square wave with envelope

  • Channel 3 - programmable 4-bit waveform (wave RAM)

  • Channel 4 - noise generator with LFSR

Each channel has its own volume envelope and a length counter. Channels 1 and 2 have volume sweep. Sound is mixed to a monaural headphone/speaker output.

Controllers#

The Game Boy has a D-pad, two action buttons (A and B), and Start/Select buttons. The joypad is read through the I/O register $FF00, multiplexed between the D-pad and the buttons.

Memory Map#

Address Range

Description

$0000-$3FFF

ROM Bank 0 (fixed)

$4000-$7FFF

ROM Bank 1+ (switchable)

$8000-$9FFF

Video RAM (tile data, maps)

$A000-$BFFF

External (cartridge) RAM

$C000-$CFFF

Work RAM (bank 0)

$D000-$DFFF

Work RAM (bank 1, or switchable on GBC)

$E000-$FDFF

Echo of work RAM (avoid)

$FE00-$FE9F

Sprite attribute table (OAM)

$FF00-$FF7F

I/O registers

$FF80-$FFFE

High RAM

I/O Registers#

The most important I/O registers are:

Address

Function

$FF00

Joypad input (P1)

$FF40

LCD control (LCDC) - display enable, tile maps, sprite size

$FF41

LCD status (STAT) - scanline/interrupt flags

$FF44

Current scanline (LY)

$FF47-$FF49

Background/window/object palette (DMG)

$FF4F

VRAM bank select (GBC only)

$FF70

Work RAM bank select (GBC only)

$FFFF

Interrupt enable register

Interrupts (in order of priority): V-Blank, LCD STAT, Timer, Serial, Joypad.

Programming#

The 8bitworkshop IDE supports Game Boy development in C (using the SDCC compiler), Z80 assembly language, and the Wiz visual programming language.

Comments