Merge branch 'master' into feature/esfm

This commit is contained in:
Kagamiin~ 2023-10-21 14:57:43 -03:00
commit dde56c0cfc
19 changed files with 566 additions and 724 deletions

View file

@ -2310,6 +2310,65 @@ void DivEngine::unmuteAll() {
BUSY_END;
}
void DivEngine::dumpSongInfo() {
printf(
"SONG INFORMATION\n"
"- name: %s\n"
"- author: %s\n"
"- album: %s\n"
"- system: %s\n"
"- %d ins, %d waves, %d samples\n"
"<<<\n%s\n>>>\n\n",
song.name.c_str(),
song.author.c_str(),
song.category.c_str(),
song.systemName.c_str(),
song.insLen,
song.waveLen,
song.sampleLen,
song.notes.c_str()
);
printf("SUB-SONGS\n");
int index=0;
for (DivSubSong* i: song.subsong) {
printf(
"=== %d: %s\n"
"<<<\n%s\n>>>\n",
index,
i->name.c_str(),
i->notes.c_str()
);
index++;
}
if (!song.ins.empty()) {
printf("\nINSTRUMENTS\n");
index=0;
for (DivInstrument* i: song.ins) {
printf(
"- %d: %s\n",
index,
i->name.c_str()
);
index++;
}
}
if (!song.sample.empty()) {
printf("\nSAMPLES\n");
index=0;
for (DivSample* i: song.sample) {
printf(
"- %d: %s\n",
index,
i->name.c_str()
);
index++;
}
}
}
int DivEngine::addInstrument(int refChan, DivInstrumentType fallbackType) {
if (song.ins.size()>=256) return -1;
BUSY_BEGIN;

View file

@ -881,6 +881,9 @@ class DivEngine {
// get ext value
unsigned char getExtValue();
// dump song info to stdout
void dumpSongInfo();
// is playing
bool isPlaying();

View file

@ -1057,7 +1057,11 @@ DivMacroInt* DivPlatformES5506::getChanMacroInt(int ch) {
}
unsigned short DivPlatformES5506::getPan(int ch) {
return ((chan[ch].lVol>>4)<<8)|(chan[ch].rVol>>4);
float expL=255.0f*pow(((float)(chan[ch].resLVol>>4))/4095.0f,4.0f);
float expR=255.0f*pow(((float)(chan[ch].resRVol>>4))/4095.0f,4.0f);
if (expL>255.0f) expL=255.0f;
if (expR>255.0f) expR=255.0f;
return (((unsigned int)expL)<<8)|((unsigned int)expR);
}
void DivPlatformES5506::reset() {

View file

@ -447,6 +447,7 @@ void DivPlatformSoundUnit::forceIns() {
chWrite(i,0x03,chan[i].pan);
writeControl(i);
writeControlUpper(i);
chWrite(i,0x08,chan[i].duty);
}
}