aboutsummaryrefslogtreecommitdiff
path: root/src/2.s
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2023-12-08 21:57:52 +0100
committerMiquel Sabaté Solà <msabate@suse.com>2023-12-08 21:57:52 +0100
commit46103595c072651ade490c48c417f5d8d7ba9327 (patch)
tree92cc48e3e88e614618ea2cca3771c88674f92189 /src/2.s
parent57fde0bb5184371da33b212de6731c6e6829349f (diff)
downloadaoc2023.nes-46103595c072651ade490c48c417f5d8d7ba9327.tar.gz
aoc2023.nes-46103595c072651ade490c48c417f5d8d7ba9327.zip
Added a test suite
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'src/2.s')
-rw-r--r--src/2.s12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/2.s b/src/2.s
index e4f0361..353cb16 100644
--- a/src/2.s
+++ b/src/2.s
@@ -38,6 +38,8 @@
.include "../include/globals.s"
.include "../include/print.s"
+.include "../test/defines.s"
+
;; "Variables" used by this program.
.scope Vars
;; Maximum number for each color according to Part 1.
@@ -127,8 +129,18 @@
sta PPU::MASK
@loop:
+ ;; Skip everything if the `done` flag is set.
+ bit Globals::m_flags
+ bvs @end
+
jsr compute_next
jmp @loop
+
+@end:
+ ;; Run tests now that everything has been done.
+ CALL_TESTS_ON_DONE
+@halt:
+ jmp @halt
.endproc
;; Compute the next game if needed.