monkey: update all the rooms

This commit is contained in:
Vince Weaver 2020-09-17 22:53:00 -04:00
parent a893a41037
commit d562adf8fd
7 changed files with 200 additions and 157 deletions

View File

@ -290,8 +290,16 @@ handle_return:
;============================== ;==============================
set_destination: set_destination:
lda CURSOR_X lda CURSOR_X
bpl destination_x_is_positive
; we are off edge of screen, just say 0
lda #0
destination_x_is_positive:
sta DESTINATION_X sta DESTINATION_X
lda CURSOR_Y lda CURSOR_Y
bpl destination_y_is_positive
lda #0
destination_y_is_positive:
sec sec
sbc #7 sbc #7
and #$FE ; has to be even and #$FE ; has to be even
@ -356,9 +364,9 @@ change_location:
lda #0 lda #0
sta ANIMATE_FRAME sta ANIMATE_FRAME
sta CURSOR_VISIBLE sta CURSOR_VISIBLE
lda #20 ; lda #20
sta CURSOR_X ; sta CURSOR_X
sta CURSOR_Y ; sta CURSOR_Y
lda LOCATION lda LOCATION
asl asl

View File

@ -88,15 +88,18 @@ game_loop:
lda LOCATION lda LOCATION
cmp #MONKEY_LOOKOUT cmp #MONKEY_LOOKOUT
beq animate_flame beq animate_flame
cmp #MONKEY_BAR
beq do_draw_bar_door
jmp nothing_special jmp nothing_special
animate_flame: animate_flame:
jsr draw_fire jsr draw_fire
jmp nothing_special jmp nothing_special
do_draw_bar_door:
jsr draw_bar_door
jmp nothing_special
nothing_special: nothing_special:
@ -192,6 +195,8 @@ done_move_guybrush:
lda LOCATION lda LOCATION
cmp #MONKEY_LOOKOUT cmp #MONKEY_LOOKOUT
beq do_draw_wall beq do_draw_wall
cmp #MONKEY_POSTER
beq do_draw_house
jmp nothing_foreground jmp nothing_foreground
@ -199,6 +204,9 @@ do_draw_wall:
jsr draw_wall jsr draw_wall
jmp nothing_foreground jmp nothing_foreground
do_draw_house:
jsr draw_house
jmp nothing_foreground
nothing_foreground: nothing_foreground:

View File

@ -1,59 +1,55 @@
; if x<5 goto DOCK at 34,20
bar_check_exit: bar_check_exit:
; lda DESTINATION_Y
; cmp #28
; bcc lookout_no_exit
; lda DESTINATION_X lda GUYBRUSH_X
; cmp #28 cmp #5
; bcc lookout_no_exit bcc bar_to_dock
; cmp #35 bcs bar_no_exit
; bcs lookout_no_exit
; lda #MONKEY_POSTER bar_to_dock:
; sta LOCATION lda #MONKEY_DOCK
; lda #2 sta LOCATION
; sta GUYBRUSH_X lda #34
; lda #22 sta GUYBRUSH_X
; sta GUYBRUSH_Y sta DESTINATION_X
; jsr change_location lda #20
sta GUYBRUSH_Y
sta DESTINATION_Y
jsr change_location
bar_no_exit: bar_no_exit:
rts rts
bar_adjust_destination: bar_adjust_destination:
; if x<21, y=20
; if x<25, y=18
; x can't go past 25
br_check_x: br_check_x:
; lda DESTINATION_X lda DESTINATION_X
; cmp #19 cmp #25
; bcc ld_x_too_small bcs br_x_too_big
; cmp #35 cmp #21
; bcs ld_x_too_big bcc br_x_small
; jmp ld_check_y bcs br_x_medium
br_x_too_big: br_x_too_big:
; lda #35 lda #25
; sta DESTINATION_X sta DESTINATION_X
; bne ld_check_y lda #18
sta DESTINATION_Y
bne done_br_adjust
br_x_too_small: br_x_medium:
; lda #18 lda #18
; sta DESTINATION_X sta DESTINATION_Y
bne done_br_adjust
br_check_y: br_x_small:
; if x < 28, Y must be between 16 and 18 lda #20
; if x < 35, Y must be between 8 and 28 sta DESTINATION_Y
; lda DESTINATION_Y
; cmp #16
; bcc ld_y_too_small
rts
br_y_too_small:
; lda #16
; sta DESTINATION_Y
done_br_adjust: done_br_adjust:
rts rts
@ -61,21 +57,32 @@ done_br_adjust:
;draw_house: draw_bar_door:
; lda #<wall_sprite lda BAR_DOOR_OPEN
; sta INL beq done_draw_bar_door
; lda #>wall_sprite
; sta INH
; lda #18 lda #<door_sprite
; sta XPOS sta INL
; lda #22 lda #>door_sprite
; sta YPOS sta INH
; jsr put_sprite_crop lda #11
sta XPOS
lda #22
sta YPOS
jsr put_sprite_crop
done_draw_bar_door:
rts
door_sprite:
.byte 2,5
.byte $d2,$d2
.byte $88,$DD
.byte $88,$DD
.byte $88,$DD
.byte $5d,$5D
; rts
;house_sprite:

