This page was last modified 02:52, 29 January 2023 by Aoineko. Based on work by Gdx.

MSXgl is a free and open-source C library to create application on MSX using SDCC. The library is built around many modules that implement in an optimized way the different features of the MSX and a cross-platform build tool (Windows, Linux and macOS) that allows to generate in 1-click, the final program in various formats (ROM, MegaROM, MSX-DOS and BASIC binary).



The library contains following features:

  • The tool chain works on Windows, Linux and macOS (all needed tools are imbedded for Windows and Linux).
  • Format: MSX-DOS binary, Basic binary, plain ROM (8 to 64 KB) and mapped ROM (ASCII 8/16, Konami, Konami SCC)
  • VDP (TMS9918, V9938, V9958), Sprite, Input (Keyboard, joystick & mouse), Math, String, Draw, BIOS, Real Time Clock, ...
  • Audio chip: PSG, MSX-Music (FM-PAC), MSX-Audio and SCC.
  • Audio format: PT3, ayFX, AT2 (AKG, AKY and AKM), TriloTracker (SCC), WYZ, VGM, ayVGM and PCM-Enc.
  • Boot code: Install cartridge ISR in page 0, install RAM and ISR in page 0, allow BDOS for cartridge program, use trampoline to access function in other segment, etc.
  • Devices: V9990, Ninja Tap.


From the same C code, MSXgl can generate a binary program usable on MSX in various formats:

  • Plain ROM (8, 16, 32, 48 or 64 KB). #1
  • MegaROM or "mapped" ROM in ASCII-16 format (from 64 KB to 4 MB) or ASCII-8, Konami and Konami with SCC (from 64 KB to 2 MB).
  • Binary for MSX-DOS 1 or MSX-DOS 2 (.com).
  • Binary for MSX BASIC (.bin).
  • Binary for disk auto-boot.

#1 For 48 and 64 KB ROM, it is possible to automatically add an interrupt handler to replace the BIOS one.


Available modules:

  • Core:
    • bios: BIOS routines wrapper
    • clock: Real-time clock (RP-5C01) handler and data save to CMOS
    • dos: MSX-DOS 1 & 2 handling functions
    • input: Keyboard, joystick, mouse and advanced input manager
    • math: Mathematic functions
    • memory: Memory handling functions
    • print: Print text on screen (all screen modes)
    • string: String and character handling
    • system: Slot handling (BIOS free)
  • Tools:
    • compress: RLE unpacker
      • compress/bitbuster: BitBuster unpacker (based on version 1.2)
      • compress/bitbuster2: BitBuster 2 unpacker (based on version 2.0)
      • compress/pletter: Pletter unpacker (based on version 0.5c1)
      • compress/zx0: ZX0 unpacker
    • draw: Advanced draw functions
    • game: Game framework (with state handling)
    • game_menu: Game menu WIP...
    • game_pawn: Character animation, movement and collision handler
    • scroll: Scrolling function (tile based)
    • device/ninjatap: NinjaTap support (to connect 4 joysticks per port)
  • Video chip:
    • vdp: TMS9918, V9938 and V9958 features (read/write, modes, sprites, commands)
    • v9990: V9990 VDP handler WIP...
  • Audio chip:
    • psg: PSG handler (AY-3-8910, YM2149 or T7766A)
    • msx-music: MSX-Music handler (YM2413, FM-PAC)
    • msx-audio: MSX-Audio handler (Y8950 + YM3014, Music-Module)
    • scc: Konami SCC handler
  • Audio format:
    • Arkos Tracker II
      • arkos/akg_player: AGK replayer
      • arkos/aky_player: AGY replayer
      • arkos/akm_player: AKM replayer
    • ayfx/ayfx_player: ayFX sound-effect replayer
    • lvgm/lvgm_player: Custom light-VGM music replayer
    • pcm/pcmenc: PCM-encoder replayer
    • pt3/pt3_player: PT3 music replayer (Vortex Tracker II)
    • trilo/trilo_scc_player: TriloTracker SCC music replayer
    • vgm/vgm_player: VGM music replayer
    • wyz/wyz_player: WYZ Tracker music replayer (based on version 47c)
    • wyz/wyz_player2: WYZ Tracker music light replayer (based on version 47d)