mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
The beginning of another approach on Zelda HLE UCode: PB debugging and comparison
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4481 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -108,8 +108,8 @@ union ZeldaVoicePB
|
||||
u32 StartAddr; // 0x8C | sound start address
|
||||
u32 UnkAddr; // 0x8E | ???
|
||||
u16 Padding[0x10]; // 0x90 | padding
|
||||
u16 Padding2[0x8]; // 0xa0 | FIR filter coefs of some sort
|
||||
u16 FilterEnable; // 0xa8 | FilterBufferInPlace enable.
|
||||
u16 Padding2[0x8]; // 0xa0 | FIR filter coefs of some sort (0xa4 controls the appearance of 0xa5-0xa7 and is almost always 0x7FFF)
|
||||
u16 FilterEnable; // 0xa8 | FilterBufferInPlace enable
|
||||
u16 Padding3[0x7]; // 0xa9 | padding
|
||||
u16 Padding4[0x10]; // 0xb0 | padding
|
||||
};
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "../main.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void CUCode_Zelda::ReadVoicePB(u32 _Addr, ZeldaVoicePB& PB)
|
||||
{
|
||||
u16 *memory = (u16*)g_dspInitialize.pGetMemoryPointer(_Addr);
|
||||
@ -220,9 +222,28 @@ clear_buffer:
|
||||
PB.CurAddr += rem_samples;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void PrintObject(const T &Obj)
|
||||
{
|
||||
char byte[2] = {0};
|
||||
std::stringstream ss;
|
||||
u8 *o = (u8 *)&Obj;
|
||||
for(int i = 0; i < sizeof(T); i++) {
|
||||
if(i > 0 && i % 2 == 0)
|
||||
ss << " ";
|
||||
|
||||
sprintf(byte, "%02X", Common::swap16(o[i]));
|
||||
ss << byte;
|
||||
}
|
||||
|
||||
DEBUG_LOG(DSPHLE, "AFC PB: %s", ss.str().c_str());
|
||||
}
|
||||
|
||||
void CUCode_Zelda::RenderVoice_AFC(ZeldaVoicePB &PB, s16 *_Buffer, int _Size)
|
||||
{
|
||||
// TODO: Compare mono, stereo and surround samples
|
||||
PrintObject(PB);
|
||||
|
||||
int _RealSize = SizeForResampling(PB, _Size, PB.RatioInt);
|
||||
|
||||
// initialize "decoder" if the sample is played the first time
|
||||
@ -340,6 +361,7 @@ restart:
|
||||
PB.CurAddr = prev_addr;
|
||||
|
||||
PB.NeedsReset = 0;
|
||||
// PB.CurBlock = 0x10 - (PB.LoopStartPos & 0xf);
|
||||
// write back
|
||||
// NumberOfSamples = (NumberOfSamples << 4) | frac; // missing fraction
|
||||
|
||||
|
Reference in New Issue
Block a user