View File

@ -1,60 +1,55 @@
; stuff regarding the dock ; stuff regarding the dock
; guybrush is a friend without pier ; guybrush is a friend without pier
; if x<4 goto MONKEY_POSTER at 28,20
; if x>35 goto MONKEY_BAR at 5,20
dock_check_exit: dock_check_exit:
; lda DESTINATION_Y
; cmp #28
; bcc lookout_no_exit
; lda DESTINATION_X lda GUYBRUSH_X
; cmp #28 cmp #4
; bcc lookout_no_exit bcc dock_to_poster
; cmp #35 cmp #35
; bcs lookout_no_exit bcs dock_to_bar
bcc dock_no_exit
; lda #MONKEY_POSTER dock_to_poster:
; sta LOCATION lda #MONKEY_POSTER
; lda #2 sta LOCATION
; sta GUYBRUSH_X lda #34
; lda #22 sta GUYBRUSH_X
; sta GUYBRUSH_Y sta DESTINATION_X
; jsr change_location lda #20
sta GUYBRUSH_Y
sta DESTINATION_Y
jsr change_location
jmp dock_no_exit
dock_to_bar:
lda #MONKEY_BAR
sta LOCATION
lda #5
sta GUYBRUSH_X
sta DESTINATION_X
lda #20
sta GUYBRUSH_Y
sta DESTINATION_Y
jsr change_location
jmp dock_no_exit
dock_no_exit: dock_no_exit:
rts rts
dock_adjust_destination: dock_adjust_destination:
; just make Y always 20
dk_check_x:
; lda DESTINATION_X
; cmp #19
; bcc ld_x_too_small
; cmp #35
; bcs ld_x_too_big
; jmp ld_check_y
dk_x_too_big:
; lda #35
; sta DESTINATION_X
; bne ld_check_y
dk_x_too_small:
; lda #18
; sta DESTINATION_X
dk_check_y: dk_check_y:
; if x < 28, Y must be between 16 and 18 ; if x < 28, Y must be between 16 and 18
; if x < 35, Y must be between 8 and 28 ; if x < 35, Y must be between 8 and 28
; lda DESTINATION_Y
; cmp #16
; bcc ld_y_too_small
rts
dk_y_too_small: dk_y_too_small:
; lda #16 lda #20
; sta DESTINATION_Y sta DESTINATION_Y
done_dk_adjust: done_dk_adjust:
rts rts

View File

@ -1,13 +1,16 @@
; if 28<x<35 and y>28 ; if 28<x<35 and y>=28 and direction==down
; goto MONKEY_POSTER ; goto MONKEY_POSTER
; at location 2,22 ; at location 4,20
lookout_check_exit: lookout_check_exit:
lda DESTINATION_Y lda GUYBRUSH_Y
cmp #28 cmp #24
bcc lookout_no_exit bcc lookout_no_exit
lda GUYBRUSH_DIRECTION
cmp #DIR_DOWN
bne lookout_no_exit
lda DESTINATION_X lda GUYBRUSH_X
cmp #28 cmp #28
bcc lookout_no_exit bcc lookout_no_exit
cmp #35 cmp #35
@ -15,10 +18,12 @@ lookout_check_exit:
lda #MONKEY_POSTER lda #MONKEY_POSTER
sta LOCATION sta LOCATION
lda #2 lda #4
sta GUYBRUSH_X sta GUYBRUSH_X
lda #22 sta DESTINATION_X
lda #20
sta GUYBRUSH_Y sta GUYBRUSH_Y
sta DESTINATION_Y
jsr change_location jsr change_location
lookout_no_exit: lookout_no_exit:

View File

@ -1,23 +1,40 @@
; if x<3 goto MONKEY_POSTER at 28,30 with destination 28,24
; if x>35 goto MONKEY_DOCK at 5,20
poster_check_exit: poster_check_exit:
; lda DESTINATION_Y lda GUYBRUSH_X
; cmp #28 cmp #3
; bcc lookout_no_exit bcc poster_to_lookout
cmp #35
bcs poster_to_dock
bcc poster_no_exit
; lda DESTINATION_X poster_to_lookout:
; cmp #28 lda #MONKEY_LOOKOUT
; bcc lookout_no_exit sta LOCATION
; cmp #35 lda #28
; bcs lookout_no_exit sta GUYBRUSH_X
lda #26
sta GUYBRUSH_Y
lda #28
sta DESTINATION_X
lda #18
sta DESTINATION_Y
lda #DIR_UP
sta GUYBRUSH_DIRECTION
jsr change_location
jmp poster_no_exit
; lda #MONKEY_POSTER poster_to_dock:
; sta LOCATION lda #MONKEY_DOCK
; lda #2 sta LOCATION
; sta GUYBRUSH_X lda #5
; lda #22 sta DESTINATION_X
; sta GUYBRUSH_Y sta GUYBRUSH_X
; jsr change_location lda #20
sta GUYBRUSH_Y
sta DESTINATION_Y
jsr change_location
poster_no_exit: poster_no_exit:
rts rts
@ -25,35 +42,13 @@ poster_no_exit:
poster_adjust_destination: poster_adjust_destination:
ps_check_x: ps_check_x:
; lda DESTINATION_X ; can be any X
; cmp #19
; bcc ld_x_too_small
; cmp #35
; bcs ld_x_too_big
; jmp ld_check_y
ps_x_too_big:
; lda #35
; sta DESTINATION_X
; bne ld_check_y
ps_x_too_small:
; lda #18
; sta DESTINATION_X
ps_check_y: ps_check_y:
; if x < 28, Y must be between 16 and 18 ; if x>5 Y should be 20
; if x < 35, Y must be between 8 and 28
; lda DESTINATION_Y lda #20
; cmp #16 sta DESTINATION_Y
; bcc ld_y_too_small
rts
ps_y_too_small:
; lda #16
; sta DESTINATION_Y
done_ps_adjust: done_ps_adjust:
rts rts
@ -63,19 +58,42 @@ done_ps_adjust:
draw_house: draw_house:
; lda #<wall_sprite lda #<house_sprite
; sta INL sta INL
; lda #>wall_sprite lda #>house_sprite
; sta INH sta INH
; lda #18 lda #9
; sta XPOS sta XPOS
; lda #22 lda #20
; sta YPOS sta YPOS
; jsr put_sprite_crop jsr put_sprite_crop
; rts rts
house_sprite: house_sprite:
.byte 18,7
;line 1
.byte $AA,$5A,$55,$55,$55,$55,$55,$55,$55,$55
.byte $55,$55,$55,$57,$7A,$7A,$AA,$AA
.byte $00,$00,$00,$00,$00,$00,$00,$05,$05,$05
.byte $05,$05,$05,$05,$05,$05,$07,$7A
.byte $22,$22,$22,$22,$20,$80,$80,$00,$80,$80
.byte $22,$72,$A7,$AA,$AA,$AA,$77,$AA
.byte $22,$22,$22,$22,$22,$88,$d8,$00,$d8,$88
.byte $22,$77,$AA,$AA,$AA,$77,$AA,$AA
.byte $22,$22,$22,$22,$22,$08,$0d,$00,$0d,$22
.byte $22,$77,$AA,$AA,$AA,$77,$AA,$AA
.byte $22,$22,$22,$22,$22,$88,$dd,$00,$dd,$22
.byte $22,$77,$7A,$7A,$7A,$77,$AA,$AA
.byte $22,$22,$22,$22,$22,$28,$20,$2d,$28,$22
.byte $77,$AA,$77,$AA,$77,$AA,$AA,$AA

View File

@ -105,6 +105,8 @@ GUYBRUSH_DIRECTION = $93
DIR_UP = 4 DIR_UP = 4
DIR_RIGHT= 6 DIR_RIGHT= 6
BAR_DOOR_OPEN = $94
; done game puzzle state ; done game puzzle state