diff --git a/games/peasant/gr_copy.s b/games/peasant/gr_copy.s new file mode 100644 index 00000000..ddb537f0 --- /dev/null +++ b/games/peasant/gr_copy.s @@ -0,0 +1,39 @@ + ;========================================================= + ; gr_copy_to_page1, 40x48 version + ;========================================================= + ; copy $2000 to $400, careful to avoid screen holes + +gr_copy_to_page1: + + ldy #119 ; for early ones, copy 120 bytes ; 2 + +gr_copy_line: + lda $2000,Y ; load a byte (self modified) ; 4 + sta $400,Y ; store a byte (self modified) ; 5 + + lda $2080,Y ; load a byte (self modified) ; 4 + sta $480,Y ; store a byte (self modified) ; 5 + + lda $2100,Y ; load a byte (self modified) ; 4 + sta $500,Y ; store a byte (self modified) ; 5 + + lda $2180,Y ; load a byte (self modified) ; 4 + sta $580,Y ; store a byte (self modified) ; 5 + + lda $2200,Y ; load a byte (self modified) ; 4 + sta $600,Y ; store a byte (self modified) ; 5 + + lda $2280,Y ; load a byte (self modified) ; 4 + sta $680,Y ; store a byte (self modified) ; 5 + + lda $2300,Y ; load a byte (self modified) ; 4 + sta $700,Y ; store a byte (self modified) ; 5 + + lda $2380,Y ; load a byte (self modified) ; 4 + sta $780,Y ; store a byte (self modified) ; 5 + + dey ; decrement pointer ; 2 + bpl gr_copy_line ; ; 2nt/3 + + rts ; 6 + diff --git a/games/peasant/graphics/Makefile b/games/peasant/graphics/Makefile index 7e78a019..a687b3d0 100644 --- a/games/peasant/graphics/Makefile +++ b/games/peasant/graphics/Makefile @@ -6,10 +6,18 @@ LZSA = ~/research/lzsa/lzsa/lzsa B2D = ../../../utils/bmp2dhr/b2d all: graphics_intro.inc \ - graphics_peasant1.inc graphics_peasant2.inc graphics_peasant3.inc \ - graphics_peasant4.inc + graphics_peasant1.inc \ + graphics_peasant2.inc \ + graphics_peasant3.inc \ + graphics_peasant4.inc \ + priority_peasant1.inc \ + priority_peasant2.inc \ + priority_peasant3.inc \ + priority_peasant4.inc +### + graphics_intro.inc: \ cottage.lzsa \ lake_e.lzsa \ @@ -81,6 +89,50 @@ graphics_peasant4.inc: \ echo "lady_cottage_lzsa: .incbin \"lady_cottage.lzsa\"" >> graphics_peasant4.inc echo "crooked_tree_lzsa: .incbin \"crooked_tree.lzsa\"" >> graphics_peasant4.inc +########### +########### + +priority_peasant1.inc: \ + todo_priority.lzsa + echo "gary_priority_lzsa: .incbin \"todo_priority.lzsa\"" > priority_peasant1.inc + echo "top_prints_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant1.inc + echo "wishing_well_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant1.inc + echo "leaning_tree_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant1.inc + echo "waterfall_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant1.inc + + +### + +priority_peasant2.inc: \ + todo_priority.lzsa + echo "haystack_priority_lzsa: .incbin \"todo_priority.lzsa\"" > priority_peasant2.inc + echo "puddle_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant2.inc + echo "archery_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant2.inc + echo "river_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant2.inc + echo "knight_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant2.inc + +### + +priority_peasant3.inc: \ + todo_priority.lzsa + echo "jhonka_priority_lzsa: .incbin \"todo_priority.lzsa\"" > priority_peasant3.inc + echo "cottage_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant3.inc + echo "lake_w_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant3.inc + echo "lake_e_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant3.inc + echo "inn_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant3.inc + +### + +priority_peasant4.inc: \ + todo_priority.lzsa \ + lady_cottage_priority.lzsa + echo "empty_hut_priority_lzsa: .incbin \"todo_priority.lzsa\"" > priority_peasant4.inc + echo "ned_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant4.inc + echo "bottom_prints_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant4.inc + echo "lady_cottage_priority_lzsa: .incbin \"lady_cottage_priority.lzsa\"" >> priority_peasant4.inc + echo "crooked_tree_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_peasant4.inc + + ### archery.lzsa: archery.hgr @@ -264,6 +316,26 @@ todo.hgr: todo.png $(PNG2HGR) todo.png > todo.hgr +########################################### +########################################### + + +### + +lady_cottage_priority.lzsa: lady_cottage_priority.hgr + $(LZSA) -r -f2 lady_cottage_priority.hgr lady_cottage_priority.lzsa + +lady_cottage_priority.hgr: lady_cottage_priority.png + $(PNG2GR) lady_cottage_priority.png lady_cottage_priority.hgr + +#### + +todo_priority.lzsa: todo_priority.gr + $(LZSA) -r -f2 todo_priority.gr todo_priority.lzsa + +todo_priority.gr: todo_priority.png + $(PNG2GR) todo_priority.png todo_priority.gr + ### diff --git a/games/peasant/graphics/lady_cottage_prioirty.png b/games/peasant/graphics/lady_cottage_priority.png similarity index 100% rename from games/peasant/graphics/lady_cottage_prioirty.png rename to games/peasant/graphics/lady_cottage_priority.png diff --git a/games/peasant/graphics/todo_priority.png b/games/peasant/graphics/todo_priority.png new file mode 100644 index 00000000..e730dba3 Binary files /dev/null and b/games/peasant/graphics/todo_priority.png differ diff --git a/games/peasant/parse_input.s b/games/peasant/parse_input.s index 880d3801..11da60d6 100644 --- a/games/peasant/parse_input.s +++ b/games/peasant/parse_input.s @@ -32,13 +32,26 @@ parse_look: parse_talk: cmp #'T' - bne parse_version + bne parse_show lda #fake_error2 jmp finish_parse_message +parse_show: + cmp #'S' + bne parse_version + + bit LORES + bit PAGE1 + + jsr wait_until_keypress + + bit PAGE2 + bit HIRES + + jmp done_parse_message parse_version: cmp #'V' @@ -60,10 +73,9 @@ finish_parse_message: jsr wait_until_keypress -done_parse_message: jsr hgr_partial_restore +done_parse_message: + + rts - - - diff --git a/games/peasant/peasant1.s b/games/peasant/peasant1.s index 137944d8..24dfa431 100644 --- a/games/peasant/peasant1.s +++ b/games/peasant/peasant1.s @@ -62,6 +62,27 @@ new_location: jsr decompress_lzsa2_fast + ; load priority to $400 + ; indirectly as we can't trash screen holes + + + ldx MAP_LOCATION + + lda map_priority_low,X + sta getsrc_smc+1 + lda map_priority_hi,X + sta getsrc_smc+2 + + lda #$20 ; temporarily load to $2000 + + jsr decompress_lzsa2_fast + + ; copy to $400 + + jsr gr_copy_to_page1 + + + ; put peasant text lda #lady_cottage_lzsa ; 18 -- cottage lady ; .byte >crooked_tree_lzsa ; 19 -- crooked tree + + +map_priority_low: + .byte gary_priority_lzsa ; 0 -- gary the horse + .byte >top_prints_priority_lzsa ; 1 -- top footprints + .byte >wishing_well_priority_lzsa ; 2 -- wishing well + .byte >leaning_tree_priority_lzsa ; 3 -- leaning tree + .byte >waterfall_priority_lzsa ; 4 -- waterfall diff --git a/games/peasant/peasant2.s b/games/peasant/peasant2.s index ea826c02..e2d851f3 100644 --- a/games/peasant/peasant2.s +++ b/games/peasant/peasant2.s @@ -64,6 +64,25 @@ new_location: jsr decompress_lzsa2_fast + + ; we are PEASANT2 so locations 5...9 map to 0...4 + + lda MAP_LOCATION + sec + sbc #5 + 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 lda #lady_cottage_lzsa ; 18 -- cottage lady ; .byte >crooked_tree_lzsa ; 19 -- crooked tree + +map_priority_low: + .byte haystack_priority_lzsa ; 5 -- haystack + .byte >puddle_priority_lzsa ; 6 -- puddle + .byte >archery_priority_lzsa ; 7 -- archery + .byte >river_priority_lzsa ; 8 -- river + .byte >knight_priority_lzsa ; 9 -- knight diff --git a/games/peasant/peasant3.s b/games/peasant/peasant3.s index f431025c..c291ea26 100644 --- a/games/peasant/peasant3.s +++ b/games/peasant/peasant3.s @@ -64,6 +64,24 @@ new_location: jsr decompress_lzsa2_fast + ; Load priority + + lda MAP_LOCATION + sec + sbc #10 + 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 lda #lady_cottage_lzsa ; 18 -- cottage lady ; .byte >crooked_tree_lzsa ; 19 -- crooked tree + +map_priority_low: + .byte jhonka_priority_lzsa ; 10 -- jhonka + .byte >cottage_priority_lzsa ; 11 -- cottage + .byte >lake_w_priority_lzsa ; 12 -- lake west + .byte >lake_e_priority_lzsa ; 13 -- lake east + .byte >inn_priority_lzsa ; 14 -- inn diff --git a/games/peasant/peasant4.s b/games/peasant/peasant4.s index c0de45ab..2b8312a6 100644 --- a/games/peasant/peasant4.s +++ b/games/peasant/peasant4.s @@ -64,6 +64,24 @@ new_location: jsr decompress_lzsa2_fast + ; load priority + + lda MAP_LOCATION + sec + sbc #15 + 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 lda #lady_cottage_lzsa ; 18 -- cottage lady .byte >crooked_tree_lzsa ; 19 -- crooked tree + + +map_priority_low: + .byte empty_hut_priority_lzsa ; 15 -- empty hut + .byte >ned_priority_lzsa ; 16 -- ned + .byte >bottom_prints_priority_lzsa ; 17 -- bottom footprints + .byte >lady_cottage_priority_lzsa ; 18 -- cottage lady + .byte >crooked_tree_priority_lzsa ; 19 -- crooked tree + +