commit 7fe99617b2b0c4a9e2b9c5e4c1db298bb396c78b
parent dd7401bc4c0386a043fe4e0085e1eba9df79b706
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date: Wed, 22 Sep 2021 16:41:25 +0100
Clear screen when ROM is loaded.
Diffstat:
2 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/projects/library/load-rom.tal b/projects/library/load-rom.tal
@@ -4,11 +4,10 @@
and has non-zero length, this function does not return, because the new ROM
is executing in its place.
- Both stacks are cleared and all the device vectors are written to zero as a
- convenience, but the screen is not cleared. All ROMs that use the screen
- define the palette (usually in the reset vector) so that should clear the
- screen anyway. All other device bytes are left untouched, so they could
- introduce a device state to the next ROM that it's not expecting.
+ The screen and both stacks are cleared and all the device vectors are
+ written to zero as a convenience. All other device bytes are left
+ untouched, so they could introduce a device state to the next ROM that
+ it's not expecting.
)
.File/name DEO2
@@ -32,6 +31,31 @@
POPr
.System/rst DEI ,&rst-loop JCN
+ ( clear screen )
+ #01 .Screen/auto DEO
+ #0000 .Screen/y DEO2
+ .Screen/width DEI2 #0007 ADD2 #03 SFT2 #ffff MUL2 STH2
+ &screen-yloop
+ #0000 .Screen/x DEO2
+ STH2kr
+ &screen-xloop-bg
+ #00 .Screen/sprite DEO
+ INC2
+ ORAk ,&screen-xloop-bg JCN
+ POP2
+ #0000 .Screen/x DEO2
+ STH2kr
+ &screen-xloop-fg
+ #40 .Screen/sprite DEO
+ INC2
+ ORAk ,&screen-xloop-fg JCN
+ POP2
+ .Screen/y DEI2 #0008 ADD2
+ DUP2 .Screen/y DEO2
+ .Screen/height DEI2 LTH2 ,&screen-yloop JCN
+ POP2r
+ #00 .Screen/auto DEO
+
( reset device vectors )
LIT2r 0000 #00
&device-vector-loop
diff --git a/projects/software/launcher.tal b/projects/software/launcher.tal
@@ -19,7 +19,7 @@
|00 @System [ &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1 ]
|10 @Console [ &vector $2 &read $1 &pad $5 &write $1 &error $1 ]
-|20 @Screen &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
+|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
|80 @Controller [ &vector $2 &button $1 &key $1 ]
|90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ]
|a0 @File &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &name $2 &length $2 &load $2 &save $2