From 6763aa44a99cc14eafba1079774756d807a4c7eb Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 5 Mar 2024 19:19:18 -0500 Subject: [PATCH] memory composition, part 4 --- src/engine/platform/es5506.cpp | 7 +++++++ src/engine/platform/ga20.cpp | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/engine/platform/es5506.cpp b/src/engine/platform/es5506.cpp index 7b3b04d21..2299752a6 100644 --- a/src/engine/platform/es5506.cpp +++ b/src/engine/platform/es5506.cpp @@ -1213,6 +1213,9 @@ void DivPlatformES5506::renderSamples(int sysID) { memset(sampleOffES5506,0,256*sizeof(unsigned int)); memset(sampleLoaded,0,256*sizeof(bool)); + memCompo=DivMemoryComposition(); + memCompo.name="Sample Memory"; + size_t memPos=128; // add silent at begin and end of each bank for reverse playback for (int i=0; isong.sampleLen; i++) { DivSample* s=parent->song.sample[i]; @@ -1241,9 +1244,13 @@ void DivPlatformES5506::renderSamples(int sysID) { } sampleOffES5506[i]=memPos; sampleLoaded[i]=true; + memCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_SAMPLE,"Sample",i,memPos,memPos+length)); memPos+=length; } sampleMemLen=memPos+256; + + memCompo.used=sampleMemLen; + memCompo.capacity=16777216; } int DivPlatformES5506::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) { diff --git a/src/engine/platform/ga20.cpp b/src/engine/platform/ga20.cpp index ae03d9e5b..859c586bb 100644 --- a/src/engine/platform/ga20.cpp +++ b/src/engine/platform/ga20.cpp @@ -451,6 +451,9 @@ void DivPlatformGA20::renderSamples(int sysID) { memset(sampleOffGA20,0,256*sizeof(unsigned int)); memset(sampleLoaded,0,256*sizeof(bool)); + memCompo=DivMemoryComposition(); + memCompo.name="Sample ROM"; + size_t memPos=0; for (int i=0; isong.sampleLen; i++) { DivSample* s=parent->song.sample[i]; @@ -463,6 +466,7 @@ void DivPlatformGA20::renderSamples(int sysID) { int actualLength=MIN((int)(getSampleMemCapacity()-memPos)-1,length); if (actualLength>0) { sampleOffGA20[i]=memPos; + memCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_SAMPLE,"Sample",i,memPos,memPos+actualLength+1)); for (int j=0; jdata8[j]))^0x80; @@ -478,10 +482,13 @@ void DivPlatformGA20::renderSamples(int sysID) { } else { sampleLoaded[i]=true; } - // allign to 16 byte + // align to 16 byte memPos=(memPos+0xf)&~0xf; } sampleMemLen=memPos; + + memCompo.used=sampleMemLen; + memCompo.capacity=1048576; } int DivPlatformGA20::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {