rename battle pyramid to battle pyramid bag

This commit is contained in:
DizzyEggg 2018-08-26 17:54:58 +02:00
parent 2811654931
commit ddd4733de3
7 changed files with 90 additions and 257 deletions

View File

@ -5,261 +5,8 @@
.text
thumb_func_start sub_8161F74
sub_8161F74: @ 8161F74
push {lr}
ldr r1, =gUnknown_085DF96C
ldr r0, =gSpecialVar_0x8004
ldrh r0, [r0]
lsls r0, 2
adds r0, r1
ldr r0, [r0]
bl _call_via_r0
pop {r0}
bx r0
.pool
thumb_func_end sub_8161F74
thumb_func_start sub_8161F94
sub_8161F94: @ 8161F94
push {r4-r7,lr}
ldr r4, =gSaveBlock2Ptr
ldr r0, [r4]
ldr r1, =0x00000ca9
adds r0, r1
ldrb r0, [r0]
lsls r0, 30
lsrs r5, r0, 30
ldr r0, =0x000040ce
bl VarGet
lsls r0, 16
lsrs r6, r0, 16
ldr r0, [r4]
ldr r2, =0x00000ca8
adds r0, r2
movs r7, 0
movs r1, 0x1
strb r1, [r0]
ldr r1, [r4]
adds r2, 0xA
adds r0, r1, r2
strh r7, [r0]
ldr r0, =0x00000ca9
adds r1, r0
ldrb r2, [r1]
movs r0, 0x5
negs r0, r0
ands r0, r2
strb r0, [r1]
ldr r1, [r4]
ldr r2, =0x00000ca9
adds r1, r2
ldrb r2, [r1]
movs r0, 0x9
negs r0, r0
ands r0, r2
strb r0, [r1]
bl sub_81A3ACC
ldr r4, [r4]
ldr r0, =0x00000cdc
adds r3, r4, r0
ldr r2, =gUnknown_085DF9AC
lsls r1, r5, 2
lsls r0, r6, 3
adds r1, r0
adds r1, r2
ldr r0, [r3]
ldr r1, [r1]
ands r0, r1
cmp r0, 0
bne _0816200E
lsls r0, r5, 1
lsls r1, r6, 2
adds r0, r1
movs r2, 0xCE
lsls r2, 4
adds r1, r4, r2
adds r1, r0
strh r7, [r1]
_0816200E:
bl sub_8164ED8
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
movs r1, 0x4
ldrsb r1, [r0, r1]
movs r2, 0x5
ldrsb r2, [r0, r2]
movs r3, 0x1
negs r3, r3
movs r0, 0
bl saved_warp2_set
ldr r0, =gTrainerBattleOpponent_A
strh r7, [r0]
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_8161F94
thumb_func_start sub_8162054
sub_8162054: @ 8162054
push {r4-r6,lr}
ldr r5, =gSaveBlock2Ptr
ldr r0, [r5]
ldr r4, =0x00000ca9
adds r0, r4
ldrb r0, [r0]
lsls r0, 30
lsrs r6, r0, 30
ldr r0, =0x000040ce
bl VarGet
lsls r0, 16
lsrs r1, r0, 16
ldr r0, =gSpecialVar_0x8005
ldrh r0, [r0]
cmp r0, 0x1
beq _08162094
cmp r0, 0x1
ble _081620E8
cmp r0, 0x2
beq _081620A8
cmp r0, 0x3
beq _081620D8
b _081620E8
.pool
_08162094:
adds r0, r6, 0
lsls r1, 24
lsrs r1, 24
bl sub_8164FCC
ldr r1, =gSpecialVar_Result
strh r0, [r1]
b _081620E8
.pool
_081620A8:
ldr r4, =gSpecialVar_Result
ldr r2, [r5]
ldr r0, =0x00000cdc
adds r2, r0
ldr r3, =gUnknown_085DF9AC
lsls r0, r6, 2
lsls r1, 3
adds r0, r1
adds r0, r3
ldr r1, [r2]
ldr r0, [r0]
ands r1, r0
negs r0, r1
orrs r0, r1
lsrs r0, 31
strh r0, [r4]
b _081620E8
.pool
_081620D8:
ldr r1, [r5]
adds r0, r1, r4
ldrb r0, [r0]
lsls r0, 30
lsrs r0, 30
ldr r2, =0x00000d07
adds r1, r2
strb r0, [r1]
_081620E8:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_8162054
thumb_func_start sub_81620F4
sub_81620F4: @ 81620F4
push {r4-r7,lr}
ldr r6, =gSaveBlock2Ptr
ldr r0, [r6]
ldr r7, =0x00000ca9
adds r0, r7
ldrb r0, [r0]
lsls r0, 30
lsrs r5, r0, 30
ldr r0, =0x000040ce
bl VarGet
lsls r0, 16
lsrs r4, r0, 16
ldr r0, =gSpecialVar_0x8005
ldrh r0, [r0]
cmp r0, 0x1
beq _08162134
cmp r0, 0x1
ble _081621B4
cmp r0, 0x2
beq _08162150
cmp r0, 0x3
beq _081621A4
b _081621B4
.pool
_08162134:
ldr r2, [r6]
lsls r0, r5, 1
lsls r1, r4, 2
adds r0, r1
movs r1, 0xCE
lsls r1, 4
adds r2, r1
adds r2, r0
ldr r0, =gSpecialVar_0x8006
ldrh r0, [r0]
strh r0, [r2]
b _081621B4
.pool
_08162150:
ldr r0, =gSpecialVar_0x8006
ldrh r0, [r0]
cmp r0, 0
beq _08162180
ldr r2, [r6]
ldr r0, =0x00000cdc
adds r2, r0
ldr r3, =gUnknown_085DF9AC
lsls r1, r5, 2
lsls r0, r4, 3
adds r1, r0
adds r1, r3
ldr r0, [r2]
ldr r1, [r1]
orrs r0, r1
str r0, [r2]
b _081621B4
.pool
_08162180:
ldr r2, [r6]
ldr r1, =0x00000cdc
adds r2, r1
ldr r3, =gUnknown_085DF9CC
lsls r1, r5, 2
lsls r0, r4, 3
adds r1, r0
adds r1, r3
ldr r0, [r2]
ldr r1, [r1]
ands r0, r1
str r0, [r2]
b _081621B4
.pool
_081621A4:
ldr r1, [r6]
adds r0, r1, r7
ldrb r0, [r0]
lsls r0, 30
lsrs r0, 30
ldr r2, =0x00000d07
adds r1, r2
strb r0, [r1]
_081621B4:
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_81620F4
thumb_func_start sub_81621C0
sub_81621C0: @ 81621C0

