You dream of creating your own game for legendary NES (Nintendo Entertainment System) But do you scare the development in assembler? It’s normal, but stop shaking, prostrate in a corner, in PTSD mode because today we will discover Nesfaba modern programming language which radically transforms the development of games in NES.
Because unlike the good old C, Nesfab was specially designed to take into account the material limitations of the NES. And the result is a cleaner code, faster and above all much more pleasant to write. The experienced developers will particularly appreciate its performance since Nesfab is able to generate a more efficient machine 6502 code than GCC and LLVM!
Here’s how it settles in video:
https://www.youtube.com/watch?v=JR9DCSEWLQC
You notice this pretty clear and modern syntax. Well yes, no need to juggle the cryptic assembler because Nesfab takes care of optimizing all of this for you.
Know the, the NES uses a 16 -bit addressing space, which seriously limits the size of the programs and traditionally, developers had to manually manage the memory banks system to bypass this limitation. With Nesfab, everything is automated and the compiler intelligently takes care of distributing your code and your data in the various banks.
No more tedious conversion scripts no more need since Nesfab automates the loading and conversion of your graphic and sound resources. To do this, simply place your files in the project folder and import the appropriate libraries.
Nesfab is delivered with:
- An integrated level editor (MAPFAB)
- Optimized libraries
- Detailed documentation
- And lots of concrete examples
And in the end, it can give Games like that.
If you are interested, we will install Nesfab together. The best approach is to compile from the sources:
git clone https://github.com/pubby/nesfab
cd nesfab
make release
Then we will be able to create our first program:
// 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
To compile it:
nesfab main.fab
And that’s it! You get a ROM (.NES) file ready to be tested in your favorite emulator.
In summary, Nesfab, it’s:
- Higher performance : Machine code more efficient than C
- Simplicity of use : modern and intuitive syntax
- Intelligent automation : Banking and resources management
- Integrated tools : everything you need to create complete games
- Rich documentation : tutorials and detailed examples
- Limited media of mappers (special cartridge circuits)
- No illegal instructions of the 6502 by default
- Project still in beta version with a few possible bugs
- Relatively limited community for the moment
I also advise you to familiarize yourself with an emulator with debugging tools like fceux or mesen. These will be precious to test and refine your creations.
It’s up to you now!
Discover Nesfab on the official website
Thank you to Letsar for the info!
Source link
Subscribe to our email newsletter to get the latest posts delivered right to your email.
Comments