Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/RSBE01_02/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ modules:
hash: 4696ac66a14c7e023bbe4c47bd997055a3107138
splits: config/RSBE01_02/rels/st_battles/splits.txt
symbols: config/RSBE01_02/rels/st_battles/symbols.txt
force_active: [HomeBtnIcon]
force_active: [create__14stBattleFieldSFv, HomeBtnIcon]
- object: files/module/st_battle.rel
hash: 6c23a264cc9732f0f411a8b4611e647e27e3690c
splits: config/RSBE01_02/rels/st_battle/splits.txt
Expand Down
11 changes: 11 additions & 0 deletions config/RSBE01_02/rels/st_battles/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ global_destructor_chain.c:
.dtors start:0x00000000 end:0x00000008
.bss start:0x00000000 end:0x00000004

mo_stage/st_battles/st_battlefieldS.cpp:
.text start:0x00000070 end:0x00000618
.ctors start:0x00000000 end:0x00000004
.rodata start:0x00000000 end:0x00000008
.data start:0x00000000 end:0x000003C0
.bss start:0x00000008 end:0x00000018

mo_stage/st_battles/gr_battlefieldS.cpp:
.text start:0x00000618 end:0x000007D0
.data start:0x000003C0 end:0x00000640

mo_stage/mo_stage.cpp:
.text start:0x000007D0 end:0x0000086C
.data start:0x00000640 end:0x0000064D
Expand Down
148 changes: 74 additions & 74 deletions config/RSBE01_02/rels/st_battles/symbols.txt
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
__register_global_object = .text:0x00000000; // type:function size:0x1C scope:global
__destroy_global_chain = .text:0x0000001C; // type:function size:0x54 scope:global
fn_42_70 = .text:0x00000070; // type:function size:0x5C
fn_42_CC = .text:0x000000CC; // type:function size:0x6C
fn_42_138 = .text:0x00000138; // type:function size:0x8
fn_42_140 = .text:0x00000140; // type:function size:0x198
fn_42_2D8 = .text:0x000002D8; // type:function size:0x4
fn_42_2DC = .text:0x000002DC; // type:function size:0xE8
fn_42_3C4 = .text:0x000003C4; // type:function size:0x4
fn_42_3C8 = .text:0x000003C8; // type:function size:0x8
fn_42_3D0 = .text:0x000003D0; // type:function size:0x8
fn_42_3D8 = .text:0x000003D8; // type:function size:0x8
fn_42_3E0 = .text:0x000003E0; // type:function size:0x8
fn_42_3E8 = .text:0x000003E8; // type:function size:0x8
fn_42_3F0 = .text:0x000003F0; // type:function size:0x4
fn_42_3F4 = .text:0x000003F4; // type:function size:0x8
fn_42_3FC = .text:0x000003FC; // type:function size:0x8
fn_42_404 = .text:0x00000404; // type:function size:0x8
fn_42_40C = .text:0x0000040C; // type:function size:0xC
fn_42_418 = .text:0x00000418; // type:function size:0xC
fn_42_424 = .text:0x00000424; // type:function size:0x10
fn_42_434 = .text:0x00000434; // type:function size:0x14
fn_42_448 = .text:0x00000448; // type:function size:0x8
fn_42_450 = .text:0x00000450; // type:function size:0x8
fn_42_458 = .text:0x00000458; // type:function size:0x8
fn_42_460 = .text:0x00000460; // type:function size:0x8
fn_42_468 = .text:0x00000468; // type:function size:0x8
fn_42_470 = .text:0x00000470; // type:function size:0x4
fn_42_474 = .text:0x00000474; // type:function size:0x1C
fn_42_490 = .text:0x00000490; // type:function size:0x8
fn_42_498 = .text:0x00000498; // type:function size:0x8
fn_42_4A0 = .text:0x000004A0; // type:function size:0x8
fn_42_4A8 = .text:0x000004A8; // type:function size:0x8
fn_42_4B0 = .text:0x000004B0; // type:function size:0xC
fn_42_4BC = .text:0x000004BC; // type:function size:0x4
fn_42_4C0 = .text:0x000004C0; // type:function size:0x8
fn_42_4C8 = .text:0x000004C8; // type:function size:0x8
fn_42_4D0 = .text:0x000004D0; // type:function size:0x8
fn_42_4D8 = .text:0x000004D8; // type:function size:0x8
fn_42_4E0 = .text:0x000004E0; // type:function size:0x64
fn_42_544 = .text:0x00000544; // type:function size:0x74
fn_42_5B8 = .text:0x000005B8; // type:function size:0x5C
fn_42_614 = .text:0x00000614; // type:function size:0x4
fn_42_618 = .text:0x00000618; // type:function size:0xC4
fn_42_6DC = .text:0x000006DC; // type:function size:0x8
fn_42_6E4 = .text:0x000006E4; // type:function size:0x58
fn_42_73C = .text:0x0000073C; // type:function size:0x8
fn_42_744 = .text:0x00000744; // type:function size:0x8
fn_42_74C = .text:0x0000074C; // type:function size:0x4
fn_42_750 = .text:0x00000750; // type:function size:0x4
fn_42_754 = .text:0x00000754; // type:function size:0x10
fn_42_764 = .text:0x00000764; // type:function size:0x10
fn_42_774 = .text:0x00000774; // type:function size:0xC
fn_42_780 = .text:0x00000780; // type:function size:0x8
fn_42_788 = .text:0x00000788; // type:function size:0x4
fn_42_78C = .text:0x0000078C; // type:function size:0x8
fn_42_794 = .text:0x00000794; // type:function size:0x8
fn_42_79C = .text:0x0000079C; // type:function size:0x1C
fn_42_7B8 = .text:0x000007B8; // type:function size:0x8
fn_42_7C0 = .text:0x000007C0; // type:function size:0x8
fn_42_7C8 = .text:0x000007C8; // type:function size:0x8
create__14stBattleFieldSFv = .text:0x00000070; // type:function size:0x5C
__dt__14stBattleFieldSFv = .text:0x000000CC; // type:function size:0x6C
loading__14stBattleFieldSFv = .text:0x00000138; // type:function size:0x8
createObj__14stBattleFieldSFv = .text:0x00000140; // type:function size:0x198
update__14stBattleFieldSFf = .text:0x000002D8; // type:function size:0x4
updateError__14stBattleFieldSFv = .text:0x000002DC; // type:function size:0xE8
startFighterEvent__5StageFv = .text:0x000003C4; // type:function size:0x4
initializeFighterAttackRatio__5StageFv = .text:0x000003C8; // type:function size:0x8
helperStarWarp__5StageFv = .text:0x000003D0; // type:function size:0x8
isSimpleBossBattleMode__5StageFv = .text:0x000003D8; // type:function size:0x8
isBossBattleMode__5StageFv = .text:0x000003E0; // type:function size:0x8
isCameraLocked__5StageFv = .text:0x000003E8; // type:function size:0x8
notifyTimmingGameStart__5StageFv = .text:0x000003F0; // type:function size:0x4
getFrameRuleTime__5StageFv = .text:0x000003F4; // type:function size:0x8
setFrameRuleTime__5StageFf = .text:0x000003FC; // type:function size:0x8
isNextStepBgmEqualNowStepBgmFromFlag__5StageFv = .text:0x00000404; // type:function size:0x8
getBgmPlayOffsetFrame__5StageFv = .text:0x0000040C; // type:function size:0xC
getBgmVolume__5StageFv = .text:0x00000418; // type:function size:0xC
setBgmChange__5StageFfbUl = .text:0x00000424; // type:function size:0x10
getBgmChangeID__5StageFPUlPf = .text:0x00000434; // type:function size:0x14
isBgmChange__5StageFv = .text:0x00000448; // type:function size:0x8
getBgmOptionID__5StageFv = .text:0x00000450; // type:function size:0x8
getNowStepBgmID__5StageFv = .text:0x00000458; // type:function size:0x8
getBgmID__5StageFv = .text:0x00000460; // type:function size:0x8
getBgmID__5StageCFv = .text:0x00000468; // type:function size:0x8
appearanceFighterLocal__5StageFv = .text:0x00000470; // type:function size:0x4
getScrollDir__5StageFP5Vec3f = .text:0x00000474; // type:function size:0x1C
getDefaultLightSetIndex__5StageFv = .text:0x00000490; // type:function size:0x8
getAIRange__5StageFv = .text:0x00000498; // type:function size:0x8
isAdventureStage__5StageFv = .text:0x000004A0; // type:function size:0x8
getPokeTrainerDrawLayer__5StageFv = .text:0x000004A8; // type:function size:0x8
getPokeTrainerPositionZ__5StageFv = .text:0x000004B0; // type:function size:0xC
getPokeTrainerPointData__5StageFPii = .text:0x000004BC; // type:function size:0x4
getPokeTrainerPointNum__5StageFv = .text:0x000004C0; // type:function size:0x8
isReStartSamePoint__7stMeleeFv = .text:0x000004C8; // type:function size:0x8
getWind2ndOnlyData__7stMeleeFv = .text:0x000004D0; // type:function size:0x8
isBamperVector__14stBattleFieldSFv = .text:0x000004D8; // type:function size:0x8
__sinit_\st_battlefieldS_cpp = .text:0x000004E0; // type:function size:0x64
__dt__36stClassInfoImpl<65,14stBattleFieldS>Fv = .text:0x00000544; // type:function size:0x74
create__36stClassInfoImpl<65,14stBattleFieldS>Fv = .text:0x000005B8; // type:function size:0x5C
preload__36stClassInfoImpl<65,14stBattleFieldS>Fv = .text:0x00000614; // type:function size:0x4
create__14grBattleFieldSFiPCcPCc = .text:0x00000618; // type:function size:0xC4
setMdlIndex__6GroundFi = .text:0x000006DC; // type:function size:0x8
__dt__14grBattleFieldSFv = .text:0x000006E4; // type:function size:0x58
adventureEventGetItem__6GroundFiP13stTriggerData = .text:0x0000073C; // type:function size:0x8
getInitializeInfo__6GroundFi = .text:0x00000744; // type:function size:0x8
setInitializeInfo__6GroundFi = .text:0x0000074C; // type:function size:0x4
setInitializeFlag__6GroundFv = .text:0x00000750; // type:function size:0x4
disableCalcCollision__6GroundFv = .text:0x00000754; // type:function size:0x10
enableCalcCollision__6GroundFv = .text:0x00000764; // type:function size:0x10
isEnableCalcCollision__6GroundFv = .text:0x00000774; // type:function size:0xC
getMdlIndex__6GroundFv = .text:0x00000780; // type:function size:0x8
initStageData__6GroundFv = .text:0x00000788; // type:function size:0x4
getStageData__6GroundFv = .text:0x0000078C; // type:function size:0x8
setStageData__6GroundFPv = .text:0x00000794; // type:function size:0x8
getModelCount__6GroundFv = .text:0x0000079C; // type:function size:0x1C
getTransparencyFlag__9grGimmickFv = .text:0x000007B8; // type:function size:0x8
getGimmickData__9grGimmickFv = .text:0x000007C0; // type:function size:0x8
setGimmickData__9grGimmickFPv = .text:0x000007C8; // type:function size:0x8
_prolog = .text:0x000007D0; // type:function size:0x48 scope:global
_epilog = .text:0x00000818; // type:function size:0x48 scope:global
_unresolved = .text:0x00000860; // type:function size:0xC scope:global
Expand All @@ -70,42 +70,42 @@ lbl_42_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float
lbl_42_rodata_4 = .rodata:0x00000004; // type:object size:0x4 align:4 data:float
lbl_42_data_0 = .data:0x00000000; // type:object size:0x38
jumptable_42_data_38 = .data:0x00000038; // type:object size:0x2C scope:local
lbl_42_data_68 = .data:0x00000068; // type:object size:0x220
__vt__14stBattleFieldS = .data:0x00000068; // type:object size:0x220
lbl_42_data_288 = .data:0x00000288; // type:object size:0xF data:string
lbl_42_data_298 = .data:0x00000298; // type:object size:0x28
lbl_42_data_2C0 = .data:0x000002C0; // type:object size:0x8
__RTTI__14stBattleFieldS = .data:0x000002C0; // type:object size:0x8
lbl_42_data_2C8 = .data:0x000002C8; // type:object size:0x8 data:string
lbl_42_data_2D0 = .data:0x000002D0; // type:object size:0x20
lbl_42_data_2F0 = .data:0x000002F0; // type:object size:0x8
__RTTI__7stMelee = .data:0x000002F0; // type:object size:0x8
lbl_42_data_2F8 = .data:0x000002F8; // type:object size:0x10 data:string
lbl_42_data_308 = .data:0x00000308; // type:object size:0x18
lbl_42_data_320 = .data:0x00000320; // type:object size:0x8
__RTTI__15stCommonGimmick = .data:0x00000320; // type:object size:0x8
lbl_42_data_328 = .data:0x00000328; // type:object size:0x6 data:string
lbl_42_data_330 = .data:0x00000330; // type:object size:0x10
lbl_42_data_340 = .data:0x00000340; // type:object size:0x8
__RTTI__5Stage = .data:0x00000340; // type:object size:0x8
lbl_42_data_348 = .data:0x00000348; // type:object size:0x7 data:string
lbl_42_data_350 = .data:0x00000350; // type:object size:0x8
lbl_42_data_358 = .data:0x00000358; // type:object size:0x14
__RTTI__6gfTask = .data:0x00000350; // type:object size:0x8
__vt__36stClassInfoImpl<65,14stBattleFieldS> = .data:0x00000358; // type:object size:0x14
lbl_42_data_36C = .data:0x0000036C; // type:object size:0x24 data:string
lbl_42_data_390 = .data:0x00000390; // type:object size:0x10
lbl_42_data_3A0 = .data:0x000003A0; // type:object size:0x8
__RTTI__36stClassInfoImpl<65,14stBattleFieldS> = .data:0x000003A0; // type:object size:0x8
lbl_42_data_3A8 = .data:0x000003A8; // type:object size:0xC data:string
lbl_42_data_3B8 = .data:0x000003B8; // type:object size:0x8
lbl_42_data_3C0 = .data:0x000003C0; // type:object size:0x1C8
__RTTI__11stClassInfo = .data:0x000003B8; // type:object size:0x8
__vt__14grBattleFieldS = .data:0x000003C0; // type:object size:0x1C8
lbl_42_data_588 = .data:0x00000588; // type:object size:0xF data:string
lbl_42_data_598 = .data:0x00000598; // type:object size:0x28
lbl_42_data_5C0 = .data:0x000005C0; // type:object size:0x8
__RTTI__14grBattleFieldS = .data:0x000005C0; // type:object size:0x8
lbl_42_data_5C8 = .data:0x000005C8; // type:object size:0xB data:string
lbl_42_data_5D4 = .data:0x000005D4; // type:object size:0x1C
lbl_42_data_5F0 = .data:0x000005F0; // type:object size:0x8
__RTTI__10grYakumono = .data:0x000005F0; // type:object size:0x8
lbl_42_data_5F8 = .data:0x000005F8; // type:object size:0xA data:string
lbl_42_data_604 = .data:0x00000604; // type:object size:0x14
lbl_42_data_618 = .data:0x00000618; // type:object size:0x8
__RTTI__9grGimmick = .data:0x00000618; // type:object size:0x8
lbl_42_data_620 = .data:0x00000620; // type:object size:0x7 data:string
lbl_42_data_628 = .data:0x00000628; // type:object size:0x10
lbl_42_data_638 = .data:0x00000638; // type:object size:0x8
__RTTI__6Ground = .data:0x00000638; // type:object size:0x8
lbl_42_data_640 = .data:0x00000640; // type:object size:0xD scope:local align:4 data:string
HomeBtnIcon = .data:0x00000660; // type:object size:0x18C0 scope:global align:32
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
lbl_42_bss_8 = .bss:0x00000008; // type:object size:0xC
lbl_42_bss_14 = .bss:0x00000014; // type:object size:0x4 data:4byte
bss_loc_14__14stBattleFieldS = .bss:0x00000014; // type:object size:0x4 data:4byte
5 changes: 4 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,10 @@ def MatchingFor(*versions):
"mw_version": config.linker_version,
"cflags": cflags_rel,
"host": False,
"objects": [],
"objects": [
Object(Matching, "mo_stage/st_battles/st_battlefieldS.cpp"),
Object(Matching, "mo_stage/st_battles/gr_battlefieldS.cpp"),
],
},
{
"lib": "st_config",
Expand Down
15 changes: 15 additions & 0 deletions include/st_battles/gr_battlefieldS.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once

#include <gr/gr_yakumono.h>
#include <types.h>

class grBattleFieldS : public grYakumono {
public:
grBattleFieldS(const char* taskName) : grYakumono(taskName) {
setupMelee();
}
static grBattleFieldS* create(int mdlIndex, const char* tgtNodeName, const char* taskName);

virtual ~grBattleFieldS();
};
static_assert(sizeof(grBattleFieldS) == 0x150, "Class is wrong size!");
42 changes: 42 additions & 0 deletions include/st_battles/st_battlefieldS.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#pragma once

#include <gm/gm_lib.h>
#include <memory.h>
#include <st/st_class_info.h>
#include <st/st_melee.h>
#include <types.h>

template<typename T>
class stClassInfoImpl<Stages::BattleFieldS, T> : public stClassInfo {
public:
stClassInfoImpl() : stClassInfo() {
setClassInfo(Stages::BattleFieldS, this);
}

virtual ~stClassInfoImpl() {
setClassInfo(Stages::BattleFieldS, 0);
}

virtual T* create() {
return T::create();
}

virtual void preload() { }
};

class stBattleFieldS : public stMelee {
public:
stBattleFieldS();
static stBattleFieldS* create();

virtual ~stBattleFieldS();
virtual void createObj();
virtual bool loading();
virtual void update(float deltaFrame);
virtual bool isBamperVector() { return true; }

virtual void updateError();

static stClassInfoImpl<Stages::BattleFieldS, stBattleFieldS> bss_loc_14;
};
static_assert(sizeof(stBattleFieldS) == 0x1D8, "Class is wrong size!");
14 changes: 14 additions & 0 deletions src/mo_stage/st_battles/gr_battlefieldS.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <memory.h>

#include <st_battles/gr_battlefieldS.h>

grBattleFieldS* grBattleFieldS::create(int mdlIndex, const char* tgtNodeName, const char* taskName) {
grBattleFieldS* ground = new (Heaps::StageInstance) grBattleFieldS(taskName);
if (ground) {
ground->setMdlIndex(mdlIndex);
ground->setTgtNode(tgtNodeName);
}
return ground;
}

grBattleFieldS::~grBattleFieldS() { }
103 changes: 103 additions & 0 deletions src/mo_stage/st_battles/st_battlefieldS.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#include <gf/gf_archive.h>
#include <gf/gf_error_manager.h>
#include <gm/gm_global.h>
#include <gm/gm_lib.h>
#include <memory.h>
#include <nw4r/g3d/g3d_resfile.h>
#include <st/st_class_info.h>
#include <st/st_melee.h>
#include <st_battles/gr_battlefieldS.h>
#include <types.h>

#include <st_battles/st_battlefieldS.h>

stClassInfoImpl<Stages::BattleFieldS, stBattleFieldS> stBattleFieldS::bss_loc_14;

stBattleFieldS::stBattleFieldS() : stMelee("stBattleFieldS", Stages::Battle) { }

stBattleFieldS* stBattleFieldS::create() {
return new (Heaps::StageInstance) stBattleFieldS;
}

stBattleFieldS::~stBattleFieldS() {
releaseArchive();
}

bool stBattleFieldS::loading() {
return true;
}

void stBattleFieldS::createObj() {
testStageParamInit(m_fileData, 10);
testStageDataInit(m_fileData, 20, 1);
grBattleFieldS* ground = grBattleFieldS::create(1, "", "grBattleFieldMainBg");
if (ground) {
addGround(ground);
ground->startup(m_fileData, 0, gfSceneRoot::Layer_Ground);
createCollision(m_fileData, 2, nullptr);
initCameraParam();
void* posData = m_fileData->getData(Data_Type_Model, 100, 0xFFFE);
if (posData) {
nw4r::g3d::ResFile posFile(posData);
createStagePositions(&posFile);
} else {
createStagePositions();
}
createWind2ndOnly();
loadStageAttrParam(m_fileData, 30);
registScnAnim(static_cast<nw4r::g3d::ResFileData*>(m_fileData->getData(Data_Type_Scene, 0, 0xFFFE)), 0);
initPosPokeTrainer(1, 0);
createObjPokeTrainer(m_fileData, 101, "PokeTrainer00", m_pokeTrainerPos, nullptr);
}
}

void stBattleFieldS::update(float deltaFrame) { }

void stBattleFieldS::updateError() {
gmGlobalModeMelee* modeMelee = g_GameGlobal->m_modeMelee;
if (modeMelee) {
u32 errorCode = 0;
u32 reasonCode = 0;
switch (modeMelee->m_meleeInitData.m_0x81) {
case 201:
errorCode = 1;
break;
case 202:
errorCode = 2;
break;
case 203:
errorCode = 3;
break;
case 204:
errorCode = 4;
break;
case 205:
errorCode = 5;
break;
case 206:
errorCode = 6;
break;
case 207:
errorCode = 7;
break;
case 208:
errorCode = 8;
break;
case 209:
errorCode = 9;
reasonCode = 29000;
break;
case 210:
errorCode = 10;
reasonCode = 29001;
break;
case 211:
errorCode = 11;
reasonCode = 12345;
break;
}
if (errorCode != 0) {
gfErrorManager::getInstance()->notifyError(errorCode, reasonCode);
}
}
}