2024-03-10 05:44:20 +00:00
|
|
|
|
|
|
|
;==================
|
|
|
|
; check for items
|
|
|
|
;==================
|
2024-03-18 05:16:13 +00:00
|
|
|
; X holds tile offset of feet?
|
2024-03-10 05:44:20 +00:00
|
|
|
check_item:
|
|
|
|
|
2024-03-18 05:16:13 +00:00
|
|
|
lda tilemap,X
|
|
|
|
cmp #27
|
|
|
|
bcc done_check_item ; not an item
|
|
|
|
cmp #32
|
|
|
|
bcs done_check_item ; not an item
|
|
|
|
|
|
|
|
sec
|
|
|
|
sbc #27 ; subtract off to get index
|
|
|
|
|
|
|
|
; 0 = laser gun
|
|
|
|
; 1 = lollipop 100 pts
|
|
|
|
; 2 = book 1000 pts
|
|
|
|
; 3 = pizza 500 pts
|
|
|
|
; 4 = carbonated beverage 200 pts
|
|
|
|
; ? = bear 5000 pts
|
|
|
|
|
|
|
|
; keycards go here too...
|
|
|
|
|
|
|
|
; use value to update score
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; erase
|
|
|
|
|
|
|
|
; FIXME: only erases small tilemap
|
|
|
|
; also need to update big
|
|
|
|
|
|
|
|
lda #1 ; plain tile
|
|
|
|
sta tilemap,X
|
2024-03-10 05:44:20 +00:00
|
|
|
|
2024-03-18 05:16:13 +00:00
|
|
|
; big tilemap:
|
|
|
|
; tilemap
|
|
|
|
|
|
|
|
lda KEEN_Y ; divide by 4 as tile 4 blocks tall
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
|
|
|
|
clc
|
|
|
|
adc TILEMAP_Y ; add in tilemap Y (each row 256 bytes)
|
|
|
|
adc #>big_tilemap ; add in offset of start
|
|
|
|
sta btc_smc+2
|
|
|
|
|
|
|
|
lda TILEMAP_X ; add in X offset of tilemap
|
|
|
|
sta btc_smc+1
|
|
|
|
|
|
|
|
lda KEEN_X
|
|
|
|
lsr
|
|
|
|
tay
|
|
|
|
iny ; why add 1????
|
|
|
|
|
|
|
|
lda #0 ; background tile
|
|
|
|
btc_smc:
|
|
|
|
sta $b000,Y
|
|
|
|
|
|
|
|
; play sound
|
|
|
|
jsr pickup_noise
|
|
|
|
|
|
|
|
.if 0
|
2024-03-10 05:44:20 +00:00
|
|
|
check_red_key:
|
2024-03-13 04:46:34 +00:00
|
|
|
lda tilemap,X
|
2024-03-10 05:44:20 +00:00
|
|
|
cmp #31 ; red key
|
|
|
|
bne check_blue_key
|
|
|
|
|
|
|
|
jsr pickup_noise
|
|
|
|
lda INVENTORY
|
|
|
|
ora #INV_RED_KEY
|
|
|
|
sta INVENTORY
|
|
|
|
|
|
|
|
; erase red key (304,96)
|
|
|
|
lda #0
|
|
|
|
sta $A938 ; hack
|
|
|
|
|
|
|
|
jsr copy_tilemap_subset
|
|
|
|
|
|
|
|
jsr update_status_bar
|
|
|
|
|
|
|
|
jmp done_check_item
|
|
|
|
|
|
|
|
check_blue_key:
|
|
|
|
cmp #30 ; blue key
|
|
|
|
bne done_check_item
|
|
|
|
|
|
|
|
jsr pickup_noise
|
|
|
|
lda INVENTORY
|
|
|
|
ora #INV_BLUE_KEY
|
|
|
|
sta INVENTORY
|
|
|
|
|
|
|
|
; erase blue key
|
|
|
|
lda #0
|
|
|
|
sta $970c ; hack
|
|
|
|
|
|
|
|
jsr copy_tilemap_subset
|
|
|
|
|
|
|
|
jsr update_status_bar
|
|
|
|
|
|
|
|
jmp keen_check_head
|
2024-03-18 05:16:13 +00:00
|
|
|
.endif
|
2024-03-10 05:44:20 +00:00
|
|
|
done_check_item:
|
|
|
|
rts
|