Document a bit of atk47

This commit is contained in:
DizzyEggg
2018-07-29 15:51:08 +02:00
parent 68145cd002
commit 9febcd3a0a
4 changed files with 12 additions and 11 deletions
+3 -3
View File
@@ -623,8 +623,8 @@ _080AA186:
bx r0 bx r0
thumb_func_end sub_80AA124 thumb_func_end sub_80AA124
thumb_func_start sub_80AA18C thumb_func_start AnimTask_StatsChange
sub_80AA18C: @ 80AA18C AnimTask_StatsChange: @ 80AA18C
push {r4,r5,lr} push {r4,r5,lr}
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
@@ -853,7 +853,7 @@ _080AA352:
pop {r0} pop {r0}
bx r0 bx r0
.pool .pool
thumb_func_end sub_80AA18C thumb_func_end AnimTask_StatsChange
thumb_func_start LaunchStatusAnimation thumb_func_start LaunchStatusAnimation
LaunchStatusAnimation: @ 80AA364 LaunchStatusAnimation: @ 80AA364
+1 -1
View File
@@ -10484,7 +10484,7 @@ AnimScript_82D7ECA:
end end
Anim_StatChange: Anim_StatChange:
createvisualtask sub_80AA18C, 0x5 createvisualtask AnimTask_StatsChange, 0x5
waitforvisualfinish waitforvisualfinish
end end
+2 -1
View File
@@ -568,10 +568,11 @@ struct BattleStruct
} }
#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8 #define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8
#define GET_STAT_BUFF_VALUE2(n)((n & 0xF0))
#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40 #define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40
#define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit #define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit
#define SET_STAT_BUFF_VALUE(n)(((s8)(((s8)(n) << 4)) & 0xF0)) #define SET_STAT_BUFF_VALUE(n)((((n) << 4) & 0xF0))
#define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7)) #define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7))
+6 -6
View File
@@ -4378,22 +4378,22 @@ static void atk46_playanimation2(void) // animation Id is stored in the first po
static void atk47_setgraphicalstatchangevalues(void) static void atk47_setgraphicalstatchangevalues(void)
{ {
u8 value = 0; u8 value = 0;
switch (gBattleScripting.statChanger & 0xF0) switch (GET_STAT_BUFF_VALUE2(gBattleScripting.statChanger))
{ {
case 0x10: // +1 case SET_STAT_BUFF_VALUE(1): // +1
value = 0xF; value = 0xF;
break; break;
case 0x20: // +2 case SET_STAT_BUFF_VALUE(2): // +2
value = 0x27; value = 0x27;
break; break;
case 0x90: // -1 case SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE: // -1
value = 0x16; value = 0x16;
break; break;
case 0xA0: // -2 case SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE: // -2
value = 0x2E; value = 0x2E;
break; break;
} }
gBattleScripting.animArg1 = (gBattleScripting.statChanger & 0xF) + value - 1; gBattleScripting.animArg1 = GET_STAT_BUFF_ID(gBattleScripting.statChanger) + value - 1;
gBattleScripting.animArg2 = 0; gBattleScripting.animArg2 = 0;
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
} }