From 5718fa67facef84728a81a4824e848e153a6649c Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 12 Apr 2022 12:23:49 +0100 Subject: [PATCH] Merge old alex branches (#691) * D_80283D98 * add tools/migrate_data_to_c.py * add .byte support * jic * update count_power_plus --- src/190B20.c | 20 ++++++++++---------- ver/us/asm/data/1AF2D0.data.s | 5 ++++- ver/us/symbol_addrs.txt | 1 + 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/190B20.c b/src/190B20.c index 1795211320..3079d6de00 100644 --- a/src/190B20.c +++ b/src/190B20.c @@ -7,6 +7,8 @@ #include "model.h" #include "sprite.h" +extern void D_80283D98; + typedef struct PartnerDMAData { /* 0x00 */ u32 dmaStart; /* 0x04 */ u32 dmaEnd; @@ -1067,10 +1069,8 @@ f32 D_80283690[] = { 1.0f, 0.8f, 0.8f, 0.8f, 0.9f, 0.9f, 0.9f, }; -// TODO fix raw ptrs -s32 D_80283744[] = { - 0x00000000, 0x80283D98, 0x80283D98, 0x80283D98, 0x80283D98, 0x80283D98, 0x80283D98, 0x80283D98, 0x80283D98, - 0x80283D98, 0x80283D98, +UNK_PTR D_80283744[] = { + NULL, &D_80283D98, &D_80283D98, &D_80283D98, &D_80283D98, &D_80283D98, &D_80283D98, &D_80283D98, &D_80283D98, &D_80283D98, &D_80283D98, }; s32 bMessages[] = { @@ -1586,26 +1586,26 @@ void btl_init_menu_partner(void) { } } -s32 count_power_plus(s32 arg0) { - s32 pp; +s32 count_power_plus(s32 damageType) { + s32 count; s32 i; if (gGameStatusPtr->peachFlags & 1) { return 0; } - pp = 0; + count = 0; for (i = 0; i < ARRAY_COUNT(gPlayerData.equippedBadges); i++) { u8 moveID = gItemTable[gPlayerData.equippedBadges[i]].moveID; if (gMoveTable[moveID].battleSubmenu == 7 && moveID == MOVE_POWER_PLUS) { - if (gBattleStatus.flags1 & BS_FLAGS1_10 || arg0 & 0x80) { - pp++; + if (gBattleStatus.flags1 & BS_FLAGS1_10 || damageType & DAMAGE_TYPE_JUMP) { + count++; } } } - return pp; + return count; } void deduct_current_move_fp(void) { diff --git a/ver/us/asm/data/1AF2D0.data.s b/ver/us/asm/data/1AF2D0.data.s index 1a3bfc15e9..d0e5024661 100644 --- a/ver/us/asm/data/1AF2D0.data.s +++ b/ver/us/asm/data/1AF2D0.data.s @@ -18,7 +18,10 @@ dlabel D_80283C68 .word 0xFFF0FFF0, 0x00000000, 0x00000000, 0x000000FF, 0x000FFFF0, 0x00000000, 0x04000000, 0x000000FF, 0x000F000F, 0x00000000, 0x04000400, 0x000000FF, 0xFFF0000F, 0x00000000, 0x00000400, 0x000000FF dlabel D_80283CA8 -.word 0xE7000000, 0x00000000, 0xD7000002, 0xFFFFFFFF, 0xFCFFB3FF, 0xFF2CFE7F, 0xE3000C00, 0x00080000, 0xE3000D01, 0x00000000, 0xE3000F00, 0x00000000, 0xE3001001, 0x00000000, 0xE3001201, 0x00003000, 0xE3001402, 0x00000C00, 0xE3001001, 0x00008000, 0xFD100000, D_8028A660, 0xE8000000, 0x00000000, 0xF5000100, 0x07000000, 0xE6000000, 0x00000000, 0xF0000000, 0x0703C000, 0xE7000000, 0x00000000, 0xFD48000F, D_8028A460, 0xF5480400, 0x07000000, 0xE6000000, 0x00000000, 0xF4000000, 0x0703E07C, 0xE7000000, 0x00000000, 0xF5400400, 0x00000000, 0xF2000000, 0x0007C07C, 0xD9FDFFFF, 0x00000000, 0xD9DFFFFF, 0x00000000, 0x01004008, D_80283C68, 0x05000204, 0x00000000, 0x05000406, 0x00000000, 0xE7000000, 0x00000000, 0xDF000000, 0x00000000, 0x00000004, 0x0000002D, 0x00000001, 0x0000003C, D_80283CA8, 0x00000002, 0x00000000, 0x00000000 +.word 0xE7000000, 0x00000000, 0xD7000002, 0xFFFFFFFF, 0xFCFFB3FF, 0xFF2CFE7F, 0xE3000C00, 0x00080000, 0xE3000D01, 0x00000000, 0xE3000F00, 0x00000000, 0xE3001001, 0x00000000, 0xE3001201, 0x00003000, 0xE3001402, 0x00000C00, 0xE3001001, 0x00008000, 0xFD100000, D_8028A660, 0xE8000000, 0x00000000, 0xF5000100, 0x07000000, 0xE6000000, 0x00000000, 0xF0000000, 0x0703C000, 0xE7000000, 0x00000000, 0xFD48000F, D_8028A460, 0xF5480400, 0x07000000, 0xE6000000, 0x00000000, 0xF4000000, 0x0703E07C, 0xE7000000, 0x00000000, 0xF5400400, 0x00000000, 0xF2000000, 0x0007C07C, 0xD9FDFFFF, 0x00000000, 0xD9DFFFFF, 0x00000000, 0x01004008, D_80283C68, 0x05000204, 0x00000000, 0x05000406, 0x00000000, 0xE7000000, 0x00000000, 0xDF000000, 0x00000000 + +glabel D_80283D98 +.word 0x00000004, 0x0000002D, 0x00000001, 0x0000003C, D_80283CA8, 0x00000002, 0x00000000, 0x00000000 dlabel D_80283DB8 .word 0xFFF0FFF0, 0x00000000, 0x00000400, 0x000000FF, 0x000FFFF0, 0x00000000, 0x04000400, 0x000000FF, 0x000F000F, 0x00000000, 0x04000000, 0x000000FF, 0xFFF0000F, 0x00000000, 0x00000000, 0x000000FF diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index 56f71665ce..d5653c95b4 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -25389,6 +25389,7 @@ D_F5000007 = 0xF5000007; // type:data D_F79DDD0F = 0xF79DDD0F; // type:data D_FA000028 = 0xFA000028; // type:data D_FD100008 = 0xFD100008; // type:data +D_80283D98 = 0x80283D98; // type:data dead_atan2 = 0x8002AF70; // type:func dead:yes dead_cos_rad = 0x8002B4C0; // type:func dead:yes dead_playFX_11 = 0x80075170; // type:func dead:yes