Now Reading
NESFab

NESFab

2023-03-07 07:52:46


NESFab

NESFab is a brand new programming language for creating
NES video games.
Designed with 8-bit limitations in thoughts, the language is extra ergonomic to make use of than C, whereas additionally producing quicker meeting code.
It is simple to get began with, and has a helpful set of libraries for making your first — or hundredth — NES sport.

// This small program performs a sound impact.

// 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 essential()
    {$2000}(%10000000)
    whereas true
        pitch *= 1.01
        play_sound()
        nmi

Efficiency

NESFab generates higher 6502 machine code than any high-level compiler examined, together with GCC and LLVM.
It is doable that NESFab is one of the best performing 6502 compiler in existence.




(Click on the picture to open in a brand new tab.)

Historically, NES video games have been written by hand in meeting language,
as anything on the time was too sluggish to run on the 1980’s period CPU.
NESFab is not sluggish although!

Computerized Financial institution Switching

The NES makes use of a 16-bit tackle house,
however most video games want extra information than 16-bits can symbolize.
To beat this limitation,
packages might be damaged up into segments referred to as “banks”,
and {hardware} on the cartridge can swap between these banks
at runtime.

Dealing with banks is generally a tedious affair for programmers,
however NESFab handles it for you.
The compiler well allocates code and information into banks,
with the gritty particulars abstracted away.

See Also

Straightforward Asset Loading

Writing a half-dozen conversion scripts is not enjoyable. Fortunately, NESFab automates asset loading and conversion for you.
Simply plop your property into your venture listing, import a library, and also you’re rolling!

The easiest way to get NESFab is by compiling it from the supply, which can all the time be up-to-date.
For individuals who don’t love compiling, binary releases might be offered infrequently.

Please perceive that NESFab is at present in beta, and certain has bugs and lacking options.

[Back to my homepage] | [Hire me]

Source Link

What's Your Reaction?
Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top