dos33fsprogs/fireworks/move_letters.s

224 lines
4.4 KiB
ArmAsm
Raw Normal View History

2018-09-12 17:30:20 +00:00
;===============================================
; Move Letters
;===============================================
2018-09-12 19:56:49 +00:00
; Normal P0 =6+13+2+22+46+37 = 126
; Normal P1 =6+13+2+22+46+37 = 126
; End of line =6+13+2+22+46+9+(28) = 126
; Next line =6+13+5+14+34+(26+28) = 126
; done entirely =6+13+5+(6+42+26+28) = 126
; Waiting =6+7+(11+6+42+26+28) = 126
2018-09-12 18:43:01 +00:00
2018-09-12 19:56:49 +00:00
; all forced to be 126
2018-09-12 18:43:01 +00:00
2018-09-12 19:56:49 +00:00
move_letters:
ldy WAITING ; 3
beq not_waiting ; 3
;============
; 6
2018-09-12 18:43:01 +00:00
2018-09-12 19:56:49 +00:00
;-1
dec WAITING ; 5
jmp wait_it_out ; 3
;===========
; 7
2018-09-12 17:30:20 +00:00
2018-09-12 19:56:49 +00:00
not_waiting:
2018-09-12 18:43:01 +00:00
; load letter from pointer, save into LETTER
2018-09-12 17:30:20 +00:00
ldy #0 ; 2
lda (LETTERL),Y ; 5
sta LETTER ; 3
2018-09-12 18:43:01 +00:00
; if high bit set, is special case
bmi letter_special ; 3
2018-09-12 17:30:20 +00:00
;==========
2018-09-12 18:43:01 +00:00
; 13
; just regular letter
;-1
lda LETTERY ; get letter Y ; 3
bmi letter_page1
;==========
; 2
letter_page0: ; -1
asl ; map to memory address ; 2
2018-09-12 17:30:20 +00:00
tay ; 2
lda gr_offsets,Y ; lookup low-res memory address ; 4
sta BASL ; store out low byte of addy ; 3
lda gr_offsets+1,Y ; look up high byte ; 4
sta BASH ; 3
lda #0 ; cycle-killer ; 2
2018-09-12 18:43:01 +00:00
jmp letter_erase ; 3
2018-09-12 17:30:20 +00:00
;==========
2018-09-12 18:43:01 +00:00
; 22
2018-09-12 17:30:20 +00:00
2018-09-12 18:43:01 +00:00
letter_page1:
asl ; map to memory address ; 2
tay ; 2
lda gr_offsets,Y ; lookup low-res memory address ; 4
sta BASL ; store out low byte of addy ; 3
lda gr_offsets+1,Y ; look up high byte ; 4
clc ; 2
adc #$4 ; adjust to page1 ; 2
sta BASH ; 3
;==========
; 22
;============================
letter_erase:
2018-09-12 19:56:49 +00:00
ldy LETTERX ; nop ; 3
nop ; nop ; 5
2018-09-12 17:30:20 +00:00
ldy #0 ; erase old char with space ; 2
lda #' '|$80 ; 2
ldy LETTERX ; 3
sta (BASL),Y ; 6
dey ; draw new char ; 2
sty LETTERX ; 3
lda LETTER ; 3
ora #$80 ; 2
ldy LETTERX ; 3
sta (BASL),Y ; 6
2018-09-12 18:43:01 +00:00
lda LETTERX ; see if we are at destination ; 3
2018-09-12 17:30:20 +00:00
cmp LETTERD ; 3
2018-09-12 18:43:01 +00:00
beq letter_next ; 3
2018-09-12 17:30:20 +00:00
;===========
2018-09-12 19:56:49 +00:00
; 46
2018-09-12 18:43:01 +00:00
;-1
2018-09-12 17:30:20 +00:00
lda #0 ; 2
lda #0 ; 2
jmp waste_28 ; 3
;==========
; 9
letter_next:
2018-09-12 18:43:01 +00:00
clc ; 16-bit inc letter pointer ; 2
2018-09-12 17:30:20 +00:00
lda LETTERL ; 3
adc #1 ; 2
sta LETTERL ; 3
lda LETTERH ; 3
adc #0 ; 2
sta LETTERH ; 3
2018-09-12 18:43:01 +00:00
inc LETTERD ; inc destination X ; 5
lda #39 ; start at right of screen ; 2
2018-09-12 17:30:20 +00:00
sta LETTERX ; 3
rts ; 6
;===========
; 37
letter_special:
2018-09-12 18:43:01 +00:00
cmp #$ff ; handle FF, we're done ; 2
beq letter_done ; 3
2018-09-12 17:30:20 +00:00
;==========
; 5
2018-09-12 18:43:01 +00:00
; -1
2018-09-12 19:56:49 +00:00
and #$7f ; clear top ; 2
sta WAITING ; this is waiting value ; 3
2018-09-12 18:43:01 +00:00
ldy #1 ; otherwise, Y,X pair ; 2
lda (LETTERL),Y ; get Y, put in LETTERY ; 5
2018-09-12 17:30:20 +00:00
sta LETTERY ; 3
;===========
2018-09-12 19:56:49 +00:00
; 14
2018-09-12 17:30:20 +00:00
2018-09-12 18:43:01 +00:00
iny ; get dest ; 2
2018-09-12 17:30:20 +00:00
lda (LETTERL),Y ; 5
2018-09-12 18:43:01 +00:00
sta LETTERD ; put in LETTERD ; 3
2018-09-12 17:30:20 +00:00
2018-09-12 18:43:01 +00:00
clc ; skip 3 bytes to begin of letters ; 2
lda LETTERL ; 16-bit add ; 3
2018-09-12 17:30:20 +00:00
adc #3 ; 2
sta LETTERL ; 3
lda LETTERH ; 3
adc #0 ; 2
sta LETTERH ; 3
lda LETTERH ; waste ; 3
2018-09-12 18:43:01 +00:00
jmp waste_26 ; 3
2018-09-12 17:30:20 +00:00
;===========
; 34
2018-09-12 19:56:49 +00:00
wait_it_out:
; wait 11
inc BLARGH ; 5
lda LETTERH ; 3
lda LETTERH ; 3
2018-09-12 17:30:20 +00:00
letter_done:
lda LETTERH ; 3
lda LETTERH ; 3
2018-09-12 19:56:49 +00:00
waste_42:
2018-09-12 17:30:20 +00:00
ldx #0 ; 2
inc BLARGH ; 5
inc BLARGH ; 5
inc BLARGH ; 5
inc BLARGH ; 5
inc BLARGH ; 5
inc BLARGH ; 5
inc BLARGH ; 5
2018-09-12 19:56:49 +00:00
inc BLARGH ; 5
2018-09-12 18:43:01 +00:00
waste_26:
2018-09-12 17:30:20 +00:00
ldx #0 ; 2
ldx #0 ; 2
ldx #0 ; 2
inc BLARGH ; 5
inc BLARGH ; 5
inc BLARGH ; 5
2018-09-12 18:43:01 +00:00
inc BLARGH ; 5
2018-09-12 17:30:20 +00:00
waste_28:
ldx #0 ; 2
inc BLARGH ; 5
inc BLARGH ; 5
inc BLARGH ; 5
inc BLARGH ; 5
rts ; 6
letters:
2018-09-12 18:43:01 +00:00
; .byte 22,28,
.byte " ",128
.byte 22+128,25," ",128
2018-09-12 18:43:01 +00:00
.byte 23,25, " ",128
.byte 23+128,25," ",128
2018-09-12 18:43:01 +00:00
.byte 22,26, "CODE BY",128
.byte 22+128,26,"CODE BY",128
2018-09-12 18:43:01 +00:00
.byte 23,26, "DEATER",128
.byte 23+128,26,"DEATER",198
2018-09-12 18:43:01 +00:00
.byte 22,26, " ",128
.byte 22+128,26," ",128
2018-09-12 18:43:01 +00:00
.byte 23,26, " ",128
.byte 23+128,26," ",128
2018-09-12 18:43:01 +00:00
.byte 22,26, "FIREWORKS",128
.byte 22+128,26,"FIREWORKS",128
2018-09-12 18:43:01 +00:00
.byte 23,26, "FOZZTEXX",128
.byte 23+128,26,"FOZZTEXX",198
2018-09-12 18:43:01 +00:00
.byte 22,26, " ",128
.byte 22+128,26," ",128
2018-09-12 18:43:01 +00:00
.byte 23,26, " ",128
.byte 23+128,26," ",128
2018-09-12 18:43:01 +00:00
.byte 22,26,"A VMW",128
.byte 22+128,26,"A VMW",128
2018-09-12 18:43:01 +00:00
.byte 23,26,"PRODUCTION",128
.byte 23+128,26,"PRODUCTION"
2018-09-12 18:43:01 +00:00
2018-09-12 17:30:20 +00:00
.byte 255