diff options
-rwxr-xr-x | asm/use_pokeblock.s | 145 | ||||
-rwxr-xr-x[-rw-r--r--] | data/use_pokeblock.s | 29 | ||||
-rwxr-xr-x[-rw-r--r--] | include/use_pokeblock.h | 2 | ||||
-rwxr-xr-x | ld_script.txt | 1 | ||||
-rwxr-xr-x | src/use_pokeblock.c | 111 | ||||
-rw-r--r-- | sym_ewram.txt | 5 |
6 files changed, 116 insertions, 177 deletions
diff --git a/asm/use_pokeblock.s b/asm/use_pokeblock.s index af050f3d5..5e1f94267 100755 --- a/asm/use_pokeblock.s +++ b/asm/use_pokeblock.s @@ -5,151 +5,6 @@ .syntax unified .text -@ -@ thumb_func_start sub_8136D00 -@ sub_8136D00: @ 8136D00 -@ push {r4,r5,lr} -@ ldr r4, _08136D30 @ =gUnknown_02039304 -@ adds r3, r4, 0 -@ movs r5, 0x5 -@ _08136D08: -@ ldr r0, [r3] -@ adds r0, 0x53 -@ ldrb r1, [r0] -@ adds r1, 0x1 -@ strb r1, [r0] -@ ldr r2, [r3] -@ adds r1, r2, 0 -@ adds r1, 0x53 -@ ldrb r0, [r1] -@ cmp r0, 0x4 -@ bhi _08136D34 -@ adds r0, r2, 0 -@ adds r0, 0x61 -@ ldrb r1, [r1] -@ adds r0, r1 -@ ldrb r0, [r0] -@ cmp r0, 0 -@ bne _08136D3A -@ b _08136D08 -@ .align 2, 0 -@ _08136D30: .4byte gUnknown_02039304 -@ _08136D34: -@ strb r5, [r1] -@ movs r0, 0 -@ b _08136D5A -@ _08136D3A: -@ ldr r2, [r4] -@ adds r0, r2, 0 -@ adds r0, 0x10 -@ adds r1, r2, 0 -@ adds r1, 0x53 -@ ldrb r1, [r1] -@ adds r2, 0x61 -@ adds r2, r1 -@ ldrb r2, [r2] -@ bl sub_8136DC0 -@ ldr r0, [r4] -@ adds r0, 0x10 -@ bl sub_8136DA0 -@ movs r0, 0x1 -@ _08136D5A: -@ pop {r4,r5} -@ pop {r1} -@ bx r1 -@ thumb_func_end sub_8136D00 -@ - thumb_func_start sub_8136D60 -sub_8136D60: @ 8136D60 - push {lr} - ldr r0, _08136D84 @ =gWindowConfig_81E709C - bl BasicInitMenuWindow - movs r0, 0 - movs r1, 0x10 - movs r2, 0x1D - movs r3, 0x13 - bl MenuDrawTextWindow - ldr r0, _08136D88 @ =gOtherText_WontEat - movs r1, 0x1 - movs r2, 0x11 - bl MenuPrint - pop {r0} - bx r0 - .align 2, 0 -_08136D84: .4byte gWindowConfig_81E709C -_08136D88: .4byte gOtherText_WontEat - thumb_func_end sub_8136D60 - - thumb_func_start sub_8136D8C -sub_8136D8C: @ 8136D8C - push {lr} - bl MenuZeroFillScreen - ldr r0, _08136D9C @ =gWindowConfig_81E7080 - bl BasicInitMenuWindow - pop {r0} - bx r0 - .align 2, 0 -_08136D9C: .4byte gWindowConfig_81E7080 - thumb_func_end sub_8136D8C - - thumb_func_start sub_8136DA0 -sub_8136DA0: @ 8136DA0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0 - movs r1, 0x10 - movs r2, 0x1D - movs r3, 0x13 - bl MenuDrawTextWindow - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x11 - bl MenuPrint - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8136DA0 - - thumb_func_start sub_8136DC0 -sub_8136DC0: @ 8136DC0 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, 16 - lsrs r0, r2, 16 - asrs r2, 16 - cmp r2, 0 - beq _08136DFC - cmp r2, 0 - ble _08136DD8 - movs r0, 0 -_08136DD8: - lsls r0, 16 - ldr r1, _08136DF4 @ =gUnknown_08406134 - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl StringCopy - ldr r1, _08136DF8 @ =gOtherText_WasEnhanced - adds r0, r4, 0 - bl StringAppend - b _08136E04 - .align 2, 0 -_08136DF4: .4byte gUnknown_08406134 -_08136DF8: .4byte gOtherText_WasEnhanced -_08136DFC: - ldr r1, _08136E0C @ =gOtherText_NothingChanged - adds r0, r4, 0 - bl StringCopy -_08136E04: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08136E0C: .4byte gOtherText_NothingChanged - thumb_func_end sub_8136DC0 thumb_func_start sub_8136E10 sub_8136E10: @ 8136E10 diff --git a/data/use_pokeblock.s b/data/use_pokeblock.s index 2eabe9ce3..88f8cc336 100644..100755 --- a/data/use_pokeblock.s +++ b/data/use_pokeblock.s @@ -3,35 +3,6 @@ .section .rodata -.ifndef GERMAN - .align 2 -ConditionUpDownPalette: - .incbin "graphics/misc/condition_up_down.gbapal" - - .align 2 -ConditionUpDownTiles: - .incbin "graphics/misc/condition_up_down.4bpp" -.endif - -gUnknown_08406118:: @ 8406118 - .4byte 22 @ MON_DATA_COOL - .4byte 47 @ MON_DATA_TOUGH - .4byte 33 @ MON_DATA_SMART - .4byte 24 @ MON_DATA_CUTE - .4byte 23 @ MON_DATA_BEAUTY - - .align 2 -gUnknown_0840612C:: @ 840612C - obj_pal 0x02030400, 0x0001 - - .align 2 -gUnknown_08406134:: @ 8406134 - .4byte OtherText_Coolness - .4byte OtherText_Toughness - .4byte OtherText_Smartness - .4byte OtherText_Cuteness - .4byte OtherText_Beauty - .align 2 gSpriteSheet_ConditionUpDown:: @ 8406148 obj_tiles ConditionUpDownTiles, 0x200, 0 diff --git a/include/use_pokeblock.h b/include/use_pokeblock.h index f34857cf1..779ba27d1 100644..100755 --- a/include/use_pokeblock.h +++ b/include/use_pokeblock.h @@ -5,6 +5,8 @@ #ifndef POKERUBY_USE_POKEBLOCK_H #define POKERUBY_USE_POKEBLOCK_H +extern void *gUnknown_02030400; + void sub_8136130(struct Pokeblock *, MainCallback); #endif //POKERUBY_USE_POKEBLOCK_H diff --git a/ld_script.txt b/ld_script.txt index 4e72e03a0..a360ee781 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -462,6 +462,7 @@ SECTIONS { src/decoration_inventory.o(.rodata); src/roamer.o(.rodata); data/battle_tower.o(.rodata); + src/use_pokeblock.o(.rodata); data/use_pokeblock.o(.rodata); data/battle_anim_8137220.o(.rodata); src/player_pc.o(.rodata); diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index 7590b19ff..efa3b6200 100755 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -7,6 +7,7 @@ #include "rom4.h" #include "string_util.h" #include "strings.h" +#include "sprite.h" #include "pokemon.h" #include "pokenav.h" #include "palette.h" @@ -18,6 +19,34 @@ #include "pokeblock_feed.h" #include "use_pokeblock.h" +#define GFX_TAG_CONDITIONUPDOWN 0 +#define GFX_TAG_UNKNOWN02030400 1 + +#ifndef GERMAN +const u16 ConditionUpDownPalette[] = INCBIN_U16("graphics/misc/condition_up_down.gbapal"); +const u32 ConditionUpDownTiles[] = INCBIN_U32("graphics/misc/condition_up_down.4bpp"); +#endif + +const u32 gUnknown_08406118[] = { + MON_DATA_COOL, + MON_DATA_TOUGH, + MON_DATA_SMART, + MON_DATA_CUTE, + MON_DATA_BEAUTY +}; + +const struct SpritePalette gUnknown_0840612C = { + (u16 *const)&gUnknown_02030400, GFX_TAG_UNKNOWN02030400 +}; + +const u8 *const gUnknown_08406134[] = { + OtherText_Coolness, + OtherText_Toughness, + OtherText_Smartness, + OtherText_Cuteness, + OtherText_Beauty +}; + asm(".text\n" ".include \"constants/gba_constants.inc\""); @@ -54,8 +83,8 @@ void sub_8136EF0(void); void sub_8137138(void); void sub_8136C6C(void); bool8 sub_8136D00(void); -void sub_8136DC0(u8 *, u8, u8); -void sub_8136DA0(u8 *); +void sub_8136DC0(u8 *, u8, s16); +void sub_8136DA0(const u8 *); void sub_8136130(struct Pokeblock *pokeblock, MainCallback callback) { @@ -638,3 +667,81 @@ bool8 sub_8136D00(void) "\tbx r1"); } #endif + +void sub_8136D60(void) +{ + BasicInitMenuWindow(&gWindowConfig_81E709C); + MenuDrawTextWindow(0, 16, 29, 19); + MenuPrint(gOtherText_WontEat, 1, 17); +} + +void sub_8136D8C(void) +{ + MenuZeroFillScreen(); + BasicInitMenuWindow(&gWindowConfig_81E7080); +} + +void sub_8136DA0(const u8 *message) +{ + MenuDrawTextWindow(0, 16, 29, 19); + MenuPrint(message, 1, 17); +} + +#ifdef NONMATCHING +void sub_8136DC0(u8 *dest, u8 a1, s16 a2) +{ + u16 v0 = a2; + if (a2 != 0) + { + if ((v0 = max(a2, 0)) == 0); + StringCopy(dest, gUnknown_08406134[a1]); + StringAppend(dest, gOtherText_WasEnhanced); + } + else + { + StringCopy(dest, gOtherText_NothingChanged); + } +} +#else +__attribute__((naked)) +void sub_8136DC0(u8 *dest, u8 a1, s16 a2) +{ + asm_unified("\tpush {r4,lr}\n" + "\tadds r4, r0, 0\n" + "\tlsls r1, 24\n" + "\tlsrs r3, r1, 24\n" + "\tlsls r2, 16\n" + "\tlsrs r0, r2, 16\n" + "\tasrs r2, 16\n" + "\tcmp r2, 0\n" + "\tbeq _08136DFC\n" + "\tcmp r2, 0\n" + "\tble _08136DD8\n" + "\tmovs r0, 0\n" + "_08136DD8:\n" + "\tlsls r0, 16\n" + "\tldr r1, _08136DF4 @ =gUnknown_08406134\n" + "\tlsls r0, r3, 2\n" + "\tadds r0, r1\n" + "\tldr r1, [r0]\n" + "\tadds r0, r4, 0\n" + "\tbl StringCopy\n" + "\tldr r1, _08136DF8 @ =gOtherText_WasEnhanced\n" + "\tadds r0, r4, 0\n" + "\tbl StringAppend\n" + "\tb _08136E04\n" + "\t.align 2, 0\n" + "_08136DF4: .4byte gUnknown_08406134\n" + "_08136DF8: .4byte gOtherText_WasEnhanced\n" + "_08136DFC:\n" + "\tldr r1, _08136E0C @ =gOtherText_NothingChanged\n" + "\tadds r0, r4, 0\n" + "\tbl StringCopy\n" + "_08136E04:\n" + "\tpop {r4}\n" + "\tpop {r0}\n" + "\tbx r0\n" + "\t.align 2, 0\n" + "_08136E0C: .4byte gOtherText_NothingChanged"); +} +#endif diff --git a/sym_ewram.txt b/sym_ewram.txt index 42b0982ab..f142a1b1a 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -539,7 +539,10 @@ gTrainerCards: @ 202FFC0 .space 0xE0 gPokemonStorage: @ 20300A0 - .space 0x83D0 + .space 0x360 + +gUnknown_02030400: @ 02030400 + .space 0x8070 gUnknown_02038470: @ 2038470 .space 0x3 |