mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-16 10:02:59 -07:00
Audio code converted to uintptr_t
This commit is contained in:
parent
e6c959e500
commit
7a4da43d7b
7 changed files with 86 additions and 81 deletions
|
@ -249,7 +249,7 @@ void AudioHeap_PopCache(s32 tableType) {
|
|||
persistent->numEntries--;
|
||||
}
|
||||
|
||||
void AudioHeap_InitMainPools(ptrdiff_t initPoolSize) {
|
||||
void AudioHeap_InitMainPools(size_t initPoolSize) {
|
||||
AudioHeap_AllocPoolInit(&gAudioContext.audioInitPool, gAudioContext.audioHeap, initPoolSize);
|
||||
AudioHeap_AllocPoolInit(&gAudioContext.audioSessionPool, gAudioContext.audioHeap + initPoolSize,
|
||||
gAudioContext.audioHeapSize - initPoolSize);
|
||||
|
@ -1266,18 +1266,18 @@ void AudioHeap_DiscardSampleCaches(void) {
|
|||
}
|
||||
|
||||
typedef struct {
|
||||
u32 oldAddr;
|
||||
u32 newAddr;
|
||||
uintptr_t oldAddr;
|
||||
uintptr_t newAddr;
|
||||
size_t size;
|
||||
u8 newMedium;
|
||||
} StorageChange;
|
||||
|
||||
void AudioHeap_ChangeStorage(StorageChange* change, SoundFontSample* sample) {
|
||||
if (sample != NULL) {
|
||||
u32 start = change->oldAddr;
|
||||
u32 end = change->oldAddr + change->size;
|
||||
uintptr_t start = change->oldAddr;
|
||||
uintptr_t end = change->oldAddr + change->size;
|
||||
|
||||
if (start <= (u32)sample->sampleAddr && (u32)sample->sampleAddr < end) {
|
||||
if (start <= sample->sampleAddr && sample->sampleAddr < end) {
|
||||
sample->sampleAddr = sample->sampleAddr - start + change->newAddr;
|
||||
sample->medium = change->newMedium;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue