1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-24 04:48:06 +11:00

recipes/sms: show all letters in font when Start is pressed

This commit is contained in:
Virgil Dupras 2019-07-01 16:15:46 -04:00
parent ba2804a255
commit ca5bc07a75

View File

@ -56,9 +56,6 @@ main:
ld a, 0x81 ld a, 0x81
out (0xbf), a out (0xbf), a
ld b, 0x41
jr updateLetter
mainloop: mainloop:
; What we do here is simple. We go though all bits of port A controller ; What we do here is simple. We go though all bits of port A controller
; increasing B each time. As soon as we get a hit, we display that ; increasing B each time. As soon as we get a hit, we display that
@ -97,13 +94,12 @@ mainloop:
out (0x3f), a out (0x3f), a
inc b ; g inc b ; g
in a, (0xdc) in a, (0xdc)
and 0b00100000 ; Port A Start pressed and 0b00010000 ; Port A Button A pressed
jr z, updateLetter jr z, updateLetter
inc b ; h inc b ; h
in a, (0xdc) in a, (0xdc)
and 0b00010000 ; Port A Button A pressed and 0b00100000 ; Port A Start pressed
jr z, updateLetter jr z, allLetters ; when start is pressed, print all letters
inc b ; i
; no button pressed on port A, continue to updateLetter ; no button pressed on port A, continue to updateLetter
; Prints letter in B ; Prints letter in B
@ -115,9 +111,25 @@ updateLetter:
ld a, b ld a, b
out (0xbe), a out (0xbe), a
jr mainloop jp mainloop
; print all letters (reverse order)
allLetters:
xor a
out (0xbf), a
ld a, 0x78
out (0xbf), a
ld b, 0x5e
.loop:
ld a, b
out (0xbe), a
xor a
out (0xbe), a
djnz .loop
jp mainloop
PaletteData: PaletteData:
.db 0x00,0x3f .db 0x00,0x3f
PaletteDataEnd: PaletteDataEnd: