ootw: can sorta walk around level2 now

This commit is contained in:
Vince Weaver 2019-03-20 22:46:18 -04:00
parent ac21bd6905
commit 57fb810d81
10 changed files with 374 additions and 12 deletions

View File

@ -50,7 +50,7 @@ ootw_c2.o: ootw_c2.s \
gr_copy.s gr_fast_clear.s gr_pageflip.s gr_unrle.s gr_putsprite.s \ gr_copy.s gr_fast_clear.s gr_pageflip.s gr_unrle.s gr_putsprite.s \
keyboard.s gr_run_sequence.s \ keyboard.s gr_run_sequence.s \
ootw_graphics/sprites/sprites_physicist.inc \ ootw_graphics/sprites/sprites_physicist.inc \
ootw_c2_cage.s ootw_c2_intro.s \ ootw_c2_cage.s ootw_c2_jail.s ootw_c2_intro.s \
ootw_graphics/cage/ootw_c2_cage.inc \ ootw_graphics/cage/ootw_c2_cage.inc \
ootw_graphics/l2intro/ootw_l2intro.inc ootw_graphics/l2intro/ootw_l2intro.inc
ca65 -o ootw_c2.o ootw_c2.s -l ootw_c2.lst ca65 -o ootw_c2.o ootw_c2.s -l ootw_c2.lst

View File

@ -69,6 +69,7 @@ end_message:
.byte 11,20,"ACCESS CODE: RAGE",0 .byte 11,20,"ACCESS CODE: RAGE",0
.include "ootw_c2_cage.s" .include "ootw_c2_cage.s"
.include "ootw_c2_jail.s"
.include "ootw_c2_intro.s" .include "ootw_c2_intro.s"
.include "physicist.s" .include "physicist.s"
.include "text_print.s" .include "text_print.s"
@ -86,6 +87,7 @@ end_message:
; room backgrounds ; room backgrounds
.include "ootw_graphics/cage/ootw_c2_cage.inc" .include "ootw_graphics/cage/ootw_c2_cage.inc"
.include "ootw_graphics/l2jail/ootw_c2_jail.inc"
; sprites ; sprites
.include "ootw_graphics/sprites/sprites_physicist.inc" .include "ootw_graphics/sprites/sprites_physicist.inc"
; intro ; intro

View File

@ -16,14 +16,6 @@ ootw_cage:
lda #1 lda #1
sta DISP_PAGE sta DISP_PAGE
;===========================
; Setup right/left exit paramaters
lda #37
sta RIGHT_LIMIT
lda #0
sta LEFT_LIMIT
;============================= ;=============================
; Load background to $c00 ; Load background to $c00
@ -44,9 +36,10 @@ ootw_cage:
; setup vars ; setup vars
lda #0 lda #0
sta GAIT
sta GAME_OVER sta GAME_OVER
bit KEYRESET ; clear keypress
;============================ ;============================
; Cage Loop ; Cage Loop
;============================ ;============================
@ -64,7 +57,28 @@ cage_loop:
;=============================== ;===============================
; check keyboard ; check keyboard
jsr handle_keypress lda KEYPRESS
bpl cage_no_keypress
;===========================
; Done with cage, enter jail
bit KEYRESET ; clear keyboard
lda #1
sta DIRECTION
lda #22
sta PHYSICIST_Y
lda #24
sta PHYSICIST_X
lda #0
sta PHYSICIST_STATE
sta WHICH_JAIL
jmp ootw_jail
cage_no_keypress:
;=============== ;===============

195
ootw/ootw_c2_jail.s Normal file
View File

