peasant: update to the new bg draw code

This commit is contained in:
Vince Weaver 2021-12-27 15:26:11 -05:00
parent 39c9c38bbf
commit 285610ab00
3 changed files with 80 additions and 60 deletions

View File

@ -77,28 +77,9 @@ new_location:
sta INH
jsr load_custom_verb_table
;=====================
; load bg
; we are PEASANT2 so locations 5...9 map to 0...4
lda MAP_LOCATION
sec
sbc #LOCATION_BASE
tax
lda map_backgrounds_low,X
sta getsrc_smc+1
; sta last_bg_l
lda map_backgrounds_hi,X
sta getsrc_smc+2
; sta last_bg_h
lda #$40
jsr decompress_lzsa2_fast
;============================
; load priority to $400
; indirectly as we can't trash screen holes
; we are PEASANT2 so locations 5...9 map to 0...4
@ -118,6 +99,30 @@ new_location:
jsr gr_copy_to_page1
;=====================
; load bg
; we are PEASANT2 so locations 5...9 map to 0...4
lda MAP_LOCATION
sec
sbc #LOCATION_BASE
tax
lda map_backgrounds_low,X
sta getsrc_smc+1
lda map_backgrounds_hi,X
sta getsrc_smc+2
lda #$20
jsr decompress_lzsa2_fast
; copy to $4000
jsr hgr_copy
; put peasant text
lda #<peasant_text
@ -412,6 +417,7 @@ to_left_of_inn:
;.include "loadsave_menu.s"
;.include "score.s"
.include "hgr_copy.s"
map_backgrounds_low:
.byte <haystack_lzsa ; 5 -- haystack

View File

@ -75,26 +75,9 @@ new_location:
sta INH
jsr load_custom_verb_table
;=====================
; load bg
; we are PEASANT3 so locations 10...14 map to 0...4, no change
lda MAP_LOCATION
sec
sbc #LOCATION_BASE
tax
lda map_backgrounds_low,X
sta getsrc_smc+1
lda map_backgrounds_hi,X
sta getsrc_smc+2
lda #$40
jsr decompress_lzsa2_fast
; Load priority
;===========================
; Load priority to $400
; indirectly as we can't touch screen holes
lda MAP_LOCATION
sec
@ -112,6 +95,29 @@ new_location:
jsr gr_copy_to_page1
;=====================
; load bg
; we are PEASANT3 so locations 10...14 map to 0...4, no change
lda MAP_LOCATION
sec
sbc #LOCATION_BASE
tax
lda map_backgrounds_low,X
sta getsrc_smc+1
lda map_backgrounds_hi,X
sta getsrc_smc+2
lda #$20
jsr decompress_lzsa2_fast
jsr hgr_copy
; put peasant text
lda #<peasant_text
@ -253,6 +259,8 @@ game_over:
;.include "score.s"
.include "gr_copy.s"
.include "hgr_copy.s"
.include "new_map_location.s"
.include "peasant_move.s"

View File

@ -78,6 +78,26 @@ new_location:
sta INH
jsr load_custom_verb_table
;=========================
; load priority to $400
lda MAP_LOCATION
sec
sbc #LOCATION_BASE
tax
lda map_priority_low,X
sta getsrc_smc+1
lda map_priority_hi,X
sta getsrc_smc+2
lda #$20
jsr decompress_lzsa2_fast
jsr gr_copy_to_page1
;=====================
; load bg
@ -93,10 +113,12 @@ new_location:
lda map_backgrounds_hi,X
sta getsrc_smc+2
lda #$40
lda #$20
jsr decompress_lzsa2_fast
jsr hgr_copy
;====================
; update ned cottage if necessary
@ -127,23 +149,7 @@ not_necessary_cottage:
; load priority
lda MAP_LOCATION
sec
sbc #LOCATION_BASE
tax
lda map_priority_low,X
sta getsrc_smc+1
lda map_priority_hi,X
sta getsrc_smc+2
lda #$20
jsr decompress_lzsa2_fast
jsr gr_copy_to_page1
; put peasant text
@ -359,8 +365,8 @@ game_over:
;.include "loadsave_menu.s"
;.include "score.s"
.include "gr_copy.s"
.include "hgr_copy.s"
.include "peasant_move.s"