mist: fix some issues with controls/pointers

now can set generator again
This commit is contained in:
Vince Weaver 2020-03-15 15:06:36 -04:00
parent a1d9678117
commit e1a662b725
3 changed files with 29 additions and 17 deletions

View File

@ -9,6 +9,8 @@
draw_pointer:
; point sprite to right location
lda CURSOR_X
sta XPOS
lda CURSOR_Y
@ -84,34 +86,37 @@ finger_point:
check_cursor_left:
ldy #LOCATION_BGS
lda (LOCATION_STRUCT_L),Y
check_left_north:
ldy DIRECTION
cpy #DIRECTION_N
lda DIRECTION
and #$f
cmp #DIRECTION_N
bne check_left_south
handle_left_north:
; check if west exists
lda (LOCATION_STRUCT_L),Y
and #BG_WEST
beq finger_point
bne finger_left
check_left_south:
cpy #DIRECTION_S
cmp #DIRECTION_S
bne check_left_east
handle_left_south:
; check if east exists
lda (LOCATION_STRUCT_L),Y
and #BG_EAST
beq finger_point
bne finger_left
check_left_east:
cpy #DIRECTION_E
cmp #DIRECTION_E
bne check_left_west
handle_left_east:
; check if north exists
lda (LOCATION_STRUCT_L),Y
and #BG_NORTH
beq finger_point
bne finger_left
@ -120,6 +125,7 @@ check_left_west:
; we should be only option left
handle_left_west:
; check if south exists
lda (LOCATION_STRUCT_L),Y
and #BG_SOUTH
beq finger_point
bne finger_left
@ -128,34 +134,37 @@ handle_left_west:
check_cursor_right:
ldy #LOCATION_BGS
lda (LOCATION_STRUCT_L),Y
check_right_north:
ldy DIRECTION
cpy #DIRECTION_N
lda DIRECTION
and #$f
cmp #DIRECTION_N
bne check_right_south
handle_right_north:
; check if east exists
lda (LOCATION_STRUCT_L),Y
and #BG_EAST
beq finger_point
bne finger_right
check_right_south:
cpy #DIRECTION_S
cmp #DIRECTION_S
bne check_right_east
handle_right_south:
; check if west exists
lda (LOCATION_STRUCT_L),Y
and #BG_WEST
beq finger_point
bne finger_right
check_right_east:
cpy #DIRECTION_E
cmp #DIRECTION_E
bne check_right_west
handle_right_east:
; check if south exists
lda (LOCATION_STRUCT_L),Y
and #BG_SOUTH
beq finger_point
bne finger_right
@ -164,6 +173,7 @@ check_right_west:
; we should be only option left
handle_right_west:
; check if north exists
lda (LOCATION_STRUCT_L),Y
and #BG_NORTH
beq finger_point
bne finger_right

View File

@ -1,10 +1,12 @@
;======================
; open the spaeshipt door
; open the spaceship door
open_ss_door:
; check if voltage is 59
lda ROCKET_VOLTS
cmp #$59
bne done_ss_door
; change to open door image
ldy #LOCATION_NORTH_BG
@ -91,7 +93,7 @@ generator_button_press:
button_top_row:
lda XPOS
lda CURSOR_X
sec
sbc #24
lsr
@ -108,7 +110,7 @@ button_top_row:
button_bottom_row:
lda XPOS
lda CURSOR_X
sec
sbc #25
lsr
@ -173,8 +175,8 @@ cbottom_button_off:
bne done_rocket_volts
lda GENERATOR_VOLTS
cmp #$59
bcs oops_flipped
cmp #$60
bcs oops_flipped ; bge
sta ROCKET_VOLTS
jmp done_rocket_volts

View File

@ -710,7 +710,7 @@ location36:
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH | BG_SOUTH
.byte DIRECTION_N|DIRECTION_SPLIT|DIRECTION_ONLY_POINT
.byte DIRECTION_N
.byte 24,36 ; special x
.byte 34,40 ; special y
.word generator_button_press-1 ; special function