From 46103595c072651ade490c48c417f5d8d7ba9327 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 8 Dec 2023 21:57:52 +0100 Subject: Added a test suite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- src/2.s | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/2.s') 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. -- cgit v1.2.3