From 230f0fd6106a64e155cc12fdedc2e2251bdb53ac Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 29 Aug 2020 23:51:29 -0400 Subject: [PATCH] mist: meche: add snake-in-box --- mist/graphics_meche/blue_room_south_e.png | Bin 1040 -> 1037 bytes mist/graphics_meche/snake_animation.png | Bin 0 -> 1197 bytes mist/leveldata_meche.inc | 3 +- mist/meche.s | 29 ++-- mist/meche_rotation.s | 194 ++++++++++++++++++++++ 5 files changed, 214 insertions(+), 12 deletions(-) create mode 100644 mist/graphics_meche/snake_animation.png diff --git a/mist/graphics_meche/blue_room_south_e.png b/mist/graphics_meche/blue_room_south_e.png index d7c18b82ddc851723acf4212c7e221917b8677b2..3d912b09d4ff625d050a3224876922185963e0ca 100644 GIT binary patch delta 483 zcmV<90UZ922#pA^5&{PS9W8ps!UvNX0w{mCNklA?1P}fa?I>#~_0dju{ z*9Bk*)SWWSIX0qMCM^LeKm#=b!BTf4Lwc|}L+lg%0}~*cLNH1>OBpa+DN8C(fKUk3 zKnpu(?#Lmss1;-kd>x{z068m`lw~lxnyl=}xj z>hcd%K-n{!fV>?a1NkWUYamV=3CDk7CI{LWh-0}6WB`3=3hE4dlcIpNttbKLSZ7!+ z8)_K>8GvteVbFLTPJqUg$ALWhhroIa*^+F@P|lh^ZU^=U!_B z{GGfzK(+vzfZ`X*y&}L%!`Uil@5zd60(zfM;kpUP58RI81lW2)YsGLPIGs;g1jeq| z7ZOk-mw?ui;p_oX#<9B$WRKP6$QdT323Wro>l3H8aiu|~DY^uDrO_Xv5(wl2AVaf~ Z0N>7TE{7x7{2#^S{5&{PR1O%eCnM9Kr0w{mFNkl_}}0;8TZNrp~#PLZk0f&V{asoI|_TxKl(@dILzb3_MPGKhE$tY}7*_ zkZ4~7hA;+7j|Ct%hMT$oVr-6=Qo=~-{isv|U*#5vF-pmM4Mq+BKwUQl+8oPl6excs zTyFql)U$0QLR> zkh}Z?4N&*YCZKG`$3Qs>{u+qWM#Fz`nCXEw2I5%m0tLVyo`O2V-lP~{Z7WIuI@TGM z%Z6KqKmp(zT?8~fN1t=C^6Hxs^xmOf;X*gTuOvF}X6ObssgzF}tJa9XT6JYBJy;sAD;FMB`BytKo zx)NW=K*T|}f!?#>>;X|uX#pr6tIbg|Ohyf`eks-`PHp2#gUnNO2_&P@AEFWn4aoN&o-= diff --git a/mist/graphics_meche/snake_animation.png b/mist/graphics_meche/snake_animation.png new file mode 100644 index 0000000000000000000000000000000000000000..a1291424473e598a58b97862ea61655caff7b34a GIT binary patch literal 1197 zcmV;e1XBBnP)EX>4Tx04R}tkv&MmKpe$iTg4(32Mda*WT?7W5EXIMDionYs1;guFuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|}?mh0_0sdNvsbx5TMG%AN#VCd(X6kdIn1JW_x`&UicTt|@eeTcErDRP8_ypovrW+RV2J!T! zrE}gV4zq%!5T6r|8FWG7N3P2*zj4kx?B|(bBbA&d4igLc7M5F>6%3Vlia4UE8s+=b zE-Re3IIE=!YuuB+FqG9+mbp%I0C6m02_gi@sGx`vEJSJ5NHLM5{g{Wp-|>s&lF3yB zBgX>DP$4;f@IUz7t(lvgaFaqYp#8v9s@5kZasf{0000PbVXQnLvL+uWo~o;Lvm$dbY)~9cWHEJ zAV*0}P*;Ht7XSbPS4l)cR9M69n0<4DAPk3@2Y2?6^ZS3>8PfOmRRBjx}-wBMBH;&~3IPXPg zkB!=#0iBzl6++sm&lxZTw-;~J=VFFoFZi9$M4MOMatQce;cu;JF2Dyw)^q0xnw(18D&@hP%T# z{4`~5jJ0vRupTW-+-~++JcrQ@;KkPSK3XhZHjsNC?M4?izQXfMt=EuL+BlXst=F>K zZN2|vy$0}yttXvw$zG4v<$yiVNdp%szVX>Do0-(%u z*9-wuyFpG#1xV82Gbzg`DqaE1XHo|ev;joBNf}XIwqe(LvJvtUQ0DL6>*?)=*J--f zyRCOy@3vmuZc3p3NoEyz_Bmk#Shg77VR5^io*}M!gKxRM1zQ%Bs9fq_0Fph_z}}wj zG%#;`5jbwQ4v_YAdb@RJh)&kqO$FpnGSfXEw_6p67Nf5rdb>4%^sR;i+jdg|^>$Ow zP;0m5dYA&Wc58mh1RSwj=dy_powRmqNGgAzDF6Pn^={w|`~|>otzh%HTHv*(00000 LNkvXXu0mjf`U@+F literal 0 HcmV?d00001 diff --git a/mist/leveldata_meche.inc b/mist/leveldata_meche.inc index 9342f528..c12656af 100644 --- a/mist/leveldata_meche.inc +++ b/mist/leveldata_meche.inc @@ -1015,8 +1015,7 @@ location54: .word blue_room_south_e_lzsa ; east bg .word $0000 ; west bg .byte BG_NORTH|BG_SOUTH|BG_EAST - .byte $ff .byte DIRECTION_E - .byte 21,30 ; special x + .byte 27,31 ; special x .byte 34,46 ; special y .word touch_blue_box-1 ; special function diff --git a/mist/meche.s b/mist/meche.s index 9a19ca7e..59df1b29 100644 --- a/mist/meche.s +++ b/mist/meche.s @@ -90,8 +90,27 @@ game_loop: beq fg_draw_red_page cmp #MECHE_RED_ROOM_EAST beq fg_draw_crystals + cmp #MECHE_BLUE_ROOM_SOUTH + beq fg_animate_snake jmp nothing_special + +fg_draw_red_page: + jsr draw_red_page + jmp nothing_special + +fg_draw_blue_page: + jsr draw_blue_page + jmp nothing_special + +fg_draw_crystals: + jsr draw_crystals + jmp nothing_special + +fg_animate_snake: + jsr draw_snake + jmp nothing_special + animate_meche_book: ; handle animated linking book @@ -171,17 +190,7 @@ done_animate_mist_book: jmp nothing_special -fg_draw_red_page: - jsr draw_red_page - jmp nothing_special -fg_draw_blue_page: - jsr draw_blue_page - jmp nothing_special - -fg_draw_crystals: - jsr draw_crystals - jmp nothing_special nothing_special: diff --git a/mist/meche_rotation.s b/mist/meche_rotation.s index 1adb6fc8..dfab245f 100644 --- a/mist/meche_rotation.s +++ b/mist/meche_rotation.s @@ -1,6 +1,200 @@ + ;================================ + ; draw snake + ;================================ +draw_snake: + lda DIRECTION + cmp #DIRECTION_E + bne done_draw_snake + + lda ANIMATE_FRAME + beq done_draw_snake + + asl + tax + + lda snake_coords,X + sta XPOS + + lda snake_coords+1,X + sta YPOS + + lda snake_sprites,X + sta INL + + lda snake_sprites+1,X + sta INH + + jsr put_sprite_crop + + lda FRAMEL + and #$1f + bne done_draw_snake + + ; advance frame + inc ANIMATE_FRAME + lda ANIMATE_FRAME + cmp #23 + bne done_draw_snake + + lda #0 + sta ANIMATE_FRAME + +done_draw_snake: + rts + +snake_coords: + .byte 28,42 ; 0 (handle down) + .byte 28,42 ; 1 (handle straight) + .byte 28,40 ; 2 (handle up) + .byte 28,42 ; 3 (handle straight) + .byte 28,42 ; 4 (handle down) + .byte 28,42 ; 5 (handle straight) + .byte 28,40 ; 6 (handle up) + .byte 28,42 ; 7 (handle straight) + .byte 28,42 ; 8 (handle down) + + .byte 22,34 ; 9 (lid up) + .byte 23,32 ; 10 (lid totally up) + .byte 23,28 ; 11 (snake up) + .byte 23,32 ; 12 (snake down) + .byte 23,28 ; 13 (snake up) + .byte 23,32 ; 14 (snake down) + + .byte 23,30 ; 15 (snake lean) + .byte 21,32 ; 16 (snake strike) + .byte 21,32 ; 17 (snake over) + .byte 22,32 ; 18 (snake back) + .byte 23,28 ; 19 (snake up) + .byte 23,32 ; 20 (snake down) + + .byte 23,32 ; 21 (lid totally up) + .byte 22,34 ; 22 (lid up) + + + +snake_sprites: + .word snake_sprite0 ; 0 (handle down) + .word snake_sprite1 ; 1 (handle straight) + .word snake_sprite2 ; 2 (handle up) + .word snake_sprite1 ; 3 (handle straight) + .word snake_sprite0 ; 4 (handle down) + .word snake_sprite1 ; 5 (handle straight) + .word snake_sprite2 ; 6 (handle up) + .word snake_sprite1 ; 7 (handle straight) + .word snake_sprite0 ; 8 (handle down) + + .word snake_sprite3 ; 9 (lid up) + .word snake_sprite4 ; 10 (lid totally up) + .word snake_sprite5 ; 11 (snake up) + .word snake_sprite6 ; 12 (snake down) + .word snake_sprite5 ; 13 (snake up) + .word snake_sprite6 ; 14 (snake down) + .word snake_sprite7 ; 15 (snake lean) + .word snake_sprite8 ; 16 (snake strike) + .word snake_sprite9 ; 17 (snake over) + .word snake_sprite10 ; 18 (snake back) + .word snake_sprite5 ; 19 (snake up) + .word snake_sprite6 ; 20 (snake down) + + .word snake_sprite4 ; 21 (lid totally up) + .word snake_sprite3 ; 22 (lid up) + + + ; 28,42 +snake_sprite0: + .byte 1,1 + .byte $AA + + ; 28,42 +snake_sprite1: + .byte 2,1 + .byte $90,$90 + + ; 28,40 +snake_sprite2: + .byte 2,2 + .byte $92,$02 + .byte $90,$99 + + ; 22,34 +snake_sprite3: ; lid up + .byte 5,3 + .byte $25,$05,$05,$05,$58 + .byte $52,$08,$00,$00,$05 + .byte $5d,$d0,$d0,$d0,$58 + + ; 23,32 +snake_sprite4: ; lid totally up + .byte 5,4 + .byte $82,$82,$80,$88,$82 + .byte $88,$88,$88,$88,$88 + .byte $58,$4c,$cc,$48,$d8 + .byte $d4,$d4,$d4,$54,$dd + + ; 23,28 +snake_sprite5: ; snake up + .byte 5,6 + .byte $22,$22,$40,$c5,$22 + .byte $22,$42,$c4,$4c,$22 + .byte $82,$44,$44,$44,$82 + .byte $88,$84,$44,$84,$88 + .byte $58,$08,$44,$08,$d8 + .byte $d0,$d0,$d4,$50,$dd + + ; 23,32 +snake_sprite6: ; snake down + .byte 5,4 + .byte $82,$82,$44,$c8,$82 + .byte $88,$48,$c4,$4c,$88 + .byte $58,$44,$44,$44,$d8 + .byte $d0,$d0,$d4,$50,$dd + + ; 23,30 +snake_sprite7: ; snake lean + .byte 5,5 + .byte $22,$c2,$c4,$48,$22 + .byte $82,$4c,$cc,$44,$82 + .byte $88,$84,$44,$84,$88 + .byte $58,$48,$44,$08,$d8 + .byte $d0,$d4,$d4,$50,$dd + + ; 21,32 +snake_sprite8: ; snake strike + .byte 7,4 + .byte $20,$22,$82,$82,$80,$88,$82 + .byte $44,$44,$44,$88,$88,$88,$88 + .byte $22,$52,$54,$44,$48,$08,$d8 + .byte $22,$5d,$d0,$d4,$d4,$50,$dd + + ; 21,32 +snake_sprite9: ; snake over + .byte 7,8 + .byte $20,$22,$82,$82,$80,$88,$82 + .byte $22,$22,$88,$88,$88,$88,$88 + .byte $22,$52,$58,$44,$44,$08,$d8 + .byte $22,$5d,$44,$44,$d4,$50,$dd + .byte $02,$45,$44,$44,$88,$5d,$00 + .byte $44,$44,$44,$44,$88,$85,$00 + .byte $44,$44,$44,$44,$88,$55,$89 + .byte $24,$44,$44,$24,$20,$22,$08 + + ; 22,32 +snake_sprite10: ; snake back + .byte 6,4 + .byte $c2,$c4,$c4,$40,$88,$82 + .byte $2c,$8c,$44,$44,$88,$88 + .byte $52,$58,$44,$44,$08,$d8 + .byte $5d,$d0,$d4,$d4,$50,$dd + + ;===================== + ; touch the snake box + ;===================== + touch_blue_box: lda #1 sta ANIMATE_FRAME + sta FRAMEL + rts ;===============================