outline: demo: sorta getting close

This commit is contained in:
Vince Weaver 2021-05-10 18:24:49 -04:00
parent 8cee9a1994
commit e9de194951
77 changed files with 2018 additions and 33 deletions

View File

@ -19,7 +19,7 @@ outline2021.dsk: QBOOT QLOAD OUTLINE
$(DOS33_RAW) outline2021.dsk 0 2 QBOOT 1 1
$(DOS33_RAW) outline2021.dsk 0 4 QBOOT 2 1
$(DOS33_RAW) outline2021.dsk 1 0 QLOAD 0 14
$(DOS33_RAW) outline2021.dsk 2 0 OUTLINE 0 80
$(DOS33_RAW) outline2021.dsk 2 0 OUTLINE 0 96
@ -50,11 +50,11 @@ qboot_sector.o: qboot_sector.s qboot_stage2.s
###
OUTLINE: outline.o
ld65 -o OUTLINE outline.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
ld65 -o OUTLINE outline.o -C apple2_5000.inc
outline.o: outline.s zp.inc \
shimmer.s a2_inside.s drops.s wires.s \
rotoplasma_tiny.s rocket_away.s \
rotoplasma_tiny.s rocket_away.s anothermist.s \
flying_dir.inc tfv_flying.s flying_mode7.s credits.s
ca65 -o outline.o outline.s -l outline.lst

View File

@ -1,10 +1,10 @@
Memory Usage:
$200
$1000-$10FF wires_lookup/plasma_lookup
$1000-$10FF wires_lookup/plasma_lookup/bg for mysto
$1100-$11FF plasma lookup
$1200-$12FF plasma lookup
$2000-$3FFF hires page 1
$4000-$6000 hires page 2 (24k)
$6000-????? code
$4000-$6000 hires page 2
$6000-????? code 21k
$B600-$BDFF multiply tables (2k)

View File

