-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
306 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#include "iso.h" | ||
|
||
#include <cstring> | ||
|
||
#include "game/overlord/jak3/basefilesystem.h" | ||
|
||
namespace jak3 { | ||
using namespace iop; | ||
|
||
static int s_nISOInitFlag; | ||
static ISO_LoadDGO s_LoadDGO; | ||
int s_nSyncMbx; | ||
CBaseFileSystem* g_pFileSystem; | ||
MsgPacket s_MsgPacket_NotOnStackSync[2]; | ||
|
||
/* COMPLETE */ | ||
void InitDriver() { | ||
if (g_pFileSystem->Init() == 0) { | ||
s_nISOInitFlag = 0; | ||
} | ||
|
||
SendMbx(s_nSyncMbx, &s_MsgPacket_NotOnStackSync[0]); | ||
} | ||
|
||
/* TODO unfinished */ | ||
static int LookMbx() { | ||
MsgPacket* pkt; | ||
|
||
int ret = PollMbx(&pkt, s_nSyncMbx); | ||
if (ret != KE_MBOX_NOMSG) { | ||
// FIXME | ||
} | ||
|
||
return ret != KE_MBOX_NOMSG; | ||
} | ||
|
||
/* COMPLETE */ | ||
static void WaitMbx(int mbx) { | ||
MsgPacket* pkt; | ||
ReceiveMbx(&pkt, mbx); | ||
} | ||
|
||
/* TODO unfinished */ | ||
int InitISOFS(const char* fs_mode, const char* loading_sceeen) { | ||
ThreadParam thp; | ||
MbxParam mbx; | ||
|
||
memset(&s_LoadDGO, 0, sizeof(s_LoadDGO)); | ||
s_nISOInitFlag = 1; | ||
|
||
return s_nISOInitFlag; | ||
} | ||
|
||
/* COMPLETE */ | ||
const ISOFileDef* FindISOFile(char* name) { | ||
return g_pFileSystem->Find(name); | ||
} | ||
|
||
/* COMPLETE */ | ||
s32 GetISOFileLength(const ISOFileDef* fd) { | ||
return g_pFileSystem->GetLength(fd); | ||
} | ||
|
||
} // namespace jak3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include "game/sce/iop.h" | ||
|
||
namespace jak3 { | ||
|
||
struct ISOBuffer { | ||
void AdjustDataLength(int); | ||
void AdvanceCurrentData(int); | ||
}; | ||
|
||
struct ISO_Hdr { | ||
iop::MsgPacket msg; | ||
|
||
void SetActive(); | ||
void SetUnk1(); | ||
void SetUnk2(); | ||
}; | ||
|
||
struct ISO_Msg : ISO_Hdr {}; | ||
|
||
struct ISO_LoadDGO : ISO_Msg {}; | ||
|
||
} // namespace jak3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "ramdisk.h" | ||
|
||
#include "common/log/log.h" | ||
|
||
#include "game/sce/iop.h" | ||
|
||
namespace jak3 { | ||
using namespace iop; | ||
|
||
static u8 gRamDisk_RPCBUF[40]; | ||
|
||
static void* RPC_Ramdisk(u32 fno, void* data, int size) { | ||
lg::error("RPC_RAMDISK UNIMPLEMENTED"); | ||
return nullptr; | ||
} | ||
|
||
void InitRamdisk() {} | ||
|
||
u32 Thread_Server() { | ||
sceSifQueueData dq; | ||
sceSifServeData serve; | ||
|
||
CpuDisableIntr(); | ||
sceSifInitRpc(0); | ||
sceSifSetRpcQueue(&dq, GetThreadId()); | ||
sceSifRegisterRpc(&serve, 0xfab2, RPC_Ramdisk, gRamDisk_RPCBUF, nullptr, nullptr, &dq); | ||
CpuEnableIntr(); | ||
sceSifRpcLoop(&dq); | ||
|
||
return 0; | ||
} | ||
|
||
} // namespace jak3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
#include "common/common_types.h" | ||
|
||
namespace jak3 { | ||
|
||
u32 Thread_Server(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#include "srpc.h" | ||
|
||
#include "common/log/log.h" | ||
|
||
#include "game/sce/iop.h" | ||
|
||
namespace jak3 { | ||
using namespace iop; | ||
|
||
constexpr int SRPC_MESSAGE_SIZE = 0x50; | ||
constexpr int SRPC_MESSAGE_COUNT = 128; | ||
|
||
static u8 s_anSRPC_PlayerBuf[SRPC_MESSAGE_SIZE * SRPC_MESSAGE_COUNT]; | ||
static u8 s_anSRPC_LoaderBuf[SRPC_MESSAGE_SIZE]; | ||
|
||
static void* RPC_Player(u32 fno, void* data, int size) { | ||
lg::error("RPC_PLAYER UNIMPLEMENTED"); | ||
return nullptr; | ||
} | ||
|
||
static void* RPC_Loader(u32 fno, void* data, int size) { | ||
lg::error("RPC_LOADER UNIMPLEMENTED"); | ||
return nullptr; | ||
} | ||
|
||
u32 Thread_Player() { | ||
sceSifQueueData dq; | ||
sceSifServeData serve; | ||
|
||
CpuDisableIntr(); | ||
sceSifInitRpc(0); | ||
sceSifSetRpcQueue(&dq, GetThreadId()); | ||
sceSifRegisterRpc(&serve, 0xfab0, RPC_Player, s_anSRPC_PlayerBuf, nullptr, nullptr, &dq); | ||
CpuEnableIntr(); | ||
sceSifRpcLoop(&dq); | ||
|
||
return 0; | ||
} | ||
|
||
u32 Thread_Loader() { | ||
sceSifQueueData dq; | ||
sceSifServeData serve; | ||
|
||
CpuDisableIntr(); | ||
sceSifInitRpc(0); | ||
sceSifSetRpcQueue(&dq, GetThreadId()); | ||
sceSifRegisterRpc(&serve, 0xfab1, RPC_Loader, s_anSRPC_LoaderBuf, nullptr, nullptr, &dq); | ||
CpuEnableIntr(); | ||
sceSifRpcLoop(&dq); | ||
|
||
return 0; | ||
} | ||
|
||
} // namespace jak3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
#include "common/common_types.h" | ||
|
||
namespace jak3 { | ||
|
||
u32 Thread_Player(); | ||
u32 Thread_Loader(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#pragma once | ||
|
||
#include "common/common_types.h" | ||
|
||
#include "game/overlord/jak3/overlord.h" | ||
|
||
namespace jak3 { | ||
|
||
struct Curve { | ||
s32 p1; | ||
s32 p2; | ||
s32 p3; | ||
s32 p4; | ||
}; | ||
|
||
struct SoundPlayParams { | ||
u16 mask; | ||
s16 pitch_mod; | ||
s16 bend; | ||
s16 fo_min; | ||
s16 fo_max; | ||
s8 fo_curve; | ||
s8 priority; | ||
s32 volume; | ||
Vec3 trans; | ||
u8 group; | ||
u8 reg[3]; | ||
}; | ||
|
||
struct SoundInfo { | ||
char name[16]; | ||
s32 id; | ||
u32 sound_handle; | ||
s32 auto_volume; | ||
s32 auto_time; | ||
SoundPlayParams params; | ||
}; | ||
|
||
} // namespace jak3 |
Oops, something went wrong.