@@ -51,6 +51,26 @@ draw_top:
51
51
ret
52
52
53
53
draw_bottom:
54
+ mv A , 1 ; A contains the X coordinate
55
+ push A , ( 1 + BOX_HEIGHT) , BL_CORNER ; x, y, character
56
+ call [ draw_character ]
57
+ mv B , (BOX_WIDTH - 2 )
58
+ . loop :
59
+ inc A
60
+ push A , B
61
+
62
+ push A , ( 1 + BOX_HEIGHT) , DASH
63
+ call [ draw_character ]
64
+
65
+ pop B , A
66
+
67
+ dec B
68
+ jnz B , [ . loop ]
69
+
70
+ inc A
71
+ push A , ( 1 + BOX_HEIGHT) , BR_CORNER
72
+ call [ draw_character ]
73
+
54
74
ret
55
75
56
76
draw_left:
@@ -85,13 +105,14 @@ draw_character:
85
105
pop H , L ; save return address
86
106
pop C , B , A ; character, Y, X
87
107
push L , H ; store return address
88
- push A , C ; save X coordinate and character
108
+ push A , C ; save X coordinate and character
109
+ jeq B , ( 1 + BOX_HEIGHT) , [ dbg ]
89
110
90
111
push B , 0 , SCREEN_WIDTH , 0
91
112
call [ mul16 ] ; get Y offset
92
113
pop H , L ; get value
93
114
94
- pop C , A ; get character X coordinate
115
+ pop C , A ; get character and X coordinate
95
116
96
117
add16 H , L , (TEXT_BUFFER >> 8 ) , (TEXT_BUFFER & 0xFF ) ; Shift address to text-buffer space
97
118
add16 H , L , 0 , A ; add X to address
@@ -100,5 +121,11 @@ draw_character:
100
121
101
122
ret
102
123
124
+ dbg:
125
+ push B , 0 , SCREEN_WIDTH , 0
126
+ call [ mul16 ] ; get Y offset
127
+ pop H , L ; get value
128
+ halt
129
+
103
130
hello_str:
104
131
@ str "Hello world!"
0 commit comments