anothermist: arrival scene works

This commit is contained in:
Vince Weaver 2020-06-20 23:54:42 -04:00
parent 21e4326582
commit 5dd6741f26
10 changed files with 2773 additions and 1 deletions

192
another_myst/Makefile Normal file
View File

@ -0,0 +1,192 @@
include ../Makefile.inc
DOS33 = ../dos33fs-utils/dos33
PNG2RLE = ../gr-utils/png2rle
PNG2LZ4 = ../gr-utils/png2lz4
all: am.dsk
am.dsk: HELLO ANOTHERMIST
cp empty.dsk am.dsk
$(DOS33) -y am.dsk SAVE A HELLO
$(DOS33) -y am.dsk BSAVE -a 0x1700 ANOTHERMIST
####
INTRO: intro.o
ld65 -o INTRO intro.o -C ../linker_scripts/apple2_1700_9000.inc
intro.o: intro.s \
gr_copy.s gr_fast_clear.s gr_pageflip.s gr_unrle.s gr_putsprite.s \
gr_overlay.s gr_run_sequence.s \
keyboard.s random16.s text_print.s zp.inc \
intro_graphics/01_building/intro_car.inc \
intro_graphics/01_building/intro_building_car.inc \
intro_graphics/01_building/intro_building.inc \
intro_graphics/02_outer_door/outer_door.inc \
intro_graphics/02_outer_door/feet.inc \
intro_graphics/03_elevator/intro_elevator.inc \
intro_graphics/03_elevator/intro_off_elevator.inc \
intro_graphics/03_elevator/intro_walking.inc \
intro_graphics/04_keypad/intro_scanner_door.inc \
intro_graphics/04_keypad/intro_approach.inc \
intro_graphics/04_keypad/intro_keypad_bg.inc \
intro_graphics/04_keypad/intro_hands.inc \
intro_graphics/04_keypad/intro_opening.inc \
intro_graphics/05_scanner/intro_scanner.inc \
intro_graphics/05_scanner/intro_scanning.inc \
intro_graphics/05_scanner/intro_ai_bg.inc \
intro_graphics/05_scanner/intro_ai.inc \
intro_graphics/06_console/intro_desktop.inc \
intro_graphics/06_console/intro_cursor.inc \
intro_graphics/06_console/intro_collider.inc \
intro_graphics/07_soda/intro_open_soda.inc \
intro_graphics/07_soda/intro_drinking.inc \
intro_graphics/08_lightning/lightning.inc \
intro_graphics/09_tunnel/intro_tunnel1.inc \
intro_graphics/09_tunnel/intro_tunnel2.inc \
intro_graphics/10_gone/intro_zappo.inc \
intro_graphics/10_gone/intro_gone.inc \
intro_data_01.lz4 \
intro_data_04.lz4 \
intro_data_06.lz4 \
intro_data_08.lz4 \
intro_data_09.lz4
ca65 -o intro.o intro.s -l intro.lst
####
intro_data_01.lz4: intro_data_01
lz4 -f -16 intro_data_01
truncate -s-8 intro_data_01.lz4
intro_data_01: intro_data_01.o
ld65 -o intro_data_01 intro_data_01.o -C ../linker_scripts/apple2_9000.inc
intro_data_01.o: intro_data_01.s
ca65 -o intro_data_01.o intro_data_01.s -l intro_data_01.lst
intro_data_04.lz4: intro_data_04
lz4 -f -16 intro_data_04
truncate -s-8 intro_data_04.lz4
intro_data_04: intro_data_04.o
ld65 -o intro_data_04 intro_data_04.o -C ../linker_scripts/apple2_9000.inc
intro_data_04.o: intro_data_04.s
ca65 -o intro_data_04.o intro_data_04.s -l intro_data_04.lst
intro_data_06.lz4: intro_data_06
lz4 -f -16 intro_data_06
truncate -s-8 intro_data_06.lz4
intro_data_06: intro_data_06.o
ld65 -o intro_data_06 intro_data_06.o -C ../linker_scripts/apple2_9000.inc
intro_data_06.o: intro_data_06.s
ca65 -o intro_data_06.o intro_data_06.s -l intro_data_06.lst
intro_data_08.lz4: intro_data_08
lz4 -f -16 intro_data_08
truncate -s-8 intro_data_08.lz4
intro_data_08: intro_data_08.o
ld65 -o intro_data_08 intro_data_08.o -C ../linker_scripts/apple2_9000.inc
intro_data_08.o: intro_data_08.s
ca65 -o intro_data_08.o intro_data_08.s -l intro_data_08.lst
intro_data_09.lz4: intro_data_09
lz4 -f -16 intro_data_09
truncate -s-8 intro_data_09.lz4
intro_data_09: intro_data_09.o
ld65 -o intro_data_09 intro_data_09.o -C ../linker_scripts/apple2_9000.inc
intro_data_09.o: intro_data_09.s
ca65 -o intro_data_09.o intro_data_09.s -l intro_data_09.lst
####
LOADER: loader.o
ld65 -o LOADER loader.o -C ../linker_scripts/apple2_1400.inc
loader.o: loader.s
ca65 -o loader.o loader.s -l loader.lst
####
LOADER2: loader2.o
ld65 -o LOADER2 loader2.o -C ../linker_scripts/apple2_1400.inc
loader2.o: loader2.s
ca65 -o loader2.o loader2.s -l loader2.lst
####
TITLE: title.o
ld65 -o TITLE title.o -C ../linker_scripts/apple2_d00.inc
title.o: title.s loader.s
ca65 -o title.o title.s -l title.lst
####
HELLO: hello.bas
../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO
####
HELLO2: hello2.bas
../asoft_basic-utils/tokenize_asoft < hello2.bas > HELLO2
#####
ANOTHERMIST: anothermist.o
ld65 -o ANOTHERMIST anothermist.o -C ../linker_scripts/apple2_1700.inc
anothermist.o: anothermist.s \
pt3_lib_core.s pt3_lib_init.s pt3_lib_mockingboard_detect.s \
pt3_lib_mockingboard_setup.s pt3_lib_irq_handler.s interrupt_handler.s \
ootw_graphics/ootw_c16_end.inc \
ootw_audio/ootw_outro.pt3 \
ootw_c5_cave.s ootw_c1.s
ca65 -o anothermist.o anothermist.s -l anothermist.lst
#####
compress_test.inc: intro_graphics/07_soda/drinking01.png
$(PNG2RLE) asm intro_graphics/07_soda/drinking01.png test_rle > compress_test.inc
$(PNG2LZ4) asm intro_graphics/07_soda/drinking01.png test_lz4 >> compress_test.inc
COMPRESS-TEST: compress_test.o
ld65 -o COMPRESS-TEST compress_test.o -C ../linker_scripts/apple2_2000.inc
compress_test.o: compress_test.s lz4_decode.s compress_test.inc
ca65 -o compress_test.o compress_test.s -l compress_test.lst
#####
zip: ootw.dsk ootw_side2.dsk side3.dsk
zip ootw.zip ootw.dsk ootw_side2.dsk ootw_side3.dsk
#####
clean:
rm -f *~ *.o *.lst *.lz4 HELLO ANOTHERMIST

View File

@ -95,6 +95,7 @@ repeat_ending:
; escape from the monster
;============================
jsr ootw
;===========================
; do the puzzle part
@ -983,6 +984,8 @@ long_wait:
.include "ootw_c5_cave.s"
.include "door.s"
.include "alien_laser.s"
.include "random16.s"
.include "ootw_c1.s"
; sprites

168
another_myst/ootw_c1.s Normal file
View File

