keen: fix up mars startup code
properly fade out when enter level, preserve mars co-ords
This commit is contained in:
parent
26fb4f3c6a
commit
f43edf23ea
|
@ -55,17 +55,6 @@ plenty_of_keens:
|
||||||
|
|
||||||
not_game_over:
|
not_game_over:
|
||||||
|
|
||||||
; TODO: set this in title, don't over-write
|
|
||||||
|
|
||||||
lda #10
|
|
||||||
sta MARS_TILEX
|
|
||||||
lda #34
|
|
||||||
sta MARS_TILEY
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta MARS_X
|
|
||||||
sta MARS_Y
|
|
||||||
|
|
||||||
;====================================
|
;====================================
|
||||||
; load mars tilemap
|
; load mars tilemap
|
||||||
;====================================
|
;====================================
|
||||||
|
@ -82,28 +71,18 @@ not_game_over:
|
||||||
; copy in tilemap subset
|
; copy in tilemap subset
|
||||||
;====================================
|
;====================================
|
||||||
|
|
||||||
|
|
||||||
; first center map around current location
|
; first center map around current location
|
||||||
|
|
||||||
jsr recenter_map
|
jsr recenter_map
|
||||||
|
|
||||||
|
; copy mini tileset
|
||||||
|
|
||||||
jsr copy_tilemap_subset
|
jsr copy_tilemap_subset
|
||||||
|
|
||||||
; make a copy in $c00 for fade-in purposes
|
|
||||||
|
|
||||||
lda DRAW_PAGE ; necssary
|
; snapshot current tileset for fade purposes
|
||||||
pha
|
|
||||||
|
|
||||||
lda #8
|
jsr snapshot_tilemap
|
||||||
sta DRAW_PAGE
|
|
||||||
|
|
||||||
jsr draw_tilemap
|
|
||||||
|
|
||||||
pla
|
|
||||||
sta DRAW_PAGE
|
|
||||||
|
|
||||||
lda #1
|
|
||||||
sta INITIAL_SOUND
|
|
||||||
|
|
||||||
jsr fade_in
|
jsr fade_in
|
||||||
|
|
||||||
|
@ -195,6 +174,8 @@ done_with_keen:
|
||||||
ldy #SFX_WLDENTRSND
|
ldy #SFX_WLDENTRSND
|
||||||
jsr play_sfx
|
jsr play_sfx
|
||||||
|
|
||||||
|
jsr snapshot_tilemap
|
||||||
|
|
||||||
jsr fade_out
|
jsr fade_out
|
||||||
|
|
||||||
; set up proper level to load
|
; set up proper level to load
|
||||||
|
@ -387,6 +368,37 @@ done_parts:
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
;===============================
|
||||||
|
;===============================
|
||||||
|
; snapshot tile map
|
||||||
|
;===============================
|
||||||
|
;===============================
|
||||||
|
; copy currnet tilemap graphics
|
||||||
|
; to $c00 for fade-in/fade-out
|
||||||
|
|
||||||
|
snapshot_tilemap:
|
||||||
|
|
||||||
|
; make a copy in $c00 for fade-in purposes
|
||||||
|
|
||||||
|
lda DRAW_PAGE ; necssary
|
||||||
|
pha
|
||||||
|
|
||||||
|
lda #8
|
||||||
|
sta DRAW_PAGE
|
||||||
|
|
||||||
|
jsr draw_tilemap
|
||||||
|
|
||||||
|
pla
|
||||||
|
sta DRAW_PAGE
|
||||||
|
|
||||||
|
lda #1
|
||||||
|
sta INITIAL_SOUND
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;====================================
|
;====================================
|
||||||
;====================================
|
;====================================
|
||||||
; Mars action (enter pressed on map)
|
; Mars action (enter pressed on map)
|
||||||
|
@ -545,6 +557,9 @@ transport_right:
|
||||||
lda #3
|
lda #3
|
||||||
sta MARS_TILEY
|
sta MARS_TILEY
|
||||||
|
|
||||||
|
ldy #SFX_TELEPORTSND
|
||||||
|
jsr play_sfx
|
||||||
|
|
||||||
jsr recenter_map ; fallthrough?
|
jsr recenter_map ; fallthrough?
|
||||||
|
|
||||||
jsr copy_tilemap_subset
|
jsr copy_tilemap_subset
|
||||||
|
@ -565,6 +580,9 @@ transport_left:
|
||||||
lda #4
|
lda #4
|
||||||
sta MARS_TILEY
|
sta MARS_TILEY
|
||||||
|
|
||||||
|
ldy #SFX_TELEPORTSND
|
||||||
|
jsr play_sfx
|
||||||
|
|
||||||
jsr recenter_map ; fallthrough?
|
jsr recenter_map ; fallthrough?
|
||||||
|
|
||||||
jsr copy_tilemap_subset
|
jsr copy_tilemap_subset
|
||||||
|
@ -586,6 +604,9 @@ transport_secret:
|
||||||
lda #24
|
lda #24
|
||||||
sta MARS_TILEY
|
sta MARS_TILEY
|
||||||
|
|
||||||
|
ldy #SFX_TELEPORTSND
|
||||||
|
jsr play_sfx
|
||||||
|
|
||||||
jsr recenter_map ; fallthrough?
|
jsr recenter_map ; fallthrough?
|
||||||
|
|
||||||
jsr copy_tilemap_subset
|
jsr copy_tilemap_subset
|
||||||
|
|
|
@ -203,13 +203,17 @@ init_vars:
|
||||||
;============================
|
;============================
|
||||||
; set up initial location
|
; set up initial location
|
||||||
|
|
||||||
lda #18
|
lda #10
|
||||||
|
sta MARS_TILEX
|
||||||
|
lda #34
|
||||||
|
sta MARS_TILEY
|
||||||
|
|
||||||
|
lda #0
|
||||||
sta MARS_X
|
sta MARS_X
|
||||||
lda #11
|
|
||||||
sta MARS_Y
|
sta MARS_Y
|
||||||
|
|
||||||
lda #LOAD_MARS
|
lda #LOAD_MARS
|
||||||
sta WHICH_LOAD ; start at first level
|
sta WHICH_LOAD ; assume new game (mars map)
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue