From ff22231f8a2f3714df701fd7c12b07915adc15e9 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 7 Mar 2025 16:04:42 +0100 Subject: shared: Add utilities for clearing screens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are quite mindless, but they are rather useful on simple examples in which we don't care about performance and we just want to show something on the screen. For now this didn't matter much, but on real hardware I was able to reproduce the same glitches as with emulators which randomized memory on both the CPU memory and on the PPU. Hence, just allow some examples to manually reset these regions and avoid silly graphical glitches. Signed-off-by: Miquel Sabaté Solà --- scroll/roulette.s | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scroll') diff --git a/scroll/roulette.s b/scroll/roulette.s index 4b13c22..aca7d72 100644 --- a/scroll/roulette.s +++ b/scroll/roulette.s @@ -107,6 +107,7 @@ ;;; player around. .segment "FIXED" .include "../shared/diskun.s" +.include "../shared/clear.s" ;;; NOTE: the main bulk of this example. Comments only for the parts which are ;;; specific to this example. @@ -201,6 +202,10 @@ reset: ;; The main function is used here only for further initialization purposes. .proc main + ;; Clear both screens to avoid funky business, as we are not doing anything + ;; specially clever here. + CLEAR_SCREENS $20, $24 + ;; Initialize both the palettes and the nametables. jsr Diskun::init_palettes jsr init_nametables -- cgit v1.2.3