@ -0,0 +1,168 @@
; Ootw Level 1 for Apple II Lores
; by Vince "Deater" Weaver <vince@deater.net>
;.include "zp.inc"
;.include "hardware.inc"
ootw:
; Initialize some variables
lda #0
sta GAME_OVER
sta EQUAKE_PROGRESS
sta EARTH_OFFSET
sta PHYSICIST_STATE
sta WHICH_CAVE
sta BEAST_OUT
sta ON_ELEVATOR
sta HAVE_GUN
;==========================
; Handle Underwater Arrival
;==========================
jsr ootw_c1_arrival
lda GAME_OVER
bmi end_c1
;==========================
; Exit the Pool
;==========================
jsr exit_pool
; Initialize some variables
lda #0
sta GAME_OVER
sta EQUAKE_PROGRESS
sta EARTH_OFFSET
sta PHYSICIST_STATE
sta WHICH_CAVE
sta BEAST_OUT
sta ON_ELEVATOR
lda #1
sta BEFORE_SWING
lda #32
sta PHYSICIST_Y
lda #20
sta PHYSICIST_X
lda #1
sta DIRECTION
lda #40
sta BOULDER_Y
;=======================
; Initialize the slugs
;=======================
; jsr init_slugs
;=======================
; Enter the game
;=======================
jsr ootw_pool
;===========================
; quit_level
;===========================
end_c1:
lda GAME_OVER ; see why we quit
cmp #$ff
beq l1_quit_or_died
;====================
; go to next level
l1_defeated:
lda #2 ; go to next level
sta WHICH_LOAD
rts
;========================
; print death message
; then restart
l1_quit_or_died:
; jsr TEXT
; jsr HOME
lda KEYRESET ; clear strobe
; lda #0
; sta DRAW_PAGE
; lda #<end_message
; sta OUTL
; lda #>end_message
; sta OUTH
; jsr move_and_print
; jsr move_and_print
;wait_loop:
; lda KEYPRESS
; bpl wait_loop
; lda KEYRESET ; clear strobe
; jmp ootw
rts
; hack, we don't have doors in l1
;recalc_walk_collision:
; rts
;end_message:
;.byte 8,10,"PRESS RETURN TO CONTINUE",0
;.byte 11,20,"ACCESS CODE: IH8S",0
; rooms
.include "ootw_c1_arrival.s"
;.include "ootw_c1_rope.s"
.include "ootw_c1_pool.s"
;.include "ootw_c1_cavern.s"
;.include "ootw_c1_mesa.s"
; movement
;.include "physicist.s"
;.include "ootw_c1_sluggy.s"
;.include "ootw_c1_beast.s"
;.include "earthquake.s"
;.include "text_print.s"
;.include "gr_pageflip.s"
;.include "gr_unrle.s"
;.include "gr_fast_clear.s"
;.include "gr_copy.s"
;.include "gr_make_quake.s"
;.include "gr_putsprite.s"
;.include "gr_putsprite_flipped.s"
;.include "gr_offsets.s"
;.include "gr_hlin.s"
;.include "random16.s"
;.include "keyboard.s"
;.include "gr_overlay.s"
;.include "gr_putsprite_crop.s"
; room backgrounds
;.include "ootw_graphics/ootw_pool.inc"
;.include "ootw_graphics/ootw_underwater.inc"
; sprites
.include "sprites/l1_background.inc"
;.include "ootw_graphics/sprites/physicist.inc"
.include "sprites/physicist_l1_swim.inc"
; cutscene data
;.include "ootw_graphics/l1end/ootw_l1end.inc"
;.include "ootw_graphics/l1end_scenes/ootw_beast_end.inc"
;.include "ootw_graphics/l1end_scenes/ootw_slug_end.inc"
;.include "ootw_graphics/l1end_scenes/ootw_beast_intro.inc"

View File

