https://github.com/optiroc/libsfx
Super Nintendo (SNES) development framework
https://github.com/optiroc/libsfx
Last synced: about 1 year ago
JSON representation
Super Nintendo (SNES) development framework
- Host: GitHub
- URL: https://github.com/optiroc/libsfx
- Owner: Optiroc
- License: mit
- Created: 2015-05-31T21:24:50.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-04-01T17:47:29.000Z (about 2 years ago)
- Last Synced: 2025-04-09T20:08:44.411Z (about 1 year ago)
- Language: Assembly
- Homepage:
- Size: 1.07 MB
- Stars: 207
- Watchers: 19
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libSFX
A Super Nintendo assembler development framework featuring:
* Basic system runtime for initialization and interrupt handling
* 65816 register size tracking macros to minimize rep/sep instructions (and mental overhead)
* Full set of memcpy/memset routines for efficiently transferring data to different parts of the system
* Some useful data structures with allocation and accessor macros (FIFO and FILO are currently implemented)
* S-SMP communication and SPC playing routines.
* LZ4 decompression
* Mouse driver
* Graphics conversion via [SuperFamiconv](https://github.com/Optiroc/SuperFamiconv)
* BRR audio encoding using [BRRtools](https://github.com/Optiroc/BRRtools)
* ROM image validation via [SuperFamicheck](https://github.com/Optiroc/SuperFamicheck)
* Sublime Text [syntax definitions](./extras/SublimeText)
Documentation available at [optiroc.github.io/libSFX](https://optiroc.github.io/libSFX).
libSFX is developed by David Lindecrantz and distributed under the terms of the [MIT license](./LICENSE).
## dependencies
A C/C++ toolchain, make, git and a decent command line interface.
Unix-like (Mac, Linux, etc.) systems should be ready to go out of the box. If you're running Windows the best option is to install [Cygwin](https://cygwin.com/install.html) and make sure you include the `git` and `mingw64` toolchain (`mingw64-x86_64-binutils`, `mingw64-x86_64-gcc-core` and `mingw64-x86_64-gcc-g++`) packages.
## building
First you need to build the bundled tools, which are included as git submodules. Simply run `make` from the libSFX root path to initialize the submodules and build the tools.
Now the toolchain is in place and you should be able to run `make` from any of the example directories to assemble the source files and link a Super Nintendo ROM image (*.sfc).
## setting up a project
For the most basic setup, copy `examples/Template` to a location of your liking. Then edit `Makefile` and make sure that `libsfx_dir` points to the libSFX root directory.
For project customization – for example extending the ROM size, adding SRAM or special code segments, or changing the default stack and scratchpad sizes – the build script looks for two files in the project directory; `libSFX.cfg` and `Map.cfg`. If these aren't found (like in the Template project), the defaults inside `$(libsfx_dir)/include/Configurations` are used.
To override the defaults, simply copy these two files into your project directory and edit them to your liking. In [include/Configurations](./include/Configurations/) there's a few additional Map.cfg examples. You may also check out the [example](./examples/SixteenMegaPower) [projects](./examples/SuperFX) to see how a project can be customized.
## acknowledgments
libSFX includes the following code and snippets:
* SPC-700 assembler for ca65 and S-SMP transfer routines by [Blargg](http://blargg.8bitalley.com)
* GSU assembler for ca65 by [ARM9](https://github.com/ARM9/casfx)
* ca65 define/undefine macros by [Movax12](http://forums.nesdev.com/memberlist.php?mode=viewprofile&u=4680)
## resources
* [fullsnes](http://problemkaputt.de/fullsnes.htm) - comprehensive SNES reference
* [ca65 users guide](https://cc65.github.io/doc/ca65.html)
* [SNESdev forum](http://forums.nesdev.com/viewforum.php?f=12)