NESFab 0.9
Overview
This release is a mix of bug fixes, features, and performance enhancements.
MapFab support and the mapfab
keyword
MapFab is a new level editor designed to be used with NESFab. Its data files can be imported into NESFab using the new mapfab
keyword:
mapfab(raw, "project.mapfab", "chr", "palette", "metatiles", "level")
This keyword invokes user-defined macros for each definition in the .mapfab
file, allowing one to customize how the data is formatted in the game.
The new example examples/mapfab
illustrates how this works.
chrrom
offsets
You can now have multiple chrrom
definitions. An integer following the chrrom
keyword specifies what offset the data will go.
chrrom $1000
(...)
chrrom $0000
(...)
VEC types
VECs are resizeable arrays that only exist at compile time. Their syntax is similar to regular arrays (TEAs), but their length is not part of their type signature:
ct Int{} my_vec = Int{}(1,2,3,4,5) // Type{} syntax means VEC
The purpose of VECs is that they let you write compile-time functions that generate or resize arrays. Two new keywords: push
and pop
were added to facilitate this.
ct fn foo(Int{} in) Int{}
Int{} out = Int{}()
for U i = 0; i < len(in); i += 1
push(out, in{i})
push(out, in{i})
return out
Unlike other types arrays, VECs can be multi-dimensional.
Patreon
I've set up a Patreon to help development: