Decompile sub_803037C

This commit is contained in:
Marijn van der Werf 2017-05-08 22:06:49 +02:00 committed by YamaArashi
parent 3cc8c20445
commit 00c64ddd66
5 changed files with 75 additions and 107 deletions

View File

@ -3673,104 +3673,7 @@ _08030378:
bx r0
thumb_func_end dp01t_11_1_message_for_player_only
thumb_func_start sub_803037C
sub_803037C: @ 803037C
push {r4,lr}
sub sp, 0x8
ldr r1, _08030434 @ =gUnknown_030042A4
movs r0, 0
strh r0, [r1]
ldr r1, _08030438 @ =gUnknown_030042A0
movs r0, 0xA0
strh r0, [r1]
ldr r4, _0803043C @ =gUnknown_03004210
movs r0, 0x1B
str r0, [sp]
movs r0, 0x12
str r0, [sp, 0x4]
adds r0, r4, 0
movs r1, 0xA
movs r2, 0x2
movs r3, 0xF
bl FillWindowRect
movs r0, 0x10
str r0, [sp]
movs r0, 0x26
str r0, [sp, 0x4]
adds r0, r4, 0
movs r1, 0xA
movs r2, 0x2
movs r3, 0x23
bl FillWindowRect
ldr r1, _08030440 @ =gUnknown_03004330
ldr r0, _08030444 @ =gUnknown_02024A60
ldrb r0, [r0]
lsls r0, 2
adds r0, r1
ldr r1, _08030448 @ =sub_802C098
str r1, [r0]
ldr r1, _0803044C @ =gUnknown_08400CF3
movs r2, 0xC8
lsls r2, 1
movs r0, 0x23
str r0, [sp]
adds r0, r4, 0
movs r3, 0x12
bl InitWindow
adds r0, r4, 0
bl sub_8002F44
ldr r1, _08030450 @ =0x0000ffff
ldr r3, _08030454 @ =0x00002d9f
movs r0, 0
str r0, [sp]
movs r2, 0xC
bl sub_814A5C0
movs r4, 0
_080303EC:
lsls r0, r4, 24
lsrs r0, 24
bl nullsub_8
adds r4, 0x1
cmp r4, 0x3
ble _080303EC
ldr r1, _08030458 @ =gUnknown_02024E60
ldr r0, _08030444 @ =gUnknown_02024A60
ldrb r0, [r0]
adds r0, r1
ldrb r0, [r0]
movs r1, 0
bl sub_802E3E4
ldr r0, _0803045C @ =gUnknown_08400CA8
bl get_battle_strings_
ldr r4, _0803043C @ =gUnknown_03004210
ldr r1, _08030460 @ =gUnknown_020238CC
movs r2, 0xDC
lsls r2, 1
movs r0, 0x23
str r0, [sp]
adds r0, r4, 0
movs r3, 0x2
bl InitWindow
adds r0, r4, 0
bl sub_8002F44
add sp, 0x8
pop {r4}
pop {r0}
bx r0
.align 2, 0
_08030434: .4byte gUnknown_030042A4
_08030438: .4byte gUnknown_030042A0
_0803043C: .4byte gUnknown_03004210
_08030440: .4byte gUnknown_03004330
_08030444: .4byte gUnknown_02024A60
_08030448: .4byte sub_802C098
_0803044C: .4byte gUnknown_08400CF3
_08030450: .4byte 0x0000ffff
_08030454: .4byte 0x00002d9f
_08030458: .4byte gUnknown_02024E60
_0803045C: .4byte gUnknown_08400CA8
_08030460: .4byte gUnknown_020238CC
thumb_func_end sub_803037C
.section .text_8030464
thumb_func_start nullsub_42
nullsub_42: @ 8030464

View File

