mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
c2cb053a5d
* Commit new spdlog implementation Hopefully resolves Linux build dependency errors * clang formatting * Fix Linux-only definition Found the culprit! * More Linux fixes Linus Torvalds have mercy on my soul * Replace printf logging with spdlog equivalent Preserve previous printfs in comments for now. Spdlog needs to be configured to be thread-safe. Few additional printfs to convert later. No changes have been made to GOAL's internal printing system * clang-format stuff * ugh more clang-format why * Another shot * CMakeLists.txt update Fix issues related to spdlog version targeting * Remove old prints + fix log types Up next is the transition to a git submodule, should be simple enough * spdlog is now a git submodule * adapted for project * Linux fix * More fixes Yikes * Update for linux I should really fix my WSL environment * Update workflow.yaml Hopefully will resolve issues with GitHub Actions on Linux
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
#include "iso_api.h"
|
|
#include "game/sce/iop.h"
|
|
#include "third-party/spdlog/include/spdlog/spdlog.h"
|
|
|
|
using namespace iop;
|
|
|
|
/*!
|
|
* Load a File to IOP memory (blocking)
|
|
*/
|
|
void LoadISOFileToIOP(FileRecord* file, void* addr, uint32_t length) {
|
|
// printf("[OVERLORD] LoadISOFileToIOP %s, %d/%d bytes\n", file->name, length, file->size);
|
|
spdlog::debug("[OVERLORD] LoadISOFileToIOP {}, {}/{} bytes", file->name, length, file->size);
|
|
IsoCommandLoadSingle cmd;
|
|
cmd.cmd_id = LOAD_TO_IOP_CMD_ID;
|
|
cmd.messagebox_to_reply = 0;
|
|
cmd.thread_id = GetThreadId();
|
|
cmd.file_record = file;
|
|
cmd.dest_addr = (u8*)addr;
|
|
cmd.length = length;
|
|
SendMbx(iso_mbx, &cmd);
|
|
SleepThread();
|
|
|
|
if (cmd.status) {
|
|
cmd.length_to_copy = 0;
|
|
}
|
|
}
|
|
|
|
/*!
|
|
* Load a File to IOP memory (blocking)
|
|
*/
|
|
void LoadISOFileToEE(FileRecord* file, uint32_t addr, uint32_t length) {
|
|
// printf("[OVERLORD] LoadISOFileToEE %s, %d/%d bytes\n", file->name, length, file->size);
|
|
spdlog::debug("[OVERLORD] LoadISOFileToEE {}, {}/{} bytes", file->name, length, file->size);
|
|
IsoCommandLoadSingle cmd;
|
|
cmd.cmd_id = LOAD_TO_EE_CMD_ID;
|
|
cmd.messagebox_to_reply = 0;
|
|
cmd.thread_id = GetThreadId();
|
|
cmd.file_record = file;
|
|
cmd.dest_addr = (u8*)(u64)addr;
|
|
cmd.length = length;
|
|
SendMbx(iso_mbx, &cmd);
|
|
SleepThread();
|
|
|
|
if (cmd.status) {
|
|
cmd.length_to_copy = 0;
|
|
}
|
|
}
|