diff options
-rw-r--r-- | utils/gen_adldata/file_formats/load_op2.h | 8 | ||||
-rw-r--r-- | utils/gen_adldata/progs_cache.cpp | 7 | ||||
-rw-r--r-- | utils/gen_adldata/progs_cache.h | 1 |
3 files changed, 11 insertions, 5 deletions
diff --git a/utils/gen_adldata/file_formats/load_op2.h b/utils/gen_adldata/file_formats/load_op2.h index 1e51563..94f61ed 100644 --- a/utils/gen_adldata/file_formats/load_op2.h +++ b/utils/gen_adldata/file_formats/load_op2.h @@ -82,14 +82,14 @@ static bool LoadDoom(const char *fn, unsigned bank, const char *prefix) int gmno = int(a < 128 ? a : ((a | 128) + 35)); char name2[512]; - sprintf(name2, "%s%c%u", prefix, (gmno < 128 ? 'M' : 'P'), gmno & 127); + std::snprintf(name2, 512, "%s%c%u", prefix, (gmno < 128 ? 'M' : 'P'), gmno & 127); Doom_opl_instr &ins = *(Doom_opl_instr *) &data[offset2]; - insdata tmp[2] = {InsertNoSoundIns(), InsertNoSoundIns()}; + insdata tmp[2] = {MakeNoSoundIns(), MakeNoSoundIns()}; tmp[0].diff = false; tmp[1].diff = true; - for(unsigned index = 0; index < 2; ++index) + for(size_t index = 0; index < 2; ++index) { const Doom_OPL2instrument &src = ins.patchdata[index]; tmp[index].data[0] = src.trem_vibr_1; @@ -116,7 +116,7 @@ static bool LoadDoom(const char *fn, unsigned bank, const char *prefix) tmp[1].finetune -= 12; } - if(!(ins.flags & 4)) + if(!(ins.flags & FL_DOUBLE_VOICE)) { size_t resno = InsertIns(tmp[0], tmp[0], tmp2, std::string(1, '\377') + name, name2); SetBank(bank, (unsigned int)gmno, resno); diff --git a/utils/gen_adldata/progs_cache.cpp b/utils/gen_adldata/progs_cache.cpp index b51f4f8..b36ae2c 100644 --- a/utils/gen_adldata/progs_cache.cpp +++ b/utils/gen_adldata/progs_cache.cpp @@ -100,7 +100,12 @@ size_t InsertIns( size_t InsertNoSoundIns() { // { 0x0F70700,0x0F70710, 0xFF,0xFF, 0x0,+0 }, - insdata tmp1 = { {0x00, 0x10, 0x07, 0x07, 0xF7, 0xF7, 0x00, 0x00, 0xFF, 0xFF, 0x00}, 0, false}; + insdata tmp1 = MakeNoSoundIns(); struct ins tmp2 = { 0, 0, 0, false, 0.0 }; return InsertIns(tmp1, tmp1, tmp2, "nosound", ""); } + +insdata MakeNoSoundIns() +{ + return { {0x00, 0x10, 0x07, 0x07, 0xF7, 0xF7, 0x00, 0x00, 0xFF, 0xFF, 0x00}, 0, false}; +} diff --git a/utils/gen_adldata/progs_cache.h b/utils/gen_adldata/progs_cache.h index b0e63a4..d652b9e 100644 --- a/utils/gen_adldata/progs_cache.h +++ b/utils/gen_adldata/progs_cache.h @@ -86,5 +86,6 @@ void SetBank(unsigned bank, unsigned patch, size_t insno); size_t InsertIns(const insdata &id, const insdata &id2, ins &in, const std::string &name, const std::string &name2); size_t InsertNoSoundIns(); +insdata MakeNoSoundIns(); #endif // PROGS_H |