mirror of
https://github.com/open-goal/jak-project
synced 2026-08-21 23:00:45 -04:00
ugh more clang-format
why
This commit is contained in:
+1
-4
@@ -8,18 +8,15 @@
|
||||
#include "third-party/spdlog/include/spdlog/spdlog.h"
|
||||
#include "third-party/spdlog/include/spdlog/sinks/basic_file_sink.h"
|
||||
|
||||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
while (true) {
|
||||
spdlog::set_level(spdlog::level::debug);
|
||||
spdlog::info("spdlog initialized");
|
||||
spdlog::debug("This is a debug-only message");
|
||||
// run the runtime in a loop so we can reset the game and have it restart cleanly
|
||||
//printf("gk %d.%d\n", versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR);
|
||||
// printf("gk %d.%d\n", versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR);
|
||||
spdlog::debug("gk {}.{} OK!\n", versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR);
|
||||
|
||||
|
||||
if (exec_runtime(argc, argv) == 2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+13
-12
@@ -68,7 +68,7 @@ void deci2_runner(SystemThreadInterface& iface) {
|
||||
iface.initialization_complete();
|
||||
|
||||
// in our own thread, wait for the EE to register the first protocol driver
|
||||
//printf("[DECI2] waiting for EE to register protos\n");
|
||||
// printf("[DECI2] waiting for EE to register protos\n");
|
||||
spdlog::debug("[DECI2] Waiting for EE to register protos");
|
||||
server.wait_for_protos_ready();
|
||||
// then allow the server to accept connections
|
||||
@@ -77,7 +77,8 @@ void deci2_runner(SystemThreadInterface& iface) {
|
||||
}
|
||||
|
||||
printf("[DECI2] waiting for listener...\n");
|
||||
//spdlog::debug("[DECI2] Waiting for listener..."); --> disabled temporarily, some weird race condition?
|
||||
// spdlog::debug("[DECI2] Waiting for listener..."); --> disabled temporarily, some weird race
|
||||
// condition?
|
||||
bool saw_listener = false;
|
||||
while (!iface.get_want_exit()) {
|
||||
if (server.check_for_listener()) {
|
||||
@@ -120,22 +121,22 @@ void ee_runner(SystemThreadInterface& iface) {
|
||||
}
|
||||
|
||||
if (g_ee_main_mem == (u8*)(-1)) {
|
||||
//printf(" Failed to initialize main memory! %s\n", strerror(errno));
|
||||
// printf(" Failed to initialize main memory! %s\n", strerror(errno));
|
||||
spdlog::debug("Failed to initialize main memory! {}", strerror(errno));
|
||||
iface.initialization_complete();
|
||||
return;
|
||||
}
|
||||
|
||||
printf(" Main memory mapped at 0x%016llx\n", (u64)(g_ee_main_mem));
|
||||
//spdlog::debug("Main memory mapped at 0x00000") --- todo: printf conversion specification
|
||||
// spdlog::debug("Main memory mapped at 0x00000") --- todo: printf conversion specification
|
||||
printf(" Main memory size 0x%x bytes (%.3f MB)\n", EE_MAIN_MEM_SIZE,
|
||||
(double)EE_MAIN_MEM_SIZE / (1 << 20));
|
||||
|
||||
//printf("[EE] Initialization complete!\n");
|
||||
// printf("[EE] Initialization complete!\n");
|
||||
spdlog::debug("[EE] Initialization complete!");
|
||||
iface.initialization_complete();
|
||||
|
||||
//printf("[EE] Run!\n");
|
||||
// printf("[EE] Run!\n");
|
||||
spdlog::debug("[EE] Run!");
|
||||
memset((void*)g_ee_main_mem, 0, EE_MAIN_MEM_SIZE);
|
||||
|
||||
@@ -158,7 +159,7 @@ void ee_runner(SystemThreadInterface& iface) {
|
||||
kprint_init_globals();
|
||||
|
||||
goal_main(g_argc, g_argv);
|
||||
//printf("[EE] Done!\n");
|
||||
// printf("[EE] Done!\n");
|
||||
spdlog::debug("[EE] Done!");
|
||||
|
||||
// // kill the IOP todo
|
||||
@@ -175,7 +176,7 @@ void ee_runner(SystemThreadInterface& iface) {
|
||||
*/
|
||||
void iop_runner(SystemThreadInterface& iface) {
|
||||
IOP iop;
|
||||
//printf("[IOP] Restart!\n");
|
||||
// printf("[IOP] Restart!\n");
|
||||
spdlog::debug("[IOP] Restart!");
|
||||
iop.reset_allocator();
|
||||
ee::LIBRARY_sceSif_register(&iop);
|
||||
@@ -199,14 +200,14 @@ void iop_runner(SystemThreadInterface& iface) {
|
||||
|
||||
iface.initialization_complete();
|
||||
|
||||
//printf("[IOP] Wait for OVERLORD to be started...\n");
|
||||
// printf("[IOP] Wait for OVERLORD to be started...\n");
|
||||
spdlog::debug("[IOP] Wait for OVERLORD to start...");
|
||||
iop.wait_for_overlord_start_cmd();
|
||||
if (iop.status == IOP_OVERLORD_INIT) {
|
||||
//printf("[IOP] Run!\n");
|
||||
// printf("[IOP] Run!\n");
|
||||
spdlog::debug("[IOP] Run!");
|
||||
} else {
|
||||
//printf("[IOP] shutdown!\n");
|
||||
// printf("[IOP] shutdown!\n");
|
||||
spdlog::debug("[IOP] Shutdown!");
|
||||
return;
|
||||
}
|
||||
@@ -269,7 +270,7 @@ u32 exec_runtime(int argc, char** argv) {
|
||||
|
||||
// join and exit
|
||||
tm.join();
|
||||
//printf("GOAL Runtime Shutdown (code %d)\n", MasterExit);
|
||||
// printf("GOAL Runtime Shutdown (code %d)\n", MasterExit);
|
||||
spdlog::info("GOAL Runtime Shutdown (code {})", MasterExit);
|
||||
return MasterExit;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ void SystemThreadManager::print_stats() {
|
||||
*/
|
||||
void SystemThreadManager::shutdown() {
|
||||
for (int i = 0; i < thread_count; i++) {
|
||||
//printf("# Stop %s\n", threads[i].name.c_str());
|
||||
// printf("# Stop %s\n", threads[i].name.c_str());
|
||||
spdlog::debug("# Stop {}", threads[i].name.c_str());
|
||||
threads[i].stop();
|
||||
}
|
||||
@@ -61,7 +61,7 @@ void SystemThreadManager::shutdown() {
|
||||
*/
|
||||
void SystemThreadManager::join() {
|
||||
for (int i = 0; i < thread_count; i++) {
|
||||
//printf("# Join %s\n", threads[i].name.c_str());
|
||||
// printf("# Join %s\n", threads[i].name.c_str());
|
||||
spdlog::debug(" # Join {}", threads[i].name.c_str());
|
||||
if (threads[i].running) {
|
||||
threads[i].join();
|
||||
@@ -76,7 +76,7 @@ void* bootstrap_thread_func(void* x) {
|
||||
SystemThread* thd = (SystemThread*)x;
|
||||
SystemThreadInterface iface(thd);
|
||||
thd->function(iface);
|
||||
//printf("[SYSTEM] Thread %s is returning\n", thd->name.c_str());
|
||||
// printf("[SYSTEM] Thread %s is returning\n", thd->name.c_str());
|
||||
spdlog::debug("[SYSTEM] Thread {} is returning", thd->name.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
@@ -85,9 +85,9 @@ void* bootstrap_thread_func(void* x) {
|
||||
* Start a thread and wait for its initialization
|
||||
*/
|
||||
void SystemThread::start(std::function<void(SystemThreadInterface&)> f) {
|
||||
//printf("# Initialize %s...\n", name.c_str());
|
||||
// printf("# Initialize %s...\n", name.c_str());
|
||||
spdlog::debug("# Initialize {}...", name.c_str());
|
||||
|
||||
|
||||
function = f;
|
||||
thread = std::thread(bootstrap_thread_func, this);
|
||||
running = true;
|
||||
@@ -124,7 +124,7 @@ void SystemThreadInterface::initialization_complete() {
|
||||
std::unique_lock<std::mutex> mlk(thread.initialization_mutex);
|
||||
thread.initialization_complete = true;
|
||||
thread.initialization_cv.notify_all();
|
||||
//printf("# %s initialized\n", thread.name.c_str());
|
||||
// printf("# %s initialized\n", thread.name.c_str());
|
||||
spdlog::debug("# {} initialized", thread.name.c_str());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user