Skip to content

Commit b54c4ba

Browse files
committed
wip
1 parent 66563b1 commit b54c4ba

File tree

16 files changed

+306
-26
lines changed

16 files changed

+306
-26
lines changed

game/overlord/jak3/basefile.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef BASEFILE_H_
2-
#define BASEFILE_H_
1+
#pragma once
32

43
#include "game/overlord/jak3/iso_structs.h"
54
#include "game/overlord/jak3/overlord.h"
@@ -18,4 +17,3 @@ class CBaseFile {
1817
};
1918
} // namespace jak3
2019

21-
#endif // BASEFILE_H_
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
#ifndef BASEFILESYSTEM_H_
2-
#define BASEFILESYSTEM_H_
1+
#pragma once
32

43
#include "game/overlord/jak3/iso_structs.h"
54

65
namespace jak3 {
76
class CBaseFileSystem {
87
public:
9-
virtual void Init() = 0;
8+
virtual int Init() = 0;
109
virtual void PollDrive() = 0;
1110
virtual const ISOFileDef* Find(const char* name) = 0;
1211
virtual const ISOFileDef* FindIN(const char* name) = 0;
@@ -16,5 +15,3 @@ class CBaseFileSystem {
1615
virtual VagDirEntryJak3* FindVagFile(const char* name) = 0;
1716
};
1817
} // namespace jak3
19-
20-
#endif // BASEFILESYSTEM_H_

game/overlord/jak3/iso.cpp

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#include "iso.h"
2+
3+
#include <cstring>
4+
5+
#include "game/overlord/jak3/basefilesystem.h"
6+
7+
namespace jak3 {
8+
using namespace iop;
9+
10+
static int s_nISOInitFlag;
11+
static ISO_LoadDGO s_LoadDGO;
12+
int s_nSyncMbx;
13+
CBaseFileSystem* g_pFileSystem;
14+
MsgPacket s_MsgPacket_NotOnStackSync[2];
15+
16+
/* COMPLETE */
17+
void InitDriver() {
18+
if (g_pFileSystem->Init() == 0) {
19+
s_nISOInitFlag = 0;
20+
}
21+
22+
SendMbx(s_nSyncMbx, &s_MsgPacket_NotOnStackSync[0]);
23+
}
24+
25+
/* TODO unfinished */
26+
static int LookMbx() {
27+
MsgPacket* pkt;
28+
29+
int ret = PollMbx(&pkt, s_nSyncMbx);
30+
if (ret != KE_MBOX_NOMSG) {
31+
// FIXME
32+
}
33+
34+
return ret != KE_MBOX_NOMSG;
35+
}
36+
37+
/* COMPLETE */
38+
static void WaitMbx(int mbx) {
39+
MsgPacket* pkt;
40+
ReceiveMbx(&pkt, mbx);
41+
}
42+
43+
/* TODO unfinished */
44+
int InitISOFS(const char* fs_mode, const char* loading_sceeen) {
45+
ThreadParam thp;
46+
MbxParam mbx;
47+
48+
memset(&s_LoadDGO, 0, sizeof(s_LoadDGO));
49+
s_nISOInitFlag = 1;
50+
51+
return s_nISOInitFlag;
52+
}
53+
54+
/* COMPLETE */
55+
const ISOFileDef* FindISOFile(char* name) {
56+
return g_pFileSystem->Find(name);
57+
}
58+
59+
/* COMPLETE */
60+
s32 GetISOFileLength(const ISOFileDef* fd) {
61+
return g_pFileSystem->GetLength(fd);
62+
}
63+
64+
} // namespace jak3

game/overlord/jak3/iso.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#pragma once
2+
3+
#include "game/sce/iop.h"
4+
5+
namespace jak3 {
6+
7+
struct ISOBuffer {
8+
void AdjustDataLength(int);
9+
void AdvanceCurrentData(int);
10+
};
11+
12+
struct ISO_Hdr {
13+
iop::MsgPacket msg;
14+
15+
void SetActive();
16+
void SetUnk1();
17+
void SetUnk2();
18+
};
19+
20+
struct ISO_Msg : ISO_Hdr {};
21+
22+
struct ISO_LoadDGO : ISO_Msg {};
23+
24+
} // namespace jak3

game/overlord/jak3/iso_structs.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef ISO_STRUCTS_H_
2-
#define ISO_STRUCTS_H_
1+
#pragma once
32

43
#include "common/common_types.h"
54

@@ -29,9 +28,5 @@ struct VagDirJak3 {
2928

3029
struct VagDirEntry {};
3130

32-
struct ISOBuffer {};
33-
3431
struct ISOFileDef {};
3532
} // namespace jak3
36-
37-
#endif // ISO_STRUCTS_H_

game/overlord/jak3/overlord.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
#ifndef OVERLORD_H_
2-
#define OVERLORD_H_
1+
#pragma once
32

43
#include <cstddef>
54

5+
#include "common/common_types.h"
6+
67
namespace jak3 {
8+
9+
struct Vec3 {
10+
s32 x, y, z;
11+
};
12+
713
enum class EIsoStatus { Unk };
814

915
int start_overlord_wrapper(int argc, const char* const* argv, bool* signal);
@@ -14,5 +20,3 @@ void InitSound();
1420

1521
int VBlank_Initialize();
1622
} // namespace jak3
17-
18-
#endif

game/overlord/jak3/pagemanager.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef PAGEMANAGER_H_
2-
#define PAGEMANAGER_H_
1+
#pragma once
32

43
#include "common/common_types.h"
54

@@ -40,5 +39,3 @@ class CPageManager {
4039
};
4140

4241
} // namespace jak3
43-
44-
#endif // PAGEMANAGER_H_

game/overlord/jak3/ramdisk.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include "ramdisk.h"
2+
3+
#include "common/log/log.h"
4+
5+
#include "game/sce/iop.h"
6+
7+
namespace jak3 {
8+
using namespace iop;
9+
10+
static u8 gRamDisk_RPCBUF[40];
11+
12+
static void* RPC_Ramdisk(u32 fno, void* data, int size) {
13+
lg::error("RPC_RAMDISK UNIMPLEMENTED");
14+
return nullptr;
15+
}
16+
17+
void InitRamdisk() {}
18+
19+
u32 Thread_Server() {
20+
sceSifQueueData dq;
21+
sceSifServeData serve;
22+
23+
CpuDisableIntr();
24+
sceSifInitRpc(0);
25+
sceSifSetRpcQueue(&dq, GetThreadId());
26+
sceSifRegisterRpc(&serve, 0xfab2, RPC_Ramdisk, gRamDisk_RPCBUF, nullptr, nullptr, &dq);
27+
CpuEnableIntr();
28+
sceSifRpcLoop(&dq);
29+
30+
return 0;
31+
}
32+
33+
} // namespace jak3

game/overlord/jak3/ramdisk.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#pragma once
2+
3+
#include "common/common_types.h"
4+
5+
namespace jak3 {
6+
7+
u32 Thread_Server();
8+
9+
}

game/overlord/jak3/sbank.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef SBANK_H_
2-
#define SBANK_H_
1+
#pragma once
32

43
#include "common/common_types.h"
54

@@ -18,5 +17,3 @@ struct SoundBankInfo {
1817
};
1918
void InitBanks();
2019
} // namespace jak3
21-
22-
#endif // SBANK_H_

0 commit comments

Comments
 (0)