Make isviewer a sink to file

This commit is contained in:
2026-03-31 11:42:38 +02:00
parent 8241e9735a
commit f8b5800486
3 changed files with 4 additions and 1 deletions
+1
View File
@@ -9,6 +9,7 @@ namespace n64 {
Mem::Mem() : flash(saveData) { Mem::Mem() : flash(saveData) {
rom.cart.resize(CART_SIZE); rom.cart.resize(CART_SIZE);
std::ranges::fill(rom.cart, 0); std::ranges::fill(rom.cart, 0);
isviewer_sink = std::ofstream("isviewer.log", std::ios::app);
} }
void Mem::Reset() { void Mem::Reset() {
+1
View File
@@ -140,6 +140,7 @@ private:
void WriteJIT(u32, u64); void WriteJIT(u32, u64);
std::array<u8, ISVIEWER_SIZE> isviewer{}; std::array<u8, ISVIEWER_SIZE> isviewer{};
std::ofstream isviewer_sink{};
int mmioSize{}, flashSize{}; int mmioSize{}, flashSize{};
JIT *jit = nullptr; JIT *jit = nullptr;
std::string sramPath{}; std::string sramPath{};
+2 -1
View File
@@ -321,7 +321,8 @@ void PI::BusWrite<u32, false>(u32 addr, u32 val) {
if (val < CART_ISVIEWER_SIZE) { if (val < CART_ISVIEWER_SIZE) {
std::string message(val + 1, 0); std::string message(val + 1, 0);
std::copy_n(mem.isviewer.begin(), val, message.begin()); std::copy_n(mem.isviewer.begin(), val, message.begin());
always("{}", message); mem.isviewer_sink << message;
mem.isviewer_sink.flush();
} else { } else {
panic("ISViewer buffer size is emulated at {} bytes, but received a flush command for {} bytes!", panic("ISViewer buffer size is emulated at {} bytes, but received a flush command for {} bytes!",
CART_ISVIEWER_SIZE, val); CART_ISVIEWER_SIZE, val);