SatBASIC: a modern BASIC for making Sega Saturn 2D games

Hi all! I’d like to share SatBASIC, a structured BASIC for making 2D games on the Sega Saturn. You write your game in simple, readable BASIC, and SatBASIC turns it into a .bin/.cue CD image you can run in an emulator or burn to a CD-R.

SatBasic Github Page


The goal is to make Saturn development approachable: no C, no makefiles, no hunting through SDK docs. You just write your game.
TITLE "Hello Saturn"

ship = LOADSPRITE("ship.png")
x = 160

GAMELOOP

IF BUTTON(BTN_LEFT) THEN x -= 2
IF BUTTON(BTN_RIGHT) THEN x += 2
SPRITE ship, x, 120, FRAMES * 3 ' a spinning ship

END GAMELOOP

The language


  • Fully structured: multi-line IF / ELSEIF / ELSE, SELECT CASE, FOR / WHILE / DO / REPEAT, EXIT and CONTINUE.
  • SUBs and FUNCTIONs with typed parameters, local variables and recursion.
  • Records (TYPE), arrays, constants and INCLUDE.
  • A built-in 60 fps GAMELOOP, so there’s no boilerplate.
  • Variables get their type from the first value you give them.
  • Clear, beginner-friendly error messages with line numbers.

Saturn hardware made easy


  • VDP1 sprites: rotation, scaling (uniform or separate X/Y), flipping, half-transparency, shadow, mesh and draw layers, all in one line each.
  • VDP2 backgrounds: a scrolling, zooming picture layer and a rotation layer for “Mode 7” floors.
  • Parallax scrolling with any number of tile-map layers, including foreground layers drawn in front of your characters.
  • CD audio music, sound effects, both controller pads, collision helpers, and fast trig and maths.

Asset pipeline (converted automatically when you build)


  • PNG sprites, sprite sheets and tilesets, with transparency.
  • Tiled maps (.tmx/.json), including solid tiles, flipped tiles and object layers for placing enemies and items.
  • WAV music (turned into CD audio tracks) and sound effects.

Tools and docs


  • Runs on Ubuntu Linux and Windows. An installer sets up everything, including the Jo Engine SDK and an SH-2 toolchain.
  • One-command workflow: satbasic run mygame.sbas builds the game and opens it in an emulator.
  • VS Code extension: syntax highlighting, autocomplete (including your own SUBs, variables and TYPE fields), hover docs, parameter hints, errors shown as you save, and F5 to build and run.
  • Three PDF manuals:
    • a full Reference Manual with a cookbook of ready-made examples
    • a Beginner’s Guide for people who have never programmed, with every line of every example explained
    • a Ninja Action Game Tutorial that builds a complete one-level game step by step

Example games included


  • Coin Quest: a platformer with a Tiled level, enemies and music.
  • Star Catcher: a small arcade game.
  • Night Blade: a ninja action game with five-layer parallax, a somersault, shuriken, sword slashes, ninja magic, sprite rotation and scaling effects everywhere, and a boss fight.

All the art, music and code in the examples are original, so feel free to learn from them and build on them.

SatBasic Github Page


Status: testers wanted!
This is a fresh 1.0. The compiler, asset converters, CD image builder and all the example games are tested on PC. SatBASIC sits on top of Jo Engine, and the part that talks to the SDK is kept in one small, documented file.




Feedback, questions and feature requests are all welcome. Happy Saturn coding!
 
Last edited:
Hi everyone!


I’d like to share SatBASIC, a structured BASIC that compiles straight to bootable Sega Saturn CD images (.bin/.cue). It runs on Ubuntu Linux and Windows 10/11 and is built on top of Jo Engine and the SH-2 GCC toolchain. The goal is to make Saturn homebrew approachable for beginners: no C, no makefiles, just write a program and press F5.

Release 1.1


A spinning 3D cube is four lines:
box = MAKECUBE(40)
GAMELOOP
DRAW3D box, 0, 0, 0, FRAMES, FRAMES * 2, 0
END GAMELOOP

New in 1.1


  • 3D graphics: ready-made shapes (MAKECUBE, MAKEBOX, MAKEPLANE, MAKEPYRAMID, MAKESPHERE, MAKECYLINDER), plus DRAW3D with position, rotation and scale, and CAMERA, LIGHT and DISTANCE3D for collisions.
  • Blender models: LOADMODEL("ship.obj") imports Wavefront .obj files with their material colours.
  • Textured models: UV-mapped textures from Blender are converted automatically. The Saturn has no UV mapping, so SatBASIC cuts each face’s part out of the texture at compile time and gives every face its own small picture (16×16 or 32×32), storing identical ones only once. Your Blender texturing ends up on the Saturn.
  • 3D levels designed in Tiled: MAPTILEID reads a top-down Tiled map by tile ID, so each tile can stand for a 3D object: wall, tree, coin and so on.
  • 2D and 3D together: text and sprites appear in front of 3D models, and VDP2 backgrounds behind them, so score displays and skies are free.
  • Windows support, with a double-click installer.
  • Fixed: SGL declarations for Jo Engine versions whose jo.h doesn’t expose SGL.

Everything from 1.0


  • The language: structured BASIC with IF/ELSEIF, SELECT CASE, every kind of loop, SUBs and FUNCTIONs with local variables, TYPE records and arrays. No line numbers.
  • Over 100 built-in commands for sprites (with rotation and scaling), tile maps, VDP2 backgrounds and Mode 7, input, CD audio music, PCM sound effects, collisions and more.
  • Asset pipeline: PNG sprites and sheets, Tiled maps (.tmx/.json) and WAV audio are converted automatically.
  • VS Code extension: syntax highlighting, completion, hover documentation, error underlining, and build and run on F5.
  • Clear error messages with file, line and a plain-English hint.

Documentation (all free PDFs)


  • Reference Manual (49 pages): every command, a cookbook and limits.
  • Beginner’s Guide (87 pages): from zero to a complete platformer.
  • 3D Guide (68 pages, new): from a first spinning cube to a complete 3D game. It covers making the models in Blender, texturing them, drawing pictures in Pinta, designing the level in Tiled and writing the program, with every line of code explained.
  • Ninja and Shmup tutorials: a full action game and a full vertical shooter, every line explained
  • 3D Platform Game Tutorial: Fully working 3D platform game where you play as little cubic robot and jump on platforms, avoid enemies, every line explained
Example games included: a platformer (Coin Quest), a ninja action game (Night Blade), a vertical shmup (Nebula Lancer), and three 3D games: Crystal Garden, Gem Garden, Pip's Island

Release 1.1


Honest status: please help test!


  • 2D programs build with the real Jo Engine and SH-2 toolchain, on [your setup, e.g. “Ubuntu 24.04 with current Jo Engine”].
  • The 3D features are brand new and so far tested with the compiler’s PC test renderer, not yet on real hardware or an emulator. They use Jo Engine’s 3D module, and every SDK call is listed in docs/PORTING.md. If something builds or looks wrong, please post your build log (the first error matters most).
 
Last edited:
  • Like
Reactions: vbt
Back
Top