updae melonds, rework the audio so it is internally resampled with blip_buf (also allows for avoiding some copying, also corrects some minor audio defects)

This commit is contained in:
CasualPokePlayer 2022-12-16 23:02:15 -08:00
parent 5e9e9ac289
commit 5f0e6a2242
3 changed files with 7 additions and 9 deletions

View File

@ -446,12 +446,11 @@ EXPORT void FrameAdvance(MyFrameInfo* f)
memcpy(f->VideoBuffer + SingleScreenSize, GPU::Framebuffer[GPU::FrontBuffer][1], SingleScreenSize * sizeof (u32));
f->Width = 256;
f->Height = 384;
f->Samples = SPU::GetOutputSize() / 2;
SPU::ReadOutput(f->SoundBuffer, f->Samples);
if (f->Samples < 547) // hack
f->Samples = SPU::ReadOutput(f->SoundBuffer);
if (f->Samples < 737) // hack
{
memset(f->SoundBuffer + (f->Samples * 2), 0, ((547 * 2) - (f->Samples * 2)) * sizeof (u16));
f->Samples = 547;
memset(f->SoundBuffer + (f->Samples * 2), 0, ((737 * 2) - (f->Samples * 2)) * sizeof (u16));
f->Samples = 737;
}
f->Cycles = NDS::GetSysClockCycles(2);
f->Lagged = NDS::LagFrameFlag;

View File

@ -16,7 +16,6 @@ CORE_SRCS = \
ARMInterpreter_ALU.cpp \
ARMInterpreter_Branch.cpp \
ARMInterpreter_LoadStore.cpp \
Config.cpp \
CP15.cpp \
CRC32.cpp \
DMA.cpp \
@ -39,7 +38,6 @@ CORE_SRCS = \
GPU3D_Soft.cpp \
NDS.cpp \
NDSCart.cpp \
NDSCart_SRAMManager.cpp \
RTC.cpp \
Savestate.cpp \
SPI.cpp \
@ -67,7 +65,8 @@ FATFS_SRCS = \
MISC_SRCS = \
sha1/sha1.c \
tiny-AES-c/aes.c \
xxhash/xxhash.c
xxhash/xxhash.c \
blip_buf/blip_buf.c \
SRCS = \
$(addprefix melonDS/src/,$(CORE_SRCS)) \

@ -1 +1 @@
Subproject commit bcbd76d780cebc0cc773a944fcd2a2fac20b38b0
Subproject commit 7c0f0934f1dcd93dacd64e76094a8d3ad62c1244