2021-03-22 02:59:54 +00:00
|
|
|
HexToChar dfb '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
|
|
|
|
|
|
|
|
; Convert a byte (Acc) into a string and store at (Y)
|
|
|
|
ByteToString and #$00FF
|
|
|
|
sep #$20
|
|
|
|
pha
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
and #$0F
|
|
|
|
tax
|
|
|
|
ldal HexToChar,x
|
|
|
|
sta: $0000,y
|
|
|
|
|
|
|
|
pla
|
|
|
|
and #$0F
|
|
|
|
tax
|
|
|
|
ldal HexToChar,x
|
|
|
|
sta: $0001,y
|
|
|
|
|
|
|
|
rep #$20
|
|
|
|
rts
|
|
|
|
|
2021-07-12 05:16:18 +00:00
|
|
|
; Convert a word (Acc) into a hexadecimal string and store at (Y)
|
2021-03-22 02:59:54 +00:00
|
|
|
WordToString pha
|
|
|
|
bra Addr2ToString
|
|
|
|
|
|
|
|
; Pass in Acc = High, X = low
|
|
|
|
Addr3ToString phx
|
|
|
|
jsr ByteToString
|
|
|
|
iny
|
|
|
|
iny
|
|
|
|
lda 1,s
|
|
|
|
Addr2ToString xba
|
|
|
|
jsr ByteToString
|
|
|
|
iny
|
|
|
|
iny
|
|
|
|
pla
|
|
|
|
jsr ByteToString
|
|
|
|
rts
|
|
|
|
|
|
|
|
; A=Value
|
|
|
|
; X=Screen offset
|
|
|
|
DrawWord phx ; Save register value
|
2021-08-10 12:59:14 +00:00
|
|
|
phy
|
2021-03-22 02:59:54 +00:00
|
|
|
ldy #WordBuff+1
|
|
|
|
jsr WordToString
|
2021-08-10 12:59:14 +00:00
|
|
|
ply
|
2021-03-22 02:59:54 +00:00
|
|
|
plx
|
|
|
|
lda #WordBuff
|
|
|
|
jsr DrawString
|
|
|
|
rts
|
|
|
|
|
2021-07-08 12:46:35 +00:00
|
|
|
; Render out the bank addresses of all the blitter fields
|
|
|
|
DumpBanks
|
|
|
|
|
|
|
|
:addr = 1
|
|
|
|
:count = 3
|
|
|
|
:ptr = 5
|
|
|
|
|
|
|
|
pea #^BlitBuff ; pointer to address table
|
|
|
|
pea #BlitBuff
|
|
|
|
pea #13 ; count = 13
|
|
|
|
pea $0000 ; addr = 0
|
|
|
|
|
|
|
|
tsc
|
|
|
|
phd ; save the direct page
|
|
|
|
tcd ; set the direct page
|
2021-03-22 02:59:54 +00:00
|
|
|
|
|
|
|
:loop lda [:ptr]
|
|
|
|
tax
|
|
|
|
ldy #2
|
|
|
|
lda [:ptr],y
|
|
|
|
|
2021-07-08 12:46:35 +00:00
|
|
|
ldy #Addr3Buff+1
|
2021-03-22 02:59:54 +00:00
|
|
|
jsr Addr3ToString
|
|
|
|
|
2021-07-08 12:46:35 +00:00
|
|
|
lda #Addr3Buff
|
2021-03-22 02:59:54 +00:00
|
|
|
ldx :addr
|
|
|
|
ldy #$7777
|
|
|
|
jsr DrawString
|
|
|
|
|
|
|
|
lda :addr
|
|
|
|
clc
|
|
|
|
adc #160*8
|
|
|
|
sta :addr
|
|
|
|
|
2021-07-08 12:46:35 +00:00
|
|
|
lda #4
|
|
|
|
adc :ptr
|
|
|
|
sta :ptr
|
2021-03-22 02:59:54 +00:00
|
|
|
|
|
|
|
dec :count
|
|
|
|
bne :loop
|
|
|
|
|
2021-07-08 12:46:35 +00:00
|
|
|
pld ; restore the direct page
|
2021-07-10 22:15:35 +00:00
|
|
|
tsc ; restore the stack pointer
|
2021-07-08 12:46:35 +00:00
|
|
|
clc
|
|
|
|
adc #8
|
2021-07-10 22:15:35 +00:00
|
|
|
tcs
|
2021-03-22 02:59:54 +00:00
|
|
|
rts
|
|
|
|
|
2021-07-08 12:46:35 +00:00
|
|
|
WordBuff str '0000'
|
|
|
|
Addr3Buff str '000000' ; str adds leading length byte
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-22 02:59:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-07-12 05:16:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-22 02:59:54 +00:00
|
|
|
|
|
|
|
|
2021-08-10 12:59:14 +00:00
|
|
|
|
|
|
|
|
2021-07-10 22:15:35 +00:00
|
|
|
|
2021-03-22 02:59:54 +00:00
|
|
|
|
|
|
|
|