mode7: add text_demo

This commit is contained in:
Vince Weaver 2018-01-26 00:03:28 -05:00
parent 3d2f707a9e
commit baa7a63a95
3 changed files with 288 additions and 2 deletions

View File

@ -11,7 +11,7 @@ $(DOS33):
mode7.dsk: $(DOS33) MODE7_ISLAND MODE7_CHECKERBOARD MODE7_RAINBOW \ mode7.dsk: $(DOS33) MODE7_ISLAND MODE7_CHECKERBOARD MODE7_RAINBOW \
PLOT_TEST RASTERBARS SCROLL_DEMO SKY_DEMO \ PLOT_TEST RASTERBARS SCROLL_DEMO SKY_DEMO \
STARFIELD_DEMO STARFIELD_1K STARFIELD_DEMO STARFIELD_1K TEXT_DEMO
$(DOS33) -y mode7.dsk BSAVE -a 0x1000 MODE7_ISLAND $(DOS33) -y mode7.dsk BSAVE -a 0x1000 MODE7_ISLAND
$(DOS33) -y mode7.dsk BSAVE -a 0x1000 MODE7_CHECKERBOARD $(DOS33) -y mode7.dsk BSAVE -a 0x1000 MODE7_CHECKERBOARD
$(DOS33) -y mode7.dsk BSAVE -a 0x1000 MODE7_RAINBOW $(DOS33) -y mode7.dsk BSAVE -a 0x1000 MODE7_RAINBOW
@ -21,6 +21,7 @@ mode7.dsk: $(DOS33) MODE7_ISLAND MODE7_CHECKERBOARD MODE7_RAINBOW \
$(DOS33) -y mode7.dsk BSAVE -a 0x1000 SKY_DEMO $(DOS33) -y mode7.dsk BSAVE -a 0x1000 SKY_DEMO
$(DOS33) -y mode7.dsk BSAVE -a 0x1000 STARFIELD_DEMO $(DOS33) -y mode7.dsk BSAVE -a 0x1000 STARFIELD_DEMO
$(DOS33) -y mode7.dsk BSAVE -a 0x1000 STARFIELD_1K $(DOS33) -y mode7.dsk BSAVE -a 0x1000 STARFIELD_1K
$(DOS33) -y mode7.dsk BSAVE -a 0x1000 TEXT_DEMO
@ -136,6 +137,17 @@ starfield_1k.o: starfield_1k.s \
../asm_routines/gr_fast_clear.s ../asm_routines/gr_fast_clear.s
ca65 -o starfield_1k.o starfield_1k.s -l starfield_1k.lst ca65 -o starfield_1k.o starfield_1k.s -l starfield_1k.lst
TEXT_DEMO: text_demo.o
ld65 -o TEXT_DEMO text_demo.o -C ./apple2_1000.inc
text_demo.o: text_demo.s \
../asm_routines/gr_scroll.s \
../asm_routines/pageflip.s \
../asm_routines/gr_setpage.s \
../asm_routines/gr_fast_clear.s
ca65 -o text_demo.o text_demo.s -l text_demo.lst
scroller: scroller.o scroller: scroller.o
$(CC) $(LFLAGS) -o scroller scroller.o $(CC) $(LFLAGS) -o scroller scroller.o
@ -151,5 +163,6 @@ background.o: background.c
clean: clean:
rm -f *~ *.o scroller background \ rm -f *~ *.o scroller background \
MODE7 MODE7_ISLAND MODE7_CHECKERBOARD MODE7_RAINBOW \ MODE7 MODE7_ISLAND MODE7_CHECKERBOARD MODE7_RAINBOW \
PLOT_TEST RASTERBARS SCROLL_DEMO STARFIELD_DEMO STARFIELD_1K *.lst PLOT_TEST RASTERBARS SCROLL_DEMO STARFIELD_DEMO STARFIELD_1K \
TEXT_DEMO *.lst

Binary file not shown.

273
mode7/text_demo.s Normal file
View File

@ -0,0 +1,273 @@
; 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:
ldx #NUM_CREDITS
credit_loop:
lda #>credits
sta OUTH
lda #<credits
sta OUTL
ldy #0
lda (OUTL),Y
clc
adc #8
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
;==================
; loop forever
;==================
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
credits:
.byte 6
.asciiz "FROGGYSUE"
.byte 6
.asciiz "PIANOMAN08"
.byte 6
.asciiz "UTOPIA BBS"
.byte 4
.asciiz "THE 7HORSEMEN"
.byte 1
.asciiz "WEAVE'S WORLD TALKER"
.byte 5
.asciiz "STEALTHSUSIE"
.byte 2
.asciiz "ECE GRAD BOWLING"
.byte 5
.asciiz "CORNELL GCF"
.byte 0
.asciiz "ALL MSTIES EVERYWHERE"
.byte 9
.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"