@ -0,0 +1,105 @@
PNG2RLE = ../../../../utils/gr-utils/png2rle
PNG2GR = ../../../../utils/gr-utils/png2gr
PNG2HGR = ../../../../utils/hgr-utils/png2hgr
LZSA = ~/research/lzsa/lzsa/lzsa
B2D = ../../../../utils/bmp2dhr/b2d
all: rocket.inc
rocket.inc: \
ootw_uboot_bg.lzsa \
ootw_uboot_flash1.lzsa \
ootw_uboot_flash2.lzsa \
swim01.lzsa swim02.lzsa swim03.lzsa \
swim04.lzsa swim05.lzsa swim06.lzsa \
another_pool.lzsa \
ashore01.lzsa ashore02.lzsa ashore03.lzsa ashore04.lzsa \
ashore05.lzsa ashore06.lzsa ashore07.lzsa ashore08.lzsa \
ashore09.lzsa ashore10.lzsa ashore11.lzsa ashore12.lzsa \
ashore13.lzsa ashore14.lzsa ashore15.lzsa ashore16.lzsa \
ashore17.lzsa ashore18.lzsa ashore19.lzsa ashore20.lzsa \
ashore21.lzsa ashore22.lzsa ashore23.lzsa ashore24.lzsa \
clock_n.lzsa tree5_n.lzsa tree4_n.lzsa tree2_n.lzsa tree1_n.lzsa \
pool_n.lzsa step_top_n.lzsa pad_n.lzsa spaceship_path_w.lzsa \
spaceship_far_n.lzsa spaceship_switch_n.lzsa spaceship_door_n.lzsa \
spaceship_door_open.lzsa \
takeoff01.lzsa takeoff02.lzsa takeoff03.lzsa takeoff04.lzsa \
takeoff05.lzsa takeoff06.lzsa takeoff07.lzsa takeoff08.lzsa \
takeoff09.lzsa takeoff10.lzsa takeoff11.lzsa takeoff12.lzsa
echo "ootw_uboot_bg_lzsa: .incbin \"ootw_uboot_bg.lzsa\"" > rocket.inc
echo "ootw_uboot_flash1_lzsa: .incbin \"ootw_uboot_flash1.lzsa\"" >> rocket.inc
echo "ootw_uboot_flash2_lzsa: .incbin \"ootw_uboot_flash2.lzsa\"" >> rocket.inc
echo "swim01_lzsa: .incbin \"swim01.lzsa\"" >> rocket.inc
echo "swim02_lzsa: .incbin \"swim02.lzsa\"" >> rocket.inc
echo "swim03_lzsa: .incbin \"swim03.lzsa\"" >> rocket.inc
echo "swim04_lzsa: .incbin \"swim04.lzsa\"" >> rocket.inc
echo "swim05_lzsa: .incbin \"swim05.lzsa\"" >> rocket.inc
echo "swim06_lzsa: .incbin \"swim06.lzsa\"" >> rocket.inc
echo "another_pool_lzsa: .incbin \"another_pool.lzsa\"" >> rocket.inc
echo "ashore01_lzsa: .incbin \"ashore01.lzsa\"" >> rocket.inc
echo "ashore02_lzsa: .incbin \"ashore02.lzsa\"" >> rocket.inc
echo "ashore03_lzsa: .incbin \"ashore03.lzsa\"" >> rocket.inc
echo "ashore04_lzsa: .incbin \"ashore04.lzsa\"" >> rocket.inc
echo "ashore05_lzsa: .incbin \"ashore05.lzsa\"" >> rocket.inc
echo "ashore06_lzsa: .incbin \"ashore06.lzsa\"" >> rocket.inc
echo "ashore07_lzsa: .incbin \"ashore07.lzsa\"" >> rocket.inc
echo "ashore08_lzsa: .incbin \"ashore08.lzsa\"" >> rocket.inc
echo "ashore09_lzsa: .incbin \"ashore09.lzsa\"" >> rocket.inc
echo "ashore10_lzsa: .incbin \"ashore10.lzsa\"" >> rocket.inc
echo "ashore11_lzsa: .incbin \"ashore11.lzsa\"" >> rocket.inc
echo "ashore12_lzsa: .incbin \"ashore12.lzsa\"" >> rocket.inc
echo "ashore13_lzsa: .incbin \"ashore13.lzsa\"" >> rocket.inc
echo "ashore14_lzsa: .incbin \"ashore14.lzsa\"" >> rocket.inc
echo "ashore15_lzsa: .incbin \"ashore15.lzsa\"" >> rocket.inc
echo "ashore16_lzsa: .incbin \"ashore16.lzsa\"" >> rocket.inc
echo "ashore17_lzsa: .incbin \"ashore17.lzsa\"" >> rocket.inc
echo "ashore18_lzsa: .incbin \"ashore18.lzsa\"" >> rocket.inc
echo "ashore19_lzsa: .incbin \"ashore19.lzsa\"" >> rocket.inc
echo "ashore20_lzsa: .incbin \"ashore20.lzsa\"" >> rocket.inc
echo "ashore21_lzsa: .incbin \"ashore21.lzsa\"" >> rocket.inc
echo "ashore22_lzsa: .incbin \"ashore22.lzsa\"" >> rocket.inc
echo "ashore23_lzsa: .incbin \"ashore23.lzsa\"" >> rocket.inc
echo "ashore24_lzsa: .incbin \"ashore24.lzsa\"" >> rocket.inc
echo "clock_n_lzsa: .incbin \"clock_n.lzsa\"" >> rocket.inc
echo "tree5_n_lzsa: .incbin \"tree5_n.lzsa\"" >> rocket.inc
echo "tree4_n_lzsa: .incbin \"tree4_n.lzsa\"" >> rocket.inc
echo "tree2_n_lzsa: .incbin \"tree2_n.lzsa\"" >> rocket.inc
echo "tree1_n_lzsa: .incbin \"tree1_n.lzsa\"" >> rocket.inc
echo "pool_n_lzsa: .incbin \"pool_n.lzsa\"" >> rocket.inc
echo "step_top_n_lzsa: .incbin \"step_top_n.lzsa\"" >> rocket.inc
echo "pad_n_lzsa: .incbin \"pad_n.lzsa\"" >> rocket.inc
echo "spaceship_path_w_lzsa: .incbin \"spaceship_path_w.lzsa\"" >> rocket.inc
echo "spaceship_far_n_lzsa: .incbin \"spaceship_far_n.lzsa\"" >> rocket.inc
echo "spaceship_switch_n_lzsa: .incbin \"spaceship_switch_n.lzsa\"" >> rocket.inc
echo "spaceship_door_n_lzsa: .incbin \"spaceship_door_n.lzsa\"" >> rocket.inc
echo "spaceship_door_open_lzsa: .incbin \"spaceship_door_open.lzsa\"" >> rocket.inc
echo "takeoff01_lzsa: .incbin \"takeoff01.lzsa\"" >> rocket.inc
echo "takeoff02_lzsa: .incbin \"takeoff02.lzsa\"" >> rocket.inc
echo "takeoff03_lzsa: .incbin \"takeoff03.lzsa\"" >> rocket.inc
echo "takeoff04_lzsa: .incbin \"takeoff04.lzsa\"" >> rocket.inc
echo "takeoff05_lzsa: .incbin \"takeoff05.lzsa\"" >> rocket.inc
echo "takeoff06_lzsa: .incbin \"takeoff06.lzsa\"" >> rocket.inc
echo "takeoff07_lzsa: .incbin \"takeoff07.lzsa\"" >> rocket.inc
echo "takeoff08_lzsa: .incbin \"takeoff08.lzsa\"" >> rocket.inc
echo "takeoff09_lzsa: .incbin \"takeoff09.lzsa\"" >> rocket.inc
echo "takeoff10_lzsa: .incbin \"takeoff10.lzsa\"" >> rocket.inc
echo "takeoff11_lzsa: .incbin \"takeoff11.lzsa\"" >> rocket.inc
echo "takeoff12_lzsa: .incbin \"takeoff12.lzsa\"" >> rocket.inc
###
%.gr: %.png
$(PNG2GR) $< $@
%.lzsa: %.gr
$(LZSA) -r -f2 $< $@
###
clean:
rm -f *~ rocket.inc *.lzsa *.gr *.hgr

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,103 @@
; another_mist -- a silly demo
; apologies to Cyan and Eric Chahi
another_mist:
;===========================
; Enable graphics
;===========================
bit LORES
bit SET_GR
bit FULLGR
bit KEYRESET
;===========================
; Setup pages (is this necessary?)
;===========================
lda #0
sta DRAW_PAGE
lda #4
sta DISP_PAGE
lda #<another_sequence
sta INTRO_LOOPL
lda #>another_sequence
sta INTRO_LOOPH
jsr run_sequence
rts
another_sequence:
.byte 255 ; load to bg
.word ootw_uboot_bg_lzsa ; this
.byte 128+5 ; .word ootw_uboot_flash1_lzsa ; (3)
.byte 128+5 ; .word ootw_uboot_flash2_lzsa ; (3)
.byte 128+8 ; .word swim01_lzsa ; (3)
.byte 128+8 ; .word swim02_lzsa ; (3)
.byte 128+8 ; .word swim03_lzsa ; (3)
.byte 128+8 ; .word swim04_lzsa ; (3)
.byte 128+8 ; .word swim05_lzsa ; (3)
.byte 128+8 ; .word swim06_lzsa ; (3)
.byte 255 ; load to bg
.word another_pool_lzsa ; this
.byte 128+50; .word ashore01
.byte 128+50; .word ashore02
.byte 128+50; .word ashore03
.byte 128+50; .word ashore04
.byte 128+50; .word ashore05
.byte 128+50; .word ashore06
.byte 128+50; .word ashore07
.byte 128+50; .word ashore08
.byte 128+50; .word ashore09
.byte 128+50; .word ashore10
.byte 128+50; .word ashore11
.byte 128+50; .word ashore12
.byte 128+50; .word ashore13
.byte 128+50; .word ashore14
.byte 128+50; .word ashore15
.byte 128+50; .word ashore16
.byte 128+50; .word ashore17
.byte 128+50; .word ashore18
.byte 128+50; .word ashore19
.byte 128+50; .word ashore20
.byte 128+50; .word ashore21
.byte 128+50; .word ashore22
.byte 128+50; .word ashore23
.byte 128+50; .word ashore24
.byte 255 ; load to bg
.word clock_n_lzsa ; this
.byte 128+90; .word tree5_n
.byte 128+80; .word tree4_n
.byte 128+70; .word tree2_n
.byte 128+70; .word tree1_n
.byte 128+70; .word pool_n
.byte 128+70; .word step_top_n
.byte 128+70; .word pad_n
.byte 128+70; .word spaceship_path_w
.byte 128+70; .word spaceship_far_n
.byte 128+70; .word spaceship_switch_n
.byte 128+70; .word spaceship_door_n
.byte 128+90; .word spaceship_door_open
.byte 255 ; load to bg
.word spaceship_far_n_lzsa
.byte 80
.word takeoff01_lzsa
.byte 128+50; .word takeoff_02
.byte 128+40; .word takeoff_03
.byte 128+20; .word takeoff_04
.byte 128+20; .word takeoff_05
.byte 128+20; .word takeoff_06
.byte 128+20; .word takeoff_07
.byte 128+20; .word takeoff_08
.byte 128+20; .word takeoff_00
.byte 128+20; .word takeoff_10
.byte 128+40; .word takeoff_11
.byte 128+80; .word takeoff_12
.byte 0

View File

@ -0,0 +1,12 @@
MEMORY {
ZP: start = $00, size = $1A, type = rw;
RAM: start = $5000, size = $7000, file = %O;
}
SEGMENTS {
CODE: load = RAM, type = ro, align=$100;
RODATA: load = RAM, type = ro;
DATA: load = RAM, type = rw;
BSS: load = RAM, type = bss, define = yes;
ZEROPAGE: load = ZP, type = zp;
}

