mist: can change direction when move to new location

This commit is contained in:
Vince Weaver 2020-03-01 15:39:49 -05:00
parent ca9c087736
commit 7105451bf8
4 changed files with 115 additions and 16 deletions

View File

@ -44,13 +44,15 @@ mist.o: mist.s zp.inc hardware.inc \
mist_graphics.inc: \
m_link_book.png \
dock_n.png dock_s.png dock_e.png dock_w.png \
dock_switch_n.png
dock_switch_n.png \
dock_steps_w.png
$(PNG2RLE) asm m_link_book.png link_book_rle > mist_graphics.inc
$(PNG2RLE) asm dock_n.png dock_n_rle >> mist_graphics.inc
$(PNG2RLE) asm dock_s.png dock_s_rle >> mist_graphics.inc
$(PNG2RLE) asm dock_e.png dock_e_rle >> mist_graphics.inc
$(PNG2RLE) asm dock_w.png dock_w_rle >> mist_graphics.inc
$(PNG2RLE) asm dock_switch_n.png dock_switch_n_rle >> mist_graphics.inc
$(PNG2RLE) asm dock_steps_w.png dock_steps_w_rle >> mist_graphics.inc
####

BIN
mist/dock_steps_w.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

View File

@ -451,6 +451,8 @@ change_location:
;===========================
go_forward:
; update new location
lda DIRECTION
clc
adc #LOCATION_NORTH_EXIT
@ -461,6 +463,16 @@ go_forward:
beq cant_go_forward
sta LOCATION
; update new direction
lda DIRECTION
clc
adc #LOCATION_NORTH_EXIT_DIR
tay
lda (LOCATION_STRUCT_L),Y
sta DIRECTION
jsr change_location
cant_go_forward:
rts
@ -562,23 +574,27 @@ finger_right_sprite:
;===============================================
; location data
;===============================================
; 19 bytes
; 24 bytes each location
LOCATION_NORTH_EXIT=0
LOCATION_SOUTH_EXIT=1
LOCATION_EAST_EXIT=2
LOCATION_WEST_EXIT=3
LOCATION_SPECIAL_EXIT=4
LOCATION_NORTH_BG=5
LOCATION_SOUTH_BG=7
LOCATION_EAST_BG=9
LOCATION_WEST_BG=11
LOCATION_SPECIAL_X1=13
LOCATION_SPECIAL_X2=14
LOCATION_SPECIAL_Y1=15
LOCATION_SPECIAL_Y2=16
LOCATION_SPECIAL_FUNC=17
LOCATION_BGS = 19
LOCATION_NORTH_EXIT_DIR=4
LOCATION_SOUTH_EXIT_DIR=5
LOCATION_EAST_EXIT_DIR=6
LOCATION_WEST_EXIT_DIR=7
LOCATION_SPECIAL_EXIT=8
LOCATION_NORTH_BG=9
LOCATION_SOUTH_BG=11
LOCATION_EAST_BG=13
LOCATION_WEST_BG=15
LOCATION_SPECIAL_X1=17
LOCATION_SPECIAL_X2=18
LOCATION_SPECIAL_Y1=19
LOCATION_SPECIAL_Y2=20
LOCATION_SPECIAL_FUNC=21
LOCATION_BGS = 23
BG_NORTH = 1
BG_SOUTH = 2
BG_EAST = 4
@ -586,7 +602,7 @@ LOCATION_BGS = 19
locations:
.word location0,location1,location2
.word location0,location1,location2,location3
; myst linking book
location0:
@ -594,6 +610,10 @@ location0:
.byte $ff ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.byte $00 ; special exit
.word link_book_rle ; north bg
.word $0000 ; south bg
@ -610,6 +630,10 @@ location1:
.byte $ff ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte DIRECTION_N ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.byte $ff ; special exit
.word dock_n_rle ; north bg
.word dock_s_rle ; south bg
@ -622,10 +646,14 @@ location1:
; by dock switch
location2:
.byte $ff ; north exit
.byte $1 ; south exit
.byte 3 ; north exit
.byte 1 ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte DIRECTION_W ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.byte $ff ; special exit
.word dock_switch_n_rle ; north bg
.word $0000 ; south bg
@ -636,6 +664,28 @@ location2:
.word $0000 ; special function
.byte $1 ; only north
; dock steps
location3:
.byte $ff ; north exit
.byte $ff ; south exit
.byte 2 ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.byte $ff ; special exit
.word $0000 ; north bg
.word $0000 ; south bg
.word $0000 ; east bg
.word dock_steps_w_rle ; west bg
.byte $ff,$ff ; special x
.byte $ff,$ff ; special y
.word $0000 ; special function
.byte $C ; only east+west
; Looking North, click enter, go to north exit
; Looking South, click enter, go to south exit
; Looking East, click enter, go to east exit

