Updating sysDef; implementing mapVelocity

This commit is contained in:
Kagamiin~ 2023-12-15 14:20:56 -03:00
parent f42332f2c0
commit 403799d1a3
3 changed files with 9 additions and 1 deletions

View file

@ -1019,6 +1019,13 @@ void DivPlatformESFM::notifyInsDeletion(void* ins) {
} }
} }
int DivPlatformESFM::mapVelocity(int ch, unsigned char vel) {
const int volMax=MAX(1,dispatch(DivCommand(DIV_CMD_GET_VOLMAX,MAX(ch,0))));
double attenDb=40*log10(vel/127);
double attenUnits=attenDb*(8.0/6.0); // negative
return MAX(0,volMax+attenUnits);
}
void DivPlatformESFM::poke(unsigned int addr, unsigned short val) { void DivPlatformESFM::poke(unsigned int addr, unsigned short val) {
immWrite(addr,val); immWrite(addr,val);
} }

View file

@ -136,6 +136,7 @@ class DivPlatformESFM: public DivDispatch {
void toggleRegisterDump(bool enable); void toggleRegisterDump(bool enable);
void notifyInsChange(int ins); void notifyInsChange(int ins);
void notifyInsDeletion(void* ins); void notifyInsDeletion(void* ins);
int mapVelocity(int ch, unsigned char vel);
void poke(unsigned int addr, unsigned short val); void poke(unsigned int addr, unsigned short val);
void poke(std::vector<DivRegWrite>& wlist); void poke(std::vector<DivRegWrite>& wlist);
void setFlags(const DivConfig& flags); void setFlags(const DivConfig& flags);

View file

@ -1972,7 +1972,7 @@ void DivEngine::registerSystems() {
); );
sysDefs[DIV_SYSTEM_ESFM]=new DivSysDef( sysDefs[DIV_SYSTEM_ESFM]=new DivSysDef(
"ESS ES1xxx series (ESFM)", NULL, 0xd1, 0, 18, true, false, 0, false, 0, "ESS ES1xxx series (ESFM)", NULL, 0xd1, 0, 18, true, false, 0, false, 0, 0, 0,
"a unique FM synth featured in PC sound cards.\nbased on the OPL3 design, but with lots of its features extended.", "a unique FM synth featured in PC sound cards.\nbased on the OPL3 design, but with lots of its features extended.",
{"FM 1", "FM 2", "FM 3", "FM 4", "FM 5", "FM 6", "FM 7", "FM 8", "FM 9", "FM 10", "FM 11", "FM 12", "FM 13", "FM 14", "FM 15", "FM 16", "FM 17", "FM 18"}, {"FM 1", "FM 2", "FM 3", "FM 4", "FM 5", "FM 6", "FM 7", "FM 8", "FM 9", "FM 10", "FM 11", "FM 12", "FM 13", "FM 14", "FM 15", "FM 16", "FM 17", "FM 18"},
{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18"}, {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18"},