View File

@ -0,0 +1,125 @@
;=========================================================
; gr_overlay, 40x40 version
;=========================================================
; copy 0xc00 to DRAW_PAGE
; then overlay with 0x1000, treating 0xa as transparent
gr_overlay_40x40:
jsr gr_copy_to_current_40x40
gr_overlay_40x40_noload:
lda #40
sta CH ; xsize is in CH ; 3
lda #38
sta CV ; ysize is in CV ; 3
jmp gr_overlay_custom
;=========================================================
; gr_overlay, 40x48 version
;=========================================================
; copy 0xc00 to DRAW_PAGE
; then overlay with 0x1000, treating 0xa as transparent
gr_overlay:
jsr gr_copy_to_current
gr_overlay_noload:
lda #40
sta CH ; xsize is in CH ; 3
lda #46
sta CV ; ysize is in CV ; 3
gr_overlay_custom:
ldy #0
gr_overlay_loop:
ldy CV ; 3
lda gr_offsets,Y ; lookup low-res memory address ; 4
sta OUTL ; store out low byte of addy ; 3
sta INL
lda gr_offsets+1,Y ; look up high byte ; 4
clc
adc DRAW_PAGE ; ; 3
sta OUTH ; and store it out ; 3
lda gr_offsets+1,Y ; look up high byte ; 4
clc
adc #$c ; force to start at $1000
sta INH
; OUTH:OUTL now points at right place
ldx CH ; load xsize into x ; 3
ldy #0
gr_overlay_put_pixel:
lda (INL),Y ; get sprite colors ; 5
; check if completely transparent
; if so, skip
cmp #$aa ; if all zero, transparent ; 2
beq gr_overlay_done_draw ; don't draw it ; 2nt/3
sta COLOR ; save color for later ; 3
; check if top pixel transparent
and #$f0 ; check if top nibble zero ; 2
cmp #$a0
bne gr_overlay_bottom ; if not skip ahead ; 2nt/3
lda COLOR
and #$0f
sta COLOR
lda #$f0 ; setup mask ; 2
sta MASK ; 3
bmi gr_overlay_mask ; always? ; 3
gr_overlay_bottom:
lda COLOR ; re-load color ; 3
and #$0f ; check if bottom nibble zero ; 2
cmp #$0a
bne overlay_put_sprite_all ; if not, skip ahead ; 2nt/3
;=============
; 7/8
lda COLOR
and #$f0
sta COLOR
lda #$0f ; 2
sta MASK ; setup mask ; 3
;===========
; 5
gr_overlay_mask:
lda (OUTL),Y ; get color at output ; 5
and MASK ; mask off unneeded part ; 3
ora COLOR ; or the color in ; 3
sta (OUTL),Y ; store it back ; 6
jmp gr_overlay_done_draw ; we are done ; 3
overlay_put_sprite_all:
lda COLOR ; load color ; 3
sta (OUTL),Y ; and write it out ; 6
gr_overlay_done_draw:
iny
dex ; decrement x counter ; 2
bne gr_overlay_put_pixel ; if not done, keep looping ; 2nt/3
dec CV ; decemenet total y count ; 5
dec CV
bpl gr_overlay_loop ; loop if not done ; 2nt/3
rts ; return ; 6

View File

