Add SPU memory allocation

This commit is contained in:
2024-08-07 23:01:43 -05:00
parent 0b340abb20
commit f18c1eb137
7 changed files with 181 additions and 4 deletions

View File

@@ -34,4 +34,14 @@ namespace JabyEngine {
}
return result;
}
template<typename T>
static constexpr T min_of(T a, T b) {
return (a < b) ? a : b;
}
template<typename T>
static constexpr T max_of(T a, T b) {
return (a > b) ? a : b;
}
}

11
include/PSX/SPU/spu.hpp Normal file
View File

@@ -0,0 +1,11 @@
#pragma once
#include "../jabyengine.hpp"
namespace JabyEngine {
namespace SPU {
const uint8_t* allocate_voice(uint8_t voice, size_t size);
void deallocate_voice(uint8_t voice);
void dump();
}
}

View File

@@ -4,6 +4,10 @@
namespace JabyEngine {
namespace SPU_IO {
namespace MemoryMap {
static constexpr uintptr_t ADPCM = 0x01000;
}
enum struct Mode {
Linear = 0,
Exponential = 1,
@@ -126,7 +130,8 @@ namespace JabyEngine {
static constexpr auto EchoBits = BitRange::from_to(0, 23);
};
static constexpr size_t VoiceCount = 24;
static constexpr size_t VoiceCount = 24;
static constexpr size_t ReverbCount = 1;
struct Key {
__declare_io_port_w_type(inline, ubus32_t, On, 0x1F801D88);