From a2c00776b6444b23b8868d76a474d2c21c7a2f53 Mon Sep 17 00:00:00 2001 From: LeonarthCG Date: Mon, 20 Aug 2018 23:36:59 +0200 Subject: [PATCH] Death animation fix Fixed death animation when Snek hits herself. Also added a new check for the win state just in case. --- ASM/Snake/moveSnake.elf | Bin 2792 -> 2792 bytes ASM/Snake/moveSnake.s | 2 +- ASM/mainLoop.elf | Bin 4836 -> 4936 bytes ASM/mainLoop.s | 20 +++++++++++++++++++- rom.gba | Bin 49428 -> 49448 bytes 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ASM/Snake/moveSnake.elf b/ASM/Snake/moveSnake.elf index 9c0f493fbc749eb17393bb40149b874748ca1c25..bb908e9be1cfbcec4ff019965b25ad7d6cbb4b26 100644 GIT binary patch delta 71 zcmaDM`a*O=03$#D77iIf83FHkZVW#dHFzf{G72*(H*79plxJjDQUn46#m%#rmN5&e SF)}~_BLj%3u{n@!Itu`F+75mI delta 85 zcmaDM`a*O=0Hca>1OFBd89^C-?|E(vKNvN5F7WSB3}G}-3Sm%4XnxSeXz`$Fa|xq7 gBfFxKA`lpCp2f6`Sx|$K0SXuyKuoR8fo#)R00!t3N&o-= diff --git a/ASM/Snake/moveSnake.s b/ASM/Snake/moveSnake.s index 9f4754f..4aea9d9 100644 --- a/ASM/Snake/moveSnake.s +++ b/ASM/Snake/moveSnake.s @@ -185,7 +185,6 @@ b End doGrow: ldrh r3,[r4] add r3,#1 -strh r3,[r4] @check if the snake is going to hit herself push {r0-r3} mov r0,r1 @@ -204,6 +203,7 @@ strh r0,[r4,#0x1A] ldrh r0,[r4,#0x16] sub r0,#1 strh r0,[r4,#0x16] +strh r3,[r4] b End End: diff --git a/ASM/mainLoop.elf b/ASM/mainLoop.elf index 8cd12063289b2da1d0650ce93a7a1c0f20f17958..288d91635f28ee68ac20adbce6458eb7ee149824 100644 GIT binary patch delta 1899 zcmZ9LZA@EL7{{N}+iq=KM_*8wz~}*HQ4m|=%RX#|g27ub24*7$r@{)Xh7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@Q zQ!%09hktqhxPbTCYrm@P5P|i$jA;vn+tfx)TORi8l(wg+{27&AjhjW1`>Gq0Sd6k7 zx#-yuEXEXI$`Bh{&WstyYvm?ml>MFiz^G&oS95IDd>h}+-U%01w^(MJiHg%^h6VWw4Z-_h&M9Ss~A$3++9PX~?w3WM?&|`elvD zeyK6luV_s6s>WE)z&Bcg>~|W|1V3m@_D7A6BHz)N`rp);>~9)V{g%cI*M}u7K^<;u zOxC?X{yee5@WSI=JzvE%zEoqX2Q;R7o5n1OiFPeP9Xd6p2~rvlBEO~a8_1Iy)A$?G zEbhsSqbsxkn)eETN<8i2uU!1Ci+^_UuP(l|mOJ6j+64UL;s-AF)3fFqZLr+M5f^Wf zy(LwArz^Y5#k=KaB~`3l{!~&Ge9cuGk(H%=zLz?ByN?Za_vL0vx3bI)JWS8?_*Rg% z0^B8i0ly2<0|3jUF9Q5a+J>K%fqD?2n6w>_mh=$rp7bz4n6v{RLfQ!sCG7&(LYe}I zlXe5tk{-c#t6n}GsM;e4djOs##n*fqz(G@}&4O(ZNx^T(2kO zl|U2z5WK<7?5L~>#@I=j$j1$GJQ(nv#A)x#kFj1WuVZCI-pBZqtO&(eNSYYq@@0%k yIT4Djuh{ayla3b$5h1^XXAK|=)q diff --git a/ASM/mainLoop.s b/ASM/mainLoop.s index 85c87ab..731a487 100644 --- a/ASM/mainLoop.s +++ b/ASM/mainLoop.s @@ -253,6 +253,13 @@ b skipSnake runSnake: strh r3,[r0,#0x18] @update counter +@check for win +ldrb r3,[r0,#0xD] +cmp r3,#0xFE +bne notWIN1 +b WIN +notWIN1: + @check for game over ldrb r3,[r0,#0xD] cmp r3,#0xFF @@ -272,9 +279,16 @@ ldr r0,=moveSnake mov lr,r0 .short 0xF800 -@check for game over +@check for win ldr r0,=#0x02000000 ldrb r3,[r0,#0xD] +cmp r3,#0xFE +bne notWIN2 +b WIN +notWIN2: + +@check for game over +ldrb r3,[r0,#0xD] cmp r3,#0xFF beq gameover @@ -443,3 +457,7 @@ ldr r3,=#0x04000100 ldrh r3,[r3,#4] @counter strh r3,[r0,#0x18] @counter last time logic was ran b main + +WIN: +swi #5 +b WIN diff --git a/rom.gba b/rom.gba index 6274b4d9b7dcdaf235dd4412c0ce626acbffed69..161c7dd87883ecbdf303dbe7b41039725a8e91a1 100644 GIT binary patch delta 942 zcmX|AT}V@57=FLAo%u~$n_)V2!8y8%l@TkfypV7%>^s`cY*IlNT2X_#IMObJB|Fm) zvm)a}Sz>A#B$>@7yZd`N+1o-=i|4QVkeoYQiwk;{H-}0!G5P zjB3xOx<;b|gi+!0gUa-Pp3oQcKJxkm>*5M;03R$3XD>AOw3K(*?arN$33YZ;$GMHE zv(2&1njGrv5MAas%Z~WLY`G^?@viGuBYfJMwe$vK|7u|AVKx|BtEtI^a2Vf&$3yeT}#MjX)!YZ$744Z>ih3zs|t^4B+v;ZxusB9VTxAb~(@70xjxG;bclmg^j$T4JN z7_xjIC+4YUU0nlkV<7WE{aZ#~S#bmRmIEK+z^z*_fH=GC1TOG9h_e|CWj>_&fC8=$ zCD<4(#35{$!*$UCyxv@ptJyE}r~H}a%(N|N%U^*Pn^M6ENy?;76)22NrMmfd{J*45 z7FIK_bC!FGJub=>^EookH)@#qtHPkP_htuJUACv%Fvp6#*uPj5W83LXGQbqxr55j} n;9Heco5RG7&EH$U$O>L|%3O2?S=6+W}un@XpxO{fwQO<1F-c{;DTz27LdIVY*AICi^!e{wxE89E;x`busQW^bUrxM z1zYp%DdJgy=lEMgV=@=;b>~=4ofg^?M3Vwdv(C{JOsN+849f~-TqxtHObTSNPq2*0 z+-Fo-*0TDwTcZq=wB{Wo3W<4R>DY3N3w2W9|bx`r98kKY^ffDsJ zpyExXQ#X(u-D4x7^^SKrb8QtHze(u}YI8)ch`<@xkZzigDPV*gkxydn}equ#a^nHr({bS;4wR42k%7UHUbH>;LbZ$aOH;ir08GCg^dVF`ceI zCGbvkv9Lm0ePKRha*}plD|IBTC;>`F)*PG|H4YzH*Nuc`Ge85t8X8P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