< back to blog

Released: Star Force SDL2 Port

Released: Star Force SDL2 Port

Star Force is now in the games archive. It's a native C11/SDL2 port of the 1984 Tehkan arcade game for Linux handhelds through PortMaster, Linux desktops, the Steam Deck, Windows and macOS. You can play it in your browser from the game page, and the source is on GitHub.

// THE GAME

Tehkan, later Tecmo, released Star Force in 1984. You fly the Final Star up a scrolling screen, over open space and great floating fortresses, shooting fighters in the air and targets on the ground with the same button. The areas are named after the Greek alphabet, starting at ALPHA-AREA, and hidden bonus targets reward players who know where to shoot. Hudson Soft's 1985 Famicom version was the game for Hudson's first caravan tournament in Japan, which made Star Force a score-attack classic.

// THE PORT

It follows the Galaga port, and it's built on its platform layer, graphics and test harness. There's an emulated Star Force board, with a 4 MHz main Z80 and a 2 MHz sound Z80 (with a PIO and CTC on its daisy chain), three background layers, the foreground and sprites. It's checked against MAME instruction for instruction and runs with --emulate. The three SN76489A sound chips and the waveform DAC are modelled from MAME's output. By default, though, the game runs in C. Both Z80 programs are rewritten in C on the board's scheduler, and their memory and sound equal the emulated board's at every frame. That holds from power-on through whole games, five DIP switch settings and 40,000 frames of the later areas.

$ cat features.txt
GFX ........ 8 presets, from classic pixels to HD glow with CRT scanlines (F3/F4/F5)
PADS ....... two pads: one for each player; one pad drives both, the players taking turns
OPERATOR ... F2 opens the DIP switches over a paused game: both coin slots, ships, bonus, difficulty
SAVES ...... settings in starforce.cfg, the BEST PLAYERS table in starforce.hiscore
COCKTAIL ... player two's turns flipped round, as on the cocktail table
PACKAGES ... Linux x86_64/aarch64, PortMaster, Windows, macOS

The effects are cheap too. Where the renderer is accelerated, the GPU adds the glow, and on 4x displays the effects are drawn at 2x and doubled. On a desktop, that took a 4x frame from about 10 ms to about 1 ms.

// YOUR ROM SET

No ROM data is included. You need your own MAME starforc set (starforc.zip, the parent set). The game finds it next to the program, through --rom, or through $STARFORCE_ROM. Files are matched by CRC. On the first run, the tiles, sprites, font, the DAC's waveform and the tables it needs are extracted to assets/.

git clone https://github.com/monkeyx-net/starforce.git
cd starforce
cmake -S . -B build && cmake --build build -j
build/starforce --windowed --rom /path/to/starforc.zip

See the Star Force game page for the full controls, or get the source on GitHub.

$ < back to blog  |  RSS feed