aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Kingston <patrick@pkingston.xyz>2026-02-07 01:25:35 -0500
committerPatrick Kingston <patrick@pkingston.xyz>2026-02-07 01:25:35 -0500
commit80a1f6aa01bcff47bbe6c4273233997da0d3c271 (patch)
treeb9e419c70204113850de324c36f67d685f22c15d
parent91ab1e7b87b7d2e19f815e4dccaa57a8d47963a1 (diff)
Create build system with babashka
-rw-r--r--bb.edn13
-rw-r--r--main.fab20
-rw-r--r--nEs.cfg5
-rw-r--r--nEs.cfg.bak5
-rw-r--r--nEs.nesbin0 -> 40976 bytes
-rw-r--r--tiles.pngbin0 -> 1650 bytes
6 files changed, 43 insertions, 0 deletions
diff --git a/bb.edn b/bb.edn
new file mode 100644
index 0000000..2411642
--- /dev/null
+++ b/bb.edn
@@ -0,0 +1,13 @@
+{:pods {org.babashka/fswatcher {:version "0.0.7"}}
+ :tasks
+ {build
+ {:doc "Builds the nesfab project"
+ :task (shell "../nesfab/nesfab nEs.cfg")}
+ watch
+ {:doc "Automatically build the nesfab project on file writes"
+ :requires ([pod.babashka.fswatcher :as fw])
+ :task (do (fw/watch "main.fab"
+ (fn [event]
+ (prn event)
+ (shell "../nesfab/nesfab nEs.cfg")))
+ (deref (promise)))}}}
diff --git a/main.fab b/main.fab
new file mode 100644
index 0000000..ebbb2a4
--- /dev/null
+++ b/main.fab
@@ -0,0 +1,20 @@
+fn load_level()
+ ppu_reset_addr($2000)
+
+ for UU i = 0; i < 1024; i += 1
+ {PPUDATA}(1)
+
+mode main()
+ // Set the palette:
+ palette = example_palette
+ ppu_upload_palette()
+
+ // Load the background
+ {PPUMASK}(PPUMASK_BG_ON | PPUMASK_NO_CLIP)
+
+ // Loop forever:
+ while true
+
+// Define the tileset (commonly called CHR):
+chrrom
+ file(fmt, "tiles.png")
diff --git a/nEs.cfg b/nEs.cfg
new file mode 100644
index 0000000..cf96c4e
--- /dev/null
+++ b/nEs.cfg
@@ -0,0 +1,5 @@
+mapper = NROM
+nesfab-dir = ../nesfab/
+input = main.fab
+input = lib/nes.fab
+output = nEs.nes
diff --git a/nEs.cfg.bak b/nEs.cfg.bak
new file mode 100644
index 0000000..cf96c4e
--- /dev/null
+++ b/nEs.cfg.bak
@@ -0,0 +1,5 @@
+mapper = NROM
+nesfab-dir = ../nesfab/
+input = main.fab
+input = lib/nes.fab
+output = nEs.nes
diff --git a/nEs.nes b/nEs.nes
new file mode 100644
index 0000000..500b066
--- /dev/null
+++ b/nEs.nes
Binary files differ
diff --git a/tiles.png b/tiles.png
new file mode 100644
index 0000000..7045dda
--- /dev/null
+++ b/tiles.png
Binary files differ