mode7_demo: start adding in the mode7 code

also add self-driving code, as well as make it load into HGR range
This commit is contained in:
Vince Weaver 2017-12-21 14:59:06 -05:00
parent 1aa43c9496
commit 85a296347d
9 changed files with 1258 additions and 10 deletions

View File

@ -10,14 +10,14 @@ $(DOS33):
cd ../dos33fs-utils && make
mode7_demo.dsk: $(DOS33) MODE7_DEMO
$(DOS33) -y mode7_demo.dsk BSAVE -a 0x1000 MODE7_DEMO
$(DOS33) -y mode7_demo.dsk BSAVE -a 0x2000 MODE7_DEMO
###
MODE7_DEMO: mode7_demo.o
ld65 -o MODE7_DEMO mode7_demo.o -C ./apple2_1000.inc
ld65 -o MODE7_DEMO mode7_demo.o -C ./apple2_2000.inc
mode7_demo.o: mode7_demo.s mode7_demo_backgrounds.inc \
a2.scrolltext deater.scrolltext \
@ -26,7 +26,8 @@ mode7_demo.o: mode7_demo.s mode7_demo_backgrounds.inc \
../asm_routines/gr_setpage.s \
../asm_routines/gr_fade.s \
../asm_routines/gr_copy.s \
../asm_routines/gr_scroll.s
../asm_routines/gr_scroll.s \
mode7.s
ca65 -o mode7_demo.o mode7_demo.s -l mode7_demo.lst

View File

