Game Boy#
Open 8bitworkshop IDE
Click here to program the Game Boy in the 8bitworkshop IDE now!
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

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 |
|---|---|
|
ROM Bank 0 (fixed) |
|
ROM Bank 1+ (switchable) |
|
Video RAM (tile data, maps) |
|
External (cartridge) RAM |
|
Work RAM (bank 0) |
|
Work RAM (bank 1, or switchable on GBC) |
|
Echo of work RAM (avoid) |
|
Sprite attribute table (OAM) |
|
I/O registers |
|
High RAM |
I/O Registers#
The most important I/O registers are:
Address |
Function |
|---|---|
|
Joypad input (P1) |
|
LCD control (LCDC) - display enable, tile maps, sprite size |
|
LCD status (STAT) - scanline/interrupt flags |
|
Current scanline (LY) |
|
Background/window/object palette (DMG) |
|
VRAM bank select (GBC only) |
|
Work RAM bank select (GBC only) |
|
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.