From 941e81bbebdaee1ca7ec0fa308d546b2c972a9b1 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sun, 3 Oct 2021 01:25:12 -0400 Subject: [PATCH] peasant: update priority drawing 15 now is foreground, look belowfor priority if color 0 --- games/peasant/TODO | 6 +- games/peasant/graphics/Makefile | 17 ++++-- games/peasant/graphics/knight_priority.png | Bin 950 -> 7702 bytes games/peasant/graphics/river_priority.png | Bin 0 -> 969 bytes games/peasant/hgr_7x28_sprite_mask.s | 61 ++++++++++++++------- games/peasant/qload.inc | 30 +++++----- 6 files changed, 71 insertions(+), 43 deletions(-) create mode 100644 games/peasant/graphics/river_priority.png 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 ea53f707c7c3a4eff28cc36ef338a53a12052d4a..86b84ec169d695df41ffece12dcad7cd47f4a771 100644 GIT binary patch literal 7702 zcmeHMc{o)4+aE;s?4e?;ZN@ANW-^wLeOK0EjKN?AGs9Str4mxsge+OJCCZYms6>&S z%92o2_R3btdq&ICbG^TRp7(lx|2=bEbI$kN%jdrD&-Xs(I`>SpnTakJyC^#d1me=y z)3yM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|kw~)H}#%8}g=oGjSh(6n10NH=Dq!L{JBI|Ft(KXxU{Fw;g z{u}pi*1u}sHU_MWjnUfPI6r!N`q~&tdVI8tH;&+f-d-vysVKpaNF@kX0fmDoVx3VC zEF6Z1C@SKVQE+EvB_tC52b4aELdBABcsdjSE>8e(loXI~7y^!fz+6>aA&Ra_t`L+9 z+!X>xA{DVPC6qD>>+%PLDVYFtCD!ZDtmsfK02CgEcY$LOa0m*9P=Y8bC^KqWc+V; z{lC%0{@1{RCjoCkG+>-zMQs`bqmY7`k(CZ`o)U9%GHKe<-UQ`2Wn^RsbZ_=N+;So_ zZF#6>W@c_(?-5v0?HRj7-s%DV+ym@0<08X=6Pu5oEd>M;HUhp>hU_8@Fd*DX)i>7J z`IeoDQEJayo=prO5~1qYP_?{?^p|YV_PZb61xzDQ-NE#CKkIPr-M|EGr?0JP6)-$M zQptW6CZN%Kmo@XtR_LtLZkcw4FU}(w4J_wqEbx|O{Xup{m{W5Y0}~6UFtA{yANx2< ze18dkYyOXmx`9R(I`o=_7ZVU8^%^HVSYb9RJ=$Clk&!MGNNw&=E@!6O@ut?n0ZlBY zr5HPKiEGaI-h5=NL5ObtJB3`uZ2*Y2{-N)|@a^y2Cn(7r@whM=$Q0 z9vvZ2xNzej9VzKa2Q#3fFF#$HU+|*48qE%5Uml|471~Pk(3Sa7zhizYp{Lx36_T`( VX=DKn+5%ev($_K3E}7Q)7AdNfTto+)GE#se|65K2e(hf2kY>AJ# zf!IVKb7kwtg1sWpEx0!*_Qv71>p}o}% OK;Y@>=d#Wzp$PzhF?JvT diff --git a/games/peasant/graphics/river_priority.png b/games/peasant/graphics/river_priority.png new file mode 100644 index 0000000000000000000000000000000000000000..b64079fa4fc18fe6f676f4c2c3a42c62bc8684d3 GIT binary patch literal 969 zcmeAS@N?(olHy`uVBq!ia0y~yV3Yu|4{$I8$roNd9zcPXOlRi+PiJR^f};Gi%$!sP z291fe6Ky>XJIEZ34_+Fi)l?=>cp_k~PDhtTmS|Ui;uWs7Rx@ILvHD6)5)pSlxb?w< z<4IQ!9*qoV4|f#!!%$dU98@w<=>K$)s3R2xclyh}%ay-pSQwZ%>#8YV#;)9DlQ|7% zM~gbI=WuqgegFWf(~#PN~)I&HcAg?hVmKAc%G)APKrd*{(4c5T@+Ud!BUTxEhy=YDEk zb6o4W?zyO?$D+PJ(eHWkb!zIm%Q9|4-4RVJf?Qb|iNM+{u-!k!>-rPD z6~iTaWVly2HNW|F@c)DI?O};UhrGK~8s3Q?|0%)fwA*3xJB$0r`!3rsHl05(_1?E| z=>uofUw+*tX3g|#TVwa@ZOh&;PPabrV6x)uP1>xPT&+wW>fG*6VP?x~{4nc!bhi9* zeuuVQUUwPT+Ye+++;qM6-rdVLZ|_f!`umqb*S4rTDCU_pFj|ZQd_r7-^kcb%1i!ui zUH&pGPM9-ij>!4H7Y_eVC}RGfWixl~-2V$Mh?NMQuIx{_n8eH(9(nZp0)-??Tq8=H z^K)}k^GX<;i&7IyQd1PlGfOfQ+&z5*!W;R-fd;30x;TbZ+Cf=4>xX)7hWbI5DkxjRpgS=s9HfIgtsE|f#yDdJGW1K! y%T2rBGE-ea?s+x^EZxk?I7(8A5T-G@yGywpYEP6x$ literal 0 HcmV?d00001 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