@ -0,0 +1,195 @@
; Ootw Checkpoint2 -- Running around the Jail
ootw_jail:
;===========================
; 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 image
jsr jail_load_background
;==============================
; setup per-room variables
lda WHICH_JAIL
bne jail1
jail0:
lda #20
sta LEFT_LIMIT
lda #37
sta RIGHT_LIMIT
; set right exit
lda #1
sta jer_smc+1
lda #<ootw_jail
sta jer_smc+5
lda #>ootw_jail
sta jer_smc+6
; set left exit
lda #0
sta jel_smc+1
lda #<ootw_jail
sta jel_smc+5
lda #>ootw_jail
sta jel_smc+6
jmp jail_setup_done
jail1:
lda #0
sta LEFT_LIMIT
lda #37
sta RIGHT_LIMIT
jail_setup_done:
;=================================
; copy to screen
jsr gr_copy_to_current
jsr page_flip
;=================================
; setup vars
lda #0
sta GAIT
sta GAME_OVER
;============================
; Cage Loop
;============================
jail_loop:
;================================
; copy background to current page
jsr gr_copy_to_current
;=======================
; draw miners mining
;===============================
; check keyboard
jsr handle_keypress
;===============
; check room limits
jsr check_screen_limit
;===============
; draw physicist
jsr draw_physicist
;================
; draw foreground
;===============
; page flip
jsr page_flip
;================
; inc frame count
inc FRAMEL
bne jail_frame_no_oflo
inc FRAMEH
jail_frame_no_oflo:
; check if done this level
lda GAME_OVER
beq still_in_jail
cmp #$ff ; if $ff, we died
beq done_jail
;===============================
; check if exited room to right
cmp #1
beq jail_exit_left
; exit to right
jail_exit_right:
lda #0
sta PHYSICIST_X
jer_smc:
lda #$0
sta WHICH_CAVE
jmp ootw_jail
jail_exit_left:
lda #37
sta PHYSICIST_X
jel_smc:
lda #0
sta WHICH_CAVE
jmp ootw_jail
; loop forever
still_in_jail:
jmp jail_loop
done_jail:
rts
;===============================
; load proper background to $c00
;===============================
jail_load_background:
lda WHICH_JAIL
bne jail_bg1
jail_bg0:
; load background
lda #>(cage_fell_rle)
sta GBASH
lda #<(cage_fell_rle)
sta GBASL
jmp jail_bg_done
jail_bg1:
; load background
lda #>(jail2_rle)
sta GBASH
lda #<(jail2_rle)
sta GBASL
jail_bg_done:
lda #$c ; load to page $c00
jmp load_rle_gr ; tail call

View File

@ -7,7 +7,8 @@ all: ootw_c2_cage.inc
##### #####
ootw_c2_cage.inc: $(PNG2RLE) ootw_c2_cage.png ootw_c2_cage.inc: $(PNG2RLE) \
ootw_c2_cage.png
$(PNG2RLE) asm ootw_c2_cage.png cage_rle > ootw_c2_cage.inc $(PNG2RLE) asm ootw_c2_cage.png cage_rle > ootw_c2_cage.inc
##### #####

View File

@ -0,0 +1,19 @@
include ../../../Makefile.inc
PNG2RLE = ../../../gr-utils/png2rle
PNG2LZ4 = ../../../gr-utils/png2lz4
all: ootw_c2_jail.inc
#####
ootw_c2_jail.inc: $(PNG2RLE) \
ootw_c2_cage_fell.png jail2_bg.png
$(PNG2RLE) asm ootw_c2_cage_fell.png cage_fell_rle > ootw_c2_jail.inc
$(PNG2RLE) asm jail2_bg.png jail2_rle >> ootw_c2_jail.inc
#####
clean:
rm -f *~ *.o *.lst *.lzz *.inc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 921 B

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

View File

