Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decomp: ResourceManager #192

Merged
merged 61 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
303ff91
MenuCharacterManager: full match
vabold Jun 17, 2022
4a5b634
JobContext: full match
vabold Jun 17, 2022
e8aac6d
CourseCache: ctor, dtor, init
vabold Jun 18, 2022
0402e87
CourseCache: load
vabold Jun 18, 2022
86f4ee3
Add loadCourse WIP
Thodoris1999 Jun 19, 2022
7b1721e
WIP comment requestLoad ASM
Thodoris1999 Jun 19, 2022
f3744cc
Match loadCourse and requestLoad
Thodoris1999 Jun 19, 2022
8c0cc0f
ResourceManager: loadCourse, requestLoad (#6)
vabold Jun 19, 2022
5651447
CourseCache: loadOther, full match
vabold Jun 19, 2022
162db4b
ResourceManager: createInstance
vabold Jun 20, 2022
2a3b32b
Merge branch 'master' of https://github.com/riidefi/mkw into riidefi-…
vabold Jun 20, 2022
8d429a1
Merge branch 'riidefi-master' into resource
vabold Jun 20, 2022
7d21487
ResourceManager: loadMission, loadCompetition
vabold Jun 21, 2022
379eff9
ResourceManager: doLoadTask
vabold Jun 21, 2022
c615fbb
Dummy: unused vtable calls
vabold Jun 21, 2022
58edd96
ResourceManager: requestLoad (DvdArchive)
vabold Jun 21, 2022
a39d821
ResourceManager: requestLoad (MultiDvdArchive, fileHeap)
vabold Jun 21, 2022
5326b92
ResourceManager: load / rodata
vabold Jun 21, 2022
c9e784f
ResourceManager: rodata formatting
vabold Jun 21, 2022
1090ae5
A couple of more functions
Thodoris1999 Jun 25, 2022
b9a619a
Merge pull request #8 from em-eight/stuff
vabold Jun 25, 2022
fa8838e
ResourceManager: loadUI, minor cleanup
vabold Jun 26, 2022
60994f7
ResourceManager: loadSystemResource
vabold Jun 27, 2022
ad0e842
ResourceManager: loadMenuKartModel, minor cleanup
vabold Jun 27, 2022
fe8139c
ResourceManager: unmountMulti, unmountArchive
vabold Jun 27, 2022
9c7172b
ResourceManager: getFile
vabold Jun 27, 2022
fc18118
ResourceManager: getCharacterFile
vabold Jun 27, 2022
a456f99
ResourceManager: getVehicleFile
vabold Jun 27, 2022
90d6ceb
ResourceManager: getFileCopy
vabold Jun 28, 2022
5630c19
a couple of functions
Thodoris1999 Jun 28, 2022
f03cb68
Merge pull request #10 from em-eight/more_stuff
vabold Jun 28, 2022
f5657a7
ResourceManager: cleanup
vabold Jun 28, 2022
82e6b49
ResourceManager: clear
vabold Jun 29, 2022
5dae6ae
ResourceManager: getBspFile, CourseCache: load
vabold Jun 29, 2022
04a9cb2
ResourceManager: getBspFile, CourseCache: load
vabold Jun 29, 2022
539e4f7
Merge branch 'resource' into preload_course
vabold Jun 29, 2022
e05e5ea
Merge pull request #13 from em-eight/preload_course
vabold Jun 29, 2022
66db81a
Merge branch 'riidefi:master' into resource
vabold Jun 30, 2022
1e135a2
Unused: getNullString
vabold Jun 30, 2022
68115ce
ResourceManager: setArcResourceLink
vabold Jun 30, 2022
19398d6
ResourceManager: attachArcResourceAccessor
vabold Jun 30, 2022
f2ba98d
ResourceManager: attachArcResourceAccessor
vabold Jun 30, 2022
9803b1c
request things
Thodoris1999 Jul 2, 2022
c19a7b3
doLoadGlobe
Thodoris1999 Jul 2, 2022
b8c3f88
Merge branch 'resource' into layoutDir
vabold Jul 2, 2022
3fae14b
Merge pull request #14 from em-eight/layoutDir
vabold Jul 2, 2022
60e5631
globe loads
Thodoris1999 Jul 3, 2022
7262b44
load globe async
Thodoris1999 Jul 3, 2022
a970100
(de)init globeHeap
Thodoris1999 Jul 3, 2022
126a151
Merge branch 'resource' into stuff
vabold Jul 4, 2022
a036840
Merge pull request #15 from em-eight/stuff
vabold Jul 4, 2022
18cd717
WIP: doLoadMenuCharacterModel
Thodoris1999 Jul 6, 2022
fbffb0c
Merge branch 'stuff' of https://github.com/em-eight/mkw into stuff
Thodoris1999 Jul 6, 2022
2be87d6
Match doLoadCharacterKartModel
riidefi Jul 6, 2022
b6c2c74
Match deinitGlobeHeap
riidefi Jul 6, 2022
f598b5f
Merge pull request #16 from em-eight/stuff
vabold Jul 7, 2022
3d31d8c
doLoadCharacterModel and staffGhost
Thodoris1999 Jul 7, 2022
d62af99
loadCharMdlAsync
Thodoris1999 Jul 7, 2022
4b7731b
FUN22CC
Thodoris1999 Jul 7, 2022
2705a3c
ResourceManager: almost complete! (#17)
vabold Jul 7, 2022
f2b0dfe
ResourceManager: start cleanup
vabold Jul 7, 2022
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
6 changes: 3 additions & 3 deletions pack/rel_objects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ out/rel/data_808b2d50_808b3188.o
out/LocalizedArchive.o
out/MultiDvdArchive.o
out/rel/text_8052ae5c_8053fc4c.o
out/rel/rodata_8088fe28_80890ad8.o
out/rel/data_808b31e8_808b3bf8.o
out/rel/rodata_8088fe28_80890490.o
out/rel/data_808b31e8_808b3960.o
out/ResourceManager.o
out/rel/text_80542878_80555464.o
out/rel/rodata_80890b20_80891370.o
out/rel/rodata_80890d0c_80891370.o
out/rel/data_808b3c2c_808b42e0.o
out/Random.o
out/rel/text_8055572c_80590128.o
Expand Down
2 changes: 1 addition & 1 deletion pack/rel_slices.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ enabled,name,textStart,textEnd,ctorsStart,ctorsEnd,dtorsStart,dtorsEnd,rodataSta
1,source/game/system/GhostFile.cpp,0x8051c088,0x8051d4d4,,,,,,,0x808b2d38,0x808b2d50,,
1,source/game/system/LocalizedArchive.cpp,0x8052a098,0x8052a538,,,,,0x8088fdc0,0x8088fe00,0x808b3188,0x808b31d8,,
1,source/game/system/MultiDvdArchive.cpp,0x8052a538,0x8052ae5c,,,,,0x8088fe00,0x8088fe28,0x808b31d8,0x808b31e8,,
1,source/game/system/ResourceManager.cpp,0x8053FC4C,0x80542878,,,,,0x80890AD8,0x80890B20,0x808B3BF8,0x808b3c2c,,
1,source/game/system/ResourceManager.cpp,0x8053FC4C,0x80542878,,,,,0x80890490,0x80890d0c,0x808b3960,0x808b3c2c,,
1,source/game/util/Random.cpp,0x80555464,0x8055572c,,,,,0x80891370,0x80891380,0x808b42e0,0x808b42ec,,
1,source/game/kart/KartComponent.cpp,0x80590128,0x805901d0,,,,,,,,,0x809c1900,0x809c1910
1,source/game/ui/ControlGroup.cpp,0x805c23e4,0x805c2c18,,,,,,,,,,
Expand Down
16 changes: 8 additions & 8 deletions pack/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9978,9 +9978,9 @@
0x80540558 unk_80540558
0x80540680 ResourceManager_loadUI
0x80540760 loadCourse__Q26System15ResourceManagerF8CourseIdPQ23EGG4Heapb
0x80540918 ResourceManager_loadMission
0x80540b14 ResourceManager_loadCompetition
0x80540cfc unk_80540cfc
0x80540918 loadMission__Q26System15ResourceManagerF8CourseIdlPQ23EGG4Heapb
0x80540b14 loadCompetition__Q26System15ResourceManagerF8CourseIdPvUlPQ23EGG4HeapUc
0x80540cfc loadKartFromArchive__Q26System15ResourceManagerFPQ26System15MultiDvdArchiveUl6KartId11CharacterId10BattleTeam8PlayModePQ23EGG4HeapPQ23EGG4Heap
0x80540e3c unk_80540e3c
0x80540f90 unk_80540f90
0x805410e4 unk_805410e4
Expand All @@ -9992,27 +9992,27 @@
0x80541320 unk_80541320
0x805413c8 unk_805413c8
0x80541438 unk_80541438
0x805414a8 unk_805414a8
0x805414a8 ResourceManager_loadBSP
0x8054155c unk_8054155c
0x805415b0 unk_805415b0
0x805415b4 unk_805415b4
0x805415c4 unk_805415c4
0x805415d4 unk_805415d4
0x805415e4 unk_805415e4
0x80541614 unk_80541614
0x80541614 getArchiveStart__Q26System15ResourceManagerFQ26System17ResourceChannelIdUl
0x8054169c unk_8054169c
0x80541738 unk_80541738
0x80541794 ResourceManager_getMenuArchiveCount
0x805417a4 unk_805417a4
0x80541878 ResourceManager_attachLayoutDir
0x80541998 ResourceManager_preloadCourseTask
0x805419ac ResourceManager_preloadCourseAsync
0x805419c8 unk_805419c8
0x805419ec unk_805419ec
0x805419c8 getCharacterName__6SystemF11CharacterId
0x805419ec getKartName__6SystemF11CharacterId
0x80541a10 unk_80541a10
0x80541a70 unk_80541a70
0x80541ac4 unk_80541ac4
0x80541b58 unk_80541b58
0x80541b58 load__Q26System11CourseCacheFl
0x80541c18 unk_80541c18
0x80541c38 unk_80541c38
0x80541c48 unk_80541c48
Expand Down
9 changes: 5 additions & 4 deletions source/egg/core/eggStreamDecomp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ namespace EGG {
//!
class StreamDecomp {
public:
virtual bool init(void* dst, u32 maxCompressedSize) = 0;
virtual bool decomp(const void* src, u32 len) = 0;
virtual u32 getHeaderSize() = 0;
virtual u32 getUncompressedSize(const void* src) = 0;
virtual bool init(void* dst, u32 maxCompressedSize);
virtual bool decomp(const void* src, u32 len);
virtual u32 getHeaderSize();
virtual u32 getUncompressedSize(const void* src);
void foo();
};

class LZStreamDecomp : public StreamDecomp {
Expand Down
1 change: 1 addition & 0 deletions source/game/system/DvdArchive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ enum ArchiveState {

class DvdArchive {
friend class MultiDvdArchive;
friend class ResourceManager;

public:
DvdArchive();
Expand Down
21 changes: 12 additions & 9 deletions source/game/system/MultiDvdArchive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,19 @@ enum ResourceChannelID {
RES_CHAN_NUM,
};

enum EResourceKind {
RES_KIND_FILE_DOUBLE_FORMAT, // 0 %s%s Supports prefix
RES_KIND_FILE_SINGLE_FORMAT, // 1 %s
RES_KIND_BUFFER, // 2
RES_KIND_3, // unseen
RES_KIND_4, // _Dif loader

RES_KIND_DEFAULT = RES_KIND_FILE_DOUBLE_FORMAT,
};

class MultiDvdArchive {
friend class ResourceManager;

public:
MultiDvdArchive(u16 archiveCount = 1);
virtual ~MultiDvdArchive();
Expand All @@ -46,15 +58,6 @@ class MultiDvdArchive {
void* getEarliestResBufInMem();
void* getFarthestResBufInMem();

enum EResourceKind {
RES_KIND_FILE_DOUBLE_FORMAT, // 0 %s%s Supports prefix
RES_KIND_FILE_SINGLE_FORMAT, // 1 %s
RES_KIND_BUFFER, // 2
RES_KIND_3, // unseen
RES_KIND_4, // _Dif loader

RES_KIND_DEFAULT = RES_KIND_FILE_DOUBLE_FORMAT,
};
enum {
SUFFIX_SIZE = 128,
};
Expand Down
28 changes: 28 additions & 0 deletions source/game/system/RaceConfig.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

#include <rk_types.h>

struct RaceConfigPlayer {
u8 _00[0x08 - 0x00];
u32 vehicleId;
u32 characterId;
u32 type;
u8 _14[0xd0 - 0x14];
s32 controllerId;
u8 _d4[0xf0 - 0xd4];
};

struct RaceConfigScenario {
u8 _000[0x004 - 0x000];
u8 playerCount;
u8 _005[0x008 - 0x005];
RaceConfigPlayer players[12];
// ...
};

struct RaceConfig {
static RaceConfig* spInstance;
u8 _0000[0x0020 - 0x0000];
RaceConfigScenario raceScenario;
// ...
};
Loading