@ -0,0 +1,353 @@
;=============================================
; put_sprite_crop
;=============================================
; Sprite to display in INH,INL
; Location is XPOS,YPOS
; Note, only works if YPOS is multiple of two
; transparent color is $A (grey #2)
; this means we can have black ($0) in a sprite
; FIXME: force YPOS to be even?
put_sprite_crop:
ldy #0 ; byte 0 is xsize ; 2
lda (INL),Y ; 5
sta CH ; xsize is in CH ; 3
iny ; 2
clc
adc XPOS
sta XMAX
lda (INL),Y ; byte 1 is ysize ; 5
sta CV ; ysize is in CV ; 3
iny ; 2
lda YPOS ; make a copy of ypos ; 3
sta TEMPY ; as we modify it ; 3
;===========
; 28
put_sprite_crop_loop:
sty TEMP ; save sprite pointer ; 3
ldy TEMPY ; 3
bpl put_sprite_crop_pos ; if < 0, skip to next
clc ; skip line in sprite too
lda TEMP
adc CH
tay
bne crop_increment_y
put_sprite_crop_pos:
cpy #48 ; bge if >= 48, done sprite
bcs crop_sprite_done
lda gr_offsets,Y ; lookup low-res memory address ; 4
clc ; 2
adc XPOS ; add in xpos ; 3
sta OUTL ; store out low byte of addy ; 3
clc ; never wraps, handle negative
lda gr_offsets+1,Y ; look up high byte ; 4
adc DRAW_PAGE ; ; 3
sta OUTH ; and store it out ; 3
ldy TEMP ; restore sprite pointer ; 3
; OUTH:OUTL now points at right place
ldx XPOS ; load xposition into x ; 3
;===========
; 34
crop_put_sprite_pixel:
lda (INL),Y ; get sprite colors ; 5
iny ; increment sprite pointer ; 2
sty TEMP ; save sprite pointer ; 3
cpx #0 ; if off-screen left, skip draw
bmi skip_drawing
cpx #40
bcs skip_drawing ; if off-screen right, skip draw
ldy #$0 ; 2
; check if completely transparent
; if so, skip
cmp #$aa ; if all zero, transparent ; 2
beq crop_put_sprite_done_draw ; don't draw it ; 2nt/3
;==============
; 16/17
sta COLOR ; save color for later ; 3
; check if top pixel transparent
and #$f0 ; check if top nibble zero ; 2
cmp #$a0
bne crop_put_sprite_bottom ; if not skip ahead ; 2nt/3
;==============
; 7/8
lda COLOR
and #$0f
sta COLOR
lda #$f0 ; setup mask ; 2
sta MASK ; 3
bmi crop_put_sprite_mask ; always? ; 3
;=============
; 8
crop_put_sprite_bottom:
lda COLOR ; re-load color ; 3
and #$0f ; check if bottom nibble zero ; 2
cmp #$0a
bne crop_put_sprite_all ; if not, skip ahead ; 2nt/3
;=============
; 7/8
lda COLOR
and #$f0
sta COLOR
lda #$0f ; 2
sta MASK ; setup mask ; 3
;===========
; 5
crop_put_sprite_mask:
lda (OUTL),Y ; get color at output ; 5
and MASK ; mask off unneeded part ; 3
ora COLOR ; or the color in ; 3
sta (OUTL),Y ; store it back ; 6
jmp crop_put_sprite_done_draw ; we are done ; 3
;===========
; 20
crop_put_sprite_all:
lda COLOR ; load color ; 3
sta (OUTL),Y ; and write it out ; 6
;============
; 9
crop_put_sprite_done_draw:
skip_drawing:
ldy TEMP ; restore sprite pointer ; 3
inc OUTL ; increment output pointer ; 5
inx ; increment x counter ; 2
cpx XMAX
bne crop_put_sprite_pixel ; if not done, keep looping ; 2nt/3
;==============
; 12/13
crop_increment_y:
inc TEMPY ; each line has two y vars ; 5
inc TEMPY ; 5
dec CV ; decemenet total y count ; 5
bne put_sprite_crop_loop ; loop if not done ; 2nt/3
;==============
; 17/18
crop_sprite_done:
rts ; return ; 6
; 0,0 = 400+0
; -1,0 = 400+ff=4ff, inc=400
; sprite: 5x4
;
; -2,0 Xstart=0, sprite_offset=2, xsize=3
; -1,0, Xstart=0, sprite_offset=1, xsize=4
; 0,0, Xstrat=0, sprite_offset=0, xsize=5
; 1,0, Xstart=1, sprite_offset=0, xsize=5
;
; 39,0 Xstart=39, sprite_offset=0, xsize=1
;
;
;
;
;=============================================
; put_sprite_flipped_crop
;=============================================
; Sprite to display in INH,INL
; Location is XPOS,YPOS
; Note, only works if YPOS is multiple of two
; transparent color is $A (grey #2)
; this means we can have black ($0) in a sprite
put_sprite_flipped_crop:
ldy #0 ; byte 0 is xsize ; 2
lda (INL),Y ; 5
sta CH ; xsize is in CH ; 3
iny ; 2
lda (INL),Y ; byte 1 is ysize ; 5
sta CV ; ysize is in CV ; 3
dey ; make Y zero again ; 2
lda INH ; ???
sta ppfc_smc+2
clc
lda INL
adc #1 ; add one (not two) because X counts
; from CH to 1 (not CH-1 to 0)
sta ppfc_smc+1
bcc psfc16
inc ppfc_smc+2
psfc16:
lda YPOS ; make a copy of ypos ; 3
sta TEMPY ; as we modify it ; 3
;===========
; 28
put_spritefc_loop:
; sty TEMP ; save sprite pointer ; 3
ldy TEMPY ; 3
bmi fcrop_increment_y ; if < 0, skip to next
cpy #48 ; bge if >= 48, done sprite
bcs fcrop_sprite_done
lda gr_offsets,Y ; lookup low-res memory address ; 4
clc ; 2
adc XPOS ; add in xpos ; 3
sta OUTL ; store out low byte of addy ; 3
lda gr_offsets+1,Y ; look up high byte ; 4
clc
adc DRAW_PAGE ; ; 3
sta OUTH ; and store it out ; 3
; ldy TEMP ; restore sprite pointer ; 3
; OUTH:OUTL now points at right place
ldx CH ; load xsize into x ; 3
;===========
; 34
put_spritefc_pixel:
clc
txa ; want (CH-X-1)+XPOS
eor #$ff
adc CH
adc XPOS
bmi cskip_drawing
cmp #40
bcs cskip_drawing ; if off-screen right, skip draw
ppfc_smc:
lda $C000,X ; get sprite colors ; 5
; iny ; increment sprite pointer ; 2
; sty TEMP ; save sprite pointer ; 3
ldy #$0 ; 2
; check if completely transparent
; if so, skip
cmp #$aa ; if all zero, transparent ; 2
beq put_spritefc_done_draw ; don't draw it ; 2nt/3
;==============
; 16/17
sta COLOR ; save color for later ; 3
; check if top pixel transparent
and #$f0 ; check if top nibble zero ; 2
cmp #$a0
bne put_spritefc_bottom ; if not skip ahead ; 2nt/3
;==============
; 7/8
lda COLOR
and #$0f
sta COLOR
lda #$f0 ; setup mask ; 2
sta MASK ; 3
bmi put_spritefc_mask ; always? ; 3
;=============
; 8
put_spritefc_bottom:
lda COLOR ; re-load color ; 3
and #$0f ; check if bottom nibble zero ; 2
cmp #$0a
bne put_spritefc_all ; if not, skip ahead ; 2nt/3
;=============
; 7/8
lda COLOR
and #$f0
sta COLOR
lda #$0f ; 2
sta MASK ; setup mask ; 3
;===========
; 5
put_spritefc_mask:
lda (OUTL),Y ; get color at output ; 5
and MASK ; mask off unneeded part ; 3
ora COLOR ; or the color in ; 3
sta (OUTL),Y ; store it back ; 6
jmp put_spritefc_done_draw ; we are done ; 3
;===========
; 20
put_spritefc_all:
lda COLOR ; load color ; 3
sta (OUTL),Y ; and write it out ; 6
;============
; 9
put_spritefc_done_draw:
cskip_drawing:
; ldy TEMP ; restore sprite pointer ; 3
inc OUTL ; increment output pointer ; 5
dex ; decrement x counter ; 2
bne put_spritefc_pixel ; if not done, keep looping ; 2nt/3
;==============
; 12/13
fcrop_increment_y:
inc TEMPY ; each line has two y vars ; 5
inc TEMPY ; 5
lda CH
clc
adc ppfc_smc+1
sta ppfc_smc+1
bcc psfco
inc ppfc_smc+2
psfco:
dec CV ; decemenet total y count ; 5
beq fcrop_sprite_done ; loop if not done ; 2nt/3
jmp put_spritefc_loop
;==============
; 17/18
fcrop_sprite_done:
rts ; return ; 6

View File

@ -0,0 +1,157 @@
;=============================================
; put_sprite_flipped
;=============================================
; Sprite to display in INH,INL
; Location is XPOS,YPOS
; Note, only works if YPOS is multiple of two
; transparent color is $A (grey #2)
; this means we can have black ($0) in a sprite
put_sprite_flipped:
ldy #0 ; byte 0 is xsize ; 2
lda (INL),Y ; 5
sta CH ; xsize is in CH ; 3
iny ; 2
lda (INL),Y ; byte 1 is ysize ; 5
sta CV ; ysize is in CV ; 3
dey ; make Y zero again ; 2
lda INH
sta ppf_smc+2
clc
lda INL
adc #1 ; add one (not two) because X counts
; from CH to 1 (not CH-1 to 0)
sta ppf_smc+1
bcc psf16
inc ppf_smc+2
psf16:
lda YPOS ; make a copy of ypos ; 3
sta TEMPY ; as we modify it ; 3
;===========
; 28
put_spritef_loop:
sty TEMP ; save sprite pointer ; 3
ldy TEMPY ; 3
lda gr_offsets,Y ; lookup low-res memory address ; 4
clc ; 2
adc XPOS ; add in xpos ; 3
sta OUTL ; store out low byte of addy ; 3
lda gr_offsets+1,Y ; look up high byte ; 4
adc DRAW_PAGE ; ; 3
sta OUTH ; and store it out ; 3
ldy TEMP ; restore sprite pointer ; 3
; OUTH:OUTL now points at right place
ldx CH ; load xsize into x ; 3
;===========
; 34
put_spritef_pixel:
ppf_smc:
lda $C000,X ; get sprite colors ; 5
iny ; increment sprite pointer ; 2
sty TEMP ; save sprite pointer ; 3
ldy #$0 ; 2
; check if completely transparent
; if so, skip
cmp #$aa ; if all zero, transparent ; 2
beq put_spritef_done_draw ; don't draw it ; 2nt/3
;==============
; 16/17
sta COLOR ; save color for later ; 3
; check if top pixel transparent
and #$f0 ; check if top nibble zero ; 2
cmp #$a0
bne put_spritef_bottom ; if not skip ahead ; 2nt/3
;==============
; 7/8
lda COLOR
and #$0f
sta COLOR
lda #$f0 ; setup mask ; 2
sta MASK ; 3
bmi put_spritef_mask ; always? ; 3
;=============
; 8
put_spritef_bottom:
lda COLOR ; re-load color ; 3
and #$0f ; check if bottom nibble zero ; 2
cmp #$0a
bne put_spritef_all ; if not, skip ahead ; 2nt/3
;=============
; 7/8
lda COLOR
and #$f0
sta COLOR
lda #$0f ; 2
sta MASK ; setup mask ; 3
;===========
; 5
put_spritef_mask:
lda (OUTL),Y ; get color at output ; 5
and MASK ; mask off unneeded part ; 3
ora COLOR ; or the color in ; 3
sta (OUTL),Y ; store it back ; 6
jmp put_spritef_done_draw ; we are done ; 3
;===========
; 20
put_spritef_all:
lda COLOR ; load color ; 3
sta (OUTL),Y ; and write it out ; 6
;============
; 9
put_spritef_done_draw:
ldy TEMP ; restore sprite pointer ; 3
inc OUTL ; increment output pointer ; 5
dex ; decrement x counter ; 2
bne put_spritef_pixel ; if not done, keep looping ; 2nt/3
;==============
; 12/13
inc TEMPY ; each line has two y vars ; 5
inc TEMPY ; 5
lda CH
clc
adc ppf_smc+1
sta ppf_smc+1
bcc psfo
inc ppf_smc+2
psfo:
dec CV ; decemenet total y count ; 5
bne put_spritef_loop ; loop if not done ; 2nt/3
;==============
; 17/18
rts ; return ; 6

View File

@ -0,0 +1,155 @@
;=================================
; Display a sequence of images
;=================================
; quit if escape pressed?
; this version (as opposed to original) the time delay is
; *after* showing the image
; pattern is TIME, PTR
; if time== 0, then done
; if time==1 or 129, then no pause
; if time== 255, reload background $C00 with PTR, no delay
; if time== 2..127, overlay PTR over $C00, then wait TIME
; if time==130..254, overlay current over $C00, then wait TIME-128
; assumes LZSA pointer points to image
; basically after decoding one, input points to next
run_sequence:
ldy #0
run_sequence_loop:
lda (INTRO_LOOPL),Y ; get time
beq run_sequence_done ; if zero, then done
cmp #$ff ; if $ff, then load image to $c00
bne not_reload
; reload background
reload_bg:
iny
lda (INTRO_LOOPL),Y
sta getsrc_smc+1 ; LZSA_SRC_LO
iny
lda (INTRO_LOOPL),Y
sta getsrc_smc+2 ; LZSA_SRC_HI
iny
sty INTRO_LOOPER ; save for later
lda #$0c ; load to $c00
jsr decompress_lzsa2_fast
jmp seq_stuff
not_reload:
tax ; load delay into X
bmi no_set_image_ptr ; if negative, no need to load pointer
; need to get image pointer from data stream
get_image_ptr:
iny
lda (INTRO_LOOPL),Y
sta getsrc_smc+1 ; LZSA_SRC_LO
iny
lda (INTRO_LOOPL),Y
sta getsrc_smc+2 ; LZSA_SRC_HI
no_set_image_ptr:
; decompress image
txa
pha ; save X on stack
iny
sty INTRO_LOOPER ; save for later
lda #$10 ; load to $1000
jsr decompress_lzsa2_fast
; display image and page flip
jsr gr_overlay
jsr page_flip
pla ; restore X from stack
and #$7f
tax
cpx #1
beq seq_no_wait
jsr long_wait
seq_no_wait:
seq_stuff:
ldy INTRO_LOOPER
; exit early if escape pressed
lda KEYPRESS
cmp #27+$80
beq run_sequence_done
bit KEYRESET
jmp run_sequence_loop
run_sequence_done:
rts
;====================================
; Display a sequence of images 40x40
run_sequence_40x40:
ldy #0
run_sequence_40x40_loop:
lda (INTRO_LOOPL),Y ; get time
beq run_sequence_40x40_done
tax
jsr long_wait
iny
lda (INTRO_LOOPL),Y
sta getsrc_smc+1 ; LZSA_SRC_LO
iny
lda (INTRO_LOOPL),Y
sta getsrc_smc+2 ; LZSA_SRC_HI
iny
sty INTRO_LOOPER ; save for later
lda #$10 ; load to $1000
jsr decompress_lzsa2_fast
jsr gr_overlay_40x40
jsr page_flip
ldy INTRO_LOOPER
jmp run_sequence_40x40_loop
run_sequence_40x40_done:
rts
.if 0
;=====================
; WAIT: delay 1/2(26+27A+5A^2) us
; A=60 approx 9.823ms
; A=61 approx 10.139ms
; A=62 approx 10.460ms
; A=63 approx 10.786ms
; A=64 approx 11.117ms
;
;=====================
; long(er) wait
; waits approximately X*10 ms
; X=100 1s
; X=4 = 40ms= 1/25s
long_wait:
lda #60
jsr WAIT ; delay
dex
bne long_wait
rts
.endif

View File

@ -1,4 +1,4 @@
; Outline 2021?
; Outline 2021
; by deater (Vince Weaver) <vince@deater.net>
@ -7,6 +7,14 @@
.include "hardware.inc"
outline_demo:
jmp $6000
.include "shimmer.s"
.include "a2_inside.s"
.align $1000
;=========================
; init the multiply tables
@ -63,8 +71,6 @@ mockingboard_not_found:
;=============================
jsr rocket_away
jsr a2_inside
jsr wires
@ -75,6 +81,10 @@ mockingboard_not_found:
jsr mode7_flying
jsr another_mist
jsr rocket_away
;=============================
; Credits
;=============================
@ -92,9 +102,8 @@ forever:
; if you're self patching, detect has to be after interrupt_handler.s
.include "pt3_lib_mockingboard_detect.s"
.include "shimmer.s"
.include "a2_inside.s"
;.include "fakepal.s"
.include "tfv_flying.s"
.include "drops.s"
.include "wires.s"
@ -113,6 +122,9 @@ forever:
.include "c00_scrn_offsets.s"
.include "gr_copy.s"
.include "gr_run_sequence2.s"
.include "gr_overlay.s"
.include "long_wait.s"
.include "random16.s"
@ -121,6 +133,9 @@ forever:
.include "graphics/outline.inc"
.include "hgr_pageflip.s"
.include "anothermist.s"
.include "animation/rocket.inc"
PT3_LOC = song
.align $100
song:

View File

@ -0,0 +1,696 @@
;=======================================
; Move physicist based on current state
;
move_physicist:
lda PHYSICIST_STATE
cmp #P_WALKING
beq move_physicist_walking
cmp #P_RUNNING
beq move_physicist_running
rts
;======================
; walking
move_physicist_walking:
inc GAIT ; cycle through animation
lda GAIT
and #$7
cmp #$4 ; only walk roughly 1/8 of time
bne no_move_walk
lda DIRECTION
beq p_walk_left
inc PHYSICIST_X ; walk right
rts
p_walk_left:
dec PHYSICIST_X ; walk left
no_move_walk:
rts
;======================
; running
move_physicist_running:
; inc GAIT ; cycle through animation
inc GAIT ; cycle through animation
lda GAIT
and #$3
cmp #$2 ; only run roughly 1/4 of time
bne no_move_run
lda DIRECTION
beq p_run_left
inc PHYSICIST_X ; run right
rts
p_run_left:
dec PHYSICIST_X ; run left
no_move_run:
rts
;======================
; standing
move_physicist_standing:
pstate_table_lo:
.byte <physicist_standing ; 00
.byte <physicist_walking ; 01
.byte <physicist_running ; 02
.byte <physicist_crouching ; 03
.byte <physicist_kicking ; 04
.byte <physicist_jumping ; 05
.byte <physicist_collapsing ; 06
.byte <physicist_falling_sideways; 07
.byte <physicist_standing ; 08 swinging
.byte <physicist_standing ; 09 elevator up
.byte <physicist_standing ; 0A elevator down
.byte <physicist_shooting ; 0B
.byte <physicist_falling_down ; 0C
.byte <physicist_impaled ; 0D
.byte <physicist_crouch_shooting; 0E
.byte <physicist_crouch_kicking ; 0F
.byte <physicist_disintegrating ; 10
pstate_table_hi:
.byte >physicist_standing
.byte >physicist_walking
.byte >physicist_running
.byte >physicist_crouching
.byte >physicist_kicking
.byte >physicist_jumping
.byte >physicist_collapsing
.byte >physicist_falling_sideways
.byte >physicist_standing ; 08 swinging
.byte >physicist_standing ; 09 elevator up
.byte >physicist_standing ; 0A elevator down
.byte >physicist_shooting ; 0B
.byte >physicist_falling_down ; 0C
.byte >physicist_impaled ; 0D
.byte >physicist_crouch_shooting; 0E
.byte >physicist_crouch_kicking ; 0F
.byte >physicist_disintegrating ; 10
; Urgh, make sure this doesn't end up at $FF or you hit the
; NMOS 6502 bug
.align 2
pjump:
.word $0000
.align 1
;======================================
; draw physicist
;======================================
draw_physicist:
lda PHYSICIST_STATE
and #$1f ; mask off high state bits
tax
lda pstate_table_lo,x
sta pjump
lda pstate_table_hi,x
sta pjump+1
jmp (pjump)
;==================================
; STANDING
;==================================
physicist_standing:
lda #<phys_stand
sta INL
lda #>phys_stand
sta INH
jmp finally_draw_him
;==================================
; SHOOTING
;==================================
physicist_shooting:
lda #<shooting1
sta INL
lda #>shooting1
sta INH
jmp finally_draw_him
;==================================
; KICKING
;==================================
physicist_kicking:
lda #<kick1
sta INL
lda #>kick1
sta INH
; If kicking long enough, return to standing
dec GAIT
bne short_draw
lda #P_STANDING
sta PHYSICIST_STATE
short_draw:
jmp finally_draw_him
;===================================
; CROUCHING
;===================================
physicist_crouching:
; FIXME: we have an animation?
; if we have some gait left, slide a bit
lda GAIT
beq crouch_done_slide
dec GAIT
bne crouch_done_slide
lda DIRECTION
beq p_slide_left
inc PHYSICIST_X
jmp crouch_done_slide
p_slide_left:
dec PHYSICIST_X
crouch_done_slide:
lda #<crouch2
sta INL
lda #>crouch2
sta INH
jmp finally_draw_him
;===================================
; CROUCH KICKING
;===================================
physicist_crouch_kicking:
dec GAIT
lda GAIT
bpl still_kicking
lda #P_CROUCHING
sta PHYSICIST_STATE
still_kicking:
lda #<crouch_kicking
sta INL
lda #>crouch_kicking
sta INH
jmp finally_draw_him
;===================================
; CROUCH SHOOTING
;===================================
physicist_crouch_shooting:
lda #<crouch_shooting
sta INL
lda #>crouch_shooting
sta INH
jmp finally_draw_him
;===================================
; JUMPING
;===================================
physicist_jumping:
lda GAIT
cmp #32
bcc still_jumping ; blt
; done juming
lda #STATE_RUNNING
bit PHYSICIST_STATE
beq jump_to_stand
jump_to_run:
lda #0
sta GAIT
lda #P_RUNNING
sta PHYSICIST_STATE
jmp physicist_running
jump_to_stand:
lda #0
sta GAIT
lda #P_STANDING
sta PHYSICIST_STATE
jmp physicist_standing
still_jumping:
lsr
and #$fe
tax
lda phys_jump_progression,X
sta INL
lda phys_jump_progression+1,X
sta INH
inc GAIT
lda #STATE_RUNNING
bit PHYSICIST_STATE
beq jump_change_x_regular
jump_change_x_running:
lda GAIT
; 1/4 not enough, 1/2 too much
; 3/8?
and #$7
cmp #5
bcc jump_no_move
jmp jump_change_x
; only change X every 8th frame
jump_change_x_regular:
lda GAIT
and #$7
bne jump_no_move
jump_change_x:
lda DIRECTION
beq jump_left
jump_right:
inc PHYSICIST_X
jmp finally_draw_him
jump_left:
dec PHYSICIST_X
jump_no_move:
jmp finally_draw_him
;===============================
; Walking
;================================
physicist_walking:
lda GAIT
cmp #40
bcc gait_fine ; blt
lda #0
sta GAIT
gait_fine:
lsr
and #$fe
tax
lda phys_walk_progression,X
sta INL
lda phys_walk_progression+1,X
sta INH
jmp finally_draw_him
;===============================
; Running
;================================
physicist_running:
lda GAIT
cmp #40
bcc run_gait_fine ; blt
lda #0
sta GAIT
run_gait_fine:
lsr
and #$fe
tax
lda phys_run_progression,X
sta INL
lda phys_run_progression+1,X
sta INH
jmp finally_draw_him
;==================================
; COLLAPSING
;==================================
physicist_collapsing:
lda GAIT
cmp #18
bne collapse_not_done
really_dead:
lda #$ff
sta GAME_OVER
jmp finally_draw_him
collapse_not_done:
ldx GAIT
lda collapse_progression,X
sta INL
lda collapse_progression+1,X
sta INH
lda FRAME
and #$1f
bne no_collapse_progress
inc GAIT
inc GAIT
no_collapse_progress:
jmp finally_draw_him
;==================================
; DISINTEGRATING
;==================================
physicist_disintegrating:
lda GAIT
cmp #28
bne disintegrate_not_done
disintegrate_really_dead:
lda #$ff
sta GAME_OVER
jmp finally_draw_him
disintegrate_not_done:
ldx GAIT
lda disintegrate_progression,X
sta INL
lda disintegrate_progression+1,X
sta INH
lda FRAME
and #$7
bne no_disintegrate_progress
inc GAIT
inc GAIT
no_disintegrate_progress:
jmp finally_draw_him
;==================================
; FALLING SIDEWAYS
;==================================
physicist_falling_sideways:
lda FRAME
and #$3
bne no_fall_progress
inc PHYSICIST_X
inc PHYSICIST_Y ; must me mul of 2
inc PHYSICIST_Y
no_fall_progress:
lda PHYSICIST_Y
fall_sideways_destination_smc:
cmp #22
bne still_falling
done_falling:
; lda #0
; sta GAIT
lda #P_CROUCHING
sta PHYSICIST_STATE
jmp physicist_crouching
still_falling:
lda #<phys_falling
sta INL
lda #>phys_falling
sta INH
jmp finally_draw_him
;==================================
; FALLING DOWN
;==================================
physicist_falling_down:
falling_stop_smc: ; $2C to fall, $4C for not
bit still_falling_down
lda FRAME
and #$1
bne no_fall_down_progress
inc PHYSICIST_Y ; must be mul of 2
inc PHYSICIST_Y
no_fall_down_progress:
lda PHYSICIST_Y
fall_down_destination_smc:
cmp #22
bne still_falling_down
done_falling_down:
jsr recalc_walk_collision
lda #P_CROUCHING
sta PHYSICIST_STATE
jmp physicist_crouching
still_falling_down:
lda #<phys_stand
sta INL
lda #>phys_stand
sta INH
jmp finally_draw_him
;==================================
; IMPALED
;==================================
physicist_impaled:
lda GAIT
cmp #$80
bne impale_not_done
impale_really_dead:
lda #$ff
sta GAME_OVER
jmp finally_draw_him
impale_not_done:
cmp #2 ; slide down one more
bne impale_enough
inc PHYSICIST_Y
inc PHYSICIST_Y
impale_enough:
inc GAIT
lda #<physicist_spike_sprite
sta INL
lda #>physicist_spike_sprite
sta INH
jmp finally_draw_him
;=============================
; Actually Draw Him
;=============================
finally_draw_him:
lda PHYSICIST_X
sta XPOS
lda PHYSICIST_Y
sec
sbc EARTH_OFFSET ; adjust for earthquakes
sta YPOS
lda DIRECTION
bne facing_right
facing_left:
jmp put_sprite_crop
facing_right:
jmp put_sprite_flipped_crop
;======================================
;======================================
; Check screen limits
;======================================
;======================================
; If too far right or left, stop at boundary
; If also > 39 or < -4 then exit room
check_screen_limit:
clc
lda PHYSICIST_X
adc #$80
cmp LEFT_WALK_LIMIT
bcs just_fine_left ; (bge==bcs)
left_on_screen:
; if limit was -4, means we are off screen
; otherwise, stop physicist at limit
lda LEFT_WALK_LIMIT
cmp #($80 - 4)
beq too_far_left
left_stop_at_barrier:
lda #0
sta PHYSICIST_STATE
lda LEFT_WALK_LIMIT
sec
sbc #$7f
sta PHYSICIST_X
rts
too_far_left:
lda #1
sta GAME_OVER
rts
just_fine_left:
; Check right edge of screen
; lda PHYSICIST_X
cmp RIGHT_WALK_LIMIT
bcc just_fine_right ; blt
right_on_screen:
; if limit was 39, means we are off screen
; otherwise, stop physicist at limit
lda RIGHT_WALK_LIMIT
cmp #($80 + 39)
beq too_far_right
right_stop_at_barrier:
lda #0
sta PHYSICIST_STATE
lda RIGHT_WALK_LIMIT
clc
adc #$7f
sta PHYSICIST_X
rts
too_far_right:
lda #2
sta GAME_OVER
just_fine_right:
rts
; LIMIT VALUE FLAGS
; 0 10 -----
; 0 0 Z----
; 0 FF
; 1 -> 129
; 0 -> 128
; -1 -> 127 FF + 80 = 7f
; XPOS XSIZE XMAX
; -5 8 3
; -4 4
; -3 5
; -2 6
; -1 7
; 0 8
; 1 9
; 2
; 3
; 4
; 5

View File

@ -10,9 +10,9 @@ qload_start:
jsr load_file
; always enter at $6000
; always enter at $5000
jmp $6000
jmp $5000
;====================================
; loads file specified by WHICH_LOAD
@ -151,7 +151,7 @@ which_disk_array:
load_address_array:
.byte $60 ;
.byte $50 ;
track_array:
.byte 2 ;
@ -162,7 +162,7 @@ sector_array:
length_array:
.byte 80 ;
.byte 112 ;

View File

@ -0,0 +1,213 @@
rocket_away:
jsr clear_bottom
jsr HGR2 ; Hi-res graphics, no text at bottom
; Y=0, A=0 after this called
lda #<(outline_space_lzsa)
sta getsrc_smc+1
lda #>(outline_space_lzsa)
sta getsrc_smc+2
lda #$20
jsr decompress_lzsa2_fast
lda #<(outline_space_lzsa)
sta getsrc_smc+1
lda #>(outline_space_lzsa)
sta getsrc_smc+2
lda #$40
jsr decompress_lzsa2_fast
lda #16 ; 112 / 7 = 16
sta XX
rocket_movement:
;=======================================
; draw new
;=======================================
; start at 112,80
lda HGR_PAGE
cmp #$20
bne draw_odd
lda #<rocket_sprite_even
sta INL
lda #>rocket_sprite_even
jmp done_draw_odd
draw_odd:
lda #<rocket_sprite_odd
sta INL
lda #>rocket_sprite_odd
done_draw_odd:
sta INH
lda #80
sta YY
hsprite_yloop:
ldy #0
ldx #0
lda YY
jsr HPOSN ; X= (y,x) Y=(a) now in GBASL with Y
; handle if negative
lda XX
bpl not_offscreen
; blurgh
clc
adc GBASL
sta GBASL
lda XX
eor #$ff
clc
adc #1
tay
jmp hsprite_xloop
not_offscreen:
clc
adc GBASL
sta GBASL
ldy #0
hsprite_xloop:
lda (INL),Y
sta (GBASL),Y
iny
cpy #8
bne hsprite_xloop
lda INL
clc
adc #8
sta INL
lda #0
adc INH
sta INH
inc YY
lda YY
cmp #92
bne hsprite_yloop
;=======================================
; delay a few seconds
;=======================================
jsr hgr_page_flip
ldx #10
jsr long_wait
;=======================================
; erase old
;=======================================
; start at 112,80
lda #80
sta YY
herase_yloop:
ldy #0
ldx #0
lda YY
jsr HPOSN ; X= (y,x) Y=(a) now in GBASL with Y
lda XX
clc
adc GBASL
sta GBASL
ldy #0
herase_xloop:
lda #0
sta (GBASL),Y
iny
cpy #8 ; erase + 1
bne herase_xloop
lda INL
clc
adc #7
sta INL
lda #0
adc INH
sta INH
inc YY
lda YY
cmp #92
bne herase_yloop
dec XX
lda XX
cmp #$f8
beq donedone
jmp rocket_movement
donedone:
; jmp donedone
ldx #50
jsr long_wait
rts
; 46x12, 46/7 = 7 roughly?
; all orange is 1 0 10 10 10 1 1 01 01 01
; $AA,$D5
; 1 100 0101 1 010 0000
; 1 000 1000 1 101 0101
; 1 101 0001
; 1 000 1000 1001 0101
; 0001000
rocket_sprite_even:
;.byte 7,12
.byte $00,$00,$00,$00,$AA,$81,$00,$00
.byte $00,$00,$00,$C0,$8A,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $A0,$C5,$AA,$D5,$8A,$00,$00,$00
.byte $88,$D5,$AA,$95,$AA,$55,$2A,$00
.byte $AA,$D1,$80,$D5,$AA,$D5,$AA,$00
.byte $AA,$D5,$AA,$D5,$AA,$55,$2A,$00
.byte $A8,$D1,$88,$95,$AA,$00,$00,$00
.byte $A0,$C5,$AA,$D5,$8A,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$C0,$8A,$00,$00,$00
.byte $00,$00,$00,$00,$AA,$81,$00,$00
; shift pixels right by 1
rocket_sprite_odd:
.byte $00,$00,$00,$00,$D4,$82,$00,$00
.byte $00,$00,$00,$80,$95,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $C0,$8A,$D5,$AA,$95,$00,$00,$00
.byte $90,$AA,$D5,$AA,$D4,$2A,$55,$00
.byte $D4,$A2,$81,$AA,$D5,$AA,$D5,$00
.byte $D4,$AA,$D5,$AA,$D5,$2A,$55,$00
.byte $D0,$A2,$91,$AA,$D4,$00,$00,$00
.byte $C0,$8A,$D5,$AA,$95,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$80,$95,$00,$00,$00
.byte $00,$00,$00,$00,$D4,$82,$00,$00

View File

@ -7,7 +7,8 @@ shimmer:
;=========================================
jsr HGR2
jsr HGR
bit FULLGR
lda #0
sta FRAME
@ -94,10 +95,10 @@ do_shimmer_y:
do_shimmer_x:
blargh:
lda $4000,X
lda $2000,X
eor #$80
blargh2:
sta $4000,X
sta $2000,X
inx
bne do_shimmer_x
@ -106,10 +107,10 @@ blargh2:
inc blargh2+2
lda blargh+2
cmp #$60
cmp #$40
bne do_shimmer_y
lda #$40
lda #$20
sta blargh+2
sta blargh2+2

View File

@ -1,16 +1,10 @@
;; Zero Page
;; LZ4 addresses
LZ4_SRC = $00
LZ4_DST = $02
LZ4_END = $04
INTRO_LOOPER = $01
INTRO_LOOPL = $02
INTRO_LOOPH = $03
WHICH_LOAD = $05
COUNT = $06
MENU_BASE = $06
MENU_HIGHLIGHT = $07
DELTA = $08
NIBCOUNT = $09
NIBCOUNT = $09 ; lzsa
; Zero page monitor routines addresses
@ -110,6 +104,62 @@ KEY_COUNT = $AB
SCALE_I = $AC
SCALE_F = $AD
BOULDER_Y = $B0
PHYSICIST_X = $B1
PHYSICIST_Y = $B2
HAVE_GUN = $B3
ON_ELEVATOR = $B4
BEAST_OUT = $B5
BEFORE_SWING = $B6
WHICH_CAVE = $B7
GAME_OVER = $B8
STATE_NO_KEYPRESS = $80
STATE_CROUCHING = $40
STATE_RUNNING = $20
PHYSICIST_STATE = $B9
P_STANDING = $00
P_WALKING = $01
P_RUNNING = $02 | STATE_RUNNING
P_CROUCHING = $03 | STATE_CROUCHING
P_KICKING = $04
P_JUMPING = $05 | STATE_NO_KEYPRESS
P_COLLAPSING = $06 | STATE_NO_KEYPRESS
P_FALLING_SIDEWAYS = $07 | STATE_NO_KEYPRESS
P_SWINGING = $08 | STATE_NO_KEYPRESS
P_ELEVATING_UP = $09
P_ELEVATING_DOWN = $0A
P_SHOOTING = $0B
P_FALLING_DOWN = $0C | STATE_NO_KEYPRESS
P_IMPALED = $0D | STATE_NO_KEYPRESS
P_CROUCH_SHOOTING = $0E | STATE_CROUCHING
P_CROUCH_KICKING = $0F | STATE_CROUCHING
P_DISINTEGRATING = $10 | STATE_NO_KEYPRESS
EARTH_OFFSET = $BA
EQUAKE_PROGRESS = $BB
EXIT_COUNT = $BC
TENTACLE_X = $BD
TENTACLE_GRAB = $BE
TENTACLE_PROGRESS = $BF
GAIT = $C0
MONSTER_AI = $C1
MONSTER_WHICH = $C2
BG_BEAST = $C3
CONSOLE_Y = $C4
BUBBLES_Y = $C5
MONSTER_GRAB = $C6
LEFT_WALK_LIMIT = $C7
LEFT_LIMIT = $C8
RIGHT_WALK_LIMIT= $C9
RIGHT_LIMIT = $CA
XMAX = $CB
FRAME = $CC
FRAMEH = $CD
SHIPY = $E4 ; mode7
HGR_PAGE = $E6
@ -118,12 +168,12 @@ HGR_SCALE = $E7
DISP_PAGE = $ED
DRAW_PAGE = $EE
FRAME = $EF
TINL = $F0
XPOS = $F0 ; shimmer
XX = $F0 ; a2
FRAMEH = $F0 ; credits
TINH = $F1
YPOS = $F1 ; shimmer