2025-02-10 07:39:00
pubby.games
![](https://pubby.games/nesfab/logo_big.png)
NESFab is a new programming language for creating
NES games.
Designed with 8-bit limitations in mind, the language is more ergonomic to use than C, while also producing faster assembly code.
It’s easy to get started with, and has a useful set of libraries for making your first — or hundredth — NES game.
// This small program plays a sound effect. // Variables: vars /sound UU pitch = 1000 // Sends 'pitch' variable to the APU, emitting sound: fn play_sound() {$4015}(%100) {$4008}($FF) {$400A}(pitch.a) {$400B}(pitch.b & %111) mode main() {PPUCTRL}(%10000000) while true pitch *= 1.01 play_sound() nmi
Performance
NESFab generates better 6502 machine code than any high-level compiler tested, including GCC and LLVM.
It’s possible that NESFab is the best performing 6502 compiler in existence.
(Click the image to open in a new tab.)
Traditionally, NES games were written by hand in assembly language,
as anything else at the time was too sluggish to run on the 1980s era CPU.
NESFab isn’t sluggish though!
Automatic Bank Switching
The NES uses a 16-bit address space,
but most games need more data than 16-bits can represent.
To overcome this limitation,
programs can be broken up into segments called “banks”,
and hardware on the cartridge can switch between these banks
at runtime.
Handling banks is normally a tedious affair for programmers,
but NESFab handles it for you.
The compiler smartly allocates code and data into banks,
with the gritty details abstracted away.
Easy Asset Loading
Writing a half-dozen conversion scripts isn’t fun. Luckily, NESFab automates asset loading and conversion for you.
Just plop your assets into your project directory, import a library, and you’re rolling!
Map Editor
Need a level editor? Use MapFab! It’s designed to be easily integrated into your NESFab projects, letting you create more, faster.
The best way to get NESFab is by compiling it from the source, which will always be up-to-date.
For those who don’t like compiling, binary releases will be provided from time to time.
Please understand that NESFab is currently in beta, and likely has bugs and missing features.
The following is a list of NESFab tutorials:
If you have produced a tutorial, reach out to have it listed here.
[Back to my homepage] | [Hire me]
Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.
Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!
Help Power Techcratic’s Future – Scan To Support
If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.
As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!
BITCOIN bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge Scan the QR code with your crypto wallet app |
DOGECOIN D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA Scan the QR code with your crypto wallet app |
ETHEREUM 0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a Scan the QR code with your crypto wallet app |
Please read the Privacy and Security Disclaimer on how Techcratic handles your support.
Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.