2018-01-31 15:16:43 +00:00
|
|
|
; Closing Credits
|
|
|
|
|
2018-02-19 20:53:11 +00:00
|
|
|
NUM_CREDITS EQU 14
|
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
;===================
|
|
|
|
; init credits
|
|
|
|
;===================
|
2018-01-31 16:12:22 +00:00
|
|
|
|
|
|
|
init_credits:
|
|
|
|
ldy #0
|
|
|
|
lda (OUTL),Y ; get the first byte of credit
|
|
|
|
; which is the X-coord
|
|
|
|
|
|
|
|
sta CH ; store HTAB value
|
|
|
|
|
|
|
|
lda #22 ; text Y=22
|
|
|
|
sta CV ; store VTAB value
|
|
|
|
|
|
|
|
lda #$f0 ; -16
|
|
|
|
sta NAMEX ; we're clicking 10 times to get to our char
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
2018-01-31 15:16:43 +00:00
|
|
|
|
|
|
|
;===========================
|
|
|
|
;===========================
|
2018-01-31 16:12:22 +00:00
|
|
|
; draw_credits
|
2018-01-31 15:16:43 +00:00
|
|
|
;===========================
|
|
|
|
;===========================
|
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
draw_credits:
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
credit_loop:
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
inner_loop:
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
jsr htab_vtab ; put the cursor (BASL/BASH) at CH,CV
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
ldy #1 ; skip the x-coord to get to string
|
|
|
|
print_loop:
|
|
|
|
lda (OUTL),Y ; get the character
|
|
|
|
beq done_print ; if 0 then end of string
|
2018-01-31 15:16:43 +00:00
|
|
|
|
|
|
|
clc
|
2018-01-31 16:12:22 +00:00
|
|
|
adc NAMEX ; subtract the char back
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
ora #$80 ; convert ASCII to apple normal text
|
|
|
|
sta (BASL),Y ; store it directly to screen
|
|
|
|
iny ; point to next character
|
|
|
|
jmp print_loop ; loop
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
done_print:
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
;==================
|
|
|
|
; click
|
|
|
|
;==================
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
lda LOOP ; get wait-at-end loop counter
|
|
|
|
beq not_waiting ; if not waiting, skip ahead
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
clc ; decrement counter
|
2018-01-31 16:12:22 +00:00
|
|
|
adc #$ff
|
|
|
|
sta LOOP
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
bne done_click ; if not zero, skip ahead
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
jsr next_credit ; was zero, skip to next credit
|
2018-01-31 16:12:22 +00:00
|
|
|
jsr init_credits
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
jmp done_click
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
not_waiting:
|
|
|
|
lda FRAME_COUNT ; slow down by x32
|
|
|
|
and #$3f
|
|
|
|
beq done_click
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
bit SPEAKER ; click the speaker
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
ldx NAMEX ; get the mutate counter
|
|
|
|
inx ; increment
|
|
|
|
stx NAMEX
|
|
|
|
cpx #0 ; if not 1, then continue
|
|
|
|
bne done_click
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
lda YY
|
2018-02-19 20:53:11 +00:00
|
|
|
cmp #NUM_CREDITS-1 ; wait after NUM_CREDITS-1
|
2018-01-31 16:37:41 +00:00
|
|
|
bne short_loop
|
|
|
|
long_loop:
|
|
|
|
lda #$ff
|
|
|
|
bne store_loop
|
|
|
|
short_loop:
|
2018-01-31 16:12:22 +00:00
|
|
|
lda #$30 ; set delay to show the credit before
|
2018-01-31 16:37:41 +00:00
|
|
|
store_loop:
|
2018-01-31 16:12:22 +00:00
|
|
|
sta LOOP ; continuing
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
done_click:
|
|
|
|
rts
|
2018-01-31 15:16:43 +00:00
|
|
|
|
|
|
|
;==================
|
|
|
|
; Next credit
|
|
|
|
;==================
|
2018-01-31 16:37:41 +00:00
|
|
|
next_credit:
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
lda #8 ; point to text line
|
2018-01-31 15:16:43 +00:00
|
|
|
sta CH
|
|
|
|
lda #22
|
|
|
|
sta CV
|
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
lda OUTH ; save credits pointer
|
2018-01-31 15:16:43 +00:00
|
|
|
pha
|
|
|
|
lda OUTL
|
|
|
|
pha
|
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
lda #>empty ; point to empty string
|
2018-01-31 15:16:43 +00:00
|
|
|
sta OUTH
|
|
|
|
lda #<empty
|
|
|
|
sta OUTL
|
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
jsr print_both_pages ; clear line on both pages
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
pla ; restore credits pointer
|
2018-01-31 15:16:43 +00:00
|
|
|
sta OUTL
|
|
|
|
pla
|
|
|
|
sta OUTH
|
|
|
|
|
|
|
|
ldy #0
|
2018-01-31 16:37:41 +00:00
|
|
|
skip_credit: ; skip ahead to next credit
|
2018-01-31 15:16:43 +00:00
|
|
|
lda (OUTL),Y
|
|
|
|
|
|
|
|
inc OUTL
|
|
|
|
bne overflow
|
|
|
|
inc OUTH
|
|
|
|
overflow:
|
|
|
|
cmp #0
|
|
|
|
beq done_skip
|
2018-01-31 16:37:41 +00:00
|
|
|
bne skip_credit
|
2018-01-31 15:16:43 +00:00
|
|
|
done_skip:
|
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
ldx YY ; increment credit pointer
|
2018-01-31 15:16:43 +00:00
|
|
|
inx
|
|
|
|
stx YY
|
|
|
|
|
2018-01-31 16:12:22 +00:00
|
|
|
rts
|
2018-01-31 15:16:43 +00:00
|
|
|
|
2018-01-31 16:37:41 +00:00
|
|
|
|
2018-01-31 15:16:43 +00:00
|
|
|
;===============================
|
|
|
|
; draw the above-credits chrome
|
|
|
|
;===============================
|
|
|
|
|
|
|
|
credits_draw_bottom:
|
|
|
|
|
|
|
|
lda #$ff
|
|
|
|
sta COLOR
|
|
|
|
|
|
|
|
; HLIN Y, V2 AT A
|
|
|
|
ldy #7
|
|
|
|
lda #32
|
|
|
|
sta V2
|
|
|
|
lda #38
|
|
|
|
jsr hlin_double
|
|
|
|
|
|
|
|
lda #$75
|
|
|
|
sta COLOR
|
|
|
|
|
|
|
|
; hlin_double(PAGE0,0,6,38);
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
lda #6
|
|
|
|
sta V2
|
|
|
|
lda #38
|
|
|
|
jsr hlin_double
|
|
|
|
|
|
|
|
; hlin_double(PAGE0,33,40,38);
|
|
|
|
|
|
|
|
ldy #33
|
|
|
|
lda #40
|
|
|
|
sta V2
|
|
|
|
lda #38
|
|
|
|
jsr hlin_double
|
|
|
|
|
|
|
|
; hlin_double(PAGE0,8,31,36);
|
|
|
|
|
|
|
|
ldy #8
|
|
|
|
lda #31
|
|
|
|
sta V2
|
|
|
|
lda #36
|
|
|
|
jsr hlin_double
|
|
|
|
|
|
|
|
lda #$70
|
|
|
|
sta COLOR
|
|
|
|
|
|
|
|
; hlin_double(PAGE0,7,7,36);
|
|
|
|
|
|
|
|
ldy #7
|
|
|
|
lda #7
|
|
|
|
sta V2
|
|
|
|
lda #36
|
|
|
|
jsr hlin_double
|
|
|
|
|
|
|
|
; hlin_double(PAGE0,32,32,36);
|
|
|
|
ldy #32
|
|
|
|
lda #32
|
|
|
|
sta V2
|
|
|
|
lda #36
|
2018-01-31 16:12:22 +00:00
|
|
|
jmp hlin_double ; tail call, will return for us
|
2018-01-31 15:16:43 +00:00
|
|
|
|
|
|
|
;============================
|
|
|
|
; Draw text mode boilerplate
|
|
|
|
;============================
|
|
|
|
credits_draw_text_background:
|
|
|
|
; text wings
|
|
|
|
|
|
|
|
lda #$20
|
|
|
|
sta COLOR
|
|
|
|
|
|
|
|
; hlin_double(0,7,40)
|
|
|
|
ldy #0
|
|
|
|
lda #7
|
|
|
|
sta V2
|
|
|
|
lda #40
|
|
|
|
jsr hlin_double
|
|
|
|
|
|
|
|
; hlin_double(32,40,40)
|
|
|
|
ldy #32
|
|
|
|
lda #40
|
|
|
|
sta V2
|
|
|
|
lda #40
|
|
|
|
jsr hlin_double
|
|
|
|
|
|
|
|
; hlin_double(0,7,44)
|
|
|
|
ldy #0
|
|
|
|
lda #7
|
|
|
|
sta V2
|
|
|
|
lda #44
|
|
|
|
jsr hlin_double
|
|
|
|
|
|
|
|
; hlin_double(0,7,44)
|
|
|
|
ldy #32
|
|
|
|
lda #40
|
|
|
|
sta V2
|
|
|
|
lda #44
|
|
|
|
jsr hlin_double
|
|
|
|
|
|
|
|
; hlin_double(7,33,48)
|
|
|
|
ldy #7
|
|
|
|
lda #32
|
|
|
|
sta V2
|
|
|
|
lda #46
|
|
|
|
jsr hlin_double
|
|
|
|
|
|
|
|
lda #11
|
|
|
|
sta CH
|
|
|
|
lda #20
|
|
|
|
sta CV
|
|
|
|
|
|
|
|
lda #>thankz
|
|
|
|
sta OUTH
|
|
|
|
lda #<thankz
|
|
|
|
sta OUTL
|
|
|
|
|
|
|
|
jsr move_and_print
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
empty:
|
|
|
|
.asciiz " "
|
|
|
|
|
|
|
|
; offset can't be 0 or it confuses the next-credit code
|
|
|
|
credits:
|
2018-01-31 16:12:22 +00:00
|
|
|
.byte 7+7
|
2018-01-31 15:16:43 +00:00
|
|
|
.asciiz "FROGGYSUE"
|
2018-01-31 16:12:22 +00:00
|
|
|
.byte 7+7
|
2018-02-19 20:53:11 +00:00
|
|
|
.asciiz "MUSIC: ???"
|
|
|
|
.byte 7+7
|
2018-01-31 15:16:43 +00:00
|
|
|
.asciiz "PIANOMAN08"
|
2018-01-31 16:12:22 +00:00
|
|
|
.byte 7+7
|
2018-01-31 15:16:43 +00:00
|
|
|
.asciiz "UTOPIA BBS"
|
2018-02-19 20:53:11 +00:00
|
|
|
.byte 3+7
|
|
|
|
.asciiz "FORD PERFECT (SIC)"
|
2018-01-31 16:12:22 +00:00
|
|
|
.byte 5+7
|
2018-01-31 15:16:43 +00:00
|
|
|
.asciiz "THE 7HORSEMEN"
|
2018-01-31 16:12:22 +00:00
|
|
|
.byte 2+7
|
2018-02-19 20:53:11 +00:00
|
|
|
.asciiz "MITHLUIN AND ROOSTER"
|
|
|
|
.byte 2+7
|
2018-01-31 15:16:43 +00:00
|
|
|
.asciiz "WEAVE'S WORLD TALKER"
|
2018-02-19 20:53:11 +00:00
|
|
|
.byte 5+7
|
|
|
|
.asciiz "DAISY AND JUNE"
|
2018-01-31 16:12:22 +00:00
|
|
|
.byte 6+7
|
2018-01-31 16:37:41 +00:00
|
|
|
.asciiz "STEALTH SUSIE"
|
2018-01-31 16:12:22 +00:00
|
|
|
.byte 3+7
|
2018-01-31 15:16:43 +00:00
|
|
|
.asciiz "ECE GRAD BOWLING"
|
2018-01-31 16:12:22 +00:00
|
|
|
.byte 6+7
|
2018-01-31 15:16:43 +00:00
|
|
|
.asciiz "CORNELL GCF"
|
2018-01-31 16:12:22 +00:00
|
|
|
.byte 1+7
|
2018-01-31 15:16:43 +00:00
|
|
|
.asciiz "ALL MSTIES EVERYWHERE"
|
2018-01-31 16:12:22 +00:00
|
|
|
.byte 10+7
|
2018-01-31 15:16:43 +00:00
|
|
|
.asciiz "..."
|
|
|
|
|
|
|
|
thankz:
|
|
|
|
.asciiz "SPECIAL THANKS TO:"
|
|
|
|
|