Skip to content

Commit c8d0d71

Browse files
committed
Added and tested clear screen function
1 parent 6f99393 commit c8d0d71

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

kernel7.asm

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ sp_eight:
5656
sp_endif:
5757

5858
MainLoop:
59+
push {r0-r3}
60+
mov r0,r7
61+
mov r3,r6
62+
bl ClearScreen
63+
pop {r0-r3}
64+
65+
5966
push {r0-r9}
6067
mov r0,r7 ;screen address
6168
mov r1,r4 ;x
@@ -65,7 +72,6 @@ MainLoop:
6572
bl DrawPlayer
6673
pop {r0-r9}
6774

68-
add r4,#10
6975
add r5,#10
7076

7177
push {r0-r9}
@@ -78,6 +84,22 @@ b MainLoop ;loop forever
7884
CoreLoop: ; Infinite Loop For Core 1..3
7985
b CoreLoop
8086

87+
ClearScreen:
88+
mov r2,#1
89+
mov r3,#0
90+
yloop:
91+
mov r1,#1
92+
xloop:
93+
push {r0-r9,lr}
94+
bl drawpixel
95+
pop {r0-r9,lr}
96+
add r1,#1
97+
cmp r1,SCREEN_X
98+
bls xloop
99+
add r2,#1
100+
cmp r2,SCREEN_Y
101+
bls yloop
102+
bx lr
81103

82104
include "drawplayer_2param.asm"
83105
include "FBinit8.asm"

0 commit comments

Comments
 (0)