dos33fsprogs/mode7/text_demo.s

328 lines
3.8 KiB
ArmAsm
Raw Normal View History

2018-01-26 05:03:28 +00:00
; Closing Text Spin Demo
.include "zp.inc"
;===========
; CONSTANTS
;===========
NUM_CREDITS EQU 10
;================================
; Clear screen and setup graphics
;================================
jsr clear_screens ; clear top/bottom of page 0/1
jsr set_gr_page0
;===============
; Init Variables
;===============
lda #0 ; 2
sta DRAW_PAGE ; 3
;===============
; Init screen
;===============
jsr init_screen
jsr page_flip ; 6
jsr init_screen
;===========================
;===========================
; Main Loop
;===========================
;===========================
forever_loop:
2018-01-26 05:28:09 +00:00
ldx #0
stx YY
2018-01-26 05:03:28 +00:00
lda #>credits
sta OUTH
lda #<credits
sta OUTL
2018-01-26 05:28:09 +00:00
outer_loop:
credit_loop:
2018-01-26 05:03:28 +00:00
ldy #0
lda (OUTL),Y
clc
2018-01-26 05:28:09 +00:00
adc #7
2018-01-26 05:03:28 +00:00
sta CH
lda #22
sta CV
lda #$f6 ; - 10
sta XX
inner_loop:
jsr htab_vtab
ldy #1
print_loop:
lda (OUTL),Y
beq done_print
clc
adc XX
ora #$80
sta (BASL),Y
iny
jmp print_loop
done_print:
;==================
; flip pages
;==================
jsr page_flip ; 6
;==================
; delay?
;==================
lda #$C0
bit SPEAKER
jsr WAIT
ldx XX
inx
stx XX
cpx #1
bne inner_loop
;==================
; Delay since done
;==================
lda #$F0
jsr WAIT
lda #$F0
jsr WAIT
lda #$F0
jsr WAIT
lda #$F0
jsr WAIT
2018-01-26 05:28:09 +00:00
;==================
; Next credit
;==================
lda #8
sta CH
lda #22
sta CV
lda OUTH
pha
lda OUTL
pha
lda #>empty
sta OUTH
lda #<empty
sta OUTL
jsr print_both_pages
pla
sta OUTL
pla
sta OUTH
ldy #0
skip_credit:
lda (OUTL),Y
inc OUTL
bne overflow
inc OUTH
overflow:
cmp #0
beq done_skip
jmp skip_credit
done_skip:
ldx YY
inx
stx YY
cpx #10
beq forever
jmp outer_loop
2018-01-26 05:03:28 +00:00
;==================
; loop forever
;==================
2018-01-26 05:28:09 +00:00
forever:
2018-01-26 05:03:28 +00:00
jmp forever_loop ; 3
;=====================
; init screen
;=====================
init_screen:
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
jsr hlin_double
; 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
2018-01-26 05:28:09 +00:00
empty:
.asciiz " "
; offset can't be 0 or it confuses the next-credit code
2018-01-26 05:03:28 +00:00
credits:
2018-01-26 05:28:09 +00:00
.byte 7
2018-01-26 05:03:28 +00:00
.asciiz "FROGGYSUE"
2018-01-26 05:28:09 +00:00
.byte 7
2018-01-26 05:03:28 +00:00
.asciiz "PIANOMAN08"
2018-01-26 05:28:09 +00:00
.byte 7
2018-01-26 05:03:28 +00:00
.asciiz "UTOPIA BBS"
2018-01-26 05:28:09 +00:00
.byte 5
2018-01-26 05:03:28 +00:00
.asciiz "THE 7HORSEMEN"
2018-01-26 05:28:09 +00:00
.byte 2
2018-01-26 05:03:28 +00:00
.asciiz "WEAVE'S WORLD TALKER"
2018-01-26 05:28:09 +00:00
.byte 6
2018-01-26 05:03:28 +00:00
.asciiz "STEALTHSUSIE"
2018-01-26 05:28:09 +00:00
.byte 3
2018-01-26 05:03:28 +00:00
.asciiz "ECE GRAD BOWLING"
2018-01-26 05:28:09 +00:00
.byte 6
2018-01-26 05:03:28 +00:00
.asciiz "CORNELL GCF"
2018-01-26 05:28:09 +00:00
.byte 1
2018-01-26 05:03:28 +00:00
.asciiz "ALL MSTIES EVERYWHERE"
2018-01-26 05:28:09 +00:00
.byte 10
2018-01-26 05:03:28 +00:00
.asciiz "..."
thankz:
.asciiz "SPECIAL THANKS TO:"
;===============================================
; External modules
;===============================================
.include "../asm_routines/pageflip.s"
.include "../asm_routines/gr_setpage.s"
;.include "../asm_routines/keypress.s"
.include "../asm_routines/gr_offsets.s"
.include "../asm_routines/gr_fast_clear.s"
.include "../asm_routines/gr_hlin.s"
.include "../asm_routines/text_print.s"