More CSND stubbing

This commit is contained in:
wheremyfoodat 2023-09-10 16:51:44 +03:00
parent da29cecf7a
commit b394cacbc7
6 changed files with 67 additions and 6 deletions

View file

@ -46,6 +46,7 @@ namespace KernelHandles {
GSPSharedMemHandle = MaxServiceHandle + 1, // Handle for the GSP shared memory
FontSharedMemHandle,
CSNDSharedMemHandle,
HIDSharedMemHandle,
MinSharedMemHandle = GSPSharedMemHandle,

View file

@ -112,10 +112,11 @@ class Memory {
// This tracks our OS' memory allocations
std::vector<KernelMemoryTypes::MemoryInfo> memoryInfo;
std::array<SharedMemoryBlock, 3> sharedMemBlocks = {
std::array<SharedMemoryBlock, 4> sharedMemBlocks = {
SharedMemoryBlock(0, 0, KernelHandles::FontSharedMemHandle), // Shared memory for the system font (size is 0 because we read the size from the cmrc filesystem
SharedMemoryBlock(0, 0x1000, KernelHandles::GSPSharedMemHandle), // GSP shared memory
SharedMemoryBlock(0, 0x1000, KernelHandles::HIDSharedMemHandle) // HID shared memory
SharedMemoryBlock(0, 0x1000, KernelHandles::HIDSharedMemHandle), // HID shared memory
SharedMemoryBlock(0, 0x3000, KernelHandles::CSNDSharedMemHandle), // CSND shared memory
};
public:

View file

@ -1,16 +1,28 @@
#pragma once
#include <optional>
#include "helpers.hpp"
#include "kernel_types.hpp"
#include "logger.hpp"
#include "memory.hpp"
// Circular dependencies ^-^
class Kernel;
class CSNDService {
Handle handle = KernelHandles::CSND;
Memory& mem;
Kernel& kernel;
MAKE_LOG_FUNCTION(log, csndLogger)
bool initialized = false;
std::optional<Handle> csndMutex = std::nullopt;
// Service functions
void initialize(u32 messagePointer);
public:
CSNDService(Memory& mem) : mem(mem) {}
CSNDService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel) {}
void reset();
void handleSyncRequest(u32 messagePointer);
};