diff --git a/games/peasant/TODO b/games/peasant/TODO index fae3921c..a23bd08e 100644 --- a/games/peasant/TODO +++ b/games/peasant/TODO @@ -2,13 +2,13 @@ TODO: before 0.75 release + update version file -+ merge electric duet + complete waterfall, including animation + have init routine set starting score, etc -+ intro, use plain sprite routine, not masked? - alternately, load the all-red screen + Fix the speech generation code + hold down open-apple at boot skip sound check? ++ update intro to walk closer to edges ++ fix color 15 on prioirty to cover all ++ fix issue where walking stops when you cross to screen w priority after 0.75 + move copy to disk2 diff --git a/games/peasant/graphics/Makefile b/games/peasant/graphics/Makefile index 57b18f9d..b92b709f 100644 --- a/games/peasant/graphics/Makefile +++ b/games/peasant/graphics/Makefile @@ -30,7 +30,6 @@ graphics_intro.inc: \ echo "lake_e_lzsa: .incbin \"lake_e.lzsa\"" >> graphics_intro.inc echo "river_lzsa: .incbin \"river.lzsa\"" >> graphics_intro.inc echo "knight_lzsa: .incbin \"knight.lzsa\"" >> graphics_intro.inc -# echo "waterfall_lzsa: .incbin \"waterfall.lzsa\"" >> graphics_intro.inc ### @@ -93,11 +92,11 @@ graphics_peasant4.inc: \ ########### priority_intro.inc: \ - todo_priority.lzsa knight_priority.lzsa + todo_priority.lzsa river_priority.lzsa knight_priority.lzsa echo "cottage_priority_lzsa: .incbin \"todo_priority.lzsa\"" > priority_intro.inc echo "lake_w_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_intro.inc echo "lake_e_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_intro.inc - echo "river_priority_lzsa: .incbin \"todo_priority.lzsa\"" >> priority_intro.inc + echo "river_priority_lzsa: .incbin \"river_priority.lzsa\"" >> priority_intro.inc echo "knight_priority_lzsa: .incbin \"knight_priority.lzsa\"" >> priority_intro.inc priority_peasant1.inc: \ @@ -113,11 +112,11 @@ priority_peasant1.inc: \ ### priority_peasant2.inc: \ - todo_priority.lzsa knight_priority.lzsa + todo_priority.lzsa river_priority.lzsa knight_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 "river_priority_lzsa: .incbin \"river_priority.lzsa\"" >> priority_peasant2.inc echo "knight_priority_lzsa: .incbin \"knight_priority.lzsa\"" >> priority_peasant2.inc ### @@ -340,6 +339,14 @@ lady_cottage_priority.hgr: lady_cottage_priority.png ### +river_priority.lzsa: river_priority.hgr + $(LZSA) -r -f2 river_priority.hgr river_priority.lzsa + +river_priority.hgr: river_priority.png + $(PNG2GR) river_priority.png river_priority.hgr + +### + knight_priority.lzsa: knight_priority.hgr $(LZSA) -r -f2 knight_priority.hgr knight_priority.lzsa diff --git a/games/peasant/graphics/knight_priority.png b/games/peasant/graphics/knight_priority.png index ea53f707..86b84ec1 100644 Binary files a/games/peasant/graphics/knight_priority.png and b/games/peasant/graphics/knight_priority.png differ diff --git a/games/peasant/graphics/river_priority.png b/games/peasant/graphics/river_priority.png new file mode 100644 index 00000000..b64079fa Binary files /dev/null and b/games/peasant/graphics/river_priority.png differ diff --git a/games/peasant/hgr_7x28_sprite_mask.s b/games/peasant/hgr_7x28_sprite_mask.s index a2b9c507..918aaed5 100644 --- a/games/peasant/hgr_7x28_sprite_mask.s +++ b/games/peasant/hgr_7x28_sprite_mask.s @@ -8,22 +8,34 @@ ; for now, BG mask is only all or nothing ; so we just skip drawing if behind - ; left sprite AT INL/INH - ; right sprite at INL/INH + 14 - ; left mask at INL/INH + 28 - ; right mask at INL/INH + 42 + ; sprite AT INL/INH + ; mask at INL/INH + 28 hgr_draw_sprite_7x28: lda #0 sta MASK_COUNTDOWN - ; set up pointers + ; calculate peasant priority + ; based on head + + lda PEASANT_Y + sec + sbc #48 ; Y=48 + lsr ; div by 8 + lsr + lsr + clc + adc #2 + sta PEASANT_PRIORITY + + ; set up sprite pointers lda INL sta h728_smc1+1 lda INH sta h728_smc1+2 + ; set up mask pointers clc lda INL adc #28 @@ -169,22 +181,12 @@ restore_yloop: ; updates MASK update_bg_mask: - ; calculate peasant priority - ; based on head - ; FIXME: only do this once at beginning - lda PEASANT_Y - sec - sbc #48 ; Y=48 - lsr ; div by 8 - lsr - lsr - clc - adc #2 - sta PEASANT_PRIORITY - - ; rrrr rtii top 5 bits row, bit 2 top/bottom + sty xsave +mask_try_again: + stx ysave + txa and #$04 ; see if odd/even beq bg_mask_even @@ -227,6 +229,20 @@ mask_bottom: mask_mask_mask: sta MASK + cmp #$0 ; 0 means collision, find mask + bne mask_not_zero ; by iteratively going down till + ldx ysave ; non-zero + ldy xsave + inx + inx + inx + inx + jmp mask_try_again + +mask_not_zero: + cmp #$f ; priority F means always on top + beq mask_true + cmp PEASANT_PRIORITY beq mask_false ; branch less than equal bcc mask_false ; blt @@ -259,7 +275,7 @@ mask_false: ; 12 128-135 ; 8 ; 13 136-143 ; 14 144-151 -; 15 152-159 +; 15 = fg = always hide ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -270,3 +286,8 @@ mask_false: save_sprite_7x28: .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + +ysave: +.byte $00 +xsave: +.byte $00 diff --git a/games/peasant/qload.inc b/games/peasant/qload.inc index c80b09f5..7d4d8f6f 100644 --- a/games/peasant/qload.inc +++ b/games/peasant/qload.inc @@ -3,27 +3,27 @@ sector_write =$0c63 requested_sector =$0d17 decompress_lzsa2_fast =$0de6 getsrc_smc =$0edc -hgr2 =$16e3 -hgr_make_tables =$15c0 +hgr2 =$1700 +hgr_make_tables =$15dd hgr_put_string =$0ee9 -save_bg_7x28 =$1417 -restore_bg_7x28 =$1438 +save_bg_7x28 =$1424 +restore_bg_7x28 =$1445 hgr_draw_sprite_7x28 =$13bd -input_buffer =$1598 -hgr_text_box =$1636 -hgr_text_box_nosave =$16aa -hgr_partial_restore =$1516 -clear_bottom =$16b8 -hgr_input =$153e -hgr_partial_save =$14e7 +input_buffer =$15b5 +hgr_text_box =$1653 +hgr_text_box_nosave =$16c7 +hgr_partial_restore =$1533 +clear_bottom =$16d5 +hgr_input =$155b +hgr_partial_save =$1504 draw_box =$126e -disp_put_string =$166c -disp_one_line =$1680 +disp_put_string =$1689 +disp_one_line =$169d invert_smc1 =$0f64 -disp_put_string_cursor =$167c +disp_put_string_cursor =$1699 hgr_put_char_cursor =$0f15 vgi_simple_rectangle =$12ef -peasant_text =$178b +peasant_text =$17a8 hposn_high = $BA00 hposn_low = $BB00 driveoff = $A22