{"id":49728057,"url":"https://github.com/mori0091/libmsx","last_synced_at":"2026-05-09T05:17:27.305Z","repository":{"id":45620331,"uuid":"418041195","full_name":"mori0091/libmsx","owner":"mori0091","description":"C library for MSX","archived":false,"fork":false,"pushed_at":"2026-03-01T06:09:47.000Z","size":13673,"stargazers_count":47,"open_issues_count":1,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-03-01T09:33:22.961Z","etag":null,"topics":["c","linux","msx","msx2","msx2plus","msxturbor"],"latest_commit_sha":null,"homepage":"https://mori0091.github.io/libmsx/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mori0091.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-10-17T06:27:32.000Z","updated_at":"2026-03-01T06:09:50.000Z","dependencies_parsed_at":"2023-12-23T08:36:56.882Z","dependency_job_id":"d27e0bd9-ddec-42bf-b5c3-fd18af409d5d","html_url":"https://github.com/mori0091/libmsx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mori0091/libmsx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mori0091%2Flibmsx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mori0091%2Flibmsx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mori0091%2Flibmsx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mori0091%2Flibmsx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mori0091","download_url":"https://codeload.github.com/mori0091/libmsx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mori0091%2Flibmsx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32808027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","linux","msx","msx2","msx2plus","msxturbor"],"created_at":"2026-05-09T05:17:26.647Z","updated_at":"2026-05-09T05:17:27.298Z","avatar_url":"https://github.com/mori0091.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libmsx ; C library for MSX\n\n![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)\n[![C/C++ CI](https://github.com/mori0091/libmsx/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/mori0091/libmsx/actions/workflows/c-cpp.yml)\n[![CodeQL](https://github.com/mori0091/libmsx/actions/workflows/codeql.yml/badge.svg)](https://github.com/mori0091/libmsx/actions/workflows/codeql.yml)\n\nThe `libmsx` library exposes MSX, MSX2, MSX2+, and MSXturboR hardware\nfunctionality to the C programmer.\n\nThe library is intended for use with the C cross compiler\n[SDCC](http://sdcc.sourceforge.net/), and makes it easy to build MSX ROM\ncartridge image (16KiB, 32KiB, or MegaROM).\n\n\u003e MSX is a registered trademark of MSX Licensing Corporation.\n\n_Pull requests (PRs) and issues (bug reports, feature requests) are welcome._ 😉\n\n\u003chttps://user-images.githubusercontent.com/659805/206341437-fcef9dde-8317-4727-ad16-a30b34b1d287.mp4\u003e\n\n\n## LICENSE\n\nCopyright (c) 2021-2026 Daishi Mori (mori0091)\n\nThis software is released under the MIT License.  \nSee \u003chttps://github.com/mori0091/libmsx/blob/main/LICENSE\u003e\n\nGitHub libmsx project  \n\u003chttps://github.com/mori0091/libmsx\u003e\n\n\u003e A code snippet (gsinit.s) extracted and derived from the SDCC runtime library\n\u003e are available under the GPLv2 license.  \n\u003e See \u003chttps://github.com/mori0091/libmsx/blob/main/sdcc/README.md\u003e.\n\n## API reference\n\nThe API reference of the `libmsx` library is hosted on GitHub Pages.  \nSee \u003chttps://mori0091.github.io/libmsx/index.html\u003e\n\n## Supported functionality\n\nThe below functionality is supported.\n\n- Getting MSX system version code\n\n- VSYNC based timing synchronization\n\n- Almost of TMS9918A, V9938, V9958 VDP (Video Display Processor) functionality.\n  - Display screen mode setting\n  - Display area position adjustment\n  - Display lines setting (192 lines / 212 lines)\n  - VRAM memory map setting (pattern name table, color table, and so on)\n  - Color palette\n  - Hardware vertical scroll\n  - Hardware horizontal scroll\n  - Enable / disable display visibility\n  - Enable / disable sprites visibility\n  - VDP command execution (HMMM, HMMV, LMMM, and LMMV)\n  - VRAM read / write\n  - … and so on\n\n- GPIO (8-bit parallel I/O port ; a.k.a Joystick I/F)\n  - Reading joystick input state.\n\n- Sound output\n  - PSG (AY-3-8910)\n  - OPLL (YM2413 / MSX-MUSIC)\n    - OPLL sound chip inspection, discovery,\n    - Enabling/Disabling register access, and\n    - Write registers.\n  - Konami SCC / SCC+ Sound Cartridge\n    - SCC / SCC+ sound cartridge inspection, discovery,\n    - Enabling/Disabling register access, and\n    - Read/Write registers.\n\n- Sound driver\n  - NDP - PSG Driver for MSX\n    - NTSC (60Hz)\n    - Stop, Start, Pause, Resume, Auto-Repeat.\n    - Playing sound effects (SFX) during playing background music (BGM).\n    - NDP was originally programmed and provided by\n      [naruto2413](https://x.com/naruto2413) and later modified for libmsx by\n      Daishi Mori ([mori0091](https://x.com/mori0091)).\n    - The original NDP driver for MSX and MML editor/compiler for Windows are\n      distributed at the following site by naruto2413.\n      - See also [NDP - PSG Driver for MSX](https://ndp.squares.net/web/)\n  - LA0 - a PSG, SCC/SCC+, and OPLL sound driver\n    - NTSC (60Hz), PAL/SECAM (50Hz), auto detect and auto adjust.\n    - Available to specify default playing frequency that the sound data author expecting.\n    - Run-time replay speed/frequency control.\n    - Stop, Start, Pause, Resume, Auto-Repeat.\n    - Playing sound effects (SFX) during playing background music (BGM).\n    - VGM files to LA0 file conversion tool is bundled [vgm2la](tools/vgm2la).\n  - SNDDRV a PSG sound driver\n    - SNDDRV covers almost feature of replayer of the [Arkos Tracker 2](http://www.julien-nevo.com/arkostracker/).\n    - SNDDRV and libmsx's build system make it easy to integrate Arkos Tracker 2\n      song file (.aks file) into your application.\n    - See also the [design note of SNDDRV](docs/design-notes_snddrv.md)\n  - Another OLD PSG sound driver (sound.h, sound_eg.h) is still available,\n    but is no longer maintained.\n\n- MegaROM Mapper\n  - SDCC `__banked` functions support (SDCC 4.2.0 or later)\n  - Supported ROM mappers:\n    - ASCII8 ROM mapper\n    - ASCII16 ROM mapper\n\n- Utility functions for inspecting MSX slot mechanisms.\n  - Various inspection functions; inspect slot contents.\n    - MAIN ROM, SUB-ROM, BDOS/FDC,\n    - MSX-MUSIC, SCC/SCC+,\n    - Internal RAM,\n    - ROM cartridges.\n  - Iteration function; invoke user-defined callbacks for each slot.\n\n- Compression / Decompression\n  - Decompressor of ZX0 data compression format v.2.\n    - The ZX0 decompressor for **libmsx** has been reimplemented by Daishi Mori (mori0091).\n    - That supports decompression of ZX0 data in ROM/RAM/MegaROM to RAM/VRAM.\n  - The ZX0 file compressor tool. (for PC)\n    - The ZX0 file compressor tool reimplemented by Daishi Mori (mori0091) is bundled.\n    - ZX0 data compression format v.2 compatible.\n    - Supports MSX-optimized ZX0 compression mode to compress MSX BSAVE format files.\n\n\u003e The origins of the ZX0 data compression format and algorithm were designed and\n\u003e implemented by Einar Saukas.  \n\u003e See also \u003chttps://github.com/einar-saukas/ZX0\u003e.\n\n\n# Pre-requisites\n\n## Target Machine\n\n- MSX\n- MSX2\n- MSX2+\n- MSXturboR\n\n## Host Platform\n\n**Linux**\n\n| Host Platform | SDCC version | status          |\n|---------------|--------------|-----------------|\n| Ubuntu 24.04  | 4.4.0        | ✔ (outdated)    |\n|               | 4.5.0        | ✔ (recommended) |\n\n**Windows**\n\n| Host Platform | SDCC version | status          |\n|---------------|--------------|-----------------|\n| MSYS2 UCRT64  | 4.4.0        | (not tested)    |\n|               | 4.5.0        | (not tested)    |\n\nOfcourse, Ubuntu on **WSL2** is okey. 😄  \n(**WSL2**: Windows Subsystem for Linux)\n\n## Build tools\n\n- SDCC  \n  Small Device C Compiler  \n  \u003chttp://sdcc.sourceforge.net/\u003e\n\n\u003e SDCC 4.5.0 or later is recommended.\n\n- Other toolchain required for libmsx  \n  GNU `find`, `make`, `gcc`, `gzip`, `zcat`, `xsltproc`, and so on.\n\n\n# Install instructions of Build tools\n\nTo use `libmsx`,\n1. Install SDCC.\n2. Install other toolchain.\n\n## Ubuntu\n\n### 1. Install SDCC\n\nDownload a SDCC pre-built binary for Linux from \u003chttp://sdcc.sourceforge.net/\u003e\nand install it.\n\nSDCC 4.5.0 or later is recommended.\n\nDon't forget adding SDCC to `PATH` environment variable.  \nAdd the below to `~/.bashrc` or `~/.bash_profile`.  \n\n\u003e At here it is assuming that the SDCC 4.5.0 is installed under `~/sdcc-4.5.0`.\n\n```shell\nexport PATH=${PATH}:~/sdcc-4.5.0/bin\n```\n\n\u003e Why don't we install sdcc by `sudo apt install sdcc` ?\n\u003e \n\u003e Because the latest version of SDCC may not be installed by `apt`. In case of\n\u003e Ubuntu 24.04, SDCC 4.2.0 is installed. Thus we recommend that you download\n\u003e SDCC 4.5.0 pre-built binary and use it on Ubuntu 24.04 or later.\n\n### 2. Install other toolchain\n\n``` shell\nsudo apt update\nsudo apt install build-essential make gcc gzip xsltproc git\n```\n\n## Windows (Ubuntu on WSL2)\n\nThe 1st case is using Ubuntu on WSL2 environment.  \nIn this case, it is same as for Ubuntu.\n\nLaunch a terminal of *Ubuntu on WSL2*, and proceed with the above instructions.\n\n\n## Windows (MSYS2)\n\nThe 2nd case is using MSYS2 UCRT64 environment.\n\n### 1. Install SDCC\n\nDownload a SDCC pre-built binary for Windows from \u003chttp://sdcc.sourceforge.net/\u003e\nand install it.\n\n### 2. Install other toolchain\n\nDownload and install [MSYS2](https://www.msys2.org/).\n\nThen launch a terminal for the MSYS2 UCRT64 environment, and do as follows:\n~~~ shell\npacman -S coreutils findutils make gcc gzip libxslt git\n~~~\n\nDon't forget adding SDCC to `PATH` environment variable.  \nAdd the below to `~/.bashrc` or `~/.bash_profile`, on MSYS2 UCRT64 environment.  \n\n\u003e At here it is assuming that the SDCC is installed under `C:\\Program Files\\SDCC`.\n\n```shell\nexport PATH=${PATH}:/c/Program\\ Files/SDCC/bin\n```\n\n\n# Build instructions of the library and sample projects\n\nThe below makes the library `libmsx.lib` into `lib` folder, and bundled tools\ninto `bin` folder.\n\n``` shell\nmake\n```\n\nTo build sample projects in `sample/`, do as follows:\n\n``` shell\nmake sample\n```\n\nAnd for cleaning up:\n\n``` shell\nmake clean\n```\n\n\n# Build instructions of user applications\n\n\u003e There are several sample projects, please refer to the `sample/`\n\u003e folder of the `libmsx` project.\n\n## Preparation\n\n**Step 1.** Make your project's Git repository.\n\n``` shell\ngit init my_proj\n```\n\n**Step 2.** Download `libmsx` and place it somewhere.\n\n``` shell\ngit clone https://github.com/mori0091/libmsx.git libmsx\n```\n\n**Step 3.** Copy `libmsx/mk/Makefile` to top of your repository, and\ncustomize it.\n\nSee \u003chttps://github.com/mori0091/libmsx/blob/main/mk/Makefile\u003e\n\n``` shell\ncp libmsx/mk/Makfile my_proj/\n```\n\n**Step 4.** Create the folder `my_proj/src/` and place your C source\nfiles under it or in its subfolders.\n\n``` shell\nmkdir my_proj/src\n```\n\n## Build your application\n\nTo build your application, do as follows on the top of your repository `my_proj`.  \nThen the ROM image will be made into `my_proj/bin` folder.\n\n``` shell\nmake\n```\n\nAnd for cleaning up:\n\n``` shell\nmake clean\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmori0091%2Flibmsx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmori0091%2Flibmsx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmori0091%2Flibmsx/lists"}