View File

@ -212,6 +212,7 @@ SECTIONS {
src/fldeff_softboiled.o(.text);
src/decoration_inventory.o(.text);
src/roamer.o(.text);
src/battle_tower.o(.text);
asm/battle_tower.o(.text);
src/use_pokeblock.o(.text);
asm/use_pokeblock.o(.text);
@ -265,8 +266,8 @@ SECTIONS {
src/berry_fix_program.o(.text);
src/pokemon_summary_screen.o(.text);
src/unk_pokedex_area_screen_helper.o(.text);
src/battle_pyramid.o(.text);
asm/battle_pyramid.o(.text);
src/battle_pyramid_bag.o(.text);
asm/battle_pyramid_bag.o(.text);
asm/pokenav.o(.text);
src/match_call.o(.text);
asm/pokenav.o(.text.after.match.call);
@ -544,7 +545,7 @@ SECTIONS {
src/berry_fix_program.o(.rodata);
src/pokemon_summary_screen.o(.rodata);
src/unk_pokedex_area_screen_helper.o(.rodata);
data/battle_pyramid.o(.rodata);
data/battle_pyramid_bag.o(.rodata);
data/pokenav.o(.rodata);
src/match_call.o(.rodata);
data/pokenav.o(.rodata.after.match.call);

85
src/battle_tower.c Normal file
View File

@ -0,0 +1,85 @@
#include "global.h"
#include "event_data.h"
#include "battle_setup.h"
#include "overworld.h"
#include "random.h"
#include "battle_tower.h"
extern void sub_81A3ACC(void);
extern const u32 gUnknown_085DF9AC[][2];
extern const u32 gUnknown_085DF9CC[][2];
extern void (* const gUnknown_085DF96C[])(void);
// This file's functions.
void sub_8164ED8(void);
u16 sub_8164FCC(u8, u8);
// code
void sub_8161F74(void)
{
gUnknown_085DF96C[gSpecialVar_0x8004]();
}
void sub_8161F94(void)
{
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
gSaveBlock2Ptr->frontier.field_CA8 = 1;
gSaveBlock2Ptr->frontier.field_CB2 = 0;
gSaveBlock2Ptr->frontier.field_CA9_a = 0;
gSaveBlock2Ptr->frontier.field_CA9_b = 0;
sub_81A3ACC();
if (!(gSaveBlock2Ptr->frontier.field_CDC & gUnknown_085DF9AC[battleMode][lvlMode]))
gSaveBlock2Ptr->frontier.field_CE0[battleMode][lvlMode] = 0;
sub_8164ED8();
saved_warp2_set(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
gTrainerBattleOpponent_A = 0;
}
void sub_8162054(void)
{
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
switch (gSpecialVar_0x8005)
{
case 0:
break;
case 1:
gSpecialVar_Result = sub_8164FCC(lvlMode, battleMode);
break;
case 2:
gSpecialVar_Result = ((gSaveBlock2Ptr->frontier.field_CDC & gUnknown_085DF9AC[battleMode][lvlMode]) != 0);
break;
case 3:
gSaveBlock2Ptr->frontier.field_D07 = gSaveBlock2Ptr->frontier.lvlMode;
break;
}
}
void sub_81620F4(void)
{
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
switch (gSpecialVar_0x8005)
{
case 0:
break;
case 1:
gSaveBlock2Ptr->frontier.field_CE0[battleMode][lvlMode] = gSpecialVar_0x8006;
break;
case 2:
if (gSpecialVar_0x8006)
gSaveBlock2Ptr->frontier.field_CDC |= gUnknown_085DF9AC[battleMode][lvlMode];
else
gSaveBlock2Ptr->frontier.field_CDC &= gUnknown_085DF9CC[battleMode][lvlMode];
break;
case 3:
gSaveBlock2Ptr->frontier.field_D07 = gSaveBlock2Ptr->frontier.lvlMode;
break;
}
}

View File

@ -729,7 +729,7 @@ gUnknown_0203CF00: @ 203CF00
.include "src/fldeff_groundshake.o"
.include "src/pokemon_summary_screen.o"
.include "src/unk_pokedex_area_screen_helper.o"
.include "src/battle_pyramid.o"
.include "src/battle_pyramid_bag.o"
gUnknown_0203CF3C: @ 203CF3C
.space 0x4