keen1: closer to getting mars working again

This commit is contained in:
Vince Weaver 2024-04-11 00:33:20 -04:00
parent eb68006055
commit 5bd0d77d18
4 changed files with 87 additions and 25 deletions

View File

@ -271,8 +271,8 @@ level1_levelover:
;==========================
; level graphics
level1_bg_zx02:
.incbin "graphics/level1_bg.gr.zx02"
;level1_bg_zx02:
; .incbin "graphics/level1_bg.gr.zx02"
.include "text_print.s"
.include "gr_offsets.s"

View File

@ -66,16 +66,16 @@ plenty_of_keens:
beq return_to_title
; TODO: get this from MARS_X and MARS_Y
; TODO: set this in title, don't over-write
lda #1
sta KEEN_TILEX
lda #13
sta KEEN_TILEY
sta MARS_TILEX
lda #6
sta MARS_TILEY
lda #0
sta KEEN_X
sta KEEN_Y
sta MARS_X
sta MARS_Y
;====================================
; load mars tilemap
@ -93,11 +93,11 @@ plenty_of_keens:
; copy in tilemap subset
;====================================
; FIXME: start values
; center around KEEN_X, KEEN_Y
; center around MARS_TILEX, MARS_TILEY
lda #0
lda MARS_TILEX
sta TILEMAP_X
lda #5
lda MARS_TILEY
sta TILEMAP_Y
jsr copy_tilemap_subset

View File

@ -108,12 +108,37 @@ check_left:
bne check_right
left_pressed:
ldy MARS_X
dey
ldx MARS_Y
jsr check_valid_feet
bcc done_left_pressed
lda TILEMAP_X
beq keen_walk_left
sec
lda MARS_TILEX
sbc TILEMAP_X
cmp #7
bcs keen_walk_left
keen_scroll_left:
dec TILEMAP_X
dec MARS_TILEX
jsr copy_tilemap_subset
jmp done_move_keen
keen_walk_left:
dec MARS_X
bpl dwl_noflo
lda #1
sta MARS_X
dec MARS_TILEX
dwl_noflo:
; ldy MARS_X
; dey
; ldx MARS_Y
; jsr check_valid_feet
; bcc done_left_pressed
; dec MARS_X
done_left_pressed:
jmp done_keypress
@ -124,12 +149,47 @@ check_right:
bne check_up
right_pressed:
ldy MARS_X
iny
ldx MARS_Y
jsr check_valid_feet
bcc done_right_pressed
move_right:
lda TILEMAP_X
cmp #50 ; 70-20
bcs keen_walk_right
sec
lda MARS_TILEX
sbc TILEMAP_X
cmp #11
bcc keen_walk_right
keen_scroll_right:
inc TILEMAP_X
inc MARS_TILEX
jsr copy_tilemap_subset
jmp done_move_keen
keen_walk_right:
inc MARS_X
lda MARS_X
cmp #2
bne dwr_noflo
lda #0
sta MARS_X
inc MARS_TILEX
dwr_noflo:
; ldy MARS_X
; iny
; ldx MARS_Y
; jsr check_valid_feet
; bcc done_right_pressed
; inc MARS_X
done_right_pressed:
jmp done_keypress
@ -194,7 +254,7 @@ check_escape:
jmp done_keypress
done_move_keen:
done_keypress:
no_keypress:
bit KEYRESET

View File

@ -138,9 +138,11 @@ TILEMAP_OFFSET = $9F
MARS_X = $A0
MARS_Y = $A1
INITIAL_SOUND = $A2
PLAY_END_SOUND = $A3
APPLEII_MODEL = $A4
MARS_TILEX = $A2
MARS_TILEY = $A3
INITIAL_SOUND = $A4
PLAY_END_SOUND = $A5
APPLEII_MODEL = $A6
WHICH_SLOT = $DA
JS_BUTTON_STATE = $DB