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
8 changes: 8 additions & 0 deletions config/RSBE01_02/rels/sora_enemy/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ global_destructor_chain.c:
.dtors start:0x00000000 end:0x00000008
.bss start:0x00000000 end:0x00000004

mo_enemy/sora_enemy/em_manager.cpp:
.text start:0x0000C6B0 end:0x0000D8D4
.data start:0x00001638 end:0x00001658
.bss start:0x00000030 end:0x00000038

mo_enemy/sora_enemy/em_archive.cpp:
.text start:0x0000D8D4 end:0x0000DB8C

mo_enemy/sora_enemy/em_info.cpp:
.text start:0x0000DB8C end:0x0000F8B8
.ctors start:0x00000004 end:0x00000008
Expand Down
76 changes: 38 additions & 38 deletions config/RSBE01_02/rels/sora_enemy/symbols.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
__register_global_object = .text:0x00000000; // type:function size:0x1C scope:global data:4byte
__destroy_global_chain = .text:0x0000001C; // type:function size:0x54 scope:global
fn_41_70 = .text:0x00000070; // type:function size:0x98
fn_41_108 = .text:0x00000108; // type:function size:0x80
fn_41_188 = .text:0x00000188; // type:function size:0x68
create__5EnemyFUlP8emCreate = .text:0x00000070; // type:function size:0x98
start__5EnemyFP5EnemyP8emCreate = .text:0x00000108; // type:function size:0x80
remove__5EnemyFP5Enemy = .text:0x00000188; // type:function size:0x68
fn_41_1F0 = .text:0x000001F0; // type:function size:0x1F3C
fn_41_212C = .text:0x0000212C; // type:function size:0x5C
fn_41_2188 = .text:0x00002188; // type:function size:0x5C
Expand Down Expand Up @@ -301,43 +301,43 @@ fn_41_C6A8 = .text:0x0000C6A8; // type:function size:0x8
create__9emManagerFUlUlUc = .text:0x0000C6B0; // type:function size:0x104
remove__9emManagerFv = .text:0x0000C7B4; // type:function size:0x50
getInstance__9emManagerFv = .text:0x0000C804; // type:function size:0xC
fn_41_C810 = .text:0x0000C810; // type:function size:0xC0
fn_41_C8D0 = .text:0x0000C8D0; // type:function size:0x64
fn_41_C934 = .text:0x0000C934; // type:function size:0xA0
__ct__9emManagerFUlPQ29emManager5EntryUlPQ29emManager5EntryUc = .text:0x0000C810; // type:function size:0xC0
clear__Q29emManager5EntryFv = .text:0x0000C8D0; // type:function size:0x64
__dt__9emManagerFv = .text:0x0000C934; // type:function size:0xA0
createEnemy__9emManagerFP8emCreate = .text:0x0000C9D4; // type:function size:0x13C
fn_41_CB10 = .text:0x0000CB10; // type:function size:0x48
fn_41_CB58 = .text:0x0000CB58; // type:function size:0x7C
isParent__9emManagerCFii = .text:0x0000CB10; // type:function size:0x48
clearParentCallback__9emManagerFii = .text:0x0000CB58; // type:function size:0x7C
removeEnemy__9emManagerFi = .text:0x0000CBD4; // type:function size:0x70
fn_41_CC44 = .text:0x0000CC44; // type:function size:0xA0
forEachEnemy__9emManagerFUlPFii_b = .text:0x0000CC44; // type:function size:0xA0
removeEnemyAll__9emManagerFv = .text:0x0000CCE4; // type:function size:0x78
fn_41_CD5C = .text:0x0000CD5C; // type:function size:0x24
fn_41_CD80 = .text:0x0000CD80; // type:function size:0x90
fn_41_CE10 = .text:0x0000CE10; // type:function size:0x74
getEnemyPtrFromId__9emManagerFi = .text:0x0000CE84; // type:function size:0x48
fn_41_CECC = .text:0x0000CECC; // type:function size:0x24
fn_41_CEF0 = .text:0x0000CEF0; // type:function size:0x28
getEnemyCount__9emManagerFv = .text:0x0000CF18; // type:function size:0x74
getEnemyCountFromKind__9emManagerF6emKind = .text:0x0000CF8C; // type:function size:0xB8
fn_41_D044 = .text:0x0000D044; // type:function size:0x64
isEnemyExist__9emManagerFi = .text:0x0000D0A8; // type:function size:0x60
fn_41_D108 = .text:0x0000D108; // type:function size:0x9C
fn_41_D1A4 = .text:0x0000D1A4; // type:function size:0x68
getEnemyEntry__9emManagerCFUl = .text:0x0000CD5C; // type:function size:0x24
getEntryEnemyPtrFromId__9emManagerCFUl = .text:0x0000CD80; // type:function size:0x90
getEmptyEnemyEntryIndex__9emManagerCFv = .text:0x0000CE10; // type:function size:0x74
getEnemyPtrFromId__9emManagerCFi = .text:0x0000CE84; // type:function size:0x48
getEnemyPtr__9emManagerCFi = .text:0x0000CECC; // type:function size:0x24
isEnemyCreatable__9emManagerCFv = .text:0x0000CEF0; // type:function size:0x28
getEnemyCount__9emManagerCFv = .text:0x0000CF18; // type:function size:0x74
getEnemyCountFromKind__9emManagerCF6emKind = .text:0x0000CF8C; // type:function size:0xB8
getParentCreateIdFromId__9emManagerCFUl = .text:0x0000D044; // type:function size:0x64
isEnemyExist__9emManagerCFUl = .text:0x0000D0A8; // type:function size:0x60
getEnemyCreateIdFromAreaId__9emManagerCFi = .text:0x0000D108; // type:function size:0x9C
set__Q29emManager5EntryFPv6emKindii = .text:0x0000D1A4; // type:function size:0x68
preloadArchive__9emManagerFP9gfArchiveP9gfArchiveP9gfArchiveP9gfArchive6emKindb = .text:0x0000D20C; // type:function size:0x174
isCompArchive__9emManagerFi = .text:0x0000D380; // type:function size:0xAC
isCompArchiveAll__9emManagerFv = .text:0x0000D42C; // type:function size:0x8C
isCompArchive__9emManagerCFi = .text:0x0000D380; // type:function size:0xAC
isCompArchiveAll__9emManagerCFv = .text:0x0000D42C; // type:function size:0x8C
removeArchive__9emManagerFi = .text:0x0000D4B8; // type:function size:0x70
removeArchiveAll__9emManagerFv = .text:0x0000D528; // type:function size:0x78
fn_41_D5A0 = .text:0x0000D5A0; // type:function size:0x24
getEntryPreloadArchivePtrFromId__9emManagerFi = .text:0x0000D5C4; // type:function size:0x80
fn_41_D644 = .text:0x0000D644; // type:function size:0x74
getPreloadArchiveCountFromKind__9emManagerF6emKind = .text:0x0000D6B8; // type:function size:0xB8
getPreloadArchivePtrFromKind__9emManagerF6emKind = .text:0x0000D770; // type:function size:0xB8
getPreloadArchiveCreateIdFromKind__9emManagerF6emKind = .text:0x0000D828; // type:function size:0xAC
fn_41_D8D4 = .text:0x0000D8D4; // type:function size:0xD8
fn_41_D9AC = .text:0x0000D9AC; // type:function size:0x54
fn_41_DA00 = .text:0x0000DA00; // type:function size:0xEC
fn_41_DAEC = .text:0x0000DAEC; // type:function size:0x98
fn_41_DB84 = .text:0x0000DB84; // type:function size:0x8
getPreloadArchiveEntry__9emManagerCFUl = .text:0x0000D5A0; // type:function size:0x24
getEntryPreloadArchivePtrFromId__9emManagerCFUl = .text:0x0000D5C4; // type:function size:0x80
getEmptyPreloadArchiveEntryIndex__9emManagerCFv = .text:0x0000D644; // type:function size:0x74
getPreloadArchiveCountFromKind__9emManagerCF6emKind = .text:0x0000D6B8; // type:function size:0xB8
getPreloadArchivePtrFromKind__9emManagerCF6emKind = .text:0x0000D770; // type:function size:0xB8
getPreloadArchiveCreateIdFromKind__9emManagerCF6emKind = .text:0x0000D828; // type:function size:0xAC
__ct__9emArchiveFP9gfArchiveP9gfArchiveP9gfArchiveP9gfArchive6emKind = .text:0x0000D8D4; // type:function size:0xD8
__dt__9emArchiveFv = .text:0x0000D9AC; // type:function size:0x54
isComp__9emArchiveCFv = .text:0x0000DA00; // type:function size:0xEC
remove__9emArchiveFv = .text:0x0000DAEC; // type:function size:0x98
getWeaponResourceId__9emArchiveCFv = .text:0x0000DB84; // type:function size:0x8
createInstance<8emKuribo>__5EnemyFUlP8emCreate_P5Enemy = .text:0x0000DB8C; // type:function size:0x54
createInstance<10emPopperam>__5EnemyFUlP8emCreate_P5Enemy = .text:0x0000DBE0; // type:function size:0x54
createInstance<7emPacci>__5EnemyFUlP8emCreate_P5Enemy = .text:0x0000DC34; // type:function size:0x54
Expand Down Expand Up @@ -3061,9 +3061,9 @@ lbl_41_data_160C = .data:0x0000160C; // type:object size:0x13 data:string
lbl_41_data_1620 = .data:0x00001620; // type:object size:0x8
lbl_41_data_1628 = .data:0x00001628; // type:object size:0x7 data:string
lbl_41_data_1630 = .data:0x00001630; // type:object size:0x8
lbl_41_data_1638 = .data:0x00001638; // type:object size:0xC
lbl_41_data_1644 = .data:0x00001644; // type:object size:0xA data:string
lbl_41_data_1650 = .data:0x00001650; // type:object size:0x8
__vt__9emManager = .data:0x00001638; // type:object size:0xC
lbl_41_data_1644 = .data:0x00001644; // type:object size:0xA scope:local data:string
__RTTI__9emManager = .data:0x00001650; // type:object size:0x8
CreateFuncPtrTable__6emInfo = .data:0x00001658; // type:object size:0xF4
ModifyExParamFuncPtrTable__6emInfo = .data:0x0000174C; // type:object size:0xF4
DeleteExParamFuncPtrTable__6emInfo = .data:0x00001840; // type:object size:0xF4
Expand Down Expand Up @@ -5022,7 +5022,7 @@ lbl_41_bss_14 = .bss:0x00000014; // type:object size:0x8
lbl_41_bss_1C = .bss:0x0000001C; // type:object size:0x8
lbl_41_bss_24 = .bss:0x00000024; // type:object size:0x1 data:byte
lbl_41_bss_28 = .bss:0x00000028; // type:object size:0x8 data:4byte
lbl_41_bss_30 = .bss:0x00000030; // type:object size:0x8 data:4byte
g_emManager = .bss:0x00000030; // type:object size:0x4 data:4byte
lbl_41_bss_38 = .bss:0x00000038; // type:object size:0xC scope:local
g_emInfo = .bss:0x00000044; // type:object size:0x4
lbl_41_bss_48 = .bss:0x00000048; // type:object size:0x8
Expand Down
6 changes: 3 additions & 3 deletions config/RSBE01_02/rels/sora_melee/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2533,8 +2533,8 @@ getAnmFile__20soResourceModuleImplFUsUlUl = .text:0x0006FAB4; // type:function s
getBinFile__20soResourceModuleImplFUlUsl = .text:0x0006FB80; // type:function size:0xCC
getFile__20soResourceModuleImplFUl11ARCNodeTypeUs = .text:0x0006FC4C; // type:function size:0xA0
getResourceIdAccesser__20soResourceModuleImplFv = .text:0x0006FCEC; // type:function size:0x8
fn_27_6FCF4 = .text:0x0006FCF4; // type:function size:0xEC
fn_27_6FDE0 = .text:0x0006FDE0; // type:function size:0xA0
create__11soArchiveDbFUlUl = .text:0x0006FCF4; // type:function size:0xEC
remove__11soArchiveDbFUl = .text:0x0006FDE0; // type:function size:0xA0
getManager__11soArchiveDbFUl = .text:0x0006FE80; // type:function size:0x14
fn_27_6FE94 = .text:0x0006FE94; // type:function size:0x14
fn_27_6FEA8 = .text:0x0006FEA8; // type:function size:0x10
Expand Down Expand Up @@ -5793,7 +5793,7 @@ getStatusKind__23soExternalValueAccesserFP11StageObject = .text:0x0008CBF4; // t
fn_27_8CC10 = .text:0x0008CC10; // type:function size:0x1C
fn_27_8CC2C = .text:0x0008CC2C; // type:function size:0x20
getSituationKind__23soExternalValueAccesserFP11StageObject = .text:0x0008CC4C; // type:function size:0x1C
fn_27_8CC68 = .text:0x0008CC68; // type:function size:0x1C
getAreaIndexFromId__23soExternalValueAccesserFP11StageObjecti = .text:0x0008CC68; // type:function size:0x1C
fn_27_8CC84 = .text:0x0008CC84; // type:function size:0x10
fn_27_8CC94 = .text:0x0008CC94; // type:function size:0x1C
fn_27_8CCB0 = .text:0x0008CCB0; // type:function size:0xC
Expand Down
8 changes: 4 additions & 4 deletions config/RSBE01_02/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3004,11 +3004,11 @@ fn_80044BFC = .text:0x80044BFC; // type:function size:0x40
fn_80044C3C = .text:0x80044C3C; // type:function size:0x604
fn_80045240 = .text:0x80045240; // type:function size:0x16C
fn_800453AC = .text:0x800453AC; // type:function size:0x234
fn_800455E0 = .text:0x800455E0; // type:function size:0x12C
addArchive__16utArchiveManagerFP9gfArchive = .text:0x800455E0; // type:function size:0x12C
fn_8004570C = .text:0x8004570C; // type:function size:0xE8
fn_800457F4 = .text:0x800457F4; // type:function size:0x5CC
fn_80045DC0 = .text:0x80045DC0; // type:function size:0xA4
fn_80045E64 = .text:0x80045E64; // type:function size:0x370
isLoaded__16utArchiveManagerCFUlPUl = .text:0x80045DC0; // type:function size:0xA4
removeArchive__16utArchiveManagerFUl = .text:0x80045E64; // type:function size:0x370
fn_800461D4 = .text:0x800461D4; // type:function size:0x380
fn_80046554 = .text:0x80046554; // type:function size:0x9C
getResFileFromId__16utArchiveManagerFl11ARCNodeTypeUlUlUl = .text:0x800465F0; // type:function size:0xB0
Expand Down Expand Up @@ -3778,7 +3778,7 @@ fn_800737E4 = .text:0x800737E4; // type:function size:0x384
loadSoundGroup__9sndSystemF10SndGroupIDib = .text:0x80073B68; // type:function size:0x130
freeGroup__9sndSystemFii = .text:0x80073C98; // type:function size:0x68
fn_80073D00 = .text:0x80073D00; // type:function size:0x8
fn_80073D08 = .text:0x80073D08; // type:function size:0x8
isSoundGroupLoadFinished__9sndSystemCF10SndGroupID = .text:0x80073D08; // type:function size:0x8
fn_80073D10 = .text:0x80073D10; // type:function size:0x8
isSoundGroupLoaded__9sndSystemF10SndGroupID = .text:0x80073D18; // type:function size:0x8
loadCommon__9sndSystemFv = .text:0x80073D20; // type:function size:0x4
Expand Down
2 changes: 2 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,8 @@ def NW4RObject(completed, name, **options):
"cflags": cflags_sora_enemy,
"host": False,
"objects": [
Object(Matching, "mo_enemy/sora_enemy/em_manager.cpp"),
Object(Matching, "mo_enemy/sora_enemy/em_archive.cpp"),
Object(Matching, "mo_enemy/sora_enemy/em_info.cpp"),
Object(Matching, "mo_enemy/sora_enemy/em_create.cpp"),
Object(Matching, "mo_enemy/sora_enemy/resource/em_resource_module_impl.cpp"),
Expand Down
24 changes: 17 additions & 7 deletions include/Brawl/Include/em/em_archive.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
#pragma once

#include <StaticAssert.h>
#include <em/em_create.h>
#include <gf/gf_archive.h>
#include <types.h>

class emArchive {
int enmCommonResourceId;
int brresResourceId;
int paramResourceId;
int weaponResourceId;
int faceTexBrresResourceId;
int extendBrresResourceId;
public:
emArchive(gfArchive* param, gfArchive* brres, gfArchive* enmCommon, gfArchive* primFaceBrres, EnemyKind enemyKind);
~emArchive();
bool isComp() const;
void remove();
u32 getWeaponResourceId() const;

private:
u32 enmCommonResourceId;
u32 brresResourceId;
u32 paramResourceId;
u32 weaponResourceId;
u32 faceTexBrresResourceId;
u32 extendBrresResourceId;
};
static_assert(sizeof(emArchive) == 24, "Class is wrong size!");
static_assert(sizeof(emArchive) == 24, "Class is wrong size!");
60 changes: 41 additions & 19 deletions include/Brawl/Include/em/em_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,74 @@
#include <types.h>

class emManager {

template <typename T>
public:
class Entry {
char _0[0x4];
public:
bool m_isActive;
EnemyKind m_enemyKind;
int m_parentCreateId;
int m_createId;
int m_soundGroupOffset;
T* m_dataPtr;
void* m_dataPtr;

void clear();
void set(void* dataPtr, EnemyKind enemyKind, int createId, int soundGroupOffset);
};
static_assert(sizeof(Entry<Enemy>) == 0x18, "Class is wrong size!");
static_assert(sizeof(Entry) == 0x18, "Class is wrong size!");

private:
u32 m_numEnemyEntries;
Entry<Enemy>* m_enemyEntries;
char _8[4];
Entry* m_enemyEntries;
int m_nextEnemyCreateId;
u32 m_numArchiveEntries;
Entry<emArchive>* m_archiveEntries;
char _20[4];
Entry* m_archiveEntries;
int m_nextArchiveCreateId;
u8 m_primidFaceType;
char _25[3];

emManager(u32 numEnemyEntries, Entry* enemyEntries, u32 numArchiveEntries, Entry* archiveEntries, u8 primidFaceType);
virtual ~emManager();

static bool clearParentCallback(int parentCreateId, int createId);
int getNextEnemyCreateId() { return m_nextEnemyCreateId++; }
int getNextArchiveCreateId() { return m_nextArchiveCreateId++; }

public:
bool isCompArchive(int id);
bool isCompArchiveAll();
int getPreloadArchiveCountFromKind(EnemyKind enemyKind);
int getPreloadArchiveCreateIdFromKind(EnemyKind enemyKind);
emArchive* getPreloadArchivePtrFromKind(EnemyKind enemyKind);
bool isCompArchive(int id) const;
bool isCompArchiveAll() const;
u32 getPreloadArchiveCountFromKind(EnemyKind enemyKind) const;
int getPreloadArchiveCreateIdFromKind(EnemyKind enemyKind) const;
emArchive* getPreloadArchivePtrFromKind(EnemyKind enemyKind) const;
#ifdef MATCHING
int preloadArchive(gfArchive* param, gfArchive* brres, gfArchive* enmCommon, gfArchive* primFaceBrres, EnemyKind enemyKind, bool isSoundRequest);
#else
int preloadArchive(gfArchive* param, gfArchive* brres, gfArchive* enmCommon, gfArchive* primFaceBrres, EnemyKind enemyKind, bool isSoundRequest, HeapType heapType = Heaps::StageResource); // Custom optional parameters for specifying what heap to load enemy resources into
#endif
int createEnemy(emCreate* create);
bool isParent(int parentCreateId, int createId) const;
void forEachEnemy(u32 createId, bool (*func)(int, int));
void removeEnemy(int id);
bool isEnemyExist(int id);
bool isEnemyExist(u32 id) const;
void removeEnemyAll();
void removeArchiveAll();
void removeArchive(int id);
static void create(u32 numEntries1, u32 numEntries2, u8 primidFaceType);
static void remove();
u32 getEnemyCount();
u32 getEnemyCountFromKind(EnemyKind enemyKind);
Enemy* getEnemyPtrFromId(int createId);
Entry<emArchive>* getEntryPreloadArchivePtrFromId(int createId);
u32 getEnemyCount() const;
u32 getEnemyCountFromKind(EnemyKind enemyKind) const;
Enemy* getEnemyPtrFromId(int createId) const;
Enemy* getEnemyPtr(int createId) const;
int getParentCreateIdFromId(u32 createId) const;
int getEnemyCreateIdFromAreaId(int areaId) const;
bool isEnemyCreatable() const;
Entry* getEnemyEntry(u32 index) const;
Entry* getEntryEnemyPtrFromId(u32 createId) const;
int getEmptyEnemyEntryIndex() const;
Entry* getPreloadArchiveEntry(u32 index) const;
Entry* getEntryPreloadArchivePtrFromId(u32 createId) const;
int getEmptyPreloadArchiveEntryIndex() const;
static emManager* getInstance();
};
static_assert(sizeof(emManager) == 32, "Class is wrong size!");

extern emManager* g_emManager;
4 changes: 4 additions & 0 deletions include/Brawl/Include/em/enemy.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class Enemy : public StageObject, public soStatusEventObserver, public soCollisi
};

