mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
rom_81700F8
This commit is contained in:
parent
78009a835f
commit
54c8580d34
@ -1,64 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81700F8
|
||||
sub_81700F8: @ 81700F8
|
||||
push {r4,r5,lr}
|
||||
ldr r5, =0x04000208
|
||||
ldrh r4, [r5]
|
||||
movs r0, 0
|
||||
strh r0, [r5]
|
||||
movs r0, 0x1
|
||||
bl RegisterRamReset
|
||||
movs r0, 0
|
||||
movs r1, 0x80
|
||||
bl ClearGpuRegBits
|
||||
strh r4, [r5]
|
||||
ldr r1, =gMain
|
||||
ldr r0, =0x00000439
|
||||
adds r1, r0
|
||||
ldrb r2, [r1]
|
||||
movs r0, 0x3
|
||||
negs r0, r0
|
||||
ands r0, r2
|
||||
strb r0, [r1]
|
||||
bl sub_815355C
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl SetSaveBlocksPointers
|
||||
bl sub_808447C
|
||||
bl ResetSaveCounters
|
||||
movs r0, 0
|
||||
bl sub_81534D0
|
||||
ldr r0, =gSaveFileStatus
|
||||
ldrh r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _08170148
|
||||
cmp r0, 0x2
|
||||
bne _0817014C
|
||||
_08170148:
|
||||
bl Sav2_ClearSetDefault
|
||||
_0817014C:
|
||||
ldr r0, =gSaveBlock2Ptr
|
||||
ldr r0, [r0]
|
||||
ldrb r0, [r0, 0x15]
|
||||
lsls r0, 31
|
||||
lsrs r0, 31
|
||||
bl SetPokemonCryStereo
|
||||
ldr r0, =0x02000000
|
||||
movs r1, 0xE0
|
||||
lsls r1, 9
|
||||
bl InitHeap
|
||||
ldr r0, =sub_8086230
|
||||
bl SetMainCallback2
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81700F8
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
15
include/gpu_regs.h
Normal file
15
include/gpu_regs.h
Normal file
@ -0,0 +1,15 @@
|
||||
//
|
||||
// Created by scott on 9/15/2017.
|
||||
//
|
||||
|
||||
#ifndef POKEEMERALD_GPU_REGS_H
|
||||
#define POKEEMERALD_GPU_REGS_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
void ClearGpuRegBits(u8 regOffset, u16 mask);
|
||||
|
||||
#endif //POKEEMERALD_GPU_REGS_H
|
@ -18,5 +18,6 @@ void SaveSerializedGame(void);
|
||||
void LoadSerializedGame(void);
|
||||
void LoadPlayerBag(void);
|
||||
void SavePlayerBag(void);
|
||||
void SetSaveBlocksPointers(u16);
|
||||
|
||||
#endif // GUARD_LOAD_SAVE_H
|
||||
|
@ -1,8 +1,11 @@
|
||||
#ifndef GUARD_MALLOC_H
|
||||
#define GUARD_MALLOC_H
|
||||
|
||||
extern u8 gHeap[];
|
||||
|
||||
void *Alloc(u32 size);
|
||||
void *AllocZeroed(u32 size);
|
||||
void Free(void *pointer);
|
||||
void InitHeap(void *pointer, u32 size);
|
||||
|
||||
#endif // GUARD_MALLOC_H
|
||||
|
@ -9,5 +9,7 @@ void ClearPokedexFlags(void);
|
||||
void WarpToTruck(void);
|
||||
void NewGameInitData(void);
|
||||
void ResetMiniGamesResults(void);
|
||||
void sub_808447C(void);
|
||||
void Sav2_ClearSetDefault(void);
|
||||
|
||||
#endif // GUARD_NEW_GAME_H
|
||||
|
15
include/rom4.h
Normal file
15
include/rom4.h
Normal file
@ -0,0 +1,15 @@
|
||||
//
|
||||
// Created by scott on 9/15/2017.
|
||||
//
|
||||
|
||||
#ifndef POKEEMERALD_ROM4_H
|
||||
#define POKEEMERALD_ROM4_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
void sub_8086230(void);
|
||||
|
||||
#endif //POKEEMERALD_ROM4_H
|
@ -1,6 +1,8 @@
|
||||
#ifndef GUARD_SAVE_H
|
||||
#define GUARD_SAVE_H
|
||||
|
||||
extern u16 gSaveFileStatus;
|
||||
|
||||
struct SaveSectionLocation
|
||||
{
|
||||
void *data;
|
||||
@ -88,5 +90,7 @@ u16 CalculateChecksum(void *, u16);
|
||||
//u8 unref_sub_8125FF0(u8 *data, u16 size);
|
||||
//u8 unref_sub_8126068(u8 sector, u8 *data, u32 size);
|
||||
//u8 unref_sub_8126080(u8 sector, u8 *data);
|
||||
u16 sub_815355C(void);
|
||||
u8 sub_81534D0(u8);
|
||||
|
||||
#endif // GUARD_SAVE_H
|
||||
|
@ -206,7 +206,7 @@ SECTIONS {
|
||||
asm/battle_controller_wally.o(.text);
|
||||
asm/player_pc.o(.text);
|
||||
asm/intro.o(.text);
|
||||
asm/rom_81700F8.o(.text);
|
||||
src/rom_81700F8.o(.text);
|
||||
asm/field_region_map.o(.text);
|
||||
asm/battle_anim_8170478.o(.text);
|
||||
asm/hall_of_fame.o(.text);
|
||||
|
32
src/rom_81700F8.c
Normal file
32
src/rom_81700F8.c
Normal file
@ -0,0 +1,32 @@
|
||||
#include "global.h"
|
||||
#include "main.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "m4a.h"
|
||||
#include "load_save.h"
|
||||
#include "save.h"
|
||||
#include "new_game.h"
|
||||
#include "rom4.h"
|
||||
#include "malloc.h"
|
||||
|
||||
void sub_81700F8(void)
|
||||
{
|
||||
u16 imeBackup;
|
||||
|
||||
imeBackup = REG_IME;
|
||||
REG_IME = 0;
|
||||
RegisterRamReset(0x00000001);
|
||||
ClearGpuRegBits(REG_OFFSET_DISPCNT, 0x80);
|
||||
REG_IME = imeBackup;
|
||||
gMain.inBattle = FALSE;
|
||||
SetSaveBlocksPointers(sub_815355C());
|
||||
sub_808447C();
|
||||
ResetSaveCounters();
|
||||
sub_81534D0(0);
|
||||
if (gSaveFileStatus == 0 || gSaveFileStatus == 2)
|
||||
{
|
||||
Sav2_ClearSetDefault();
|
||||
}
|
||||
SetPokemonCryStereo(gSaveBlock2Ptr->optionsSound);
|
||||
InitHeap(gHeap, 0x1c000);
|
||||
SetMainCallback2(sub_8086230);
|
||||
}
|
Loading…
Reference in New Issue
Block a user