@ -0,0 +1,952 @@
; Ootw Checkpoint1 -- arriving with a splash
ootw_c1_arrival:
;===========================
; Enable graphics
bit LORES
bit SET_GR
bit FULLGR
;===========================
; Setup pages (is this necessary?)
lda #0
sta DRAW_PAGE
lda #1
sta DISP_PAGE
;=============================
; Load background to $c00
lda #>(underwater_rle)
sta GBASH
lda #<(underwater_rle)
sta GBASL
lda #$c ; load image off-screen $c00
jsr load_rle_gr
;=================================
; do intro flash
jsr do_flash
;=================================
; setup vars
lda #0
sta GAME_OVER
sta GAIT
sta MONSTER_GRAB
lda #20
sta BUBBLES_Y
sta CONSOLE_Y
sta PHYSICIST_Y
lda #17
sta PHYSICIST_X
bit KEYRESET ; clear keypress
; reset tentacle monster
lda #60
sta tentacle_ypos
sta tentacle_ypos+1
sta tentacle_ypos+2
sta tentacle_ypos+3
sta tentacle_ypos+4
lda #10
sta tentacle_xpos
lda #15
sta tentacle_xpos+1
lda #20
sta tentacle_xpos+2
lda #25
sta tentacle_xpos+3
lda #30
sta tentacle_xpos+4
;============================
; Underwater Loop
;============================
underwater_loop:
;================================
; copy background to current page
;================================
jsr gr_copy_to_current
;=======================
; draw Surface ripple
;=======================
jsr draw_surface_ripple
;======================
; draw console
;======================
lda #16
sta XPOS
lda CONSOLE_Y
sta YPOS
lda #<console_sprite
sta INL
lda #>console_sprite
sta INH
jsr put_sprite_crop
;=================================
; draw physicist
;=================================
lda MONSTER_GRAB
beq swim_physicist_normal
; draw being pulled by tentacle
ldx MONSTER_WHICH
lda tentacle_xpos,X
sta XPOS
lda tentacle_ypos,X
sec
sbc #10
and #$fe
sta YPOS
; see if game over
cmp #80
bcc not_too_far_down
lda #$ff
sta GAME_OVER
not_too_far_down:
lda #<swimming1
sta INL
lda #>swimming1
jmp swim_physicist_draw
swim_physicist_normal:
lda PHYSICIST_X
sta XPOS
lda PHYSICIST_Y
and #$fe
sta YPOS
ldy GAIT
lda swim_progression,Y
sta INL
lda swim_progression+1,Y
swim_physicist_draw:
sta INH
jsr put_sprite_crop
;======================
; draw monster
;======================
jsr draw_tentacle_monster
jsr move_tentacle_monster
;======================
; draw bubbles
;======================
lda BUBBLES_Y
cmp #2
bcc no_draw_bubbles ; blt
sta YPOS
lda #17
sta XPOS
lda #<bubbles_sprite
sta INL
lda #>bubbles_sprite
sta INH
jsr put_sprite_crop
no_draw_bubbles:
;===============================
; check keyboard
;===============================
lda MONSTER_GRAB
bne underwater_done_keyboard
lda KEYPRESS
bpl underwater_done_keyboard
cmp #27+$80
beq underwater_escape
cmp #'A'+$80
beq uw_left_pressed
cmp #8+$80
beq uw_left_pressed
cmp #'D'+$80
beq uw_right_pressed
cmp #$15+$80
beq uw_right_pressed
cmp #'W'+$80
beq uw_up_pressed
cmp #$0B+$80
beq uw_up_pressed
cmp #'S'+$80
beq uw_down_pressed
cmp #$0A+$80
beq uw_down_pressed
jmp underwater_done_keyboard
underwater_escape:
lda #$ff
sta GAME_OVER
bne underwater_done_keyboard ; bra
uw_left_pressed:
dec PHYSICIST_X
jmp underwater_done_keyboard
uw_right_pressed:
inc PHYSICIST_X
jmp underwater_done_keyboard
uw_up_pressed:
dec PHYSICIST_Y
jmp underwater_done_keyboard
uw_down_pressed:
inc PHYSICIST_Y
jmp underwater_done_keyboard
underwater_done_keyboard:
bit KEYRESET
;=================================
; move things
;=================================
;===================
; move bubbles
;===================
lda FRAMEL
and #$f
bne no_move_bubbles
ldx BUBBLES_Y
beq no_move_bubbles
dex
dex
stx BUBBLES_Y
no_move_bubbles:
;===================
; move console
;===================
lda FRAMEL
and #$1f
bne no_move_console
ldx CONSOLE_Y
cpx #48
bcs no_move_console ; bge
inx
inx
stx CONSOLE_Y
no_move_console:
;===================
; move physicist
;===================
; gradually pull you down
lda FRAMEL
and #$f
bne no_move_swim
lda GAIT
clc
adc #$2
and #$f
sta GAIT
no_move_swim:
lda FRAMEL
and #$1f
bne no_move_physicist
ldx PHYSICIST_Y
cpx #34
bcs no_move_physicist ; bge
; temporarily disable for monster debugging
inx
inx
stx PHYSICIST_Y
no_move_physicist:
;===============
; page flip
jsr page_flip
;================
; inc frame count
inc FRAMEL
bne underwater_frame_no_oflo
inc FRAMEH
underwater_frame_no_oflo:
;==========================
; check if done this level
;==========================
lda GAME_OVER
cmp #$ff
beq done_underwater
; check if leaving the pool
lda PHYSICIST_Y
cmp #$FE
beq done_underwater
; loop forever
jmp underwater_loop
done_underwater:
rts
;==============================
; draw surface ripple
;==============================
draw_surface_ripple:
lda #8
sta XPOS
lda #0
sta YPOS
lda FRAMEL
and #$60
lsr
lsr
lsr
lsr
tay
lda ripple_progression,Y
sta INL
lda ripple_progression+1,Y
sta INH
jsr put_sprite_crop
rts
ripple_progression:
.word ripple1_sprite
.word ripple2_sprite
.word ripple3_sprite
.word ripple4_sprite
ripple1_sprite:
.byte 24,1
.byte $26,$22,$66,$6E,$2E,$6E,$25,$25,$66,$6E,$6E,$66
.byte $66,$66,$66,$5E,$2F,$2F,$6F,$66,$66,$66,$26,$26
ripple2_sprite:
.byte 24,1
.byte $26,$22,$66,$6E,$2E,$6E,$25,$65,$66,$6E,$2E,$66
.byte $66,$66,$26,$5E,$2F,$2F,$2F,$66,$66,$26,$26,$26
ripple3_sprite:
.byte 24,1
.byte $26,$22,$66,$6E,$2E,$6E,$65,$65,$66,$2E,$2E,$66
.byte $66,$66,$66,$5E,$2F,$2F,$2F,$26,$66,$26,$26,$26
ripple4_sprite:
.byte 24,1
.byte $26,$22,$66,$6E,$6E,$6E,$65,$65,$25,$2E,$6E,$66
.byte $66,$66,$26,$5E,$2F,$2F,$2F,$66,$66,$26,$26,$26
bubbles_sprite:
.byte 5,2
.byte $6A,$AA,$A6,$7A,$6A
.byte $AA,$AA,$A6,$AA,$AA
console_sprite:
.byte 6,5
.byte $AA,$A5,$55,$5A,$AA,$AA
.byte $AA,$AA,$00,$05,$05,$AA
.byte $5A,$05,$00,$00,$00,$55
.byte $AA,$A5,$55,$00,$00,$55
.byte $AA,$AA,$A5,$A0,$A0,$A5
;============================
; Do Flash
;============================
do_flash:
lda #0
sta FRAMEL
;============================
; Flash Loop
;============================
flash_loop:
;================================
; Handle Flash
;================================
lda FRAMEL
cmp #180
bcc no_flash ; blt
cmp #182
bcc first_flash
bcs second_flash
first_flash:
; Load background to $1000
lda #>(uboot_flash1_rle)
sta GBASH
lda #<(uboot_flash1_rle)
sta GBASL
lda #$10 ; load image off-screen $c00
jsr load_rle_gr
jsr gr_overlay
jmp check_flash_done
second_flash:
; Load background to $1000
lda #>(uboot_flash2_rle)
sta GBASH
lda #<(uboot_flash2_rle)
sta GBASL
lda #$10 ; load image off-screen $c00
jsr load_rle_gr
jsr gr_overlay
jmp check_flash_done
no_flash:
;================================
; copy background to current page
;================================
jsr gr_copy_to_current
;=======================
; draw Surface ripple
;=======================
jsr draw_surface_ripple
;=======================
; draw Overall ripple
;=======================
check_flash_done:
;===============
; page flip
jsr page_flip
;================
; inc frame count
inc FRAMEL
bne flash_frame_no_oflo
inc FRAMEH
flash_frame_no_oflo:
;==========================
; check if done this level
;==========================
lda FRAMEL
cmp #184
beq done_flash
; loop forever
jmp flash_loop
done_flash:
rts
;======================
;======================
; move tentacle monster
;======================
;======================
move_tentacle_monster:
lda MONSTER_GRAB
beq move_tentacle_notgrabbed
;====================
lda FRAMEL
and #$7
bne no_move_tentacle_grabbed
ldx #0
jsr random16
lda SEEDL
sta MONSTER_AI
move_tentacle_grab_loop:
cpx MONSTER_WHICH
bne tentacle_grab_random
; pull down quickly if grabbed
inc tentacle_ypos,X
inc tentacle_ypos,X
inc tentacle_ypos,X
jmp tentacle_grab_animate
;=====================
; randomly adjust y
tentacle_grab_random:
ror MONSTER_AI
lda MONSTER_AI
and #$3
clc
adc tentacle_ypos,X
sta tentacle_ypos,X
; adjust place in animation
tentacle_grab_animate:
inc tentacle_gait,X
lda tentacle_gait,X
and #$7
sta tentacle_gait,X
inx
cpx #5
bne move_tentacle_grab_loop
no_move_tentacle_grabbed:
rts
move_tentacle_notgrabbed:
; if (physicist_x+1<tentacle_x) no collision
; if (physicist_x>tentacle_x+2) no collision
; else, colllision
;=====================
; check for grab
ldx #0
tentacle_collision_loop:
lda PHYSICIST_X
clc
adc #1
cmp tentacle_xpos,X
bcc tentacle_no_collision ; blt
lda PHYSICIST_X
ldy tentacle_xpos,X
iny
iny
sty TEMPY
cmp TEMPY
bcs tentacle_no_collision ; bge
tentacle_collision_x:
lda PHYSICIST_Y
bmi tentacle_no_collision ; if exiting pool, no collision
lda tentacle_ypos,X
sec
sbc #10
cmp PHYSICIST_Y
bcs tentacle_no_collision ; bge
tentacle_collision:
stx MONSTER_WHICH
lda #1
sta MONSTER_GRAB
jmp no_move_tentacle
tentacle_no_collision:
inx
cpx #5
bne tentacle_collision_loop
;====================
lda FRAMEL
and #$7
bne no_move_tentacle
ldx #0
jsr random16
lda SEEDL
sta MONSTER_AI
move_tentacle_monster_loop:
;=====================
; move toward swimmer
lda FRAMEL
and #$3f
bne tentacle_no_sideways
lda tentacle_xpos,X
sec
sbc PHYSICIST_X
bmi tentacle_move_right
dec tentacle_xpos,X
jmp tentacle_no_sideways
tentacle_move_right:
inc tentacle_xpos,X
tentacle_no_sideways:
;=====================
; randomly adjust y
ror MONSTER_AI
lda MONSTER_AI
and #$2
eor #$ff
sec
adc tentacle_ypos,X
sta tentacle_ypos,X
random_not_move:
; adjust place in animation
inc tentacle_gait,X
lda tentacle_gait,X
and #$7
sta tentacle_gait,X
inx
cpx #5
bne move_tentacle_monster_loop
no_move_tentacle:
rts
;======================
;======================
; draw tentacle monster
;======================
;======================
draw_tentacle_monster:
ldx #0
draw_tentacle_monster_loop:
jsr draw_one_tentacle
inx
cpx #5
bne draw_tentacle_monster_loop
rts
tentacle_xpos:
.byte 10,15,20,25,30
tentacle_ypos:
.byte 46,46,46,46,46
tentacle_gait:
.byte 0,5,2,7,4
;======================
;======================
; draw one tentacle
;======================
;======================
draw_one_tentacle:
lda tentacle_xpos,X
sta XPOS
lda tentacle_ypos,X
and #$fe
sta YPOS
ldy tentacle_gait,X
lda tentacle_monster_progress_lo,Y
sta INL
lda tentacle_monster_progress_hi,Y
sta INH
txa
pha
jsr put_sprite_crop
pla
tax
lda tentacle_ypos,X
cmp #32
bcs done_draw_tentacle ; bge
;==========================
; draw base of tentacle
lda tentacle_xpos,X
sta XPOS
lda tentacle_ypos,X
and #$fe
clc
adc #16
sta YPOS
lda #<tentacle_base
sta INL
lda #>tentacle_base
sta INH
txa
pha
jsr put_sprite_crop
pla
tax
done_draw_tentacle:
rts
tentacle_monster_progress_lo:
.byte <tentacle_sprite1
.byte <tentacle_sprite2
.byte <tentacle_sprite3
.byte <tentacle_sprite4
.byte <tentacle_sprite5
.byte <tentacle_sprite6
.byte <tentacle_sprite7
.byte <tentacle_sprite8
tentacle_monster_progress_hi:
.byte >tentacle_sprite1
.byte >tentacle_sprite2
.byte >tentacle_sprite3
.byte >tentacle_sprite4
.byte >tentacle_sprite5
.byte >tentacle_sprite6
.byte >tentacle_sprite7
.byte >tentacle_sprite8
tentacle_sprite1:
.byte 3,8
.byte $55,$AA,$AA
.byte $55,$AA,$AA
.byte $55,$AA,$AA
.byte $A5,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
tentacle_sprite2:
.byte 3,8
.byte $55,$AA,$AA
.byte $55,$5A,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
tentacle_sprite3:
.byte 3,8
.byte $A5,$5A,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
tentacle_sprite4:
.byte 3,8
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
tentacle_sprite5:
.byte 3,8
.byte $AA,$5A,$A5
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
tentacle_sprite6:
.byte 3,8
.byte $AA,$5A,$A5
.byte $AA,$55,$AA
.byte $AA,$AA,$55
.byte $AA,$AA,$55
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
tentacle_sprite7:
.byte 3,8
.byte $5A,$A5,$AA
.byte $55,$AA,$AA
.byte $AA,$55,$AA
.byte $AA,$5A,$55
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
tentacle_sprite8:
.byte 3,8
.byte $AA,$55,$AA
.byte $55,$AA,$AA
.byte $55,$AA,$AA
.byte $A5,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
.byte $AA,$55,$AA
tentacle_base:
.byte 1,14
.byte $55
.byte $55
.byte $55
.byte $55
.byte $55
.byte $55
.byte $55
.byte $55
.byte $55
.byte $55
.byte $55
.byte $55
.byte $55
.byte $55

