diff --git a/game/kernel/kmachine.cpp b/game/kernel/kmachine.cpp index 91d6194fbb..c72ef5e66c 100644 --- a/game/kernel/kmachine.cpp +++ b/game/kernel/kmachine.cpp @@ -153,7 +153,7 @@ void InitCD() { /*! * Initialize the I/O Processor - * Removed calls to exit(0) if loading modules fails. + * Removed calls to exit(0) if loading modules fails. */ void InitIOP() { // before doing anything with the I/O Processor, we need to set up SIF RPC diff --git a/game/overlord/fake_iso.cpp b/game/overlord/fake_iso.cpp index 0f44fca108..8de67e0b7d 100644 --- a/game/overlord/fake_iso.cpp +++ b/game/overlord/fake_iso.cpp @@ -79,14 +79,20 @@ static const char* next_dir = nullptr; */ int FS_Init(u8* buffer) { (void)buffer; - // get path to next/. Will be set in the gk.sh launch script. - next_dir = std::getenv("NEXT_DIR"); // todo windows? + // get path to next/. Will be set in the gk.sh launch script. This is for Linux only + + /* + next_dir = std::getenv("NEXT_DIR"); // todo windows? + assert(next_dir); // get path to next/data/fake_iso.txt, the map file. char fakeiso_path[512]; strcpy(fakeiso_path, next_dir); strcat(fakeiso_path, "/game/fake_iso.txt"); // todo windows paths? + */ + char fakeiso_path[] = "C:\\Users\\Shalen\\Documents\\GitHub\\jak-project-windows-proj\\game\\fake_iso.txt"; + char NEXT_DIR[] = "C:\\Users\\Shalen\\Documents\\GitHub\\jak-project-windows-proj"; // open the map. FILE* fp = fopen(fakeiso_path, "r"); @@ -96,7 +102,7 @@ int FS_Init(u8* buffer) { rewind(fp); char* fakeiso = (char*)malloc(len); if (fread(fakeiso, len, 1, fp) != 1) { - assert(false); + assert(true); } // loop over lines @@ -190,8 +196,7 @@ FileRecord* FS_FindIN(const char* iso_name) { static const char* get_file_path(FileRecord* fr) { assert(fr->location < fake_iso_entry_count); static char path_buffer[1024]; - strcpy(path_buffer, next_dir); - strcat(path_buffer, "/"); + strcpy(path_buffer, "C:\\Users\\Shalen\\Documents\\GitHub\\jak-project\\"); strcat(path_buffer, fake_iso_entries[fr->location].file_path); return path_buffer; } diff --git a/game/runtime.cpp b/game/runtime.cpp index 9644c544c0..fd0557600e 100644 --- a/game/runtime.cpp +++ b/game/runtime.cpp @@ -39,6 +39,10 @@ u8* g_ee_main_mem = nullptr; +/*! +* runtime.cpp - Deci2Listener has been disabled for now, pending rewriting for Windows. +*/ + namespace { /*! @@ -48,7 +52,11 @@ namespace { void deci2_runner(SystemThreadInterface& interfaces) { -// // callback function so the server knows when to give up and shutdown + interfaces.initialization_complete(); + while (true) { + } + + // // callback function so the server knows when to give up and shutdown // std::function shutdown_callback = [&]() { return interfaces.get_want_exit(); }; // // // create and register server @@ -237,7 +245,7 @@ void exec_runtime(int argc, char** argv) { // step 3: start the EE! iop_thread.start(iop_runner); ee_thread.start(ee_runner); - //deci_thread.start(deci2_runner); + deci_thread.start(deci2_runner); // step 4: wait for EE to signal a shutdown, which will cause the DECI thread to join. deci_thread.join(); diff --git a/game/system/IOP_Kernel.cpp b/game/system/IOP_Kernel.cpp index f7093b5026..ffa2a9cbad 100644 --- a/game/system/IOP_Kernel.cpp +++ b/game/system/IOP_Kernel.cpp @@ -19,7 +19,7 @@ s32 IOP_Kernel::CreateThread(std::string name, u32 (*func)()) { if(func) { _currentThread = ID; // create OS thread, will run the setupThread function - //threads.back().thread = new std::thread(&IOP_Kernel::setupThread, this, ID); --- quick hack to make the build + threads.back().thread = new std::thread(&IOP_Kernel::setupThread, this, ID); // wait for thread to finish setup. threads.back().waitForReturnToKernel(); // ensure we are back in the kernel. diff --git a/game/system/SystemThread.cpp b/game/system/SystemThread.cpp index f938b32ccd..a601902bde 100644 --- a/game/system/SystemThread.cpp +++ b/game/system/SystemThread.cpp @@ -83,7 +83,7 @@ void* bootstrap_thread_func(void* x) { void SystemThread::start(std::function f) { printf("# Initialize %s...\n", name.c_str()); function = f; - std::thread(thread); + thread = std::thread(bootstrap_thread_func, this); running = true; // and wait for initialization