dos33fsprogs/monkey/monkey_bar.s

218 lines
3.1 KiB
ArmAsm
Raw Normal View History

2020-09-18 02:53:00 +00:00
; if x<5 goto DOCK at 34,20
2020-09-18 01:37:50 +00:00
;===========================
; check if exit bar screen
;===========================
; if x<5 goto DOCK at 34,20
; if x>35 goto TOWN
2020-09-29 19:14:21 +00:00
; if 9<x<14 and y<20 and door open, BAR_INSIDE1
2020-09-18 01:37:50 +00:00
bar_check_exit:
2020-09-18 02:53:00 +00:00
lda GUYBRUSH_X
cmp #5
bcc bar_to_dock
2020-09-19 05:36:48 +00:00
cmp #35
bcs bar_to_town
2020-09-29 19:14:21 +00:00
cmp #9
2020-09-19 05:36:48 +00:00
bcc bar_no_exit
2020-09-29 19:14:21 +00:00
cmp #14
bcs bar_no_exit
bar_to_inside:
lda GUYBRUSH_Y
cmp #20
bcs bar_no_exit
lda BAR_DOOR_OPEN
beq bar_no_exit
lda #MONKEY_BAR_INSIDE1
sta LOCATION
lda #5
sta GUYBRUSH_X
sta DESTINATION_X
lda #20
sta GUYBRUSH_Y
sta DESTINATION_Y
jsr change_location
jmp bar_no_exit
2020-09-18 02:53:00 +00:00
bar_to_dock:
lda #MONKEY_DOCK
sta LOCATION
lda #34
sta GUYBRUSH_X
sta DESTINATION_X
lda #20
sta GUYBRUSH_Y
sta DESTINATION_Y
jsr change_location
2020-09-19 05:36:48 +00:00
jmp bar_no_exit
bar_to_town:
lda #MONKEY_TOWN
sta LOCATION
lda #34
sta GUYBRUSH_X
sta DESTINATION_X
lda #18
2020-09-19 05:36:48 +00:00
sta GUYBRUSH_Y
lda #26
sta DESTINATION_Y
lda #DIR_DOWN
sta GUYBRUSH_DIRECTION
jsr change_location
2020-09-18 01:37:50 +00:00
bar_no_exit:
rts
;===========================
2020-09-29 19:14:21 +00:00
; adjust bounds
;===========================
bar_keep_in_bounds:
2020-09-18 02:53:00 +00:00
br_force_x:
lda GUYBRUSH_X
2020-09-18 02:53:00 +00:00
cmp #25
2020-09-29 19:14:21 +00:00
bcs br_gb_x_far_right
2020-09-18 02:53:00 +00:00
cmp #21
2020-09-29 19:14:21 +00:00
bcs br_gb_x_right
cmp #9
bcc br_gb_x_left
cmp #14
bcc br_gb_doorway
bcs br_gb_x_left
br_gb_doorway:
lda GUYBRUSH_Y
cmp #20
bcc br_gb_x_right
bcs br_gb_x_left
2020-09-18 01:37:50 +00:00
2020-09-29 19:14:21 +00:00
br_gb_x_far_right:
2020-09-19 05:36:48 +00:00
lda #16
bne done_br_gb_adjust
2020-09-18 01:37:50 +00:00
2020-09-29 19:14:21 +00:00
br_gb_x_right:
2020-09-18 02:53:00 +00:00
lda #18
bne done_br_gb_adjust
2020-09-18 01:37:50 +00:00
2020-09-29 19:14:21 +00:00
br_gb_x_left:
2020-09-18 02:53:00 +00:00
lda #20
done_br_gb_adjust:
2020-09-29 19:14:21 +00:00
sta GUYBRUSH_Y
sta DESTINATION_Y
rts
;===========================
; adjust walking destination
;===========================
bar_adjust_destination:
2020-09-29 19:14:21 +00:00
; just keep Y whatever is in bounds
; *except* in doorway 9<x<14
; then allow it to be 18
2020-09-29 19:14:21 +00:00
lda GUYBRUSH_X
cmp #9
bcc bar_adjust_force_y
cmp #14
bcs bar_adjust_force_y
2020-09-18 01:37:50 +00:00
2020-09-29 19:22:40 +00:00
lda CURSOR_X
cmp #9
bcc done_br_adjust
cmp #14
bcs done_br_adjust
2020-09-29 19:14:21 +00:00
lda CURSOR_Y
cmp #28
bcs done_br_adjust
2020-09-29 19:14:21 +00:00
lda #18
sta GUYBRUSH_Y
sta DESTINATION_Y
2020-09-29 19:14:21 +00:00
bar_adjust_force_y:
lda GUYBRUSH_Y
sta DESTINATION_Y
2020-09-18 02:53:00 +00:00
done_br_adjust:
2020-09-18 01:37:50 +00:00
rts
2020-09-29 19:14:21 +00:00
;=====================
; draw bar door
;=====================
2020-09-18 02:53:00 +00:00
draw_bar_door:
2020-09-18 01:37:50 +00:00
2020-09-18 02:53:00 +00:00
lda BAR_DOOR_OPEN
beq done_draw_bar_door
2020-09-18 01:37:50 +00:00
2020-09-18 02:53:00 +00:00
lda #<door_sprite
sta INL
lda #>door_sprite
sta INH
2020-09-18 01:37:50 +00:00
2020-09-18 02:53:00 +00:00
lda #11
sta XPOS
lda #22
sta YPOS
2020-09-18 01:37:50 +00:00
2020-09-18 02:53:00 +00:00
jsr put_sprite_crop
done_draw_bar_door:
rts
2020-09-18 01:37:50 +00:00
2020-09-18 02:53:00 +00:00
door_sprite:
.byte 2,5
.byte $d2,$d2
.byte $88,$DD
.byte $88,$DD
.byte $88,$DD
.byte $5d,$5D
2020-09-18 01:37:50 +00:00
draw_bar_fg_building:
; only draw it if we're that side of screeen
lda GUYBRUSH_X
cmp #24
bcc done_draw_bar_fg_building
lda #<building_sprite
sta INL
lda #>building_sprite
sta INH
lda #27
sta XPOS
lda #16
sta YPOS
jsr put_sprite_crop
done_draw_bar_fg_building:
rts
2020-09-18 01:37:50 +00:00
building_sprite:
.byte 13,7
.byte $77,$22,$9d,$00,$9d,$00,$22,$22,$22,$00,$00,$00,$0A
.byte $77,$25,$25,$25,$25,$25,$22,$22,$22,$00,$00,$00,$00
.byte $77,$22,$22,$22,$22,$22,$22,$22,$02,$00,$00,$90,$90
.byte $A7,$72,$02,$02,$02,$00,$00,$00,$00,$00,$00,$09,$09
.byte $AA,$77,$00,$00,$00,$00,$00,$00,$00,$60,$60,$d9,$dd
.byte $AA,$77,$00,$00,$00,$00,$60,$00,$60,$06,$00,$66,$dd
.byte $AA,$77,$00,$60,$26,$66,$02,$06,$00,$00,$60,$22,$00