605
another_myst/ootw_c1_pool.s Normal file
View File

@ -0,0 +1,605 @@
; Ootw Pool Party
ootw_pool:
;================
; Enable graphics
bit LORES
bit SET_GR
bit FULLGR
;===================
; disable earthquake
lda #0
sta EARTH_OFFSET
lda #4
sta WHICH_CAVE
;===========================
; Setup pages (is this necessary?)
lda #0
sta DRAW_PAGE
lda #1
sta DISP_PAGE
;===========================
; Setup right/left exit paramaters
lda #(39+128)
sta RIGHT_LIMIT
sta RIGHT_WALK_LIMIT
lda #(-4+128)
sta LEFT_LIMIT
sta LEFT_WALK_LIMIT
;=============================
; Load background to $c00
lda #>(pool_rle)
sta GBASH
lda #<(pool_rle)
sta GBASL
lda #$c ; load image off-screen $c00
jsr load_rle_gr
;=================================
; setup vars
lda #0
sta GAIT
sta GAME_OVER
sta TENTACLE_GRAB
lda #30
sta TENTACLE_PROGRESS
;==================================
; setup beast if we're running from it
; jsr setup_beast
;============================
;============================
;============================
; Pool Loop (palindrome)
;============================
;============================
;============================
pool_loop:
;================================
; copy background to current page
jsr gr_copy_to_current
;================================
; draw bg beast, if needed
; jsr draw_bg_beast
;=======================
; draw pool ripples
; jsr draw_ripples
;==============================
; handle being grabbed
lda TENTACLE_GRAB
beq tentacle_action
;=================================
; actively being grabbed
lda TENTACLE_PROGRESS
tax
lda caught_progression,X
sta INL
lda caught_progression+1,X
sta INH
lda TENTACLE_X
sta XPOS
lda #32
sta YPOS
lda FRAMEL
and #$1f
bne no_caught_progress
inc TENTACLE_PROGRESS
inc TENTACLE_PROGRESS
no_caught_progress:
jsr put_sprite
lda TENTACLE_PROGRESS
cmp #24
bne beyond_tentacles
lda #$ff
sta GAME_OVER
jmp beyond_tentacles
;===============
; move/draw tentacle monster
tentacle_action:
lda FRAMEH
and #3
bne tentacle_move
lda FRAMEL
cmp #$ff
bne tentacle_move
tentacle_init:
sec
lda PHYSICIST_X
sbc #2
sta TENTACLE_X
lda #0
sta TENTACLE_PROGRESS
tentacle_move:
lda TENTACLE_PROGRESS
cmp #26
bpl no_tentacle
tax
lda tentacle_progression,X
sta INL
lda tentacle_progression+1,X
sta INH
lda TENTACLE_X
sta XPOS
lda #32
sta YPOS
lda FRAMEL
and #$3f
bne no_tentacle_progress
inc TENTACLE_PROGRESS
inc TENTACLE_PROGRESS
no_tentacle_progress:
jsr put_sprite
; See if we are fully extended
; if we are close enough to grab
lda TENTACLE_PROGRESS
cmp #12
bne no_tentacle
sec
lda PHYSICIST_X
sbc TENTACLE_X ; want -4 to 4
clc
adc #4 ; want 0 to 8
and #$f8
bne no_tentacle
lda #0
sta TENTACLE_PROGRESS
lda #1
sta TENTACLE_GRAB
no_tentacle:
;===============================
; check keyboard
jsr handle_keypress
;===============================
; move physicist
jsr move_physicist
;===============================
; check limits
jsr check_screen_limit
;===============
; draw physicist
jsr draw_physicist
;================
; handle beast
lda BEAST_OUT
beq pool_no_beast
;================
; move beast
; jsr move_beast
;================
; draw beast
; jsr draw_beast
pool_no_beast:
beyond_tentacles:
;======================
; draw foreground plant
; jsr draw_fg_plant
;===============
; page flip
jsr page_flip
;================
; inc frame count
inc FRAMEL
bne frame_no_oflo
inc FRAMEH
frame_no_oflo:
; pause?
; check if done this level
lda GAME_OVER
cmp #$ff
beq done_pool
; check if done this level
; cmp #$2
; bne not_to_right
; exit to right
; lda #0
; sta PHYSICIST_X
; sta WHICH_CAVE
; jmp ootw_cavern
;not_to_right:
; cmp #$1
; bne not_done_pool
; lda #36
; sta PHYSICIST_X
; jmp ootw_rope
;not_done_pool:
; loop forever
jmp pool_loop
done_pool:
rts
;=======================
; draw pool ripples
.if 0
draw_ripples:
lda FRAMEL
and #$30 ; 0110 1100
lsr
lsr
lsr
tax
lda pool_ripples,X
sta INL
lda pool_ripples+1,X
sta INH
lda #9
sta XPOS
lda #30
sta YPOS
jsr put_sprite
lda FRAMEL
and #$30 ; 0110 1100
lsr
lsr
lsr
clc
adc #2
and #$6
tax
lda pool_ripples,X
sta INL
lda pool_ripples+1,X
sta INH
lda #27
sta XPOS
lda #30
sta YPOS
jsr put_sprite
lda FRAMEL
and #$30 ; 0110 1100
lsr
lsr
lsr
clc
adc #4
and #$6
tax
lda #18
sta XPOS
lda #28
sta YPOS
jmp put_sprite ; tail call
; rts
.endif
;============================
;============================
; exit pool
;============================
;============================
exit_pool:
lda #0
sta BG_BEAST
sta EXIT_COUNT
;=============================
; Load background to $c00
lda #>(pool_rle)
sta GBASH
lda #<(pool_rle)
sta GBASL
lda #$c ; load image off-screen $c00
jsr load_rle_gr
exit_pool_loop:
;================================
; copy background to current page
jsr gr_copy_to_current
;=======================
; draw pool ripples
; jsr draw_ripples
;================
; draw background beast
; jsr draw_bg_beast
;===============
; draw physicist
lda EXIT_COUNT
and #$fe
tay
lda #20
sta XPOS
lda #32
sta YPOS
lda pool_exit_progression,Y
sta INL
lda pool_exit_progression+1,Y
sta INH
jsr put_sprite
;=================
; draw foreground plant
; jsr draw_fg_plant
;===============
; page flip
jsr page_flip
;================
; inc frame count
inc FRAMEL
bne framee_no_oflo
inc FRAMEH
framee_no_oflo:
; increment exit count
lda FRAMEL
and #$0f
bne exit_count_same
inc EXIT_COUNT
exit_count_same:
; see if start bg beast going
lda EXIT_COUNT
cmp #(14*2)
bne check_done_exiting_pool
lda #2
sta BG_BEAST
check_done_exiting_pool:
; check if done
lda EXIT_COUNT
cmp #(26*2)
beq done_exit_pool
jmp exit_pool_loop
done_exit_pool:
bit KEYRESET
rts
;=========================
; draw background beast
;=========================
draw_bg_beast:
.if 0
; if 0, skip altogether
lda BG_BEAST
beq done_draw_bg_beast
cmp #14
bcc bg_beast_incoming ; blt
cmp #$44
bcs bg_beast_outgoing ; bge
bg_beast_just_standing:
; FIXME: look at you when close
lda PHYSICIST_X
cmp #30
bcs beast_staring ; bge
lda #<beast_bg7
sta INL
lda #>beast_bg7
sta INH
lda #33
sta XPOS
jmp bg_beast_callsprite
beast_staring:
lda #<beast_bg8
sta INL
lda #>beast_bg8
sta INH
lda #33
sta XPOS
jmp bg_beast_callsprite
bg_beast_incoming:
lda BG_BEAST
and #$fe
asl
tay
lda beast_incoming,Y
sta INL
lda beast_incoming+1,Y
sta INH
lda beast_incoming+2,Y
jmp bg_beast_callsprite
bg_beast_outgoing:
lda BG_BEAST
sec
sbc #$44
and #$fe
asl
tay
lda beast_outgoing,Y
sta INL
lda beast_outgoing+1,Y
sta INH
lda beast_outgoing+2,Y
jmp bg_beast_callsprite
bg_beast_callsprite:
sta XPOS
lda #8
sta YPOS
jsr put_sprite_crop
lda FRAMEL
and #$7
bne done_draw_bg_beast
inc BG_BEAST
lda BG_BEAST
cmp #$50
bcc done_draw_bg_beast
; disable if hit $50
lda #0
sta BG_BEAST
done_draw_bg_beast:
.endif
rts