@ -1,6 +1,6 @@
MEMORY {
ZP: start = $00, size = $1A, type = rw;
RAM: start = $1000, size = $8E00, file = %O;
RAM: start = $2000, size = $7E00, file = %O;
}
SEGMENTS {

16
mode7_demo/island_map.inc Normal file
View File

@ -0,0 +1,16 @@
flying_map:
.byte $22,$ff,$ff,$ff, $ff,$ff,$ff,$22
.byte $dd,$cc,$cc,$88, $44,$44,$00,$dd
.byte $dd,$cc,$cc,$cc, $88,$44,$44,$dd
.byte $dd,$cc,$cc,$88, $44,$44,$44,$dd
.byte $dd,$cc,$99,$99, $88,$44,$44,$dd
.byte $dd,$cc,$99,$88, $44,$44,$44,$dd
.byte $dd,$cc,$99,$99, $11,$44,$44,$dd
.byte $22,$dd,$dd,$dd, $dd,$dd,$dd,$22
water_map:
.byte $22,$22,$22,$22, $22,$22,$22,$22
.byte $ee,$22,$22,$22, $22,$22,$22,$22
.byte $22,$22,$22,$22, $22,$22,$22,$22
.byte $22,$22,$22,$22, $ee,$22,$22,$22

1101
mode7_demo/mode7.s Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -5,12 +5,72 @@
;================================
jsr set_gr_page0
bit FULLGR
jsr clear_screens_notext ; clear top/bottom of page 0/1
lda #$4
sta DRAW_PAGE
; Initialize the 2kB of multiply lookup tables
jsr init_multiply_tables
;================================
; Main Loop
;================================
main_loop:
jsr title_routine
jsr checkerboard_demo
jsr island_demo
jsr star_demo
jmp main_loop
;===========================
; Checkerboard Demo
;===========================
checkerboard_demo:
; initialize
lda #>sky_background
sta INH
lda #<sky_background
sta INL
jsr decompress_scroll
jsr mode7_flying
rts
;===========================
; Island Demo
;===========================
island_demo:
; initialize
jsr mode7_flying
rts
;===========================
; Star Demo
;===========================
star_demo:
; initialize
rts
;===========================
; Title routine
;===========================
title_routine:
bit FULLGR
jsr clear_screens_notext ; clear top/bottom of page 0/1
lda #<demo_rle
sta GBASL
lda #>demo_rle
@ -24,8 +84,6 @@
jsr load_rle_gr
demo_loop:
;==========
; Fade in
;==========
@ -68,8 +126,7 @@ demo_loop:
;=============
jsr fade_out
jmp demo_loop
rts
;===============================================
@ -84,6 +141,8 @@ demo_loop:
.include "../asm_routines/gr_copy.s"
.include "../asm_routines/gr_scroll.s"
.include "mode7.s"
.include "mode7_demo_backgrounds.inc"

59
mode7_demo/sprites.inc Normal file
View File

@ -0,0 +1,59 @@
;================
; Ship Sprites
;================
splash_forward:
.byte $7,$2
.byte $00,$ee,$00,$00,$00,$ee,$00
.byte $ee,$00,$00,$00,$00,$00,$ee
splash_right:
.byte $7,$2
.byte $00,$00,$00,$00,$00,$ee,$00
.byte $00,$00,$00,$00,$00,$00,$ee
splash_left:
.byte $7,$2
.byte $00,$ee,$00,$00,$00,$00,$00
.byte $ee,$00,$00,$00,$00,$00,$00
shadow_forward:
.byte $3,$2
.byte $00,$aa,$00
.byte $a0,$aa,$a0
shadow_right:
.byte $3,$2
.byte $a0,$00,$aa
.byte $00,$0a,$a0
shadow_left:
.byte $3,$2
.byte $aa,$00,$a0
.byte $a0,$0a,$00
ship_forward:
.byte $9,$5
.byte $00,$00,$00,$00,$ff,$00,$00,$00,$00
.byte $00,$00,$00,$66,$ff,$66,$00,$00,$00
.byte $00,$00,$70,$2f,$12,$2f,$70,$00,$00
.byte $f0,$f7,$f7,$f2,$d9,$f2,$f7,$f7,$f0
.byte $00,$00,$00,$00,$0d,$00,$00,$00,$00
ship_right:
.byte $9,$5
.byte $00,$00,$00,$00,$00,$60,$60,$f0,$00
.byte $00,$f0,$70,$70,$f6,$f6,$6f,$66,$00
.byte $00,$07,$ff,$2f,$12,$27,$f6,$00,$00
.byte $00,$00,$00,$dd,$d9,$f2,$77,$00,$00
.byte $00,$00,$00,$00,$00,$0f,$ff,$70,$00
ship_left:
.byte $9,$5
.byte $00,$f0,$60,$60,$00,$00,$00,$00,$00
.byte $00,$66,$6f,$f6,$f6,$70,$70,$f0,$00
.byte $00,$00,$f6,$27,$12,$2f,$ff,$07,$00
.byte $00,$00,$77,$f2,$d9,$dd,$00,$00,$00
.byte $00,$70,$ff,$0f,$00,$00,$00,$00,$00

View File

@ -0,0 +1,10 @@
; Original size = 1020 bytes
sky_background:
; scroll_length:
.byte 255
.byte $A9,$00,$D0,$A9,$00,$50,$F5,$50,$AB,$00,$0F,$A7,$00,$0D,$DD,$D0,$A7,$00,$F0,$A5,$00,$11,$A7,$00,$A4,$70,$D0,$D0,$A7,$00,$70,$A9,$00,$05,$A0,$11,$00,$0F,$A0,$11,$00,$D0,$A0,$12,$00,$50,$A0,$2F,$00,$D0,$A9,$00,$50,$F5,$50,$AB,$00,$0F,$A0,$28,$00
.byte $A5,$00,$0F,$A6,$00,$F0,$A4,$00,$0F,$00,$00,$05,$A9,$00,$0F,$A4,$00,$05,$A7,$00,$DD,$A7,$00,$0F,$00,$F0,$00,$F0,$A8,$00,$07,$70,$A4,$75,$FF,$FF,$F0,$A0,$11,$00,$F0,$A5,$00,$05,$A5,$00,$07,$A0,$11,$00,$50,$A0,$1D,$00,$0F,$A0,$18,$00,$05,$AB,$00,$0F,$A6,$00,$F0,$A4,$00,$0F,$00,$00,$05,$A9,$00,$0F,$A4,$00,$05,$A0,$26,$00
.byte $00,$00,$F0,$AA,$00,$F0,$00,$00,$F0,$A7,$00,$07,$A4,$00,$70,$AB,$00,$D0,$DD,$0D,$A5,$00,$D0,$A5,$00,$0F,$A8,$00,$07,$70,$05,$75,$75,$D5,$DF,$0F,$A5,$00,$F0,$A5,$00,$50,$A0,$19,$00,$50,$A4,$00,$0D,$AE,$00,$0F,$A5,$00,$07,$A8,$00,$D0,$AB,$00,$07,$AB,$00,$0F,$AF,$00,$F0,$AA,$00,$F0,$00,$00,$F0,$A7,$00,$07,$A4,$00,$70,$A0,$2C,$00
.byte $A0,$40,$00,$07,$A0,$BF,$00
.byte $A1
; Compressed size = 231 bytes

View File

@ -95,6 +95,8 @@ LAST_SPACEY_I EQU $88
LAST_MAP_COLOR EQU $89
DRAW_SKY EQU $8A
COLOR_MASK EQU $8B
KEY_COUNT EQU $8C
KEY_OFFSET EQU $8D
SHIPY EQU $E4