Merge branch 'master' into fastmem

This commit is contained in:
wheremyfoodat 2024-12-01 01:20:17 +02:00
commit f7dc10bc41
13 changed files with 162 additions and 7 deletions

View file

@ -58,6 +58,7 @@ struct EmulatorConfig {
bool enableRenderdoc = false;
bool printAppVersion = true;
bool printDSPFirmware = false;
bool chargerPlugged = true;
// Default to 3% battery to make users suffer

View file

@ -10,6 +10,7 @@
#include "memory.hpp"
#include "result/result.hpp"
struct EmulatorConfig;
// Circular dependencies!
class Kernel;
@ -19,7 +20,9 @@ class DSPService {
Handle handle = KernelHandles::DSP;
Memory& mem;
Kernel& kernel;
const EmulatorConfig& config;
Audio::DSPCore* dsp = nullptr;
MAKE_LOG_FUNCTION(log, dspServiceLogger)
// Number of DSP pipes
@ -58,7 +61,7 @@ class DSPService {
void writeProcessPipe(u32 messagePointer);
public:
DSPService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel) {}
DSPService(Memory& mem, Kernel& kernel, const EmulatorConfig& config) : mem(mem), kernel(kernel), config(config) {}
void reset();
void handleSyncRequest(u32 messagePointer);
void setDSPCore(Audio::DSPCore* pointer) { dsp = pointer; }
@ -84,4 +87,5 @@ class DSPService {
void triggerInterrupt1();
ComponentDumpResult dumpComponent(const std::filesystem::path& path);
void printFirmwareInfo();
};

View file

@ -0,0 +1,76 @@
#pragma once
#include <array>
#include "helpers.hpp"
namespace DSP {
struct FirmwareInfo {
using Hash = std::array<u8, 32>;
Hash hash; // Firmware hash (SHA-256)
u32 size; // Firmware size in bytes
bool supportsAAC; // Does this firmware support AAC decoding?
const char* notes; // Miscellaneous notes about the firmware
explicit constexpr FirmwareInfo(const Hash& hash, u32 size, bool supportsAAC, const char* notes)
: hash(hash), size(size), supportsAAC(supportsAAC), notes(notes) {}
};
static constexpr std::array<FirmwareInfo, 9> firmwareDB = {
FirmwareInfo(
{0x47, 0xD6, 0x6C, 0xD2, 0x13, 0x1, 0xFF, 0x62, 0xAD, 0x16, 0x98, 0x2, 0x46, 0x67, 0xF3, 0x9,
0xDA, 0x7, 0x20, 0x9E, 0xFB, 0xB, 0x6A, 0x81, 0x98, 0xFF, 0x9B, 0xE0, 0x51, 0x67, 0xC9, 0xA6},
48480, false, "Spotted in some versions of Activity Log potentially other apps"
),
FirmwareInfo(
{0xF5, 0xDA, 0x79, 0xE7, 0x24, 0x6C, 0x51, 0x9A, 0x28, 0x6C, 0x50, 0xC9, 0x9F, 0xA1, 0xE6, 0x4D,
0xA5, 0x72, 0x96, 0x5F, 0xEA, 0x14, 0x20, 0xA7, 0x70, 0x90, 0x57, 0x42, 0x34, 0x6E, 0x18, 0xD1},
49674, false, "One of the most common firmwares. Found in NSMB2 and others"
),
FirmwareInfo(
{0x94, 0x4B, 0x40, 0xB5, 0x46, 0x93, 0xF4, 0xB1, 0xD9, 0x52, 0xBE, 0x84, 0x87, 0xE9, 0xE9, 0x1F,
0x66, 0x7F, 0xC4, 0x89, 0xF8, 0x15, 0x79, 0xF, 0x3D, 0x3E, 0x89, 0x26, 0x5F, 0xE0, 0x89, 0xC4},
49800, false, "One of the most common firmwares. Found in Majora's Mask and others"
),
FirmwareInfo(
{0x8E, 0x21, 0x3F, 0x3E, 0x71, 0xD2, 0xE3, 0xE4, 0x5D, 0x11, 0x69, 0xBA, 0xC6, 0x46, 0x5A, 0x70,
0xEA, 0xBE, 0xB2, 0x2B, 0x30, 0x3F, 0x1F, 0xA6, 0xD7, 0x67, 0x93, 0x70, 0xFF, 0xAD, 0xF, 0x54},
49756, false, "Fairly common firmware. Found in PSMD and others"
),
FirmwareInfo(
{0xA2, 0x6C, 0x74, 0xD1, 0xEF, 0x7F, 0x4F, 0xA5, 0xFF, 0xFF, 0xFB, 0xEC, 0x75, 0x8A, 0x40, 0x8D,
0x8F, 0x22, 0x87, 0x72, 0x78, 0x1B, 0x81, 0x88, 0x86, 0x5F, 0x83, 0x4D, 0x1D, 0x90, 0x6B, 0xAA},
48804, false, "Spotted in MK7"
),
FirmwareInfo(
{0x75, 0x12, 0x70, 0xB2, 0x43, 0xB0, 0xCA, 0xFB, 0x51, 0x99, 0xF2, 0x98, 0x2, 0x2, 0xC9, 0xB4,
0xC7, 0x7A, 0x67, 0x5E, 0xF0, 0x43, 0x8F, 0xD5, 0xA8, 0x9E, 0x83, 0xAA, 0xB9, 0xA8, 0x7, 0x9B},
48652, false, "One of the most common firmwares. Found in OoT, Pokemon Rumble Blast, and others"
),
FirmwareInfo(
{0xF2, 0x96, 0xE2, 0xE5, 0xEC, 0x34, 0x9F, 0x6A, 0x6C, 0xF3, 0xE1, 0xC7, 0xC, 0xDD, 0x65, 0xC2,
0x2, 0x72, 0xB6, 0xE7, 0xFF, 0xE5, 0x57, 0x92, 0x69, 0x4E, 0x83, 0xAE, 0x24, 0xF1, 0x68, 0xBF},
217976, true, "Most common AAC-enabled firmware. Found in Rhythm Heaven, Fire Emblem Fates/Echoes, Pokemon X/Y, and others"
),
FirmwareInfo(
{0xF0, 0x6C, 0x1B, 0x59, 0x23, 0xE1, 0x71, 0x19, 0x5, 0x66, 0x59, 0xCB, 0x3D, 0x9B, 0xF0, 0x26,
0x62, 0x84, 0xE9, 0xA6, 0xC0, 0x8, 0x23, 0x99, 0xD7, 0x45, 0x8D, 0x7C, 0x52, 0xAE, 0x32, 0x1C},
48708, false, "Spotted in Super Mario 3D Land"
),
FirmwareInfo(
{0x7E, 0xA3, 0xC4, 0x4A, 0x1C, 0x57, 0x51, 0x4B, 0xEB, 0xBE, 0xBC, 0xE8, 0xA7, 0x99, 0x5F, 0x7F,
0x3A, 0x29, 0x1, 0x70, 0xEA, 0x3B, 0x6C, 0x14, 0x57, 0x49, 0xAD, 0x93, 0x58, 0x67, 0x2C, 0x97},
49716, false, "Spotted in PMD: GTI"
),
};
} // namespace DSP