View File

@ -18,7 +18,9 @@ ootw_c16_end.inc: $(PNG2RLE) \
the_end01.png the_end02.png the_end03.png the_end04.png the_end05.png \
the_end06.png the_end07.png the_end08.png the_end09.png the_end10.png \
east_top_w.png temple_center_w.png temple_center_ex.png \
generator_n.png approach07.png blank.png
generator_n.png approach07.png blank.png \
ootw_uboot_flash2.png ootw_uboot_flash1.png ootw_uboot_bg.png \
another_pool.png
$(PNG2RLE) asm wing_bg.png wing_bg_rle > ootw_c16_end.inc
$(PNG2RLE) asm left_unfurl1.png left_unfurl1_rle >> ootw_c16_end.inc
$(PNG2RLE) asm left_unfurl2.png left_unfurl2_rle >> ootw_c16_end.inc
@ -52,6 +54,11 @@ ootw_c16_end.inc: $(PNG2RLE) \
$(PNG2RLE) asm generator_n.png generator_n_rle >> ootw_c16_end.inc
$(PNG2RLE) asm approach07.png approach07_rle >> ootw_c16_end.inc
$(PNG2RLE) asm blank.png blank_rle >> ootw_c16_end.inc
$(PNG2RLE) asm ootw_uboot_bg.png underwater_rle >> ootw_c16_end.inc
$(PNG2RLE) asm ootw_uboot_flash1.png uboot_flash1_rle >> ootw_c16_end.inc
$(PNG2RLE) asm ootw_uboot_flash2.png uboot_flash2_rle >> ootw_c16_end.inc
$(PNG2RLE) asm another_pool.png pool_rle >> ootw_c16_end.inc
#####

View File

