Skip to content

Commit

Permalink
Add logging of Additional chunk data
Browse files Browse the repository at this point in the history
Easy to compare JPCSP emulator log. Debugging in hrydgard#19994
  • Loading branch information
sum2012 committed Feb 21, 2025
1 parent 4565cc2 commit e877b81
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Core/HLE/AtracCtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "Core/HLE/AtracCtx.h"
#include "Core/HW/Atrac3Standalone.h"
#include "Core/HLE/sceKernelMemory.h"
#include <sstream>
#include <iomanip>

const size_t overAllocBytes = 16384;

Expand Down Expand Up @@ -357,6 +359,21 @@ int AnalyzeAtracTrack(u32 addr, u32 size, Track *track) {
// This is the offset to the jointStereo_ field.
track->jointStereo = Memory::Read_U32(addr + offset + 24);
}
if (chunkSize > 16) {
std::stringstream restChunkStream;

// Read and format extra bytes as hexadecimal
for (int i = 16; i < chunkSize; ++i) {
unsigned char byte = Memory::Read_U8(addr + offset + i);
restChunkStream << " " << std::hex << std::uppercase << std::setw(2) << std::setfill('0') << (int)byte;
}

std::string restChunk = restChunkStream.str();
if (!restChunk.empty()) {
DEBUG_LOG(Log::ME, "Additional chunk data:%s", restChunk.c_str());
}

}
}
break;
case FACT_CHUNK_MAGIC:
Expand Down

0 comments on commit e877b81

Please sign in to comment.