7 macro PRINTSTR, row, col, str
19 macro PRINTVAL, row, col, str
48 PRINTSTR START_ROW, 0, str_row0
49 PRINTSTR START_ROW + 1, 0, str_row1
50 PRINTSTR START_ROW + 2, 0, str_row2
51 PRINTSTR START_ROW + 3, 0, str_row3
52 PRINTSTR START_ROW + 4, 0, str_row4
53 PRINTSTR START_ROW + 5, 0, str_row5
54 PRINTSTR START_ROW + 6, 0, str_row6
55 PRINTSTR START_ROW + 7, 0, str_row7
58 ld bc, $fefe ; c: port $fe, b: row select $fe
108 ; expects X -> c, Y -> b, returns in de
112 sla b ; change from blocks to pixels
114 ; construct low address byte -> e
115 ld a, b ; start with Y
118 and $e0 ; keep top 3 bits
119 ld e, a ; move into e
121 and $1f ; keep low 5 bits
122 or e ; combine with Y bits
123 ld e, a ; move the result back to e
124 ; construct high address byte -> d
125 ld a, b ; start with Y again
129 and $18 ; keep bits 3 and 4
130 ld d, a ; keep it in d
131 ld a, b ; grap Y one more time
132 and $7 ; keep low 3 bits of Y in a
133 or d ; combine with Y6-Y7
135 or b ; combine with high byte of fb address
136 ld d, a ; move result back to d
293 str_row0 asciiz 'ROW0: V C X Z [: '
294 str_row1 asciiz 'ROW1: G F D S A: '
295 str_row2 asciiz 'ROW2: T R E W Q: '
296 str_row3 asciiz 'ROW3: 5 4 3 2 1: '
297 str_row4 asciiz 'ROW4: 6 7 8 9 0: '
298 str_row5 asciiz 'ROW5: Y U I O P: '
299 str_row6 asciiz 'ROW6: H J K L ^: '
300 str_row7 asciiz 'ROW7: B N M ] \\: '