new game fully decompiled
This commit is contained in:
@@ -1,49 +0,0 @@
|
|||||||
.include "asm/macros.inc"
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
thumb_func_start ResetMiniGamesResults
|
|
||||||
ResetMiniGamesResults: @ 80845CC
|
|
||||||
push {r4-r6,lr}
|
|
||||||
sub sp, 0x4
|
|
||||||
mov r0, sp
|
|
||||||
movs r5, 0
|
|
||||||
strh r5, [r0]
|
|
||||||
ldr r4, =gSaveBlock2Ptr
|
|
||||||
ldr r1, [r4]
|
|
||||||
movs r0, 0xF6
|
|
||||||
lsls r0, 1
|
|
||||||
adds r1, r0
|
|
||||||
ldr r6, =0x01000008
|
|
||||||
mov r0, sp
|
|
||||||
adds r2, r6, 0
|
|
||||||
bl CpuSet
|
|
||||||
ldr r0, [r4]
|
|
||||||
movs r1, 0xFA
|
|
||||||
lsls r1, 1
|
|
||||||
adds r0, r1
|
|
||||||
movs r1, 0
|
|
||||||
bl SetBerryPowder
|
|
||||||
bl ResetPokeJumpResults
|
|
||||||
mov r0, sp
|
|
||||||
adds r0, 0x2
|
|
||||||
strh r5, [r0]
|
|
||||||
ldr r1, [r4]
|
|
||||||
movs r2, 0x83
|
|
||||||
lsls r2, 2
|
|
||||||
adds r1, r2
|
|
||||||
adds r2, r6, 0
|
|
||||||
bl CpuSet
|
|
||||||
add sp, 0x4
|
|
||||||
pop {r4-r6}
|
|
||||||
pop {r0}
|
|
||||||
bx r0
|
|
||||||
.pool
|
|
||||||
thumb_func_end ResetMiniGamesResults
|
|
||||||
|
|
||||||
.align 2, 0 @ Don't pad with nop.
|
|
||||||
+19
-7
@@ -124,7 +124,14 @@ struct BerryPickingResults // possibly used in the game itself? Size may be wron
|
|||||||
u32 bestScore;
|
u32 bestScore;
|
||||||
u16 berriesPicked;
|
u16 berriesPicked;
|
||||||
u16 berriesPickedInRow;
|
u16 berriesPickedInRow;
|
||||||
// unk size
|
u8 field_8;
|
||||||
|
u8 field_9;
|
||||||
|
u8 field_A;
|
||||||
|
u8 field_B;
|
||||||
|
u8 field_C;
|
||||||
|
u8 field_D;
|
||||||
|
u8 field_E;
|
||||||
|
u8 field_F;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PyramidBag
|
struct PyramidBag
|
||||||
@@ -134,6 +141,13 @@ struct PyramidBag
|
|||||||
u8 quantity[10];
|
u8 quantity[10];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct BerryCrush
|
||||||
|
{
|
||||||
|
u16 berryCrushResults[4];
|
||||||
|
u32 berryPowderAmount;
|
||||||
|
u32 unk;
|
||||||
|
};
|
||||||
|
|
||||||
struct SaveBlock2
|
struct SaveBlock2
|
||||||
{
|
{
|
||||||
/*0x00*/ u8 playerName[8];
|
/*0x00*/ u8 playerName[8];
|
||||||
@@ -160,12 +174,10 @@ struct SaveBlock2
|
|||||||
|
|
||||||
// TODO: fix and verify labels
|
// TODO: fix and verify labels
|
||||||
/*0xB0*/ u8 field_B0[316];
|
/*0xB0*/ u8 field_B0[316];
|
||||||
/*0x1EC*/ u16 berryCrushResults[4];
|
/*0x1EC*/ struct BerryCrush berryCrush;
|
||||||
/*0x1F4*/ u32 berryPowderAmount;
|
/*0x1FC*/ struct PokemonJumpResults pokeJump;
|
||||||
/*0x1F8*/ u32 field_1F8;
|
/*0x20C*/ struct BerryPickingResults berryPick;
|
||||||
/*0x1FC*/ struct PokemonJumpResults pokeJumpResults;
|
/*0x214*/ u8 field_214[1032];
|
||||||
/*0x20C*/ struct BerryPickingResults berryPickResults;
|
|
||||||
/*0x214*/ u8 field_214[1040];
|
|
||||||
/*0x624*/ u16 contestLinkResults[20]; // 4 positions for 5 categories, possibly a struct or a 2d array
|
/*0x624*/ u16 contestLinkResults[20]; // 4 positions for 5 categories, possibly a struct or a 2d array
|
||||||
|
|
||||||
// All below could be a one giant struct
|
// All below could be a one giant struct
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ SECTIONS {
|
|||||||
asm/berry_blender.o(.text);
|
asm/berry_blender.o(.text);
|
||||||
src/play_time.o(.text);
|
src/play_time.o(.text);
|
||||||
src/new_game.o(.text);
|
src/new_game.o(.text);
|
||||||
asm/new_game.o(.text);
|
|
||||||
asm/rom4.o(.text);
|
asm/rom4.o(.text);
|
||||||
asm/fieldmap.o(.text);
|
asm/fieldmap.o(.text);
|
||||||
asm/metatile_behavior.o(.text);
|
asm/metatile_behavior.o(.text);
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "battle.h"
|
#include "battle.h"
|
||||||
|
#include "battle_move_effects.h"
|
||||||
|
#include "moves.h"
|
||||||
|
#include "abilities.h"
|
||||||
|
#include "item.h"
|
||||||
|
#include "items.h"
|
||||||
|
#include "hold_effects.h"
|
||||||
|
|
||||||
void atk00_attackcanceler(void);
|
void atk00_attackcanceler(void);
|
||||||
void atk01_accuracycheck(void);
|
void atk01_accuracycheck(void);
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ extern void sub_801AFD8(void);
|
|||||||
extern void sub_800E5AC(void);
|
extern void sub_800E5AC(void);
|
||||||
extern void sub_81D54BC(void);
|
extern void sub_81D54BC(void);
|
||||||
extern void ResetContestLinkResults(void);
|
extern void ResetContestLinkResults(void);
|
||||||
|
extern void ResetPokeJumpResults(void);
|
||||||
|
extern void SetBerryPowder(u32* powder, u32 newValue);
|
||||||
|
|
||||||
extern u8 gUnknown_082715DE[];
|
extern u8 gUnknown_082715DE[];
|
||||||
|
|
||||||
@@ -204,3 +206,11 @@ void NewGameInitData(void)
|
|||||||
sub_81D54BC();
|
sub_81D54BC();
|
||||||
ResetContestLinkResults();
|
ResetContestLinkResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResetMiniGamesResults(void)
|
||||||
|
{
|
||||||
|
CpuFill16(0, &gSaveBlock2Ptr->berryCrush, sizeof(struct BerryCrush));
|
||||||
|
SetBerryPowder(&gSaveBlock2Ptr->berryCrush.berryPowderAmount, 0);
|
||||||
|
ResetPokeJumpResults();
|
||||||
|
CpuFill16(0, &gSaveBlock2Ptr->berryPick, sizeof(struct BerryPickingResults));
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user