View File

@ -287,3 +287,50 @@ dock_switch_n_rle: .byte $28 ; ysize=48
.byte $A5,$44
.byte $A1
; cycles=48572
dock_steps_w_rle: .byte $28 ; ysize=48
.byte $A9,$77, $55, $22, $55, $22, $A4,$55, $22
.byte $A4,$55, $22, $55, $22, $72, $A8,$77, $87
.byte $88, $55, $85, $88, $55, $77,$77, $47
.byte $A6,$77, $55, $22, $55, $22, $A4,$55, $22
.byte $A4,$55, $22, $55, $22, $A9,$77, $88, $58
.byte $55, $85, $88, $55, $77,$77, $44, $77
.byte $47, $A4,$77, $55, $22, $55, $22, $A4,$55
.byte $22, $A4,$55, $22, $55, $22, $A8,$77, $55
.byte $88, $55, $85, $88, $55,$55, $44, $77
.byte $44, $47, $44, $A4,$77, $55, $22, $25
.byte $22, $A4,$25, $22, $25,$25, $55,$55, $22, $55
.byte $22, $A6,$77, $57, $55, $58, $88, $55
.byte $88, $58, $55,$55, $84, $47, $44,$44, $88
.byte $A3,$77, $27, $AC,$22, $25, $22, $25, $22
.byte $27, $A4,$77, $57, $A3,$88, $55, $88, $58
.byte $A3,$55, $88, $44, $88, $44, $88, $44
.byte $77, $AE,$55, $A6,$52, $77, $27, $55, $A4,$58
.byte $55, $28, $A4,$55, $88, $47, $88, $44
.byte $88, $54, $A0,$15,$55, $27, $22, $A3,$25, $A3,$55
.byte $22, $A4,$55, $88, $47, $88, $44, $88
.byte $A0,$16,$55, $A5,$22, $25, $55, $25, $22, $25
.byte $A3,$55, $88, $47, $88, $74, $88, $A0,$16,$55
.byte $AA,$22, $A3,$55, $08, $07, $08, $07, $08
.byte $A0,$16,$55, $22,$22, $00, $A8,$22, $25,$25, $A5,$00, $AD,$55
.byte $75,$75, $A7,$55, $22,$22, $00, $02,$02, $A3,$82, $22
.byte $82, $88,$88, $48, $A5,$00, $AC,$55, $A4,$77, $A3,$55
.byte $00, $05, $55, $22,$22, $A3,$00, $08, $88,$88
.byte $08, $88, $48, $44,$44, $A5,$00, $AC,$55, $A4,$77
.byte $55,$55, $A4,$00, $22,$22, $A6,$00, $80, $48, $A3,$44
.byte $A5,$00, $AC,$55, $A4,$77, $55, $05, $A5,$00, $22
.byte $A3,$00, $22, $80, $00,$00, $A4,$44, $75,$75, $A3,$55
.byte $A4,$50, $A9,$05, $07,$07, $05,$05, $AA,$00, $88,$88, $00,$00
.byte $A4,$44, $A3,$22, $A8,$25, $A0,$15,$55, $22, $88,$88, $A5,$44
.byte $A0,$11,$22, $50,$50, $00, $A7,$07, $A5,$55, $22, $58
.byte $88,$88, $A4,$44, $A0,$10,$22, $00, $55,$55, $AC,$00, $55
.byte $22, $55, $88, $28, $24, $A3,$04, $A3,$00
.byte $AC,$22, $02, $55,$55, $A4,$75, $A5,$70, $A4,$00, $55
.byte $52, $55,$55, $22,$22, $20, $A7,$00, $A4,$02, $A5,$22
.byte $02, $A3,$55, $A3,$00, $A6,$07, $A4,$77, $A4,$55, $52
.byte $88,$88, $80, $AF,$00, $A4,$55, $AE,$00, $A3,$55, $58
.byte $A3,$88, $AE,$00, $A5,$55, $A6,$22, $A7,$20, $80, $A4,$55
.byte $A4,$88, $AC,$00, $A5,$55, $A4,$77, $A3,$72, $A5,$22, $82
.byte $88,$88, $A4,$55, $A4,$88, $AB,$00, $A5,$55, $A4,$00, $A3,$07
.byte $A4,$77, $A5,$78, $A4,$55, $A4,$88
.byte $A1
; cycles=12581