GBA: update memory composition view

This commit is contained in:
Natt Akuma 2024-03-17 19:48:36 +07:00
parent 3961f8ef53
commit cebe47d992
2 changed files with 17 additions and 17 deletions

View file

@ -478,9 +478,9 @@ void DivPlatformGBADMA::renderSamples(int sysID) {
break;
}
sampleLoaded[i]=true;
romMemCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_SAMPLE,"PCM",i,sampleOff[i],memPos));
// pad to multiple of 16 bytes
memPos=(memPos+15)&~15;
romMemCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_SAMPLE,"PCM",i,sampleOff[i],memPos));
}
sampleMemLen=memPos;
romMemCompo.used=sampleMemLen;
@ -500,6 +500,13 @@ int DivPlatformGBADMA::init(DivEngine* p, int channels, int sugRate, const DivCo
parent=p;
dumpWrites=false;
skipRegisterWrites=false;
for (int i=0; i<2; i++) {
isMuted[i]=false;
oscBuf[i]=new DivDispatchOscBuffer;
wtMemCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_WAVE_RAM, fmt::sprintf("Channel %d",i),-1,i*256,i*256));
}
sampleMem=new signed char[getSampleMemCapacity()];
sampleMemLen=0;
romMemCompo=DivMemoryComposition();
romMemCompo.name="Sample ROM";
wtMemCompo=DivMemoryComposition();
@ -508,13 +515,6 @@ int DivPlatformGBADMA::init(DivEngine* p, int channels, int sugRate, const DivCo
wtMemCompo.capacity=256*2;
wtMemCompo.memory=(unsigned char*)wtMem;
wtMemCompo.waveformView=DIV_MEMORY_WAVE_8BIT_SIGNED;
for (int i=0; i<2; i++) {
isMuted[i]=false;
oscBuf[i]=new DivDispatchOscBuffer;
wtMemCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_WAVE_RAM, fmt::sprintf("Channel %d",i),-1,i*256,i*256));
}
sampleMem=new signed char[getSampleMemCapacity()];
sampleMemLen=0;
setFlags(flags);
reset();
return 2;

View file

@ -700,6 +700,7 @@ void DivPlatformGBAMinMod::renderSamples(int sysID) {
sampleOff[i]=memPos;
memcpy(&sampleMem[memPos],s->data8,actualLength);
memPos+=actualLength;
romMemCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_SAMPLE,"PCM",i,sampleOff[i],memPos));
// if it's one-shot, add 16 silent samples for looping area
// this should be enough for most cases even though the
// frequency register can make position jump by up to 256 samples
@ -708,7 +709,6 @@ void DivPlatformGBAMinMod::renderSamples(int sysID) {
memset(&sampleMem[memPos],0,oneShotLen);
memPos+=oneShotLen;
}
romMemCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_SAMPLE,"PCM",i,sampleOff[i],memPos));
}
if (actualLength<length) {
logW("out of GBA MinMod PCM memory for sample %d!",i);
@ -740,8 +740,8 @@ void DivPlatformGBAMinMod::setFlags(const DivConfig& flags) {
wtMemCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_WAVE_RAM, fmt::sprintf("Channel %d",i),-1,i*256,i*256));
}
for (int i=0; i<(int)mixBufs; i++) {
mixMemCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_WAVE_RAM, fmt::sprintf("Buffer %d Left",i),-1,i*2048,i*2048));
mixMemCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_WAVE_RAM, fmt::sprintf("Buffer %d Right",i),-1,i*2048+1024,i*2048+1024));
mixMemCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_ECHO, fmt::sprintf("Buffer %d Left",i),-1,i*2048,i*2048));
mixMemCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_ECHO, fmt::sprintf("Buffer %d Right",i),-1,i*2048+1024,i*2048+1024));
}
}
@ -749,6 +749,12 @@ int DivPlatformGBAMinMod::init(DivEngine* p, int channels, int sugRate, const Di
parent=p;
dumpWrites=false;
skipRegisterWrites=false;
for (int i=0; i<16; i++) {
isMuted[i]=false;
oscBuf[i]=new DivDispatchOscBuffer;
}
sampleMem=new signed char[getSampleMemCapacity()];
sampleMemLen=0;
romMemCompo=DivMemoryComposition();
romMemCompo.name="Sample ROM";
wtMemCompo=DivMemoryComposition();
@ -761,12 +767,6 @@ int DivPlatformGBAMinMod::init(DivEngine* p, int channels, int sugRate, const Di
mixMemCompo.capacity=2048*15;
mixMemCompo.memory=(unsigned char*)mixBuf;
mixMemCompo.waveformView=DIV_MEMORY_WAVE_8BIT_SIGNED;
for (int i=0; i<16; i++) {
isMuted[i]=false;
oscBuf[i]=new DivDispatchOscBuffer;
}
sampleMem=new signed char[getSampleMemCapacity()];
sampleMemLen=0;
setFlags(flags);
reset();