@ -0,0 +1,130 @@
cage_fell_rle: .byte $28 ; ysize=48
.byte $A4,$22, $A5,$00, $22,$22, $02, $55, $A6,$00, $22
.byte $00, $20,$20, $00, $20, $22, $00,$00, $66
.byte $55, $22, $66,$66, $A5,$88, $A5,$22, $02, $A3,$00
.byte $22,$22, $00, $02, $00, $55, $A3,$00, $22,$22
.byte $A3,$00, $22,$22, $00, $02, $A3,$00, $66, $55
.byte $22, $66,$66, $A6,$88, $A4,$22, $00, $20, $A5,$00
.byte $20,$20, $55, $02, $22, $20, $22,$22, $AA,$00
.byte $66, $55, $22, $66,$66, $A6,$88, $A3,$22, $00,$00
.byte $02, $A4,$00, $78, $08, $98, $78, $08,$08
.byte $78, $22,$22, $02,$02, $22, $A7,$00, $66, $55
.byte $22, $66,$66, $A6,$88, $A3,$22, $A7,$00, $77, $00
.byte $66, $77, $00,$00, $77, $22,$22, $00,$00, $02
.byte $A7,$00, $66, $55, $22, $66,$66, $A6,$88, $22,$22
.byte $A8,$00, $77, $00, $05, $77, $60,$60, $77
.byte $22,$22, $AA,$00, $66, $55, $22, $66,$66, $88,$88
.byte $65, $A3,$88, $22,$22, $A8,$00, $77, $66, $00
.byte $77, $66,$66, $77, $22,$22, $00, $02, $20
.byte $A3,$00, $22, $A3,$00, $66, $55, $22, $66,$66
.byte $A6,$88, $22, $02, $A8,$00, $77, $06, $40
.byte $77, $00, $55, $77, $22,$22, $02, $22
.byte $02, $A7,$00, $66, $55, $22, $66,$66, $A7,$88
.byte $A9,$00, $77, $00, $44, $77, $50, $55
.byte $77, $22, $00,$00, $02, $A7,$00, $20, $66
.byte $55, $22, $66,$66, $A7,$88, $A9,$00, $77, $00
.byte $F4, $77, $00,$00, $77, $22, $50, $52
.byte $22, $A7,$00, $02, $66, $55, $22, $66,$66
.byte $A7,$88, $A9,$00, $A5,$08, $58, $08, $02, $05,$05
.byte $02, $00,$00, $20,$20, $00,$00, $22, $00, $66
.byte $55, $22, $66,$66, $A7,$88, $AE,$00, $55, $A7,$00
.byte $02,$02, $A4,$00, $55,$55, $22, $66,$66, $A7,$88, $A8,$00
.byte $20, $22, $A4,$00, $05, $00, $22, $AB,$00
.byte $55,$55, $22, $66,$66, $A7,$88, $A7,$00, $22,$22, $55
.byte $22, $00, $55, $00, $22,$22, $00, $22
.byte $AA,$00, $55,$55, $22, $66,$66, $A7,$88, $A5,$00, $20,$20
.byte $02, $22, $55, $02, $00, $55, $A3,$22
.byte $AC,$00, $55,$55, $22, $66,$66, $A7,$88, $A5,$00, $02,$02
.byte $A4,$00, $20,$20, $00, $02,$02, $AC,$00, $55,$55, $22
.byte $66,$66, $A7,$88, $AB,$00, $02,$02, $A8,$00, $20,$20, $00,$00
.byte $02, $00,$00, $55,$55, $22, $66,$66, $A7,$88, $AC,$00
.byte $22, $A8,$00, $22,$22, $00, $A7,$25, $66,$66, $A7,$88
.byte $A3,$60, $AF,$00, $A6,$60, $A7,$62, $66,$66, $A7,$68, $22
.byte $00,$00, $20,$20, $A8,$00, $22,$22, $A4,$00, $55, $00
.byte $55, $00, $55, $22, $52, $00, $55
.byte $22, $52, $00, $55, $00, $55, $00
.byte $55, $00, $55, $00, $55, $A0,$A0,$00
.byte $A1
jail2_rle: .byte $28 ; ysize=50
.byte $A3,$22, $55, $A5,$22, $55, $22, $55, $00,$00
.byte $A0,$1A,$26, $A3,$22, $55, $A5,$22, $55, $22, $55
.byte $00,$00, $A0,$1D,$22, $55, $A5,$22, $55, $22, $55
.byte $00,$00, $55, $A0,$19,$25, $A3,$22, $55, $A5,$22, $55
.byte $22, $55, $00,$00, $55, $25, $05, $75
.byte $05, $75, $05, $22, $05, $75, $05
.byte $75, $05, $75, $22, $05, $75, $05
.byte $75, $05, $75, $22, $05, $75, $05
.byte $75, $A3,$22, $55, $A5,$22, $55, $22, $55
.byte $00,$00, $25, $22, $00, $77, $00, $77
.byte $00, $22, $00, $77, $00, $77, $00
.byte $77, $22, $00, $77, $00, $77, $00
.byte $77, $22, $00, $77, $00, $77, $A3,$22
.byte $55, $A5,$22, $55, $22, $55, $00,$00, $22,$22
.byte $00, $77, $00, $77, $00, $22, $00
.byte $77, $00, $77, $00, $77, $22, $00
.byte $77, $00, $77, $00, $77, $22, $00
.byte $77, $00, $77, $A3,$22, $55, $A5,$22, $55
.byte $22, $55, $00,$00, $22,$22, $00, $77, $00
.byte $77, $88, $22, $00, $77, $00, $77
.byte $88, $77, $22, $00, $77, $00, $77
.byte $88, $77, $22, $00, $77, $88, $77
.byte $A9,$22, $55, $22, $55, $00,$00, $22,$22, $00
.byte $77, $00, $77, $88, $22, $00, $77
.byte $00, $77, $66, $77, $22, $00, $77
.byte $60, $77, $08, $77, $22, $00, $77
.byte $66, $77, $A9,$22, $55, $22, $55, $00,$00
.byte $22,$22, $00, $77, $80, $77, $88, $22
.byte $00, $77, $00, $77, $55, $77, $22
.byte $00, $77, $06, $77, $05, $77, $22
.byte $50, $77, $06, $77, $A9,$22, $55, $22
.byte $55, $00,$00, $22,$22, $00, $77, $88, $77
.byte $88, $22, $00, $77, $55, $77, $00
.byte $77, $22, $00, $77, $55, $77, $55
.byte $77, $22, $55, $77, $50, $77, $A6,$22
.byte $75, $22,$22, $55, $22, $55, $00,$00, $22,$22
.byte $00, $77, $88, $77, $88, $22, $00
.byte $77, $66, $77, $55, $77, $22, $00
.byte $77, $66, $77, $00, $77, $22, $55
.byte $77, $65, $77, $AB,$22, $55, $00,$00, $A0,$1A,$27
.byte $AA,$22, $52, $55, $0F, $00, $A0,$1B,$22, $A5,$52
.byte $A4,$22, $55,$55, $00,$00, $A0,$1A,$52, $22, $55, $A3,$22
.byte $77, $A4,$22, $55,$55, $0F, $00, $22,$22, $A5,$52
.byte $22,$22, $A5,$52, $22,$22, $A5,$52, $22,$22, $A3,$52, $22
.byte $55, $A3,$22, $77, $A4,$22, $55,$55, $00,$00, $62
.byte $22, $00, $77, $00, $77, $00, $22,$22
.byte $00, $77, $00, $77, $00, $22,$22, $00
.byte $77, $00, $77, $00, $22,$22, $00, $77
.byte $00, $02, $05, $00, $22,$22, $77, $A4,$22
.byte $55,$55, $00,$00, $66, $22, $00, $77, $00
.byte $77, $00, $22,$22, $00, $77, $00, $77
.byte $00, $22,$22, $00, $77, $00, $77, $00
.byte $22,$22, $00, $77, $00, $22, $55, $20
.byte $22,$22, $77, $A4,$22, $55,$55, $00,$00, $66, $22
.byte $00, $77, $00, $77, $00, $22,$22, $00
.byte $77, $00, $77, $00, $22,$22, $00, $77
.byte $00, $77, $00, $22,$22, $00, $77, $00
.byte $22, $55, $A3,$22, $77, $A4,$22, $55,$55, $00,$00
.byte $66, $22, $00, $77, $00, $77, $88
.byte $22,$22, $00, $77, $00, $77, $88, $22,$22
.byte $00, $77, $00, $77, $88, $22,$22, $00
.byte $77, $00, $22, $55, $A3,$22, $77, $22
.byte $00, $22,$22, $55,$55, $00,$00, $66, $22, $00
.byte $77, $00, $77, $88, $22,$22, $00, $77
.byte $00, $77, $88, $22,$22, $00, $77, $00
.byte $77, $88, $22,$22, $00, $77, $00, $22
.byte $55, $A3,$22, $77, $22, $20, $22,$22, $55,$55
.byte $00,$00, $66, $22, $00, $77, $00, $77
.byte $88, $22,$22, $00, $77, $00, $77, $88
.byte $22,$22, $00, $77, $00, $77, $88, $22,$22
.byte $00, $77, $00, $22, $55, $A3,$22, $77
.byte $22, $52, $22,$22, $25, $75, $66, $70
.byte $66, $22, $00, $77, $88, $77, $88
.byte $22,$22, $00, $77, $88, $77, $88, $22,$22
.byte $00, $77, $88, $77, $88, $22,$22, $00
.byte $77, $88, $22, $55, $A3,$22, $77, $A5,$22
.byte $A3,$00, $66, $22, $00, $77, $88, $77
.byte $88, $52, $55, $00, $77, $88, $77
.byte $88, $22,$22, $00, $77, $88, $77, $88
.byte $22,$22, $00, $77, $88, $A7,$55, $56,$56, $55,$55
.byte $A8,$56, $A4,$55, $A3,$56, $AE,$55, $A0,$28,$00
.byte $A1

View File

@ -137,6 +137,7 @@ LEFT_LIMIT = $E0
RIGHT_LIMIT = $E1 RIGHT_LIMIT = $E1
WHICH_SLUG = $E2 WHICH_SLUG = $E2
WHICH_CAVE = $E3 WHICH_CAVE = $E3
WHICH_JAIL = $E3
BEAST_OUT = $E4 BEAST_OUT = $E4
GAME_OVER = $E5 GAME_OVER = $E5
EQUAKE_PROGRESS = $E6 EQUAKE_PROGRESS = $E6