Platform SMS - z88dk/z88dk GitHub Wiki

Hardware specs

  • Z80 @ 3.58Mhz
  • 8k RAM
  • 16k VRAM (VDP like)
  • 8k Bios ROM
  • SN76489 PSG

Classic library support (+sms)

  • Native console output
  • Native console input
  • ANSI vt100 engine
  • Generic console
    • Redefinable font
    • UDG support
    • Paper colour
    • Ink colour
    • Inverse attribute
    • Bold attribute
    • Underline attribute
  • Lores graphics
  • Hires graphics
  • PSG sound
    • ETracker (SAA tracker)
    • PSG Lib (SN76489)
    • Arkos2 Player (AY)
    • WYZ Player (AY)
    • Vortex tracker (AY)
  • One bit sound
  • Inkey driver
  • Hardware joystick
  • File I/O
  • Interrupts
  • RS232

Quick Start

zcc +sms -create-app -o program.bin program.c

zcc +sms -create-app -lgamegear -o program.bin program.c

The resulting file 'program.sms' can be loaded into an SMS emulator.

Library support

The z88dk classic library comprises of a fusion of the TMS99x8 with a donated custom library. This fusion allows the creation of either highly portable applications (using conio and the rest of the z88dk libraries) or applications leveraging the features of the SMS hardware.

Generic console

The generic console currently only supports the 3 modes in common with the TMS99x8 chip. Remember to add the --generic-console option to enable it at compile time to switch screen mode before printing - the classic +sms target starts up in mode 4.

Gamegear support

A Gamegear will load .sms file and use hardware scaling to shrink the 256x192 TMS99x8 display to the 160x144 Gamegear LCD. This can make graphics a little fuzzy to say the least. Another key difference is that the Gamegear, unlike the SMS, will not automatically set the palette used by the TMS99x8 screen modes, however z88dk will set the appropriate palette entries following setting the mode. Thus, if you have a custom palette, remember to set it after switching screen mode. As an additional note, the palette for TMS99x8 modes on the Gamegear starts at index 16, rather than index 0 on the SMS.

z88dk can also produce .gg files when the option -subtype=gamegear is supplied. When a Gamegear loads a .gg file, hardware scaling isn't enabled and the only visible area of the screen is 160x144 which is centred within the 256x192 display. The z88dk generic console takes this into account and adjusts its size and location to match the visible area. In Gamegear mode, the palette hardware is much improved and the default palette used by z88dk more closely resembles the palette on other TMS99x8 machines.

The following function load_palette_gamegear() can be used in Gamegear mode to set that palette using 12 bit BGR values.

Emulators

Example usage

mednafen -force_module sms program.sms
mednafen -force_module gg  program.sms
mame sms1 program.sms
mame gamegear program.sms

Links

"stevepro studios" - z88dk Programming related articles

King Kong game

Thread about using sprites on SMS and z88dk (French)

Haroldo-OK website, some game for the SMS is written with z88dk

SMSBomberman preview (YouTube video)