Clear screen when ROM is loaded.

This commit is contained in:
Andrew Alderwick 2021-09-22 16:41:25 +01:00
parent dd7401bc4c
commit 7fe99617b2
2 changed files with 30 additions and 6 deletions

View File

@ -4,11 +4,10 @@
and has non-zero length, this function does not return, because the new ROM and has non-zero length, this function does not return, because the new ROM
is executing in its place. is executing in its place.
Both stacks are cleared and all the device vectors are written to zero as a The screen and both stacks are cleared and all the device vectors are
convenience, but the screen is not cleared. All ROMs that use the screen written to zero as a convenience. All other device bytes are left
define the palette (usually in the reset vector) so that should clear the untouched, so they could introduce a device state to the next ROM that
screen anyway. All other device bytes are left untouched, so they could it's not expecting.
introduce a device state to the next ROM that it's not expecting.
) )
.File/name DEO2 .File/name DEO2
@ -32,6 +31,31 @@
POPr POPr
.System/rst DEI ,&rst-loop JCN .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 ) ( reset device vectors )
LIT2r 0000 #00 LIT2r 0000 #00
&device-vector-loop &device-vector-loop

View File

@ -19,7 +19,7 @@
|00 @System [ &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1 ] |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 ] |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 ] |80 @Controller [ &vector $2 &button $1 &key $1 ]
|90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $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 |a0 @File &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &name $2 &length $2 &load $2 &save $2