keen: more or less have things fixed for 128x80 grid now

This commit is contained in:
Vince Weaver 2024-04-14 23:30:41 -04:00
parent 95fc2febff
commit fbaec2928b
5 changed files with 82 additions and 24 deletions

View File

@ -203,9 +203,11 @@ tilemap_count_smc:
done_tilemap_subset:
;==========================
; activate yorps
;==========================
ldx NUM_ENEMIES
ldx #NUM_ENEMIES
beq done_yorps
clc

View File

@ -232,10 +232,7 @@ skip_end_sound:
level1_gameover:
; mars plays this
; ldy #SFX_GAMEOVERSND
; jsr play_sfx
; mars plays the sound
lda #GAME_OVER
sta LEVEL_OVER
@ -252,10 +249,6 @@ level1_levelover:
; includes
;==========================
; level graphics
;level1_bg_zx02:
; .incbin "graphics/level1_bg.gr.zx02"
.include "text_print.s"
.include "gr_offsets.s"
.include "gr_fast_clear.s"

View File

@ -35,9 +35,14 @@ enemy_is_out:
lda enemy_data_tiley,X
adc #2 ; point below feet
adc #>big_tilemap
tay
lda tilemap_lookup_high,Y
; adc #>big_tilemap
sta load_foot1_smc+2
lda tilemap_lookup_low,Y
sta load_foot1_smc+1
ldy enemy_data_tilex,X
load_foot1_smc:
@ -128,9 +133,14 @@ enemy_facing_right:
clc
lda enemy_data_tiley,X
adc #1 ; point to feet
tay
adc #>big_tilemap
; adc #>big_tilemap
lda tilemap_lookup_high,Y
sta load_right_foot_smc+2
lda tilemap_lookup_low,Y
sta load_right_foot_smc+1
ldy enemy_data_tilex,X
iny ; to the right
@ -182,8 +192,13 @@ enemy_facing_left:
lda enemy_data_tiley,X
adc #1 ; point to feet
adc #>big_tilemap
tay
; adc #>big_tilemap
lda tilemap_lookup_high,Y
sta load_left_foot_smc+2
lda tilemap_lookup_low,Y
sta load_left_foot_smc+1
ldy enemy_data_tilex,X
dey ; look to the left

View File

@ -13,13 +13,20 @@ check_items:
; if X==0, check TILEX and TILEX+1
; if X==1, check TILEX+1
clc
lda KEEN_TILEY
adc #>big_tilemap
ldx KEEN_TILEY
lda tilemap_lookup_high,X
sta INH
lda KEEN_TILEX
lda tilemap_lookup_low,X
ora KEEN_TILEX
sta INL
; clc
; adc #>big_tilemap
; sta INH
; lda KEEN_TILEX
; sta INL
lda KEEN_X
bne check_head_tilex1
@ -50,7 +57,26 @@ check_head_tilex1:
;========================
; check feet
check_feet:
inc INH ; point to next row
; inc INH ; point to next row
lda INL ; blurgh much longer
clc
adc #$80
sta INL
lda #$0
adc INH
sta INH
; won't work, maybe not faster
; lda INL
; eor #$80
; sta INL
; asl
; adc INH
; sta INH
dec INL ; restore tile pointer
lda KEEN_X

View File

@ -180,12 +180,21 @@ keen_check_head:
sec
lda KEEN_TILEY
sbc #1
adc #>big_tilemap
tay
lda tilemap_lookup_high,Y
sta INH
lda #0
lda tilemap_lookup_low,Y
sta INL
; adc #>big_tilemap
; sta INH
; lda #0
; sta INL
ldy KEEN_TILEX
lda KEEN_X
bne collide_head_r
collide_head_l:
@ -223,12 +232,20 @@ collide_left_right:
clc
lda KEEN_TILEY
adc #1
adc #>big_tilemap
adc #1 ; look at feet
tay
lda tilemap_lookup_high,Y
sta INH
lda KEEN_TILEX
lda tilemap_lookup_low,Y
ora KEEN_TILEX
sta INL
; adc #>big_tilemap
; sta INH
; lda KEEN_TILEX
; sta INL
lda KEEN_DIRECTION
beq done_keen_collide ; can this happen?
@ -365,9 +382,14 @@ check_falling:
lda KEEN_TILEY
adc #2 ; point below feet
adc #>big_tilemap
tax
lda tilemap_lookup_high,X
; adc #>big_tilemap
sta INH
lda #0
lda tilemap_lookup_low,X
; lda #0
sta INL
ldy KEEN_TILEX