@ -928,3 +928,128 @@ blank_rle: .byte $28 ; ysize=48
.byte $A0,$FF,$AA, $A0,$FF,$AA, $A0,$FF,$AA, $A0,$C3,$AA
.byte $A1
; cycles=5368
underwater_rle: .byte $28 ; ysize=48
.byte $AB,$66, $6E, $2E, $6E, $25,$25, $66, $6E,$6E
.byte $A4,$66, $5E, $2F,$2F, $6F, $AD,$66, $AB,$00, $22
.byte $A4,$00, $50, $20, $A3,$00, $22, $A0,$1F,$00, $02
.byte $00,$00, $02,$02, $A0,$1D,$00, $02, $AA,$00, $02, $A3,$00
.byte $22, $A0,$20,$00, $60,$60, $A7,$00, $20,$20, $A0,$1D,$00, $02
.byte $05, $A7,$00, $02,$02, $A0,$1E,$00, $20,$20, $A3,$00, $20
.byte $A0,$23,$00, $02, $A0,$1B,$00, $22, $20, $AD,$00, $20
.byte $00,$00, $22,$22, $AF,$00, $D0, $A3,$00, $A5,$22, $A5,$00
.byte $02, $A3,$00, $02, $A7,$00, $20, $AD,$00, $DD,$DD
.byte $D0, $55,$55, $52,$52, $22,$22, $A9,$00, $02, $A4,$00
.byte $20, $00,$00, $02, $AD,$00, $DD,$DD, $A6,$55, $02
.byte $A6,$00, $22, $A3,$00, $20, $A3,$00, $02, $A0,$10,$00
.byte $DD,$DD, $00,$00, $05,$05, $55,$55, $AB,$00, $02, $A3,$00
.byte $25, $A0,$10,$00, $DD, $A5,$00, $05,$05, $A0,$20,$00, $DD
.byte $00, $50,$50, $A3,$00, $D0, $DD, $A7,$00, $22
.byte $A0,$17,$00, $DD, $A4,$55, $50,$50, $A3,$DD, $A0,$1D,$00, $D0
.byte $A7,$55, $A3,$DD, $A0,$18,$00, $A3,$D0, $A3,$DD, $00, $05
.byte $A4,$55, $A4,$DD, $A8,$00, $02, $AC,$00, $D0, $A4,$DD
.byte $A3,$0D, $DD, $A4,$00, $05,$05, $A5,$DD, $A0,$12,$00, $D0
.byte $DD,$DD, $0D, $00, $0D, $DD, $A3,$00, $DD
.byte $A5,$00, $D0, $A5,$DD, $A0,$11,$00, $A4,$DD, $A3,$00, $0D
.byte $A3,$00, $0D, $A5,$00, $A7,$DD, $AE,$00, $D0, $A5,$DD
.byte $D0, $00, $50, $05,$05, $00, $05,$05, $A5,$00
.byte $A7,$DD, $AD,$00, $D0, $A3,$DD, $A4,$0D, $55, $05
.byte $00, $A3,$50, $A5,$00, $D0, $A7,$DD, $AC,$00, $D0
.byte $A4,$DD, $A3,$00, $55, $00, $50,$50, $05, $80
.byte $DD, $A5,$00, $A8,$DD, $AB,$00, $A6,$DD, $D0, $00,$00
.byte $05, $00, $55, $00, $DD, $A3,$88
.byte $A1
; cycles=8687
uboot_flash1_rle: .byte $28 ; ysize=48
.byte $A0,$FF,$EE, $A0,$A3,$EE, $FE, $FF, $FE, $A0,$13,$EE, $A0,$11,$FE
.byte $A5,$FF, $A0,$12,$FE, $A0,$28,$FF, $A0,$11,$EE, $EF, $A3,$FF, $EF
.byte $A0,$24,$EE, $EF,$EF, $A0,$FF,$EE, $A0,$7D,$EE
.byte $A1
; cycles=3478
uboot_flash2_rle: .byte $28 ; ysize=48
.byte $AB,$66, $6F, $2F, $6F, $A3,$66, $6F,$6F, $A4,$66
.byte $A4,$6F, $AD,$66, $A0,$10,$22, $62,$62, $A3,$22, $56, $A0,$22,$22
.byte $26,$26, $A0,$28,$22, $25, $A3,$22, $56, $A0,$20,$22, $F2,$F2
.byte $A7,$22, $52, $62, $A0,$1D,$22, $26,$26, $A7,$22, $25,$25
.byte $A0,$1E,$22, $52, $62, $A3,$22, $52, $A0,$23,$22, $25
.byte $A0,$1B,$22, $66, $62, $AD,$22, $52, $22,$22, $55
.byte $56, $AF,$22, $F2, $A3,$22, $A5,$66, $A5,$22, $25
.byte $A3,$22, $E5, $EE,$EE, $E2, $A4,$22, $52, $AD,$22
.byte $FF,$FF, $F2, $77,$77, $76,$76, $66,$66, $A8,$22, $E2
.byte $A4,$EE, $E2, $52, $22,$22, $25, $AD,$22, $FF,$FF
.byte $A6,$77, $26, $A6,$22, $55, $22, $EE,$EE, $FE,$FE
.byte $EE,$EE, $25, $A0,$10,$22, $FF,$FF, $55,$55, $57,$57, $77,$77
.byte $A9,$22, $A3,$EE, $EF, $EE,$EE, $65, $A0,$10,$22, $FF
.byte $A5,$55, $57,$57, $A9,$22, $2E, $A4,$EE, $2E, $A0,$11,$22
.byte $FF, $55, $75,$75, $A3,$55, $F5, $FF, $A7,$22
.byte $55, $22, $A4,$2E, $A0,$12,$22, $FF, $A4,$77, $75,$75
.byte $A3,$FF, $A0,$1D,$22, $F2, $A7,$77, $A3,$FF, $A0,$18,$22, $A3,$F2
.byte $A3,$FF, $55, $57, $A4,$77, $A4,$FF, $A8,$22, $25
.byte $AC,$22, $F2, $A4,$FF, $A3,$5F, $FF, $A4,$55, $57,$57
.byte $A5,$FF, $A0,$12,$22, $F2, $FF,$FF, $5F, $55, $5F
.byte $FF, $A3,$55, $FF, $A5,$55, $F5, $A5,$FF, $A0,$11,$22
.byte $A4,$FF, $A3,$55, $5F, $A3,$55, $5F, $A5,$55, $A7,$FF
.byte $AE,$22, $F2, $A5,$FF, $F5, $55, $75, $57,$57
.byte $55, $57,$57, $A5,$55, $A7,$FF, $AD,$22, $F2, $A3,$FF
.byte $A4,$5F, $77, $57, $55, $A3,$75, $A5,$55, $F5
.byte $A7,$FF, $AC,$22, $F2, $A4,$FF, $A3,$55, $77, $55
.byte $75,$75, $57, $DF, $DD, $A5,$55, $A8,$FF, $AB,$22
.byte $A6,$FF, $F5, $55,$55, $57, $55, $77, $FF,$FF
.byte $A3,$DD
.byte $A1
; cycles=8759
pool_rle: .byte $28 ; ysize=48
.byte $88, $99, $55, $A3,$44, $45, $4A, $A0,$02,$AF
.byte $A4,$44, $4F, $A7,$FF, $5F, $A5,$55, $5A,$5A, $05
.byte $A9,$FF, $88, $99, $4F,$4F, $44, $FF, $44,$44
.byte $FF, $88, $A4,$44, $A6,$FF, $5F, $A7,$55, $05,$05
.byte $00, $A9,$FF, $88, $99, $A5,$44, $84, $44
.byte $88, $44, $F8, $44,$44, $4F, $A6,$FF, $55,$55
.byte $05,$05, $A3,$50, $55, $00,$00, $A9,$FF, $88, $99
.byte $AC,$44, $4F, $A6,$FF, $F0, $50, $A6,$55, $70
.byte $AA,$FF, $88, $99, $44, $F8, $84, $F4
.byte $44, $FF,$FF, $F8, $88, $A4,$44, $A7,$FF, $55
.byte $D5, $FD, $0D, $FD, $D5, $55, $77
.byte $AA,$FF, $88, $99, $44, $FF, $88, $A0,$01,$AA
.byte $54, $A3,$FF, $88, $94, $F4,$F4, $A8,$FF, $55
.byte $DD, $FF, $00, $FF, $DD, $55, $77
.byte $AA,$FF, $88, $89, $98, $FF, $88, $A0,$01,$AA
.byte $F5, $A3,$FF, $88, $99, $AA,$FF, $55, $DD
.byte $FF, $F0, $FF, $DD, $55, $77, $AA,$FF
.byte $88,$88, $99, $4F, $48, $45, $44, $54
.byte $FF,$FF, $88, $99, $AA,$FF, $55, $DD, $A3,$FF
.byte $DD, $55, $77, $AA,$FF, $88,$88, $99, $A3,$44
.byte $84, $44, $FF,$FF, $88, $99, $AA,$FF, $55,$55
.byte $A3,$5D, $55,$55, $77, $AA,$FF, $88,$88, $99, $F8
.byte $44,$44, $FF, $F5, $FF,$FF, $88, $99, $AA,$FF
.byte $A7,$55, $77, $AA,$FF, $88,$88, $99, $FF, $84
.byte $F4, $A4,$FF, $88, $99, $AA,$FF, $A7,$55, $77
.byte $AA,$FF, $88,$88, $99, $EF, $88, $A5,$EF, $88
.byte $99, $AA,$EE, $55,$55, $85, $88, $85, $55,$55
.byte $77, $AA,$EE, $88,$88, $99, $EE, $88, $A5,$EE
.byte $88, $99, $AA,$EE, $55,$55, $A3,$88, $55,$55, $77
.byte $AA,$EE, $88,$88, $99, $EE, $88, $A5,$EE, $88
.byte $99, $A8,$EE, $5E, $88, $55,$55, $A3,$88, $55,$55
.byte $77, $AA,$EE, $88,$88, $99, $EE, $88, $99
.byte $A4,$EE, $88, $99, $A8,$EE, $05, $88, $55,$55
.byte $A3,$88, $55,$55, $77, $5E, $A9,$EE, $88,$88, $99
.byte $9E, $88, $99, $A4,$EE, $88, $99, $A8,$EE
.byte $60, $A3,$00, $A3,$08, $05,$05, $07, $A3,$55, $A7,$EE
.byte $88,$88, $99,$99, $88, $99, $A4,$EE, $88, $99
.byte $A8,$EE, $66, $60,$60, $05, $55, $60, $00
.byte $05, $55,$55, $E0,$E0, $E5, $A7,$EE, $88,$88, $99,$99
.byte $88, $99, $A4,$EE, $88, $99, $8E,$8E, $A6,$EE
.byte $E6, $A9,$66, $AB,$EE, $88, $99,$99, $88, $99
.byte $A3,$EE, $DE, $88, $99, $80, $88, $0D,$0D
.byte $DE,$DE, $A3,$EE, $A9,$66, $AB,$EE, $88, $99,$99, $88
.byte $99, $A3,$EE, $00, $88, $99, $D0,$D0, $91
.byte $D0, $5D, $55, $A3,$EE, $A8,$66, $AC,$EE, $88
.byte $99,$99, $88, $99, $A3,$EE, $00, $88, $99
.byte $00,$00, $0D, $5D, $55,$55, $A3,$EE, $A8,$66, $AB,$EE
.byte $4C, $88, $99,$99, $88, $99, $A3,$CE, $CC
.byte $88, $99, $A3,$C0, $A3,$C5, $CE,$CE, $8E, $A8,$66
.byte $AB,$EE, $4C, $88, $99,$99, $4C, $CC, $4C
.byte $C4,$C4, $4C, $88, $99, $AB,$CC, $A3,$C6, $66,$66
.byte $E6, $AB,$EE, $CC, $88, $99,$99, $CC, $C4
.byte $A5,$CC, $99, $A0,$12,$CC, $A5,$CE, $A5,$EE
.byte $A1
; cycles=1017

