From 7e1acaf9d5d7f09b61373e9c5fc253eec9abac42 Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 5 Feb 2023 12:46:23 +0900 Subject: [PATCH] Add define value for number of chip defines --- src/engine/defines.h | 1 + src/engine/engine.h | 10 +++++----- src/engine/sysDef.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/engine/defines.h b/src/engine/defines.h index 0f53bd777..9564f418d 100644 --- a/src/engine/defines.h +++ b/src/engine/defines.h @@ -24,6 +24,7 @@ #define DIV_MAX_CHIPS 32 #define DIV_MAX_CHANS 128 #define DIV_MAX_PATTERNS 256 +#define DIV_MAX_CHIP_DEFS 256 // in-pattern #define DIV_MAX_ROWS 256 diff --git a/src/engine/engine.h b/src/engine/engine.h index fc552cacc..89251a291 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -391,9 +391,9 @@ class DivEngine { std::vector midiOuts; std::vector cmdStream; std::vector possibleInsTypes; - static DivSysDef* sysDefs[256]; - static DivSystem sysFileMapFur[256]; - static DivSystem sysFileMapDMF[256]; + static DivSysDef* sysDefs[DIV_MAX_CHIP_DEFS]; + static DivSystem sysFileMapFur[DIV_MAX_CHIP_DEFS]; + static DivSystem sysFileMapDMF[DIV_MAX_CHIP_DEFS]; struct SamplePreview { double rate; @@ -1162,11 +1162,11 @@ class DivEngine { memset(tremTable,0,128*sizeof(short)); memset(reversePitchTable,0,4096*sizeof(int)); memset(pitchTable,0,4096*sizeof(int)); - memset(sysDefs,0,256*sizeof(void*)); + memset(sysDefs,0,DIV_MAX_CHIP_DEFS*sizeof(void*)); memset(walked,0,8192); memset(oscBuf,0,DIV_MAX_OUTPUTS*(sizeof(float*))); - for (int i=0; i<256; i++) { + for (int i=0; iid!=0) { sysFileMapFur[sysDefs[i]->id]=(DivSystem)i;