diff options
author | jiangzhengwenjz <jiangzhengwenjzw@qq.com> | 2019-07-30 03:27:06 +0800 |
---|---|---|
committer | jiangzhengwenjz <jiangzhengwenjzw@qq.com> | 2019-07-31 07:58:09 +0800 |
commit | 3f866d2a60cde838d9170bf080b075f120d81ed5 (patch) | |
tree | c8321fe3856e1df8cff9b0625e61cb763b9f16e7 | |
parent | 045331d139f04169df59f4550fd2f5fadac14a58 (diff) |
matched BattleLoadSubstituteOrMonSpriteGfx
-rw-r--r-- | src/battle_gfx_sfx_util.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index f0a724fe6..ba691801f 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -758,10 +758,8 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, u8 notTransform) void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite) { u8 position; - // variable i is actually u8, but needs to be 32-bit to make the inline ASM match. s32 i; u32 palOffset; - const void *substitutePal; if (!loadMonSprite) { @@ -770,19 +768,16 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite) LZDecompressVram(gSubstituteDollGfx, gMonSpritesGfxPtr->sprites[position]); else LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites[position]); - i = 1; - palOffset = battlerId * 16; - substitutePal = gSubstituteDollPal; - for (; i < 4; ++i) + for (i = 1; i < 4; ++i) { - #ifndef NONMATCHING - register void *dmaSrc asm("r0") = gMonSpritesGfxPtr->sprites[position]; - #endif - void *dmaDst = (i * 0x800) + dmaSrc; + u8 (*ptr)[4][0x800] = gMonSpritesGfxPtr->sprites[position]; - DmaCopy32(3, dmaSrc, dmaDst, 0x800); + ++ptr; + --ptr; + DmaCopy32Defvars(3, (*ptr)[0], (*ptr)[i], 0x800); } - LoadCompressedPalette(substitutePal, palOffset + 0x100, 0x20); + palOffset = (battlerId * 16) + 0x100; + LoadCompressedPalette(gSubstituteDollPal, palOffset, 32); } else { |