119
another_myst/random16.s Normal file
View File

@ -0,0 +1,119 @@
; 16-bit 6502 Random Number Generator (cycle-invariant version)
; Linear feedback shift register PRNG by White Flame
; http://codebase64.org/doku.php?id=base:small_fast_16-bit_prng
; The Apple II KEYIN routine increments SEEDL:SEEDH
; while waiting for keypress
;SEEDL = $4E
;SEEDH = $4F
XOR_MAGIC = $7657 ; "vW"
;=============================
; random16
;=============================
; takes:
; not 0, cs = 6(r16)+12(lnz)+5(nop)+ 19(deo) = 42
; not 0, cc = 6(r16)+14(lnz)+2(nop)+ 20(neo) = 42
; $0000 = 6(r16)+ 6(loz)+11nops+ 19(deo) = 42
; $8000 = 6(r16)+ 6(loz)+ 4(ceo) + 6nops+ 20(neo) = 42
; $XX00 cc = 6(r16)+ 6(loz)+4(ceo)+2(cep) +4nops+ 20(neo) = 42
; $XX00 cs = 6(r16)+ 6(loz)+4(ceo)+4(cep) +3nops+ 19(deo) = 42*
random16:
lda SEEDL ; 3
beq low_zero ; $0000 and $8000 are special values ; 3
;==========
; 6
lownz:
; -1
asl SEEDL ; Do a normal shift ; 5
lda SEEDH ; 3
rol ; 2
bcs five_cycle_do_eor ; 3
;===========
; 12
bcc two_cycle_no_eor ; 3
;==========
; 12+3-1 = 14
;===================================================================
eleven_cycle_do_eor:
nop ; 2
nop ; 2
nop ; 2
five_cycle_do_eor:
nop ; 2
three_cycle_do_eor:
sta SEEDH ; nop ; 3
do_eor:
; high byte is in A
eor #>XOR_MAGIC ; 2
sta SEEDH ; 3
lda SEEDL ; 3
eor #<XOR_MAGIC ; 2
sta SEEDL ; 3
eor_rts:
rts ; 6
;===========
; 19
;=========================================================================
six_cycles_no_eor:
nop ; 2
four_cycle_no_eor:
nop ; 2
two_cycle_no_eor:
nop ; 2
no_eor:
nop ; 2
nop ; 2
nop ; 2
nop ; 2
sta SEEDH ; 3
jmp eor_rts ; 3+6
;===========
; 20
;======================================================================
;======================================================================
low_zero:
lda SEEDH ; 3
beq eleven_cycle_do_eor ; High byte is also zero ; 3
; so apply the EOR
;============
; 6
ceo:
; -1
; wasn't zero, check for $8000
asl ; 2
beq six_cycles_no_eor ; if $00 is left after the shift; 3
; then it was $80
;===========
; 4
; else, do the EOR based on the carry
cep:
; -1
bcc four_cycle_no_eor ; 3
;============
; 2
bcs three_cycle_do_eor ; 2+3-1 = 4

View File

@ -0,0 +1,258 @@
;=======================
; scenery
plant_wind:
.word plant1
.word plant2
.word plant3
.word plant4
plant1:
.byte $4,$5
.byte $aa,$00,$aa,$aa
.byte $aa,$00,$aa,$aa
.byte $aa,$00,$aa,$aa
.byte $aa,$00,$aa,$00
.byte $aa,$00,$aa,$00
plant2:
.byte $4,$5
.byte $a0,$0a,$aa,$aa
.byte $aa,$00,$aa,$aa
.byte $aa,$00,$aa,$aa
.byte $aa,$00,$aa,$00
.byte $aa,$00,$aa,$00
plant3:
.byte $4,$5
.byte $00,$aa,$aa,$aa
.byte $a0,$0a,$aa,$aa
.byte $aa,$00,$aa,$aa
.byte $aa,$00,$aa,$00
.byte $aa,$00,$aa,$00
plant4:
.byte $4,$5
.byte $00,$aa,$aa,$aa
.byte $aa,$00,$aa,$aa
.byte $aa,$00,$aa,$aa
.byte $aa,$00,$aa,$00
.byte $aa,$00,$aa,$00
pool_ripples:
.word ripple1
.word ripple2
.word ripple3
.word ripple4
ripple1:
.byte $3,$1
.byte $5a,$5a,$aa
ripple2:
.byte $3,$1
.byte $aa,$5a,$aa
ripple3:
.byte $3,$1
.byte $aa,$aa,$aa
ripple4:
.byte $3,$1
.byte $aa,$aa,$aa
foreground_spikes:
.byte $4,$5
.byte $00,$aa,$aa,$00
.byte $00,$aa,$0a,$00
.byte $00,$aa,$00,$00
.byte $00,$aa,$00,$00
.byte $00,$aa,$aa,$00
;=======================
; Tentacle
tentacle_progression:
.word tentacle0 ; 0
.word tentacle1 ; 1
.word tentacle2 ; 2
.word tentacle3 ; 3
.word tentacle4 ; 4
.word tentacle5 ; 5
.word tentacle5 ; 6
.word tentacle5 ; 7
.word tentacle4 ; 8
.word tentacle3 ; 9
.word tentacle2 ; 10
.word tentacle1 ; 11
.word tentacle0 ; 12
tentacle0:
.byte $2,$5
.byte $aa,$aa
.byte $aa,$aa
.byte $aa,$aa
.byte $aa,$aa
.byte $aa,$5a
tentacle1:
.byte $2,$5
.byte $aa,$aa
.byte $aa,$aa
.byte $aa,$aa
.byte $aa,$aa
.byte $aa,$00
tentacle2:
.byte $2,$5
.byte $aa,$aa
.byte $aa,$aa
.byte $aa,$aa
.byte $00,$aa
.byte $aa,$00
tentacle3:
.byte $2,$5
.byte $aa,$aa
.byte $aa,$aa
.byte $aa,$00
.byte $00,$aa
.byte $aa,$00
tentacle4:
.byte $2,$5
.byte $aa,$aa
.byte $00,$aa
.byte $aa,$00
.byte $00,$aa
.byte $aa,$00
tentacle5:
.byte $2,$5
.byte $aa,$00
.byte $00,$aa
.byte $aa,$00
.byte $00,$aa
.byte $aa,$00
caught_progression:
.word caught0
.word caught1
.word caught2
.word caught3
.word caught4
.word caught5
.word caught6
.word caught7
.word caught8
.word ripple4
.word ripple4
.word ripple4 ; 12
caught0:
.byte $5,$8
.byte $aa,$aa,$aa,$9a,$9a
.byte $aa,$00,$00,$99,$bb
.byte $aa,$00,$aa,$0b,$aa
.byte $00,$aa,$aa,$bb,$aa
.byte $aa,$00,$aa,$bb,$aa
.byte $aa,$aa,$aa,$44,$aa
.byte $aa,$aa,$aa,$44,$aa
.byte $aa,$aa,$aa,$f4,$fa
caught1:
.byte $6,$8
.byte $aa,$aa,$aa,$9a,$9a,$aa
.byte $aa,$aa,$aa,$99,$bb,$aa
.byte $aa,$00,$00,$0b,$00,$aa
.byte $00,$aa,$aa,$bb,$00,$0a
.byte $aa,$00,$aa,$bb,$aa,$aa
.byte $aa,$aa,$aa,$44,$aa,$aa
.byte $aa,$aa,$aa,$44,$aa,$aa
.byte $aa,$aa,$aa,$f4,$fa,$aa
caught2:
.byte $7,$8
.byte $aa,$aa,$aa,$9a,$9a,$aa,$aa
.byte $aa,$bb,$aa,$bb,$bb,$aa,$bb
.byte $aa,$aa,$bb,$0b,$0b,$bb,$aa
.byte $aa,$0a,$0a,$00,$00,$0a,$aa
.byte $aa,$00,$aa,$00,$00,$a0,$aa
.byte $aa,$aa,$aa,$44,$44,$aa,$aa
.byte $aa,$aa,$aa,$44,$44,$aa,$aa
.byte $aa,$aa,$aa,$f4,$f4,$aa,$aa
caught3:
.byte $6,$7
.byte $aa,$aa,$aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$b9,$b9,$aa
.byte $aa,$aa,$bb,$0b,$0b,$bb
.byte $aa,$0a,$0a,$00,$00,$0a
.byte $aa,$00,$aa,$00,$00,$a0
.byte $aa,$aa,$aa,$44,$44,$aa
.byte $aa,$aa,$aa,$af,$af,$aa
caught4:
.byte $6,$6
.byte $aa,$aa,$aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$9a,$aa,$aa
.byte $aa,$aa,$aa,$bb,$aa,$aa
.byte $aa,$aa,$0a,$0b,$aa,$aa
.byte $aa,$aa,$00,$40,$0a,$a0
.byte $aa,$aa,$aa,$af,$aa,$aa
caught5:
.byte $5,$5
.byte $aa,$aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$9a,$aa
.byte $aa,$ae,$0a,$b0,$ae
caught6:
.byte $6,$5
.byte $aa,$aa,$aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa,$aa,$aa
.byte $aa,$ea,$aa,$aa,$aa,$ea
.byte $aa,$aa,$5a,$0e,$5a,$aa
caught7:
.byte $6,$5
.byte $aa,$aa,$aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$ea,$aa,$aa
.byte $aa,$ae,$5a,$5a,$5a,$ae
caught8:
.byte $4,$5
.byte $aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$aa
.byte $aa,$aa,$aa,$5e
;============================
; Falling boulder
boulder:
.byte $3,$2
.byte $22,$22,$2a
.byte $22,$22,$22

