From 63897b552fc0d0a2544a547318017485ed220c67 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 12 Dec 2023 20:03:06 +0100 Subject: Implemented day 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note that only part 1 has been implemented. The reasoning is on the file header. Moreover, we are not printing 24-bit results yet because that would entail modifying the somewhat terrifying vendor code on `vendor/bcd16.s`. Since this will be a recurring theme, I guess that I will have to come up with a solution sooner or later. Signed-off-by: Miquel Sabaté Solà --- include/print.s | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/print.s b/include/print.s index 7a0ac23..15755d5 100644 --- a/include/print.s +++ b/include/print.s @@ -22,10 +22,39 @@ rts .endproc - ;; TODO + ;; Print a "Done!" message to the screen in a similar fashion as `show_wait_message`. + .proc show_done_message + ;; Clear tiles that were written by `show_wait_message` and that are not + ;; re-used here. + WRITE_PPU_DATA $2129, $00 + WRITE_PPU_DATA $212A, $00 + WRITE_PPU_DATA $212B, $00 + WRITE_PPU_DATA $212C, $00 + WRITE_PPU_DATA $212D, $00 + WRITE_PPU_DATA $2132, $00 + WRITE_PPU_DATA $2134, $00 + WRITE_PPU_DATA $2135, $00 + WRITE_PPU_DATA $2136, $00 + + ;; And print the message. + WRITE_PPU_DATA $212E, $1E + WRITE_PPU_DATA $212F, $29 + WRITE_PPU_DATA $2130, $28 + WRITE_PPU_DATA $2131, $1F + WRITE_PPU_DATA $2133, $37 + + rts + .endproc + + ;; Show a 16-bit number on screen. + ;; + ;; NOTE: This subroutine will do nothing if `vendor/bcd16.s` has not been + ;; previously included. .proc show_bcd_16_number - ;; Clear tiles that were written by `show_wait_message` and that are not re-used - ;; here. + .ifdef BCD16_SUPPORT + + ;; Clear tiles that were written by `show_wait_message` and that are not + ;; re-used here. WRITE_PPU_DATA $2129, $00 WRITE_PPU_DATA $212A, $00 WRITE_PPU_DATA $212B, $00 @@ -58,6 +87,7 @@ cpy #$33 bne @loop + .endif rts .endproc -- cgit v1.2.3