mastersystem.package
README.md
mastersystem
A Sega Master System / Game Gear / SG-1000 emulator written in Luau, packaged
as emulatorCores so the consoles appear on the room's console TVs beside the
NES, Game Boy, Neo Geo and Mega Drive. Players upload their own .sms/.gg/.sg
carts (or a zip of one); the shelf carries original homebrew written for this
package and released under CC0.
mastersystem_core.emulatorCore— Master System (and SG-1000) spec: 256×192 at 59.92 Hz, worker thread, pad bar D-pad / 1 / 2 / Pause, battery RAM undermastersystem_saves/, save states.gamegear_core.emulatorCore— Game Gear spec: the same machine in GG mode, 160×144, Start button, saves undergamegear_saves/.machine.module(require("mastersystem.machine")) — the machine: VDP (mode 4 + TMS9918 Graphic 1/2 and Text, sprites with the 8-per-line limit, overflow/collision flags, scroll locks, line/frame interrupts, V/H counters), cart loader (raw, copier header, zip, TMR SEGA + SDSC headers), Sega / Codemasters / no mapper with 32 KB cartridge RAM, pads + Pause NMI, line scheduler (262 × 228 T-states). The Z80 and zip reader areneogeo.machine.z80/zip; the SN76489 ismegadrive.psg.asm.module(require("mastersystem.asm")) — a two-pass Z80 assembler (Zilog syntax, full documented set), reusable for any Z80 machine.homebrew.module(require("mastersystem.homebrew")) — the Z80 runtime, font, tile/tilemap/palette/music helpers and the games below;build()writes the carts.tests/sms_tests.luau— VDP, mappers, cart RAM, pads/Pause, GG Start, PSG, save states, assembler (80 checks).
Games on the shelf (all CC0 1.0, written for this package)
The engine has no network access, so no published homebrew could be fetched;
these carts were written here in Z80 assembly and are released under
CC0 1.0 Universal (public domain dedication: copy, modify, redistribute,
commercially or not, without asking). Source: homebrew.module/*.luau.
| cart | console | players | what it shows |
|---|---|---|---|
mastersystem_roms/neon_trails.sms — Neon Trails | Master System | 1-2 (CPU rides pad 2 until a pad-2 button is pressed) | light-cycle duel: tile trails, sprite heads, PSG music + effects |
mastersystem_roms/sky_ranger.sms — Sky Ranger | Master System | 1 | shooter: top-row scroll lock status bar, 3-band parallax switched by line interrupts, sprites, music, high score in battery RAM |
gamegear_roms/gem_catch.gg — Gem Catch | Game Gear | 1 | 160×144 window, 12-bit palette, Start button, battery high score |
Every game advances the byte at RAM $C000 once per logic step: the
logic-rate probe (m:watchRam(0xC000)).