mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-02-12 23:31:43 +00:00
xmas2018: move bunch of files into place
This commit is contained in:
parent
aa4ba44522
commit
afd6e29146
@ -7,35 +7,21 @@ PNG_TO_RLE = ../gr-utils/png2rle
|
||||
|
||||
all: xmas2018.dsk
|
||||
|
||||
xmas2018.dsk: wreath.img
|
||||
# $(DOS33) -y xmas2018.dsk BSAVE -a 0x4000 XMAS2018
|
||||
xmas2018.dsk: XMAS2018 wreath.img
|
||||
$(DOS33) -y xmas2018.dsk BSAVE -a 0x4000 XMAS2018
|
||||
$(DOS33) -y xmas2018.dsk BSAVE -a 0x2000 wreath.img WREATH.IMG
|
||||
|
||||
####
|
||||
|
||||
MEGADEMO: megademo.o
|
||||
ld65 -o MEGADEMO megademo.o -C ../linker_scripts/apple2_4000.inc
|
||||
XMAS2018: xmas2018.o
|
||||
ld65 -o XMAS2018 xmas2018.o -C ../linker_scripts/apple2_4000.inc
|
||||
|
||||
megademo.o: megademo.s \
|
||||
xmas2018.o: xmas2018.s \
|
||||
zp.inc hardware.inc \
|
||||
gr_hline.s gr_offsets.s vapor_lock.s delay_a.s wait_keypress.s \
|
||||
vapor_lock.s delay_a.s wait_keypress.s \
|
||||
mockingboard.s \
|
||||
c64_opener.s c64.img.lz4 \
|
||||
falling_apple.s apple_40_96.inc \
|
||||
starring.s starring1.inc starring2.inc starring3.img.lz4\
|
||||
starring_people.s sp_names.inc fs.inc FS_HGRC.BIN.lz4 \
|
||||
deater.inc DEATER_HGRC.BIN.lz4 lg.inc LG_HGRC.BIN.lz4 \
|
||||
check_email.s email_40_96.inc \
|
||||
leaving.s leaving.inc tfv_sprites.inc \
|
||||
arrival.s arrival.inc \
|
||||
bird_mountain.s letters.s \
|
||||
waterfall.s waterfall_page1.inc waterfall_page2.inc \
|
||||
takeoff.s takeoff.inc takeoff.img.lz4 \
|
||||
mode7.s \
|
||||
space_bars.s text_print.s \
|
||||
fireworks.s fw_background.inc fw_state_machine.s fw.s \
|
||||
hgr.s random16.s move_letters.s
|
||||
ca65 -o megademo.o megademo.s -l megademo.lst
|
||||
wreath.img.lz4
|
||||
ca65 -o xmas2018.o xmas2018.s -l xmas2018.lst
|
||||
|
||||
|
||||
####
|
||||
|
84
xmas_2018/hardware.inc
Normal file
84
xmas_2018/hardware.inc
Normal file
@ -0,0 +1,84 @@
|
||||
;; HARDWARE LOCATIONS
|
||||
|
||||
KEYPRESS = $C000
|
||||
KEYRESET = $C010
|
||||
|
||||
;; SOFT SWITCHES
|
||||
CLR80COL = $C000 ; PAGE0/PAGE1 normal
|
||||
SET80COL = $C001 ; PAGE0/PAGE1 switches PAGE0 in Aux instead
|
||||
EIGHTYCOLOFF = $C00C
|
||||
EIGHTYCOLON = $C00D
|
||||
SPEAKER = $C030
|
||||
SET_GR = $C050
|
||||
SET_TEXT = $C051
|
||||
FULLGR = $C052
|
||||
TEXTGR = $C053
|
||||
PAGE0 = $C054
|
||||
PAGE1 = $C055
|
||||
LORES = $C056 ; Enable LORES graphics
|
||||
HIRES = $C057 ; Enable HIRES graphics
|
||||
AN3 = $C05E ; Annunciator 3
|
||||
|
||||
PADDLE_BUTTON0 = $C061
|
||||
PADDL0 = $C064
|
||||
PTRIG = $C070
|
||||
|
||||
;; BASIC ROUTINES
|
||||
|
||||
NORMAL = $F273
|
||||
|
||||
;; MONITOR ROUTINES
|
||||
|
||||
HLINE = $F819 ;; HLINE Y,$2C at A
|
||||
VLINE = $F828 ;; VLINE A,$2D at Y
|
||||
CLRSCR = $F832 ;; Clear low-res screen
|
||||
CLRTOP = $F836 ;; clear only top of low-res screen
|
||||
SETCOL = $F864 ;; COLOR=A
|
||||
TEXT = $FB36
|
||||
TABV = $FB5B ;; VTAB to A
|
||||
BASCALC = $FBC1 ;;
|
||||
VTAB = $FC22 ;; VTAB to CV
|
||||
HOME = $FC58 ;; Clear the text screen
|
||||
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||
SETINV = $FE80 ;; INVERSE
|
||||
SETNORM = $FE84 ;; NORMAL
|
||||
COUT = $FDED ;; output A to screen
|
||||
COUT1 = $FDF0 ;; output A to screen
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
COLOR_BLACK = 0
|
||||
COLOR_RED = 1
|
||||
COLOR_DARKBLUE = 2
|
||||
COLOR_PURPLE = 3
|
||||
COLOR_DARKGREEN = 4
|
||||
COLOR_GREY = 5
|
||||
COLOR_MEDIUMBLUE = 6
|
||||
COLOR_LIGHTBLUE = 7
|
||||
COLOR_BROWN = 8
|
||||
COLOR_ORANGE = 9
|
||||
COLOR_GREY2 = 10
|
||||
COLOR_PINK = 11
|
||||
COLOR_LIGHTGREEN = 12
|
||||
COLOR_YELLOW = 13
|
||||
COLOR_AQUA = 14
|
||||
COLOR_WHITE = 15
|
||||
|
||||
COLOR_BOTH_BLACK = $00
|
||||
COLOR_BOTH_RED = $11
|
||||
COLOR_BOTH_DARKBLUE = $22
|
||||
COLOR_BOTH_DARKGREEN = $44
|
||||
COLOR_BOTH_GREY = $55
|
||||
COLOR_BOTH_MEDIUMBLUE = $66
|
||||
COLOR_BOTH_LIGHTBLUE = $77
|
||||
COLOR_BOTH_BROWN = $88
|
||||
COLOR_BOTH_ORANGE = $99
|
||||
COLOR_BOTH_PINK = $BB
|
||||
COLOR_BOTH_LIGHTGREEN = $CC
|
||||
COLOR_BOTH_YELLOW = $DD
|
||||
COLOR_BOTH_AQUA = $EE
|
||||
COLOR_BOTH_WHITE = $FF
|
||||
|
10
xmas_2018/hello.bas
Normal file
10
xmas_2018/hello.bas
Normal file
@ -0,0 +1,10 @@
|
||||
5 PRINT "VMW PRODUCTIONS 2018 CHRISTMAS DEMO"
|
||||
10 PRINT
|
||||
10 PRINT "ONLY 22 YEARS SINCE THE LAST ONE"
|
||||
20 PRINT
|
||||
30 PRINT "* CODE: DEATER"
|
||||
40 PRINT "* DISK/LZ4: QKUMBA"
|
||||
50 PRINT "* MUSIC: F. MENDELSSOHN"
|
||||
60 PRINT "* PICTURES: "
|
||||
90 PRINT: X=PEEK(49237)
|
||||
100 PRINT CHR$ (4)"BRUN XMAS2018"
|
209
xmas_2018/mockingboard.s
Normal file
209
xmas_2018/mockingboard.s
Normal file
@ -0,0 +1,209 @@
|
||||
; ZP addresses
|
||||
|
||||
; left channel
|
||||
MOCK_6522_1_ORB = $C400 ; 6522 #1 port b data
|
||||
MOCK_6522_1_ORA = $C401 ; 6522 #1 port a data
|
||||
MOCK_6522_1_DDRB = $C402 ; 6522 #1 data direction port B
|
||||
MOCK_6522_1_DDRA = $C403 ; 6522 #1 data direction port A
|
||||
MOCK_6522_1_T1C_L = $C404 ; 6522 #1 Low-order counter
|
||||
MOCK_6522_1_T1C_H = $C405 ; 6522 #1 High-order counter
|
||||
MOCK_6522_1_T1L_L = $C406 ; 6522 #1 Low-order latch
|
||||
MOCK_6522_1_T1L_H = $C407 ; 6522 #1 High-order latch
|
||||
MOCK_6522_1_T2C_L = $C408 ; 6522 #1 Timer2 Low-order Latch/Counter
|
||||
MOCK_6522_1_T2C_H = $C409 ; 6522 #1 Timer2 High-order Latch/Counter
|
||||
MOCK_6522_1_SR = $C40A ; 6522 #1 Shift Register
|
||||
MOCK_6522_1_ACR = $C40B ; 6522 #1 Auxiliary Control Register
|
||||
MOCK_6522_1_PCR = $C40C ; 6522 #1 Peripheral Control Register
|
||||
MOCK_6522_1_IFR = $C40D ; 6522 #1 Interrupt Flag Register
|
||||
MOCK_6522_1_IER = $C40E ; 6522 #1 Interrupt Enable Register
|
||||
MOCK_6522_1_ORAN = $C40F ; 6522 #1 port a data, no handshake
|
||||
|
||||
; right channel
|
||||
MOCK_6522_2_ORB = $C480 ; 6522 #2 port b data
|
||||
MOCK_6522_2_ORA = $C481 ; 6522 #2 port a data
|
||||
MOCK_6522_2_DDRB = $C482 ; 6522 #2 data direction port B
|
||||
MOCK_6522_2_DDRA = $C483 ; 6522 #2 data direction port A
|
||||
MOCK_6522_2_T1C_L = $C484 ; 6522 #2 Low-order counter
|
||||
MOCK_6522_2_T1C_H = $C485 ; 6522 #2 High-order counter
|
||||
MOCK_6522_2_T1L_L = $C486 ; 6522 #2 Low-order latch
|
||||
MOCK_6522_2_T1L_H = $C487 ; 6522 #2 High-order latch
|
||||
MOCK_6522_2_T2C_L = $C488 ; 6522 #2 Timer2 Low-order Latch/Counter
|
||||
MOCK_6522_2_T2C_H = $C489 ; 6522 #2 Timer2 High-order Latch/Counter
|
||||
MOCK_6522_2_SR = $C48A ; 6522 #2 Shift Register
|
||||
MOCK_6522_2_ACR = $C48B ; 6522 #2 Auxiliary Control Register
|
||||
MOCK_6522_2_PCR = $C48C ; 6522 #2 Peripheral Control Register
|
||||
MOCK_6522_2_IFR = $C48D ; 6522 #2 Interrupt Flag Register
|
||||
MOCK_6522_2_IER = $C48E ; 6522 #2 Interrupt Enable Register
|
||||
MOCK_6522_2_ORAN = $C48F ; 6522 #2 port a data, no handshake
|
||||
|
||||
|
||||
; AY-3-8910 commands on port B
|
||||
; RESET BDIR BC1
|
||||
MOCK_AY_RESET = $0 ; 0 0 0
|
||||
MOCK_AY_INACTIVE = $4 ; 1 0 0
|
||||
MOCK_AY_READ = $5 ; 1 0 1
|
||||
MOCK_AY_WRITE = $6 ; 1 1 0
|
||||
MOCK_AY_LATCH_ADDR = $7 ; 1 1 1
|
||||
|
||||
|
||||
;========================
|
||||
; Mockingboard Init
|
||||
;========================
|
||||
; Initialize the 6522s
|
||||
; set the data direction for all pins of PortA/PortB to be output
|
||||
|
||||
mockingboard_init:
|
||||
lda #$ff ; all 8 pins output (1), portA
|
||||
|
||||
sta MOCK_6522_1_DDRA
|
||||
sta MOCK_6522_2_DDRA
|
||||
; only 3 pins output (1), port B
|
||||
lda #$7
|
||||
sta MOCK_6522_1_DDRB
|
||||
|
||||
sta MOCK_6522_2_DDRB
|
||||
|
||||
|
||||
reset_ay_both:
|
||||
;======================
|
||||
; Reset Left AY-3-8910
|
||||
;======================
|
||||
reset_ay_left:
|
||||
lda #MOCK_AY_RESET
|
||||
sta MOCK_6522_1_ORB
|
||||
lda #MOCK_AY_INACTIVE
|
||||
sta MOCK_6522_1_ORB
|
||||
|
||||
; AY-3-8913: Wait 5 us
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
;======================
|
||||
; Reset Right AY-3-8910
|
||||
;======================
|
||||
reset_ay_right:
|
||||
lda #MOCK_AY_RESET
|
||||
sta MOCK_6522_2_ORB
|
||||
lda #MOCK_AY_INACTIVE
|
||||
sta MOCK_6522_2_ORB
|
||||
|
||||
; AY-3-8913: Wait 5 us
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
;=========================
|
||||
; Setup initial conditions
|
||||
;=========================
|
||||
|
||||
; 7: ENABLE
|
||||
ldx #7
|
||||
lda #$38 ; noise disabled, ABC enabled
|
||||
sta MB_VALUE
|
||||
jsr write_ay_both
|
||||
|
||||
;=========================
|
||||
; Setup Interrupt Handler
|
||||
;=========================
|
||||
; Vector address goes to 0x3fe/0x3ff
|
||||
; FIXME: should chain any existing handler
|
||||
|
||||
lda #<interrupt_handler
|
||||
sta $03fe
|
||||
lda #>interrupt_handler
|
||||
sta $03ff
|
||||
|
||||
;============================
|
||||
; Enable 60Hz clock on 6522
|
||||
;============================
|
||||
|
||||
sei ; disable interrupts just in case
|
||||
|
||||
lda #$40 ; Continuous interrupts, don't touch PB7
|
||||
sta $C40B ; ACR register
|
||||
lda #$7F ; clear all interrupt flags
|
||||
sta $C40E ; IER register (interrupt enable)
|
||||
|
||||
lda #$C0
|
||||
sta $C40D ; IFR: 1100, enable interrupt on timer one oflow
|
||||
sta $C40E ; IER: 1100, enable timer one interrupt
|
||||
|
||||
lda #$1a
|
||||
sta $C404 ; write into low-order latch
|
||||
lda #$41
|
||||
sta $C405 ; write into high-order latch,
|
||||
; load both values into counter
|
||||
; clear interrupt and start counting
|
||||
|
||||
; 9c40 / 1e6 = .040s, 25Hz
|
||||
; 4fe7 / 1e6 = .020s, 50Hz
|
||||
; 411a / 1e6 = .016s, 60Hz
|
||||
|
||||
rts
|
||||
|
||||
interrupt_handler:
|
||||
; A saved by firmware in $45
|
||||
; sta $45
|
||||
txa
|
||||
pha ; save X
|
||||
tya
|
||||
pha ; save Y
|
||||
|
||||
bit $C404 ; clear 6522 interrupt by reading T1C-L ; 4
|
||||
|
||||
jsr play_music
|
||||
|
||||
pla
|
||||
tay ; restore Y
|
||||
pla
|
||||
tax ; restore X
|
||||
lda $45 ; restore A
|
||||
|
||||
rti ; return from interrupt ; 6
|
||||
|
||||
|
||||
;=========================================
|
||||
; Write Right/Left to save value AY-3-8910
|
||||
;=========================================
|
||||
; register in X
|
||||
; value in MB_VALUE
|
||||
|
||||
write_ay_both:
|
||||
; address
|
||||
stx MOCK_6522_1_ORA ; put address on PA1 ; 4
|
||||
stx MOCK_6522_2_ORA ; put address on PA2 ; 4
|
||||
lda #MOCK_AY_LATCH_ADDR ; latch_address on PB1 ; 2
|
||||
sta MOCK_6522_1_ORB ; latch_address on PB1 ; 4
|
||||
sta MOCK_6522_2_ORB ; latch_address on PB2 ; 4
|
||||
lda #MOCK_AY_INACTIVE ; go inactive ; 2
|
||||
sta MOCK_6522_1_ORB ; 4
|
||||
sta MOCK_6522_2_ORB ; 4
|
||||
;===========
|
||||
; 28
|
||||
; value
|
||||
lda MB_VALUE ; 3
|
||||
sta MOCK_6522_1_ORA ; put value on PA1 ; 4
|
||||
sta MOCK_6522_2_ORA ; put value on PA2 ; 4
|
||||
lda #MOCK_AY_WRITE ; ; 2
|
||||
sta MOCK_6522_1_ORB ; write on PB1 ; 4
|
||||
sta MOCK_6522_2_ORB ; write on PB2 ; 4
|
||||
lda #MOCK_AY_INACTIVE ; go inactive ; 2
|
||||
sta MOCK_6522_1_ORB ; 4
|
||||
sta MOCK_6522_2_ORB ; 4
|
||||
;===========
|
||||
; 31
|
||||
|
||||
rts ; 6
|
||||
;===========
|
||||
; 65
|
||||
|
||||
mockingboard_mute:
|
||||
ldx #7
|
||||
lda #$ff
|
||||
sta MB_VALUE
|
||||
jmp write_ay_both
|
240
xmas_2018/vapor_lock.s
Normal file
240
xmas_2018/vapor_lock.s
Normal file
@ -0,0 +1,240 @@
|
||||
; This took a while to track down
|
||||
; On Apple II/II+ the horiz blanking addr are $1000 higher than on IIe
|
||||
; So on II+ were outside video area, so unlikely to be our set value
|
||||
; (unless I foolishly use $ff which some uninitialized mem is set to)
|
||||
; Lots of this color fiddling is to make sure you don't accidentally
|
||||
; get runs of colors on IIe due to the horiz blank
|
||||
|
||||
; 0-5 aqua 6-12 = grey, 13 - 20 = yellow, 21-23 = aqua rainbow 14
|
||||
;
|
||||
;
|
||||
;16 0 YA
|
||||
;17 1 YA
|
||||
;18 2 YA
|
||||
;19 3 YA
|
||||
;20 4 YA
|
||||
;21 5 AA
|
||||
;22 6 AG
|
||||
;23 7 AG
|
||||
;0 8 AG
|
||||
;1 9 AG
|
||||
;2 10 AG
|
||||
;3 11 AG
|
||||
;4 12 AG
|
||||
;5 13 AY ****
|
||||
;6 14 GY RAINBOW
|
||||
;7 15 GY
|
||||
;8 16 GY
|
||||
;9 17 GY
|
||||
;10 18 GY
|
||||
;11 19 GY
|
||||
;12 20 GY
|
||||
;13 21 YA
|
||||
;14 22 YA
|
||||
;15 23 YA
|
||||
|
||||
|
||||
|
||||
;==============================
|
||||
; setup graphics for vapor lock
|
||||
;==============================
|
||||
vapor_lock:
|
||||
|
||||
; Clear Page0
|
||||
lda #$0
|
||||
sta DRAW_PAGE
|
||||
lda #$ee ; full screen white $ff
|
||||
jsr clear_gr
|
||||
|
||||
lda #$dd
|
||||
ldy #40
|
||||
jsr clear_page_loop ; make bottom half yellow $dd
|
||||
|
||||
lda #$aa
|
||||
ldy #24
|
||||
jsr clear_page_loop ; make middle grey2 $aa
|
||||
|
||||
lda #$ee
|
||||
ldy #10
|
||||
jsr clear_page_loop ; make top half aqua $ee
|
||||
|
||||
; set up a rainbow to aid in exact lock
|
||||
|
||||
ldy #00
|
||||
rainbow_loop:
|
||||
tya
|
||||
sta $728+20,Y
|
||||
iny
|
||||
cpy #20
|
||||
bne rainbow_loop
|
||||
|
||||
;btt:
|
||||
; jmp btt
|
||||
|
||||
|
||||
;=====================================================
|
||||
; attempt vapor lock
|
||||
; by reading the "floating bus" we can see most recently
|
||||
; written value of the display
|
||||
;=====================================================
|
||||
; See:
|
||||
; Have an Apple Split by Bob Bishop
|
||||
; Softalk, October 1982
|
||||
|
||||
; Challenges: each scan line scans 40 bytes.
|
||||
; The blanking happens at the *beginning*
|
||||
; So 65 bytes are scanned, starting at adress of the line - 25
|
||||
|
||||
; the scan takes 8 cycles, look for 4 repeats of the value
|
||||
; to avoid false positive found if the horiz blanking is mirroring
|
||||
; the line (max 3 repeats in that case)
|
||||
|
||||
vapor_lock_loop:
|
||||
|
||||
; first make sure we have a full line of $aa
|
||||
|
||||
lda #$aa ; 2
|
||||
zxloop:
|
||||
ldx #$04 ; 2
|
||||
wiloop:
|
||||
cmp $C051 ; read the floating bus ; 4
|
||||
bne zxloop ; if not, start from scratch ; 2/3
|
||||
dex ; we were, dec ; 2
|
||||
bne wiloop ; if not 4 of them, restart ; 3/2
|
||||
|
||||
; if we get here we read 4 proper pixels, 11 apart (2+4+2+2+3)
|
||||
; 0 11 22 33, clock at 34
|
||||
; 1 12 23 34, clock at 35
|
||||
; 2 13 24 35, clock at 36
|
||||
; 3 14 25 36, clock at 37
|
||||
; 4 15 26 37, clock at 38
|
||||
; 5 16 27 38, clock at 39
|
||||
; 6 17 28 39, clock at 40
|
||||
|
||||
|
||||
; X X X X
|
||||
; X X X X
|
||||
; X X X X
|
||||
; X X X X
|
||||
; X X X X
|
||||
; X X X X
|
||||
; X X X X
|
||||
; 0123456789012345678901234 0123456789012345678901234567890123456789
|
||||
; 1 2 1 2 3
|
||||
; hsync pixels
|
||||
; XXXXXXXXXXXXXXXXXXXXXXXXX 4444444444444444444444444444440123456789
|
||||
|
||||
; now look for the color change that
|
||||
; happens at line 13*8 = 104
|
||||
|
||||
lda #$dd ; 2
|
||||
zloop:
|
||||
ldx #$04 ; 2
|
||||
qloop:
|
||||
cmp $C051 ; read floating bus ; 4
|
||||
bne zloop ; 2/3
|
||||
dex ; 2
|
||||
bne qloop ; 3/2
|
||||
;============
|
||||
; 11
|
||||
|
||||
; Found it!
|
||||
; if we get here we read 4 proper pixels, 11 apart (2+4+2+2+3)
|
||||
; 0 11 22 33, clock at 34
|
||||
; 1 12 23 34, clock at 35
|
||||
; 2 13 24 35, clock at 36
|
||||
; 3 14 25 36, clock at 37
|
||||
; 4 15 26 37, clock at 38
|
||||
; 5 16 27 38, clock at 39
|
||||
; 6 17 28 39, clock at 40
|
||||
|
||||
|
||||
|
||||
|
||||
;btt:
|
||||
; jmp btt
|
||||
|
||||
; In theory near end of line 104
|
||||
|
||||
; now skip ahead 8 lines and read from the rainbow pattern we set
|
||||
; up to find our exact location
|
||||
|
||||
; delay 65 * 8 = 520
|
||||
; we back off a few to make sure we're not in the horiz blank
|
||||
; try to delay 510
|
||||
|
||||
; *NOTE* sometimes we end up going one (or rarely, two??) lines too far
|
||||
; so instead try going 7 lines ahead, and if still dd then one more
|
||||
|
||||
; so single step until we get a rainbow color
|
||||
|
||||
; go to next line, -10
|
||||
lda #28 ; 2
|
||||
jsr delay_a ; delay 25+28 = 53
|
||||
; total delay = 55
|
||||
|
||||
vl_try_again:
|
||||
lda #29 ; 2
|
||||
jsr delay_a ; delay 25+29 = 54
|
||||
; total delay = 56
|
||||
|
||||
|
||||
|
||||
lda $C051 ; 4
|
||||
cmp #$dd ; 2
|
||||
beq vl_try_again ; 3
|
||||
; -1
|
||||
|
||||
|
||||
; now near end of line 112
|
||||
;lda $0 ; nop to match old code ; 3
|
||||
; nop ; nop to match old code ; 2
|
||||
|
||||
lda $C051 ; 4
|
||||
;kbb:
|
||||
; jmp kbb
|
||||
|
||||
; we are in theory on line $728 = 14*8 = 112
|
||||
; so 112*65 = 7280 cycles from start
|
||||
|
||||
; we are actualy 25+20+A pixels in
|
||||
; 7325+A
|
||||
|
||||
; Our goal is line 114 at 7410 cycles
|
||||
; 7410 - 7325 = 85
|
||||
|
||||
; so kill 85-A cycles
|
||||
; -6 to do subtraction
|
||||
; -6 for rts
|
||||
; -25 for delay_a overhead
|
||||
|
||||
; +1 for fallthrough from previous loop?
|
||||
|
||||
eor #$ff ; 2
|
||||
sec ; 2
|
||||
adc #48 ; 2
|
||||
|
||||
jsr delay_a ; should total 48 cycles
|
||||
|
||||
|
||||
done_vapor_lock:
|
||||
rts ; 6
|
||||
|
||||
|
||||
|
||||
|
||||
; Some random related work
|
||||
; Docs:
|
||||
; Lancaster
|
||||
; Bishop
|
||||
; Sather
|
||||
|
||||
; Vaguely relevant but no help with the Apple II+ issue
|
||||
;
|
||||
; Eamon: Screen display and timing synchronization
|
||||
; on the Apple IIe and Apple IIgs
|
||||
;
|
||||
; Adams: Visually presented verbal stimuli by assembly
|
||||
; language on the Apple II computer.
|
||||
; Cavanagh and Anstis: Visual psychophysics on the
|
||||
; Apple II: Getting started
|
659
xmas_2018/wreath.s
Normal file
659
xmas_2018/wreath.s
Normal file
@ -0,0 +1,659 @@
|
||||
;=====================================
|
||||
; XMAS2018 -- Wreath Part
|
||||
;=====================================
|
||||
|
||||
|
||||
wreath:
|
||||
|
||||
;===================
|
||||
; init screen
|
||||
|
||||
;===================
|
||||
; init vars
|
||||
lda #15
|
||||
sta XPOS
|
||||
lda #38
|
||||
sta YPOS
|
||||
|
||||
lda #0
|
||||
sta FRAME
|
||||
sta FRAMEH
|
||||
|
||||
;=============================
|
||||
; Load graphic hgr
|
||||
|
||||
lda #<sb_background_hgr
|
||||
sta LZ4_SRC
|
||||
lda #>sb_background_hgr
|
||||
sta LZ4_SRC+1
|
||||
|
||||
lda #<(sb_background_hgr_end-8) ; skip checksum at end
|
||||
sta LZ4_END
|
||||
lda #>(sb_background_hgr_end-8) ; skip checksum at end
|
||||
sta LZ4_END+1
|
||||
|
||||
lda #<$2000
|
||||
sta LZ4_DST
|
||||
lda #>$2000
|
||||
sta LZ4_DST+1
|
||||
|
||||
jsr lz4_decode
|
||||
|
||||
;==============================
|
||||
; setup graphics for vapor lock
|
||||
;==============================
|
||||
|
||||
jsr vapor_lock ; 6
|
||||
|
||||
; vapor lock returns with us at beginning of hsync in line
|
||||
; 114 (7410 cycles), so with 5070 lines to go
|
||||
|
||||
; so we have 5070 + 4550 = 9620 to kill
|
||||
|
||||
jsr gr_copy_to_current ; 6+ 9292
|
||||
|
||||
; now we have 322 left
|
||||
|
||||
; GR part
|
||||
bit LORES ; 4
|
||||
bit SET_GR ; 4
|
||||
bit FULLGR ; 4
|
||||
|
||||
; 322 - 12 = 310
|
||||
; - 3 for jmp
|
||||
; 307
|
||||
|
||||
; Try X=9 Y=6 cycles=307
|
||||
|
||||
ldy #6 ; 2
|
||||
sbloopA:ldx #9 ; 2
|
||||
sbloopB:dex ; 2
|
||||
bne sbloopB ; 2nt/3
|
||||
dey ; 2
|
||||
bne sbloopA ; 2nt/3
|
||||
|
||||
jmp sb_begin_loop
|
||||
.align $100
|
||||
|
||||
|
||||
;================================================
|
||||
; Spacebars Loop
|
||||
;================================================
|
||||
; each scan line 65 cycles
|
||||
; 1 cycle each byte (40cycles) + 25 for horizontal
|
||||
; Total of 12480 cycles to draw screen
|
||||
; Vertical blank = 4550 cycles (70 scan lines)
|
||||
; Total of 17030 cycles to get back to where was
|
||||
|
||||
sb_begin_loop:
|
||||
|
||||
sb_display_loop:
|
||||
|
||||
|
||||
; 1 2 3
|
||||
;0123456789012345678901234567890123456789
|
||||
;LEVEL: 6 LIVES: 2 SCORE: 01978 HI: 02018
|
||||
|
||||
; 0-7 = text mode
|
||||
; 8-87 = hgr
|
||||
; 88 - 168 = split
|
||||
; 169 - 191 = gr
|
||||
|
||||
|
||||
; 8 lines of text mode
|
||||
|
||||
|
||||
ldy #8 ; 2
|
||||
|
||||
sb_text_loop:
|
||||
bit SET_TEXT ; 4
|
||||
lda #29 ; 2
|
||||
jsr delay_a ; 25+29
|
||||
|
||||
dey ; 2
|
||||
bne sb_text_loop ; 3
|
||||
;================
|
||||
; 65
|
||||
|
||||
|
||||
; -1
|
||||
|
||||
|
||||
sb_hgr_loop:
|
||||
; delay 80*65 = 5200
|
||||
; 2180
|
||||
; -2
|
||||
; +1
|
||||
; -8
|
||||
;=========================
|
||||
; 3011
|
||||
; -1038 play_music
|
||||
;================================
|
||||
; 1973
|
||||
|
||||
bit SET_GR ; 4
|
||||
bit HIRES ; 4
|
||||
|
||||
|
||||
|
||||
; draw sprite at same time
|
||||
lda #>ship_forward ; 2
|
||||
sta INH ; 3
|
||||
lda #<ship_forward ; 2
|
||||
sta INL ; 3
|
||||
jsr put_sprite ; 6
|
||||
; + 2164
|
||||
;===========
|
||||
; 2180
|
||||
|
||||
|
||||
jsr play_music ; 6+1032
|
||||
|
||||
; Try X=196 Y=2 cycles=1973
|
||||
|
||||
; Try X=59 Y=10 cycles=3011
|
||||
|
||||
ldy #2 ; 2
|
||||
sbloopC:ldx #196 ; 2
|
||||
sbloopD:dex ; 2
|
||||
bne sbloopD ; 2nt/3
|
||||
dey ; 2
|
||||
bne sbloopC ; 2nt/3
|
||||
|
||||
|
||||
|
||||
|
||||
sb_mixed:
|
||||
lda $0 ;kill 6 cycles (room for rts) ; 2
|
||||
ldx #9 ; 2
|
||||
ldy #9 ; 14 ; 126 ; 2
|
||||
|
||||
sb_mixed_loop:
|
||||
lda ss_multiples,x ; 4
|
||||
sta split_smc+1 ; 4
|
||||
split_smc:
|
||||
jsr split_4 ; 6+46
|
||||
dey ; 2
|
||||
bne sb_mixed_loop ; 3
|
||||
|
||||
; -1
|
||||
nop ; 2
|
||||
ldy #9 ; 2
|
||||
dex ; 2
|
||||
bne split_smc ; 3
|
||||
|
||||
; -1
|
||||
|
||||
; need to kill
|
||||
; -6 from offset
|
||||
; +1 fall through
|
||||
; -9 from check
|
||||
; +1 from other fallthrough
|
||||
;================
|
||||
; -13
|
||||
|
||||
|
||||
|
||||
sb_all_gr:
|
||||
; 23 lines of this
|
||||
|
||||
; 23 * 65 = 1495
|
||||
; -4
|
||||
; -13
|
||||
; =========
|
||||
; 1478
|
||||
|
||||
bit LORES ; 4
|
||||
|
||||
; Try X=41 Y=7 cycles=1478
|
||||
|
||||
ldy #7 ; 2
|
||||
sbloopE:ldx #41 ; 2
|
||||
sbloopF:dex ; 2
|
||||
bne sbloopF ; 2nt/3
|
||||
dey ; 2
|
||||
bne sbloopE ; 2nt/3
|
||||
|
||||
|
||||
|
||||
;======================================================
|
||||
; We have 4550 cycles in the vblank, use them wisely
|
||||
;======================================================
|
||||
|
||||
; do_nothing should be 4550
|
||||
; -3470 draw_framebuffer
|
||||
; -533 setup framebuffer
|
||||
; -21 frame count
|
||||
; -16 auto-move
|
||||
; -7 timeout
|
||||
; -34 keypress
|
||||
; -1 adjust center mark back
|
||||
; ===========
|
||||
; 468
|
||||
|
||||
|
||||
|
||||
;====================
|
||||
; Auto-move ship
|
||||
;====================
|
||||
; look it up in lookup table?
|
||||
|
||||
lda FRAMEH ; 3
|
||||
lsr ; 2
|
||||
and #$1f ; 2
|
||||
tax ; 2
|
||||
lda sb_x_lookup,X ; 4
|
||||
sta XPOS ; 3
|
||||
;=======
|
||||
; 16
|
||||
|
||||
;=====================
|
||||
; timeout
|
||||
;=====================
|
||||
; 7 cycles
|
||||
lda FRAMEH ; 3
|
||||
cmp #100 ; 2
|
||||
beq sb_exit ; 3
|
||||
; -1
|
||||
|
||||
; Try X=11 Y=8 cycles=489 R2
|
||||
; Try X=31 Y=3 cycles=484
|
||||
; Try X=22 Y=4 cycles=465 R3
|
||||
|
||||
lda $0
|
||||
|
||||
ldy #4 ; 2
|
||||
sbloop1:ldx #22 ; 2
|
||||
sbloop2:dex ; 2
|
||||
bne sbloop2 ; 2nt/3
|
||||
dey ; 2
|
||||
bne sbloop1 ; 2nt/3
|
||||
|
||||
jsr setup_framebuffer ; 6+527
|
||||
|
||||
jsr draw_framebuffer ; 6+3464
|
||||
|
||||
; Increment frame count
|
||||
; noflo: 16 + 2 + (3) = 21
|
||||
; oflo: 16 + 5 = 21
|
||||
inc FRAME ; 5
|
||||
lda FRAME ; 3
|
||||
and #3 ; 15 Hz ; 2
|
||||
sta FRAME ; 3
|
||||
beq sb_frame_oflo ; 3
|
||||
;============
|
||||
; 16
|
||||
; -1
|
||||
lda $0 ; nop ; 3
|
||||
jmp sb_frame_noflo ; 3
|
||||
sb_frame_oflo:
|
||||
inc FRAMEH ; 5
|
||||
sb_frame_noflo:
|
||||
|
||||
|
||||
; no keypress = 10+(24) = 34
|
||||
; left pressed = 9+8+12+(5)= 34
|
||||
; right pressed = 9+8+5+12 = 34
|
||||
|
||||
lda KEYPRESS ; 4
|
||||
bpl sb_no_keypress ; 3
|
||||
; -1
|
||||
jmp sb_handle_keypress ; 3
|
||||
sb_no_keypress:
|
||||
inc $0 ; 5
|
||||
dec $0 ; 5
|
||||
inc $0 ; 5
|
||||
dec $0 ; 5
|
||||
nop ; 2
|
||||
nop ; 2
|
||||
|
||||
jmp sb_display_loop ; 3
|
||||
|
||||
sb_handle_keypress:
|
||||
bit KEYRESET ; clear keypress ; 4
|
||||
cmp #'Q'|$80 ; 2
|
||||
beq sb_exit ; 3
|
||||
; -1
|
||||
|
||||
sb_check_left:
|
||||
cmp #$08|$80 ; left ; 2
|
||||
bne sb_check_right ; 3
|
||||
; -1
|
||||
dec XPOS ; 5
|
||||
|
||||
nop ; nop ; 2
|
||||
lda $0 ; nop ; 3
|
||||
jmp sb_display_loop ; 3
|
||||
|
||||
sb_check_right:
|
||||
cmp #$15|$80 ; 2
|
||||
bne sb_exit ; 3
|
||||
; -1
|
||||
inc XPOS ; 5
|
||||
|
||||
jmp sb_display_loop ; 3
|
||||
|
||||
sb_exit:
|
||||
cli ; re-enable interrupt music
|
||||
jmp blue_line
|
||||
|
||||
sb_real_exit:
|
||||
bit KEYRESET
|
||||
rts ; 6
|
||||
|
||||
|
||||
.align $100
|
||||
|
||||
; total =
|
||||
; 4 wide: = 53
|
||||
; 12 wide: = 253
|
||||
; 20 wide: = 421
|
||||
; 28 wide: = 813
|
||||
; 36 wide: = 757
|
||||
; 40 wide: = 1161
|
||||
; 6
|
||||
;====================================
|
||||
; 3464
|
||||
draw_framebuffer:
|
||||
|
||||
|
||||
; 2 + (4*(X*8)+5) -1 =
|
||||
; 2 + 4*(8+5) -1 = 85
|
||||
|
||||
ldx #4 ; 2
|
||||
fb4_loop:
|
||||
lda FRAMEBUFFER+0 ; 3
|
||||
sta $5a8+18-1,x ; 5
|
||||
dex ; 2
|
||||
bne fb4_loop ; 3
|
||||
|
||||
|
||||
; 2 + (12*(X*8)+5) -1 =
|
||||
; 2 + 12*(16+5) -1 = 253
|
||||
|
||||
ldx #12 ; 2
|
||||
fb12_loop:
|
||||
lda FRAMEBUFFER+1 ; 3
|
||||
sta $628+14-1,x ; 5
|
||||
lda FRAMEBUFFER+2 ; 3
|
||||
sta $6a8+14-1,x ; 5
|
||||
dex ; 2
|
||||
bne fb12_loop ; 3
|
||||
|
||||
; 2 + (20*(X*8)+5) -1 =
|
||||
; 2 + 20*(16+5) -1 = 421
|
||||
|
||||
ldx #20 ; 2
|
||||
fb20_loop:
|
||||
lda FRAMEBUFFER+3 ; 3
|
||||
sta $728+10-1,x ; 5
|
||||
lda FRAMEBUFFER+4 ; 3
|
||||
sta $7a8+10-1,x ; 5
|
||||
dex ; 2
|
||||
bne fb20_loop ; 3
|
||||
|
||||
|
||||
; 2 + (28*(X*8)+5) -1 =
|
||||
; 2 + 28*(24+5) -1 = 813
|
||||
|
||||
ldx #28 ; 2
|
||||
fb28_loop:
|
||||
lda FRAMEBUFFER+5 ; 3
|
||||
sta $450+6-1,x ; 5
|
||||
lda FRAMEBUFFER+6 ; 3
|
||||
sta $4d0+6-1,x ; 5
|
||||
lda FRAMEBUFFER+7 ; 3
|
||||
sta $550+6-1,x ; 5
|
||||
dex ; 2
|
||||
bne fb28_loop ; 3
|
||||
|
||||
|
||||
; 2 + (36*(X*8)+5) -1 =
|
||||
; 2 + 36*(16+5) -1 = 757
|
||||
|
||||
ldx #36 ; 2
|
||||
fb36_loop:
|
||||
lda FRAMEBUFFER+8 ; 3
|
||||
sta $5d0+2-1,x ; 5
|
||||
lda FRAMEBUFFER+9 ; 3
|
||||
sta $650+2-1,x ; 5
|
||||
dex ; 2
|
||||
bne fb36_loop ; 3
|
||||
|
||||
; 2 + (40*(X*8)+5) -1 =
|
||||
; 2 + 40*(24+5) + -1 = 1161
|
||||
|
||||
ldx #40 ; 2
|
||||
fb40_loop:
|
||||
lda FRAMEBUFFER+10 ; 3
|
||||
sta $6d0-1,x ; 5
|
||||
lda FRAMEBUFFER+11 ; 3
|
||||
sta $750-1,x ; 5
|
||||
lda FRAMEBUFFER+12 ; 3
|
||||
sta $7d0-1,x ; 5
|
||||
dex ; 2
|
||||
bne fb40_loop ; 3
|
||||
|
||||
; -1
|
||||
rts ; 6
|
||||
|
||||
|
||||
|
||||
;.align $100
|
||||
;.include "screen_split.s"
|
||||
;background_hgr:
|
||||
;.incbin "SB_BACKGROUNDC.BIN.lz4",11
|
||||
;background_hgr_end:
|
||||
|
||||
score_text:
|
||||
.byte 0,0
|
||||
.asciiz "LEVEL:6 LIVES:2 SCORE:001978 HI:002018"
|
||||
|
||||
|
||||
|
||||
; Note on the distance calculations
|
||||
; we use something simplistic here
|
||||
; see http://www.extentofthejam.com/pseudo/
|
||||
|
||||
; "Texture": 64?
|
||||
; 0 GREY 5,7,f,7,5,0,0,0
|
||||
; 1 0,0,0,0,0,0,0,0
|
||||
; 2 BLUE 2,6,f,6,2,0,0,0
|
||||
; 3 0,0,0,0,0,0,0,0
|
||||
; 4 GREEN 4,c,f,c,4,0,0,0
|
||||
; 5 0,0,0,0,0,0,0,0
|
||||
; 6 RED 1,b,f,b,1,0,0,0
|
||||
; 7 0,0,0,0,0,0,0,0
|
||||
.align $100
|
||||
;.align 64
|
||||
raster_texture:
|
||||
.byte $5,$7,$f,$7,$5,$0,$0,$0 ; grey
|
||||
.byte $0,$0,$0,$0,$0,$0,$0,$0
|
||||
.byte $2,$6,$f,$6,$2,$0,$0,$0 ; blue
|
||||
.byte $0,$0,$0,$0,$0,$0,$0,$0
|
||||
.byte $4,$c,$f,$c,$4,$0,$0,$0 ; green
|
||||
.byte $0,$0,$0,$0,$0,$0,$0,$0
|
||||
.byte $1,$b,$f,$b,$1,$0,$0,$0 ; red
|
||||
.byte $0,$0,$0,$0,$0,$0,$0,$0,$0
|
||||
|
||||
offset_lookup:
|
||||
|
||||
; Linear
|
||||
; .byte 26,24,22,20,18,16,14,12,10, 8, 6, 4, 2,0
|
||||
|
||||
.byte 29,24,20,16,13,10,8,6,4,3,2,1,0,0
|
||||
|
||||
sb_x_lookup:
|
||||
.byte 15,14,13,12,11,10, 9, 8, 8, 9,10,11,12,13,14,15
|
||||
.byte 15,16,17,18,19,20,21,22, 22,21,20,19,18,17,16,15
|
||||
|
||||
;.align $100
|
||||
|
||||
; 2 + 40*13 + 5 = 527
|
||||
setup_framebuffer:
|
||||
ldx #0 ; 2
|
||||
setup_fb_loop:
|
||||
lda offset_lookup,X ; 4
|
||||
clc ; 2
|
||||
adc FRAMEH ; 3
|
||||
and #$3f ; 2
|
||||
tay ; 2
|
||||
lda raster_texture,y ; 4
|
||||
asl ; 2
|
||||
asl ; 2
|
||||
asl ; 2
|
||||
asl ; 2
|
||||
;============
|
||||
; 25
|
||||
|
||||
ora raster_texture+1,y ; 4
|
||||
|
||||
sta FRAMEBUFFER,x ; zp ; 4
|
||||
inx ; 2
|
||||
cpx #13 ; 2
|
||||
bne setup_fb_loop ; 3
|
||||
;===========
|
||||
; 15
|
||||
|
||||
; -1
|
||||
rts ; 6
|
||||
|
||||
|
||||
|
||||
|
||||
blue_line:
|
||||
bit PAGE0 ; set page 0
|
||||
bit LORES ; Lo-res graphics
|
||||
bit FULLGR
|
||||
bit SET_GR ; set graphics
|
||||
|
||||
lda #0
|
||||
sta DRAW_PAGE
|
||||
jsr clear_all
|
||||
; jsr clear_screens_notext ; clear top/bottom of page 0/1
|
||||
|
||||
blueline_loop:
|
||||
|
||||
;================
|
||||
; draw the ship
|
||||
;================
|
||||
draw_ship_big:
|
||||
jsr clear_all
|
||||
|
||||
lda #>ship_forward
|
||||
sta INH
|
||||
lda #<ship_forward
|
||||
sta INL
|
||||
|
||||
lda #15
|
||||
sta XPOS
|
||||
lda #34
|
||||
sta YPOS
|
||||
jsr put_sprite
|
||||
|
||||
draw_ship_small:
|
||||
jsr delay_1s
|
||||
jsr clear_all
|
||||
|
||||
lda #>ship_small
|
||||
sta INH
|
||||
lda #<ship_small
|
||||
sta INL
|
||||
|
||||
lda #17
|
||||
sta XPOS
|
||||
lda #30
|
||||
sta YPOS
|
||||
jsr put_sprite
|
||||
|
||||
draw_ship_tiny:
|
||||
jsr delay_1s
|
||||
jsr clear_all
|
||||
|
||||
lda #>ship_tiny
|
||||
sta INH
|
||||
lda #<ship_tiny
|
||||
sta INL
|
||||
|
||||
lda #18
|
||||
sta XPOS
|
||||
lda #28
|
||||
sta YPOS
|
||||
jsr put_sprite
|
||||
|
||||
lda #18
|
||||
sta SPEED
|
||||
|
||||
jsr delay_1s
|
||||
|
||||
draw_ship_line:
|
||||
lda #2
|
||||
jsr delay_custom
|
||||
jsr clear_all
|
||||
|
||||
lda #COLOR_LIGHTBLUE
|
||||
sta COLOR
|
||||
|
||||
clc
|
||||
lda #20
|
||||
adc SPEED
|
||||
sta V2
|
||||
|
||||
sec
|
||||
lda #20
|
||||
sbc SPEED
|
||||
tay
|
||||
|
||||
; 20 - 0 to 0 - 20, 20 - 40
|
||||
|
||||
lda #26
|
||||
jsr hlin_double
|
||||
|
||||
dec SPEED
|
||||
bne draw_ship_line
|
||||
|
||||
draw_ship_done:
|
||||
lda #$77
|
||||
sta clear_all_color+1
|
||||
jsr clear_all
|
||||
|
||||
lda #2
|
||||
jsr delay_custom
|
||||
|
||||
lda #$0
|
||||
sta clear_all_color+1
|
||||
jsr clear_all
|
||||
|
||||
jsr delay_1s
|
||||
|
||||
lda #40
|
||||
jsr delay_custom
|
||||
|
||||
jmp sb_real_exit
|
||||
|
||||
;1s = 17030*60 = 1021800
|
||||
|
||||
|
||||
delay_1s:
|
||||
lda #20
|
||||
delay_custom:
|
||||
sta STATE
|
||||
delay_1s_loop:
|
||||
|
||||
; 17030 - 1038 = 15992
|
||||
|
||||
; jsr play_music ; 6+1032
|
||||
|
||||
; Try X=113 Y=28 cycles=15989 R3
|
||||
|
||||
ldy #28 ; 2
|
||||
sbloopU:ldx #113 ; 2
|
||||
sbloopV:dex ; 2
|
||||
bne sbloopV ; 2nt/3
|
||||
dey ; 2
|
||||
bne sbloopU ; 2nt/3
|
||||
|
||||
dec STATE
|
||||
bne delay_1s_loop
|
||||
|
||||
rts
|
224
xmas_2018/xmas2018.s
Normal file
224
xmas_2018/xmas2018.s
Normal file
@ -0,0 +1,224 @@
|
||||
; Apple II Megademo
|
||||
|
||||
; by deater (Vince Weaver) <vince@deater.net>
|
||||
|
||||
.include "zp.inc"
|
||||
.include "hardware.inc"
|
||||
|
||||
; external routines
|
||||
|
||||
play_music=$1000
|
||||
mockingboard_init=$1100
|
||||
mockingboard_mute=$11a1
|
||||
|
||||
|
||||
megademo_start: ; this should end up at $4000
|
||||
|
||||
;===================
|
||||
; Check for Apple II and patch
|
||||
;===================
|
||||
|
||||
lda $FBB3 ; IIe and newer is $06
|
||||
cmp #6
|
||||
beq apple_iie
|
||||
|
||||
lda #$54 ; patch the check_email font code
|
||||
sta ce_patch+1
|
||||
|
||||
|
||||
apple_iie:
|
||||
|
||||
;==================
|
||||
; Init mockingboard
|
||||
;==================
|
||||
|
||||
lda #0
|
||||
sta MB_PATTERN
|
||||
lda #$60
|
||||
sta MB_FRAME
|
||||
|
||||
jsr mockingboard_init
|
||||
|
||||
;===================
|
||||
; set graphics mode
|
||||
;===================
|
||||
jsr HOME
|
||||
|
||||
; jsr space_bars
|
||||
|
||||
; jsr arriving_there
|
||||
|
||||
; jsr fireworks
|
||||
|
||||
; C64 Opening Sequence
|
||||
|
||||
jsr c64_opener
|
||||
|
||||
; Falling Apple II
|
||||
|
||||
jsr falling_apple
|
||||
|
||||
; Starring Screens
|
||||
jsr starring
|
||||
|
||||
jsr setup_people_fs
|
||||
jsr starring_people
|
||||
jsr setup_people_deater
|
||||
jsr starring_people
|
||||
jsr setup_people_lg
|
||||
jsr starring_people
|
||||
|
||||
; E-mail arriving
|
||||
jsr check_email
|
||||
|
||||
; Leaving house
|
||||
jsr leaving_home
|
||||
|
||||
; Riding bird
|
||||
jsr bird_mountain
|
||||
|
||||
; Waterfall
|
||||
jsr waterfall
|
||||
|
||||
; Enter ship
|
||||
jsr rocket_takeoff
|
||||
|
||||
; mode7 (???)
|
||||
jsr mode7_flying
|
||||
|
||||
; Fly in space
|
||||
jsr space_bars
|
||||
|
||||
; Arrive
|
||||
jsr arriving_there
|
||||
|
||||
; Fireworks
|
||||
jsr fireworks
|
||||
|
||||
;==================
|
||||
; Game over
|
||||
;==================
|
||||
; we never get here
|
||||
;game_over_man:
|
||||
; jmp game_over_man
|
||||
|
||||
|
||||
.align $100
|
||||
.include "lz4_decode.s"
|
||||
.include "c64_opener.s"
|
||||
.include "falling_apple.s"
|
||||
.include "gr_unrle.s"
|
||||
.include "gr_copy.s"
|
||||
.include "starring.s"
|
||||
.include "starring_people.s"
|
||||
.include "check_email.s"
|
||||
.align $100
|
||||
.include "gr_offsets.s"
|
||||
.include "gr_hline.s"
|
||||
.include "vapor_lock.s"
|
||||
.include "delay_a.s"
|
||||
; .include "wait_keypress.s"
|
||||
.include "random16.s"
|
||||
.align $100
|
||||
.include "fireworks.s"
|
||||
.include "hgr.s"
|
||||
.include "bird_mountain.s"
|
||||
.include "move_letters.s"
|
||||
.align $100
|
||||
.include "gr_putsprite.s"
|
||||
.include "mode7.s"
|
||||
.include "space_bars.s"
|
||||
.include "takeoff.s"
|
||||
.include "leaving.s"
|
||||
.include "arrival.s"
|
||||
.include "waterfall.s"
|
||||
.include "text_print.s"
|
||||
.align $100
|
||||
.include "screen_split.s"
|
||||
|
||||
;============================
|
||||
; Include Sprites
|
||||
;============================
|
||||
.align $100
|
||||
.include "tfv_sprites.inc"
|
||||
.include "mode7_sprites.inc"
|
||||
|
||||
;=================================
|
||||
; Include Text for Sliding Letters
|
||||
; *DONT CROSS PAGES*
|
||||
;=================================
|
||||
.include "letters.s"
|
||||
|
||||
;============================
|
||||
; Include Lores Graphics
|
||||
; No Alignment Needed
|
||||
;============================
|
||||
|
||||
; falling_apple
|
||||
.include "apple_40_96.inc"
|
||||
|
||||
; starring
|
||||
.include "starring1.inc"
|
||||
.include "starring2.inc"
|
||||
.include "fs.inc"
|
||||
.include "deater.inc"
|
||||
.include "lg.inc"
|
||||
.include "sp_names.inc"
|
||||
|
||||
; e-mail
|
||||
.include "email_40_96.inc"
|
||||
|
||||
; leaving
|
||||
.include "leaving.inc"
|
||||
|
||||
; waterfall
|
||||
.include "waterfall_page1.inc"
|
||||
.include "waterfall_page2.inc"
|
||||
|
||||
; takeoff
|
||||
.include "takeoff.inc"
|
||||
|
||||
; arrival
|
||||
.include "arrival.inc"
|
||||
|
||||
;background:
|
||||
.include "fw_background.inc"
|
||||
|
||||
;============================
|
||||
; Include Hires Graphics
|
||||
; No Alignment Needed
|
||||
; FIXME: we can save 8 bytes per file by stripping checksums off end
|
||||
;============================
|
||||
|
||||
; starring
|
||||
starring3:
|
||||
.incbin "starring3.img.lz4",11
|
||||
starring3_end:
|
||||
fs_hgr:
|
||||
.incbin "FS_HGRC.BIN.lz4",11
|
||||
fs_hgr_end:
|
||||
deater_hgr:
|
||||
.incbin "DEATER_HGRC.BIN.lz4",11
|
||||
deater_hgr_end:
|
||||
lg_hgr:
|
||||
.incbin "LG_HGRC.BIN.lz4",11
|
||||
lg_hgr_end:
|
||||
|
||||
; bird mountain
|
||||
katahdin:
|
||||
.incbin "KATC.BIN.lz4",11 ; skip the header
|
||||
katahdin_end:
|
||||
|
||||
; takeoff
|
||||
takeoff_hgr:
|
||||
.incbin "takeoff.img.lz4",11
|
||||
takeoff_hgr_end:
|
||||
|
||||
; spacebars
|
||||
sb_background_hgr:
|
||||
.incbin "SB_BACKGROUNDC.BIN.lz4",11
|
||||
sb_background_hgr_end:
|
||||
|
||||
|
||||
|
||||
|
168
xmas_2018/zp.inc
Normal file
168
xmas_2018/zp.inc
Normal file
@ -0,0 +1,168 @@
|
||||
;; Zero Page
|
||||
|
||||
FRAMEBUFFER = $00 ; $00 - $0F
|
||||
|
||||
;; LZ4 addresses
|
||||
|
||||
LZ4_SRC = $00
|
||||
LZ4_DST = $02
|
||||
LZ4_END = $04
|
||||
COUNT = $06
|
||||
DELTA = $08
|
||||
|
||||
;; Zero page monitor routines addresses
|
||||
|
||||
WNDLFT = $20
|
||||
WNDWDTH = $21
|
||||
WNDTOP = $22
|
||||
WNDBTM = $23
|
||||
CH = $24
|
||||
CV = $25
|
||||
GBASL = $26
|
||||
GBASH = $27
|
||||
BASL = $28
|
||||
BASH = $29
|
||||
H2 = $2C
|
||||
V2 = $2D
|
||||
MASK = $2E
|
||||
COLOR = $30
|
||||
;INVFLG = $32
|
||||
|
||||
; dos33 zero page = 26-2f, 35-38, 3e 3f 40-4d
|
||||
; overlap applesoft 67-6a,6f,70,af,b0,ca-cd,d8
|
||||
|
||||
|
||||
; DOS33: Confirmed kills $68
|
||||
|
||||
RWTSL = $60
|
||||
RWTSH = $61
|
||||
DOSBUFL = $62
|
||||
DOSBUFH = $63
|
||||
FILEML = $64
|
||||
FILEMH = $65
|
||||
|
||||
|
||||
FRAME = $60
|
||||
FRAMEH = $61
|
||||
WAITING = $62
|
||||
LETTERL = $63
|
||||
LETTERH = $64
|
||||
LETTERX = $65
|
||||
LETTERY = $66
|
||||
LETTERD = $67
|
||||
LETTER = $68
|
||||
BLARGH = $69
|
||||
|
||||
;FACTOR_I = $66
|
||||
;FACTOR_F = $67
|
||||
;DX_I = $68
|
||||
;DX_F = $69
|
||||
;SPACEX_I = $6A
|
||||
;SPACEX_F = $6B
|
||||
;CX_I = $6C
|
||||
;CX_F = $6D
|
||||
;DY_I = $6E
|
||||
;DY_F = $6F
|
||||
|
||||
|
||||
ZPOS = $78
|
||||
|
||||
REGISTER_DUMP = $70
|
||||
A_FINE_TONE = $70
|
||||
A_COARSE_TONE = $71
|
||||
B_FINE_TONE = $72
|
||||
B_COARSE_TONE = $73
|
||||
C_FINE_TONE = $74
|
||||
C_COARSE_TONE = $75
|
||||
NOISE = $76
|
||||
ENABLE = $77
|
||||
A_VOLUME = $78
|
||||
B_VOLUME = $79
|
||||
C_VOLUME = $7A
|
||||
ENVELOPE_FINE = $7B
|
||||
ENVELOPE_COARSE = $7C
|
||||
ENVELOPE_SHAPE = $7D
|
||||
|
||||
|
||||
COPY_OFFSET = $7E
|
||||
DECODER_STATE = $7F
|
||||
|
||||
|
||||
REGISTER_DUMP2 = $80
|
||||
A_FINE_TONE2 = $80
|
||||
A_COARSE_TONE2 = $81
|
||||
B_FINE_TONE2 = $82
|
||||
B_COARSE_TONE2 = $83
|
||||
C_FINE_TONE2 = $84
|
||||
C_COARSE_TONE2 = $85
|
||||
NOISE2 = $86
|
||||
ENABLE2 = $87
|
||||
A_VOLUME2 = $88
|
||||
B_VOLUME2 = $89
|
||||
C_VOLUME2 = $8A
|
||||
ENVELOPE_FINE2 = $8B
|
||||
ENVELOPE_COARS2 = $8C
|
||||
ENVELOPE_SHAPE2 = $8D
|
||||
LYRICSL = $8E
|
||||
LYRICSH = $8F
|
||||
|
||||
FRAME_COUNT = $90
|
||||
MB_VALUE = $91
|
||||
MB_ADDRL = $91
|
||||
MB_ADDRH = $92
|
||||
DONE_PLAYING = $93
|
||||
MB_CHUNK_OFFSET = $94
|
||||
MB_FRAME = $94
|
||||
MB_PATTERN = $95
|
||||
CHUNKSIZE = $95
|
||||
LZ4_DONE = $96
|
||||
DECODE_ERROR = $97
|
||||
COPY_TIME = $98
|
||||
DECOMPRESS_TIME = $99
|
||||
TIME_TAKEN = $9A
|
||||
LYRICS_ACTIVE = $9B
|
||||
;FORTYCOL = $9C
|
||||
CURSOR = $9D
|
||||
|
||||
; More zero-page addresses
|
||||
; we try not to conflict with anything DOS, MONITOR or BASIC related
|
||||
|
||||
;COLOR1 = $E0
|
||||
;COLOR2 = $E1
|
||||
;MATCH = $E2
|
||||
XX = $E3
|
||||
YY = $E4
|
||||
HGR_COLOR = $E4
|
||||
;SHIPY = $E4
|
||||
;YADD = $E5
|
||||
;LOOP = $E6
|
||||
;MEMPTRL = $E7
|
||||
;MEMPTRH = $E8
|
||||
;NAMEL = $E9
|
||||
;NAMEH = $EA
|
||||
;NAMEX = $EB
|
||||
;CHAR = $EC
|
||||
STATE = $ED
|
||||
DISP_PAGE = $ED
|
||||
DRAW_PAGE = $EE
|
||||
OFFSET = $EF
|
||||
|
||||
;FIRST = $F0
|
||||
|
||||
LASTKEY = $F1
|
||||
PADDLE_STATUS = $F2
|
||||
|
||||
SPRITETEMP = $F2
|
||||
XPOS = $F3
|
||||
YPOS = $F4
|
||||
TEMP = $FA
|
||||
TEMPY = $FB
|
||||
INL = $FC
|
||||
INH = $FD
|
||||
OUTL = $FE
|
||||
OUTH = $FF
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user