Platform Gameboy - z88dk/z88dk GitHub Wiki

Hardware

  • Sharp LR35902 at 4.19 MHz
  • 8k VRAM
  • 8k General purpose RAM
  • 32k cartridge + banked memory

Classic library support (+gb)

  • Native console output (GBDK)
  • Native console input (GBDK)
  • ANSI vt100 engine
  • Generic console
    • Redefinable font
    • UDG support (64 UDGs available in mode 0)
    • Paper colour (APA mode)
    • Ink colour (APA mode)
    • Inverse attribute (APA mode)
    • Bold attribute (APA mode)
    • Underline attribute (APA mode)
  • Lores graphics (both modes, using z88dk API)
  • Hires graphics (APA mode, using GBDK API)
  • PSG sound
  • One bit sound
  • Inkey driver
  • Hardware joystick
  • File I/O
  • Interrupts
  • RS232

Compilation

zcc +gb -create-app [file.c]

A .gb file will be created suitable for insertion into an emulator

Library support

The "standard" GBDK library is provided with z88dk. The standard library (printf, strings etc) is supplied by the usual z88dk libraries.

Generic console

The following screen modes are supported by the generic console:

  • "Text", mode 0, tile based, supports lores graphics (4x4 pixels) and scrolling
  • "Drawing", mode 1, APA mode, supports lores graphics (via z88dk) and pixel graphics (via gbdk)

In mode 0, the font and UDGs are copied to the into the tilemap, as a result you should set the font and graphics once the mode has been switched.

Custom fonts

The fonts within the z88dk library contain a header defining their size. If you use a custom font then you'll need to include the following file before including your font as a binary blob. The linked file contains both a header and some additional graphics for lores graphics and the virtual keyboard.

Note: UDGs which are set using console_ioctl(IOCTL_GENCON_SET_UDGS,&param) do not need the header.

Limitations

  • Graphics support is not complete

Compiler support

Both sccz80 and zsdcc are supported.

Banked memory

z88dk supports explicit bank placement for user code. Your functions should be placed into the BANK_XX section where XX is a hex number from 01 to 1F - note, sdcc support is not quite correct.

When the function is annotated as __banked, intra-bank calling will be enabled. Unlike gbdk, __banked functions can return long values.

Links