target-sms

Compiles C and assembly programs for Sega Master System and Game Gear using z88dk.

1.1k|206|Updated Mar 16, 2016
One-click install
npx skills add https://github.com/z88dk/z88dk --skill target-sms-z88dk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: target-sms
Source: https://github.com/z88dk/z88dk/tree/main/.agents/skills/target-sms
Command: npx skills add https://github.com/z88dk/z88dk --skill target-sms-z88dk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building software for the Sega Master System and Game Gear requires knowing the correct z88dk target flags, CLIB selection, CRT startup code, and ROM packaging options, which are easy to get wrong without target-specific guidance. ## Core Features & Use Cases - Target Configuration: Documents the +sms target defaults, including the classic sms_clib library, __SMS define, and .sms ROM output via appmake. - Classic vs Newlib Guidance: Explains how to select classic or newlib (-clib=new, sdcc_ix, sdcc_iy) builds and warns about newlib stdio linking pitfalls. - Subtype Packaging: Covers the gamegear subtype producing .gg files and the none subtype for un packaged builds. - Use Case: Compile a C game with zcc +sms -vn game.c -o game -create-app to produce a runnable Master System ROM, or add -subtype=gamegear for a Game Gear build. ## Quick Start Compile my game.c file into a Sega Master System ROM using the z88dk +sms target with create-app enabled.

Frequently Asked Questions about target-sms

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compile a C program for Sega Master System with z88dk?

Use the command zcc +sms -vn game.c -o game -create-app to compile C source into a .sms ROM file. The bare +sms target uses the classic library with sms_clib and the classic CRT by default.

How to build a Game Gear ROM with z88dk?

Add the gamegear subtype to the +sms target: zcc +sms -subtype=gamegear -create-app. This applies the -Cz+sms -Cz-e -Cz.gg appmake options, defines __GAMEGEAR__, and produces a .gg file instead of .sms.

What is the difference between classic and newlib CLIB for SMS?

Classic is the default and links -lsms_clib with the classic sms_crt0. Newlib is selected with -clib=new, sdcc_ix, or sdcc_iy and links -lsms with sms_crt.asm.m4, but a minimal printf may not link on a bare program without a CRT that instantiates stdio.

Why does printf fail to link in a newlib SMS build?

A minimal printf may not link on a bare newlib SMS program because _stdout is not instantiated. Use the newlib SMS examples or a CRT that sets up stdio rather than assuming classic drop-in compatibility.

Does the z88dk SMS target support disk file I/O?

No, the SMS target generally has no classic disk stack. The classic library provides gencon console, hires graphics, PSG sound, joystick, and interrupt support, but file I/O is not available on this hardware.