@ -10,20 +10,23 @@ void sub_80157C4(u8 index);
u8 sub_8015A98(u8, u8, u8);
u8 sub_8018324(u8, u8, u8, u8, u16);
// asm/battle_5.o
void sub_802C098();
void sub_802E3E4(u8, int);
void nullsub_8(u8);
// asm/battle_7.o
void sub_8032AA8(u8 index, int i);
// src/pokemon_3.o
u16 SpeciesToNationalPokedexNum(u16);
// asm/pokemon_3.o
void DrawSpindaSpots(u16, u32, u8 *, u8);
u8 sub_803FC58(u16);
void AdjustFriendship(struct Pokemon *, u8);
void sub_80408BC();
void current_map_music_set__default_for_battle(u16);
// asm/util.o
// src/util.o
void StoreWordInTwoHalfwords(u16 *, u32);
void LoadWordFromTwoHalfwords(u16 *, u32 *);
@ -157,7 +160,7 @@ void sub_806FA18(u8 taskId);
// src/party_menu.o
void sub_806E834();
// asm/rom_8077ABC.o
// src/rom_8077ABC.o
u8 battle_side_get_owner(u8);
u8 battle_get_per_side_status(u8);
u8 battle_get_side_with_given_state(u8);
@ -211,6 +214,9 @@ void sub_8089A70(void);
void sub_808A004();
void sub_808AB90(void);
// asm/rom_8094928.o
u8 pokemon_order_func(u8);
// asm/pokemon_storage_system.o
void sub_80961D8(void);
@ -354,7 +360,7 @@ s16 sub_810CAE4(u8, struct Pokeblock *);
// asm/fldeff_flash.o
void sub_810CC80(void);
// asm/time_events.o
// src/time_events.o
u8 IsMirageIslandPresent(void);
// asm/field_specials.o
@ -374,6 +380,10 @@ void sub_811AABC(u8);
void sub_811AAD8(u8);
u8 sub_811AAE8(void);
// asm/battle_message.o
void get_battle_strings_(u8 *);
void sub_8120FFC(const u8 *, u8 *);
// src/mystery_event_script.o
u32 sub_812613C(u8 *);
void sub_8126160(u8);

View File

@ -56,6 +56,8 @@ SECTIONS {
asm/battle_4.o(.text);
asm/battle_5.o(.text);
asm/battle_6.o(.text);
src/battle_6.o(.text);
asm/battle_6.o(.text_8030464);
asm/battle_7.o(.text);
asm/battle_8.o(.text);
asm/battle_9.o(.text);

57
src/battle_6.c Normal file
View File

@ -0,0 +1,57 @@
#include "global.h"
#include "asm.h"
#include "menu_cursor.h"
#include "text.h"
extern u16 gUnknown_030042A4;
extern u16 gUnknown_030042A0;
extern struct Window gUnknown_03004210;
extern void (*gUnknown_03004330[])(void);
extern u8 gUnknown_02024A60;
extern u8 gUnknown_02024E60[];
extern u8 gUnknown_020238CC[];
extern u16 gUnknown_030042C0;
extern u16 gUnknown_030041B4;
extern u16 gUnknown_03004288;
extern u16 gUnknown_03004280;
extern u16 gUnknown_030041B0;
extern u16 gUnknown_030041B8;
extern const u8 gUnknown_08400CA8[];
extern const u8 gUnknown_08400CF3[];
#if ENGLISH
#define SUB_803037C_TILE_DATA_OFFSET 440
#elif GERMAN
#define SUB_803037C_TILE_DATA_OFFSET 444
#endif
void sub_803037C(void) {
int r4;
gUnknown_030042A4 = 0;
gUnknown_030042A0 = 160;
FillWindowRect(&gUnknown_03004210, 10, 2, 15, 27, 18);
FillWindowRect(&gUnknown_03004210, 10, 2, 35, 16, 38);
gUnknown_03004330[gUnknown_02024A60] = sub_802C098;
InitWindow(&gUnknown_03004210, gUnknown_08400CF3, 400, 18, 35);
sub_8002F44(&gUnknown_03004210);
sub_814A5C0(0, 0xFFFF, 12, 11679, 0);
for (r4 = 0; r4 < 4; r4++)
{
nullsub_8(r4);
}
sub_802E3E4(gUnknown_02024E60[gUnknown_02024A60], 0);
get_battle_strings_((u8 *) gUnknown_08400CA8);
InitWindow(&gUnknown_03004210, gUnknown_020238CC, SUB_803037C_TILE_DATA_OFFSET, 2, 35);
sub_8002F44(&gUnknown_03004210);
}

View File

@ -53,10 +53,6 @@ struct SpindaSpot
u16 image[16];
};
extern void get_battle_strings_(u8 *);
extern void sub_8120FFC(const u8 *, u8 *);
extern u8 pokemon_order_func(u8);
extern u8 gPlayerPartyCount;
extern struct Pokemon gPlayerParty[6];
extern u8 gEnemyPartyCount;