View File

@ -0,0 +1,343 @@
pool_exit_progression:
.word pool_exit_1 ; 0
.word pool_exit_2 ; 1
.word pool_exit_3 ; 2
.word pool_exit_2 ; 3
.word pool_exit_1 ; 4
.word pool_exit_0 ; 5
.word pool_exit_0 ; 6
.word pool_exit_0 ; 7
.word pool_exit_0 ; 8
.word pool_exit_0 ; 9
.word pool_exit_0 ; 10
.word pool_exit_4 ; 11
.word pool_exit_5 ; 12
.word pool_exit_5 ; 13
.word pool_exit_5 ; 14
.word pool_exit_5 ; 15
.word pool_exit_5 ; 16
.word pool_exit_6 ; 17
.word pool_exit_7 ; 18
.word pool_exit_8 ; 19
.word pool_exit_8 ; 20
.word pool_exit_8 ; 21
.word pool_exit_8 ; 22
.word pool_exit_8 ; 23
.word pool_exit_9 ; 24
.word pool_exit_10 ; 25
pool_exit_0: ; nothing
.byte 3,8
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
pool_exit_1:
.byte 3,8
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AB,$AA,$AB
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
pool_exit_2:
.byte 3,8
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $BA,$AA,$BA
.byte $AB,$AA,$AB
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
pool_exit_3:
.byte 3,8
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $BB,$AA,$BB
.byte $AB,$A9,$AB
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
pool_exit_4:
.byte 3,8
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$9A,$AA
.byte $BA,$AB,$BA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
pool_exit_5:
.byte 3,8
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$9A,$AA
.byte $B0,$A9,$BA
.byte $AA,$AB,$AA
.byte $AA,$AA,$AA
pool_exit_6:
.byte 3,8
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$9A,$AA
.byte $BA,$99,$BA
.byte $BB,$A0,$BB
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
pool_exit_7:
.byte 3,8
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$9A,$AA
.byte $B0,$99,$B0
.byte $BB,$00,$BB
.byte $AB,$A4,$AB
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
pool_exit_8:
.byte 3,8
.byte $AA,$AA,$AA
.byte $AA,$AA,$AA
.byte $AA,$9A,$AA
.byte $00,$99,$00
.byte $BB,$00,$BB
.byte $BB,$4B,$4B
.byte $AA,$AA,$74
.byte $AA,$AA,$AA
pool_exit_9:
.byte 3,8
.byte $AA,$9A,$AA
.byte $AA,$BB,$AA
.byte $00,$00,$00
.byte $BB,$00,$BB
.byte $BB,$40,$BB
.byte $CC,$C4,$44
.byte $CC,$AA,$74
.byte $AA,$AA,$AA
pool_exit_10:
.byte 3,8
.byte $AA,$9A,$AA
.byte $AA,$BB,$AA
.byte $0A,$00,$00
.byte $BB,$00,$BB
.byte $BB,$40,$BB
.byte $AA,$C4,$44
.byte $AA,$CC,$44
.byte $AA,$7C,$F4
swim_progression:
.word swimming1
.word swimming2
.word swimming3
.word swimming4
.word swimming5
.word swimming6
.word swimming7
.word swimming8
swimming1:
.byte 2,6
.byte $77,$AA
.byte $55,$55
.byte $00,$00
.byte $00,$00
.byte $22,$22
.byte $55,$77
swimming2:
.byte 2,6
.byte $77,$7A
.byte $55,$55
.byte $00,$00
.byte $00,$00
.byte $52,$22
.byte $A5,$77
swimming3:
.byte 2,6
.byte $77,$77
.byte $55,$55
.byte $00,$00
.byte $00,$00
.byte $55,$22
.byte $AA,$77
swimming4:
.byte 2,6
.byte $7A,$77
.byte $55,$55
.byte $00,$00
.byte $00,$00
.byte $52,$22
.byte $A5,$77
swimming5:
.byte 2,6
.byte $AA,$77
.byte $55,$55
.byte $00,$00
.byte $00,$00
.byte $22,$22
.byte $55,$77
swimming6:
.byte 2,6
.byte $7A,$77
.byte $55,$55
.byte $00,$00
.byte $00,$00
.byte $22,$72
.byte $55,$A7
swimming7:
.byte 2,6
.byte $77,$77
.byte $55,$55
.byte $00,$00
.byte $00,$00
.byte $22,$77
.byte $55,$AA
swimming8:
.byte 2,6
.byte $77,$7A
.byte $55,$55
.byte $00,$00
.byte $00,$00
.byte $22,$72
.byte $55,$A7
.if 0
swimming1:
.byte 2,8
.byte $77,$AA
.byte $55,$55
.byte $05,$05
.byte $00,$00
.byte $00,$00
.byte $22,$22
.byte $22,$22
.byte $55,$77
swimming2:
.byte 2,8
.byte $77,$7A
.byte $55,$55
.byte $05,$05
.byte $00,$00
.byte $00,$00
.byte $22,$22
.byte $52,$22
.byte $A5,$77
swimming3:
.byte 2,8
.byte $77,$77
.byte $55,$55
.byte $05,$05
.byte $00,$00
.byte $00,$00
.byte $22,$22
.byte $55,$22
.byte $AA,$77
swimming4:
.byte 2,8
.byte $7A,$77
.byte $55,$55
.byte $05,$05
.byte $00,$00
.byte $00,$00
.byte $22,$22
.byte $52,$22
.byte $A5,$77
swimming5:
.byte 2,8
.byte $AA,$77
.byte $55,$55
.byte $05,$05
.byte $00,$00
.byte $00,$00
.byte $22,$22
.byte $22,$22
.byte $55,$77
swimming6:
.byte 2,8
.byte $7A,$77
.byte $55,$55
.byte $05,$05
.byte $00,$00
.byte $00,$00
.byte $22,$22
.byte $22,$72
.byte $55,$A7
swimming7:
.byte 2,8
.byte $77,$77
.byte $55,$55
.byte $05,$05
.byte $00,$00
.byte $00,$00
.byte $22,$22
.byte $22,$77
.byte $55,$AA
swimming8:
.byte 2,8
.byte $77,$7A
.byte $55,$55
.byte $05,$05
.byte $00,$00
.byte $00,$00
.byte $22,$22
.byte $22,$72
.byte $55,$A7
.endif