@@ -52,14 +52,14 @@ draw_top:
52
52
53
53
draw_bottom:
54
54
mv A , 1 ; A contains the X coordinate
55
- push A , ( 1 + BOX_HEIGHT) , BL_CORNER ; x, y, character
55
+ push A , BOX_HEIGHT , BL_CORNER ; x, y, character
56
56
call [ draw_character ]
57
57
mv B , (BOX_WIDTH - 2 )
58
58
. loop :
59
59
inc A
60
60
push A , B
61
61
62
- push A , ( 1 + BOX_HEIGHT) , DASH
62
+ push A , BOX_HEIGHT , DASH
63
63
call [ draw_character ]
64
64
65
65
pop B , A
@@ -68,15 +68,44 @@ draw_bottom:
68
68
jnz B , [ . loop ]
69
69
70
70
inc A
71
- push A , ( 1 + BOX_HEIGHT) , BR_CORNER
71
+ push A , BOX_HEIGHT , BR_CORNER
72
72
call [ draw_character ]
73
73
74
74
ret
75
75
76
76
draw_left:
77
+ inc A
78
+ mv A , 1 ; A contains the Y coordinate
79
+ mv B , (BOX_HEIGHT - 2 )
80
+ . loop :
81
+ inc A
82
+ push A , B
83
+
84
+ push 1 , A , WALL
85
+ call [ draw_character ]
86
+
87
+ pop B , A
88
+
89
+ dec B
90
+ jnz B , [ . loop ]
91
+
77
92
ret
78
93
79
94
draw_right:
95
+ mv A , 1 ; A contains the Y coordinate
96
+ mv B , (BOX_HEIGHT - 2 )
97
+ . loop :
98
+ inc A
99
+ push A , B
100
+
101
+ push BOX_WIDTH , A , WALL
102
+ call [ draw_character ]
103
+
104
+ pop B , A
105
+
106
+ dec B
107
+ jnz B , [ . loop ]
108
+
80
109
ret
81
110
82
111
draw_hello:
@@ -106,7 +135,6 @@ draw_character:
106
135
pop C , B , A ; character, Y, X
107
136
push L , H ; store return address
108
137
push A , C ; save X coordinate and character
109
- jeq B , ( 1 + BOX_HEIGHT) , [ dbg ]
110
138
111
139
push B , 0 , SCREEN_WIDTH , 0
112
140
call [ mul16 ] ; get Y offset
@@ -121,11 +149,5 @@ draw_character:
121
149
122
150
ret
123
151
124
- dbg:
125
- push B , 0 , SCREEN_WIDTH , 0
126
- call [ mul16 ] ; get Y offset
127
- pop H , L ; get value
128
- halt
129
-
130
152
hello_str:
131
153
@ str "Hello world!"
0 commit comments