Files
jak-project/game/overlord/iso_api.cpp
T
Shay e2ea57ea58 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
2020-10-01 16:08:23 -06:00

47 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::info("[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::info("[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;
}
}