55#include " common/log/log.h"
66
77#include " game/common/dgo_rpc_types.h"
8+ #include " game/overlord/common/isocommon.h"
89#include " game/overlord/jak3/basefilesystem.h"
910#include " game/overlord/jak3/iso_api.h"
1011#include " game/overlord/jak3/iso_fake.h"
12+ #include " game/overlord/jak3/iso_queue.h"
1113#include " game/overlord/jak3/stream.h"
1214
1315namespace jak3 {
@@ -20,6 +22,8 @@ int g_nSTRThreadID;
2022int g_nPlayThreadID;
2123int g_nISOMbx;
2224VagDirJak3 g_VagDir;
25+ char g_szCurrentMusicName[16 ];
26+ char g_szTargetMusicName[16 ];
2327
2428static int s_nISOInitFlag;
2529static ISO_LoadDGO s_LoadDGO;
@@ -30,6 +34,7 @@ static int s_nDGOMbx;
3034
3135static u32 DGOThread ();
3236u32 ISOThread ();
37+ int NullCallback (ISO_Msg* msg);
3338
3439/* COMPLETE */
3540void InitDriver () {
@@ -135,9 +140,35 @@ const ISOFileDef* FindIsoFile(const char* name) {
135140}
136141
137142u32 ISOThread () {
143+ ISO_Msg* msg;
144+
145+ g_szCurrentMusicName[0 ] = ' \0 ' ;
146+ g_szTargetMusicName[0 ] = ' \0 ' ;
147+ InitBuffers ();
148+ // InitVagCmds();
149+
138150 InitDriver ();
139151
140152 while (true ) {
153+ int res = PollMbx ((MsgPacket**)&msg, g_nISOMbx);
154+ if (res == KE_OK) {
155+ msg->SetActive (false );
156+ msg->SetUnk1 (false );
157+ msg->SetUnk2 (false );
158+ msg->file = nullptr ;
159+ msg->callback = NullCallback;
160+
161+ switch (msg->msg_kind ) {
162+ case LOAD_TO_EE_CMD_ID:
163+ case LOAD_TO_IOP_CMD_ID:
164+ case LOAD_TO_EE_OFFSET_CMD_ID:
165+ break ;
166+ default :
167+ lg::error (" unhandled iso msg type {:x}" , msg->msg_kind );
168+ break ;
169+ }
170+ }
171+
141172 DelayThread (4000 );
142173 }
143174
@@ -208,4 +239,37 @@ s32 GetISOFileLength(const ISOFileDef* fd) {
208239 return g_pFileSystem->GetLength (fd);
209240}
210241
242+ int NullCallback (ISO_Msg* msg) {
243+ return 7 ;
244+ }
245+
246+ void ISO_Hdr::SetActive (bool b) {
247+ m_bActive = b;
248+ }
249+
250+ void ISO_Hdr::SetUnk1 (bool b) {
251+ unk1 = b;
252+ }
253+
254+ void ISO_Hdr::SetUnk2 (bool b) {
255+ unk2 = b;
256+ }
257+
258+ void ISOBuffer::AdjustDataLength (int size) {
259+ int state;
260+
261+ CpuSuspendIntr (&state);
262+ decompressed_size -= size;
263+ CpuResumeIntr (state);
264+ }
265+
266+ void ISOBuffer::AdvanceCurrentData (int size) {
267+ int state;
268+
269+ CpuSuspendIntr (&state);
270+ decomp_buffer += size;
271+ decompressed_size -= size;
272+ CpuResumeIntr (state);
273+ }
274+
211275} // namespace jak3
0 commit comments