Initial commit

This commit is contained in:
Gericom
2025-11-22 11:08:28 +01:00
commit 9cf3ffbfcf
358 changed files with 58350 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#pragma once
#include "logger/IOutputStream.h"
#define REG_NOCASH_STRING_OUT (*(vu32*)0x04FFFA10)
#define REG_NOCASH_CHAR_OUT (*(vu32*)0x04FFFA1C)
class NocashOutputStream : public IOutputStream
{
public:
void Write(const char* str) override
{
// melon ds doesn't support string addresses in itcm and dtcm
char c;
while ((c = *str++) != 0)
{
REG_NOCASH_CHAR_OUT = c;
}
// REG_NOCASH_STRING_OUT = (u32)str;
}
void Flush() override { }
};

View File

@@ -0,0 +1,25 @@
#pragma once
#include "core/mini-printf.h"
#include "logger/ILogger.h"
#include "logger/IOutputStream.h"
class PlainLogger : public ILogger
{
LogLevel _maxLogLevel;
IOutputStream* _outputStream;
// char _logBuffer[512];
public:
PlainLogger(LogLevel maxLogLevel, IOutputStream* outputStream)
: _maxLogLevel(maxLogLevel), _outputStream(outputStream) { }
void LogV(LogLevel level, const char* fmt, va_list vlist) override
{
if (level > _maxLogLevel)
return;
char logBuffer[128];
mini_vsnprintf(logBuffer, sizeof(logBuffer), fmt, vlist);
_outputStream->Write(logBuffer);
}
};