dos33fsprogs/monkey/monkey_map.s

138 lines
1.6 KiB
ArmAsm
Raw Normal View History

2020-09-25 03:33:59 +00:00
; 11, 22 = lookout
; 10, 24 = poster
; 25, 4 = zipline
2020-09-19 05:36:48 +00:00
map_check_exit:
lda GUYBRUSH_X
cmp #11
2020-09-25 03:33:59 +00:00
beq check_lookout
cmp #10
beq check_poster
cmp #25
beq check_zipline
rts
2020-09-19 05:36:48 +00:00
2020-09-25 03:33:59 +00:00
check_lookout:
lda GUYBRUSH_Y
cmp #22
bne map_no_exit
map_to_lookout:
lda #MONKEY_LOOKOUT
2020-09-19 05:36:48 +00:00
sta LOCATION
lda #30
2020-09-19 05:36:48 +00:00
sta GUYBRUSH_X
sta DESTINATION_X
lda #14
2020-09-19 05:36:48 +00:00
sta GUYBRUSH_Y
lda #22
2020-09-19 05:36:48 +00:00
sta DESTINATION_Y
lda #DIR_DOWN
sta GUYBRUSH_DIRECTION
2020-09-19 05:36:48 +00:00
jsr change_location
2020-09-25 03:33:59 +00:00
check_poster:
lda GUYBRUSH_Y
cmp #24
bne map_no_exit
map_to_poster:
lda #MONKEY_POSTER
sta LOCATION
lda #4
sta GUYBRUSH_X
sta DESTINATION_X
lda #20
sta GUYBRUSH_Y
sta DESTINATION_Y
lda #DIR_DOWN
sta GUYBRUSH_DIRECTION
jsr change_location
check_zipline:
lda GUYBRUSH_Y
cmp #4
bne map_no_exit
map_to_zipline:
lda #MONKEY_ZIPLINE
sta LOCATION
lda #4
sta GUYBRUSH_X
sta DESTINATION_X
lda #26
sta GUYBRUSH_Y
sta DESTINATION_Y
lda #DIR_RIGHT
sta GUYBRUSH_DIRECTION
jsr change_location
2020-09-19 05:36:48 +00:00
map_no_exit:
rts
2020-09-25 03:33:59 +00:00
2020-09-19 05:36:48 +00:00
map_adjust_destination:
; x between 6 and 30
; y between 2 and 32
2020-09-19 05:36:48 +00:00
mp_check_x:
lda DESTINATION_X
cmp #6
bcc mp_too_left
2020-09-19 05:36:48 +00:00
cmp #30
bcc mp_check_y
2020-09-19 05:36:48 +00:00
lda #30
sta DESTINATION_X
jmp mp_check_y
mp_too_left:
lda #6
sta DESTINATION_X
mp_check_y:
2020-09-19 05:36:48 +00:00
lda DESTINATION_Y
cmp #2
bcc mp_too_up
cmp #32
bcc done_mp_adjust
lda #32
2020-09-19 05:36:48 +00:00
sta DESTINATION_Y
jmp done_mp_adjust
mp_too_up:
lda #2
sta DESTINATION_Y
2020-09-19 05:36:48 +00:00
done_mp_adjust:
rts
;draw_map_door:
;
; lda BAR_DOOR_OPEN
; beq done_draw_map_door
; lda #<door_sprite
; sta INL
; lda #>door_sprite
; sta INH
; lda #11
; sta XPOS
; lda #22
; sta YPOS
; jsr put_sprite_crop
;done_draw_map_door:
; rts
2020-10-01 19:07:02 +00:00
map_check_bounds:
rts