mirror of
https://github.com/pmret/papermario.git
synced 2024-11-18 00:42:34 +01:00
Merge 4DF30 into battle/battle (#309)
* merge 4DF30 into battle/battle * nomatching load_battle * oops
This commit is contained in:
parent
da6fd773bb
commit
31b0c3f685
60
src/4DF30.c
60
src/4DF30.c
@ -1,60 +0,0 @@
|
||||
#include "common.h"
|
||||
#include "battle/battle.h"
|
||||
|
||||
extern s32 D_800DC060;
|
||||
extern Stage* D_800DC064;
|
||||
|
||||
INCLUDE_ASM(s32, "4DF30", reset_battle_status);
|
||||
|
||||
void ALT_reset_battle_status(void) {
|
||||
reset_battle_status();
|
||||
}
|
||||
|
||||
void func_80072BCC(s32 arg0) {
|
||||
gBattleStatus.unk_488 = arg0;
|
||||
}
|
||||
|
||||
//weird stuff with loading gBattleStatus
|
||||
#ifdef NON_MATCHING
|
||||
void load_battle_section(void) {
|
||||
BattleArea* battleArea;
|
||||
s32 temp_a0;
|
||||
|
||||
battleArea = &gBattleAreas[gBattleStatus.currentBattleSection];
|
||||
dma_copy(battleArea->dmaStart, battleArea->dmaEnd, battleArea->dmaDest);
|
||||
|
||||
gBattleStatus.unk_48C = &(*battleArea->battles)[gBattleStatus.unk_47B];
|
||||
|
||||
if (gBattleStatus.unk_47C >= 0) {
|
||||
D_800DC064 = NULL;
|
||||
} else {
|
||||
D_800DC064 = &(*battleArea->stages)[gBattleStatus.unk_47C];
|
||||
}
|
||||
|
||||
btl_set_state(1);
|
||||
gBattleStatus.unk_460 = 0;
|
||||
}
|
||||
#else
|
||||
INCLUDE_ASM(s32, "4DF30", load_battle_section);
|
||||
#endif
|
||||
|
||||
INCLUDE_ASM(s32, "4DF30", load_battle);
|
||||
|
||||
void set_battle_stage(s32 arg0) {
|
||||
gBattleStatus.unk_47C = arg0;
|
||||
}
|
||||
|
||||
void set_battle_formation(s32 arg0) {
|
||||
gBattleStatus.unk_484 = arg0;
|
||||
}
|
||||
|
||||
void func_80072CEC(f32 arg0, f32 arg1, f32 arg2) {
|
||||
}
|
||||
|
||||
void func_80072CF4(void) {
|
||||
func_80072CEC(1.0f, 1.1f, 1.2f);
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "4DF30", setup_demo_player);
|
||||
|
||||
INCLUDE_ASM(s32, "4DF30", load_demo_battle);
|
@ -2,6 +2,9 @@
|
||||
#include "ld_addrs.h"
|
||||
#include "battle.h"
|
||||
|
||||
extern s32 D_800DC060;
|
||||
extern Stage* D_800DC064;
|
||||
|
||||
extern BattleList b_area_kmr_part_1_formationTable;
|
||||
extern StageList b_area_kmr_part_1_stageTable;
|
||||
|
||||
@ -274,3 +277,69 @@ BattleArea gBattleAreas[0x30] = {
|
||||
},
|
||||
{},
|
||||
};
|
||||
|
||||
INCLUDE_ASM(s32, "battle/battle", reset_battle_status);
|
||||
|
||||
void ALT_reset_battle_status(void) {
|
||||
reset_battle_status();
|
||||
}
|
||||
|
||||
void func_80072BCC(s32 arg0) {
|
||||
gBattleStatus.unk_488 = arg0;
|
||||
}
|
||||
|
||||
//weird stuff with loading gBattleStatus
|
||||
#ifdef NON_MATCHING
|
||||
void load_battle_section(void) {
|
||||
BattleArea* battleArea;
|
||||
s32 temp_a0;
|
||||
|
||||
battleArea = &gBattleAreas[gBattleStatus.currentBattleSection];
|
||||
dma_copy(battleArea->dmaStart, battleArea->dmaEnd, battleArea->dmaDest);
|
||||
|
||||
gBattleStatus.unk_48C = &(*battleArea->battles)[gBattleStatus.unk_47B];
|
||||
|
||||
if (gBattleStatus.unk_47C >= 0) {
|
||||
D_800DC064 = NULL;
|
||||
} else {
|
||||
D_800DC064 = &(*battleArea->stages)[gBattleStatus.unk_47C];
|
||||
}
|
||||
|
||||
btl_set_state(1);
|
||||
gBattleStatus.unk_460 = 0;
|
||||
}
|
||||
#else
|
||||
INCLUDE_ASM(s32, "battle/battle", load_battle_section);
|
||||
#endif
|
||||
|
||||
// gBattleStatus is possibly shorter than we think
|
||||
#ifdef NON_MATCHING
|
||||
void load_battle(s32 arg0) {
|
||||
gBattleStatus.unk_478 = arg0;
|
||||
set_game_mode(8);
|
||||
gBattleState = 0;
|
||||
gBattleStatus.unk_460 = 0;
|
||||
gBattleStatus.battleState = 0;
|
||||
}
|
||||
#else
|
||||
INCLUDE_ASM(s32, "battle/battle", load_battle);
|
||||
#endif
|
||||
|
||||
void set_battle_stage(s32 arg0) {
|
||||
gBattleStatus.unk_47C = arg0;
|
||||
}
|
||||
|
||||
void set_battle_formation(s32 arg0) {
|
||||
gBattleStatus.unk_484 = arg0;
|
||||
}
|
||||
|
||||
void func_80072CEC(f32 arg0, f32 arg1, f32 arg2) {
|
||||
}
|
||||
|
||||
void func_80072CF4(void) {
|
||||
func_80072CEC(1.0f, 1.1f, 1.2f);
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "battle/battle", setup_demo_player);
|
||||
|
||||
INCLUDE_ASM(s32, "battle/battle", load_demo_battle);
|
||||
|
@ -245,8 +245,7 @@ segments:
|
||||
- [0x4a1f0, c, os/4a1f0_len_170] # yay0 decompression - some or all is hand-written
|
||||
- [0x4a360, c, os/4a360_len_930] # osFlash* - IDO O2 -g
|
||||
- [0x4ac90, c, 4ac90_len_3910]
|
||||
- [0x4DF30, c, battle/battle] # DUMMY ROM location - not sure where it should go
|
||||
- [0x4DF30, c, 4DF30]
|
||||
- [0x4DF30, c, battle/battle]
|
||||
- [0x4E5A0, data, 1000_len_60]
|
||||
- [0x4F410, .data, 1370_len_7d0]
|
||||
- [0x4F420, .data, main_loop]
|
||||
@ -330,7 +329,6 @@ segments:
|
||||
- [0x75340, .rodata, os/491c0_len_f80]
|
||||
- [0x75540, .rodata, os/49C70]
|
||||
- [0x75640, .rodata, battle/battle]
|
||||
- [0x75978, .rodata, 4DF30]
|
||||
# bss starts at 0x8009A5B0
|
||||
# 0x800 of bss until...
|
||||
# - [0x75240, .bss, main_loop]
|
||||
|
Loading…
Reference in New Issue
Block a user