emAIModuleImpl& getAIModule() { return m_aiModule; }
EnemyKind getEnemyKind() const { return m_enemyKind; }
static Enemy* create(u32 createId, emCreate* create);
static void start(Enemy* enemy, emCreate* create);
static void remove(Enemy* enemy);
Vec3f getCenterPos();
s32 getNameMsgId();
nw4r::g3d::ResFileData* getFaceTexPtr(u32 p1);
Expand Down
1 change: 1 addition & 0 deletions include/Brawl/Include/snd/snd_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class sndSystem {
char _2D4[0x8FC];

int loadSoundGroup(SndGroupID sndGroupId, int, bool isRequest);
bool isSoundGroupLoadFinished(SndGroupID sndGroupId) const;
bool isSoundGroupLoaded(SndGroupID sndGroupId);
void freeGroup(int heapLevel, int);
bool loadArchiveHeader();
Expand Down
2 changes: 2 additions & 0 deletions include/Brawl/Include/so/so_archive_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
// TODO: class size
class soArchiveDb {
public:
static bool create(u32 index, u32 numArchives);
static void remove(u32 index);
static utArchiveManager* getManager(u32 index);
};
1 change: 1 addition & 0 deletions include/Brawl/Include/so/so_external_value_accesser.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class soExternalValueAccesser {
static float getLr(StageObject* stageObject);
static SituationKind getSituationKind(StageObject* stageObject);
static int getStatusKind(StageObject* stageObject);
static int getAreaIndexFromId(StageObject* stageObject, int id);
static bool getWorkFlag(StageObject* stageObject, u32);
static int getWorkInt(StageObject* stageObject, u32);
static soModuleAccesser* getModuleAccesser(StageObject* stageObject);
Expand Down
3 changes: 3 additions & 0 deletions include/Brawl/Include/ut/ut_archive_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
// TODO: class size
class utArchiveManager {
public:
u32 addArchive(gfArchive* archive);
int isLoaded(u32 id, u32* p2) const;
void removeArchive(u32 id);
void* getPublicAddress(u32 paramArcId, const char* nodeName, u16 fileIndex, u32 groupID, u32 endian);
void resolveReference(u32 paramArcId, u32 emCommonArcId, u32 p3, u32 p4, u32 p5, u32 p6);
nw4r::g3d::ResFileData* getResFileFromId(s32 p1, ARCNodeType type, u32 p3, u32 p4, u32 p5);
Expand Down
Loading
Loading