Merge branch 'master' of https://github.com/tildearrow/furnace into es5506_alt

* 'master' of https://github.com/tildearrow/furnace: (46 commits)
  PCE: fix two issues
  SegaPCM: fix samples bigger than 64KB
  SCC: implement VGM soft reset
  GUI: add option to clear orders
  GUI: implement "clear all subsongs"
  GUI: fix crash when deleting current subsong
  CI: only 1 core for MinGW
  Fix AY8910 envelope hangs
  OPL: fix fixed frequency drums
  pick nits: the sequel
  pick nits
  AY: fix possible hang
  hide .ftm format
  Add x2 icon variations as well
  Install more size variations on Linux
  OPLL: fix fixed drums freq
  GUI: make backupTimer atomic
  Have OPN* platforms set the correct YM2149 chip type.
  update to-do list
  ZX beeper: clarify effects (will be done later)
  ...

# Conflicts:
#	src/engine/platform/segapcm.cpp
This commit is contained in:
cam900 2022-05-22 18:24:17 +09:00
commit f7ba60bfa9
30 changed files with 1287 additions and 260 deletions

View file

@ -443,6 +443,13 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write
w->writeC(0x04);
w->writeC(0x00);
break;
case DIV_SYSTEM_SCC:
case DIV_SYSTEM_SCC_PLUS:
w->writeC(0xd2);
w->writeC(baseAddr2|3);
w->writeC(0);
w->writeC(0);
break;
default:
break;
}
@ -1395,16 +1402,17 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version) {
size_t memPos=0;
for (int i=0; i<song.sampleLen; i++) {
DivSample* sample=song.sample[i];
if ((memPos&0xff0000)!=((memPos+sample->length8)&0xff0000)) {
unsigned int alignedSize=(sample->length8+0xff)&(~0xff);
if (alignedSize>65536) alignedSize=65536;
if ((memPos&0xff0000)!=((memPos+alignedSize)&0xff0000)) {
memPos=(memPos+0xffff)&0xff0000;
}
logV("- sample %d will be at %x with length %x",i,memPos,alignedSize);
if (memPos>=16777216) break;
sample->offSegaPCM=memPos;
unsigned int alignedSize=(sample->length8+0xff)&(~0xff);
unsigned int readPos=0;
if (alignedSize>65536) alignedSize=65536;
for (unsigned int j=0; j<alignedSize; j++) {
if ((sample->loopMode && readPos>=sample->loopEnd) || readPos>=sample->length8) {
if (((sample->loopMode != DIV_SAMPLE_LOOPMODE_ONESHOT) && readPos>=sample->loopEnd) || readPos>=sample->length8) {
if (sample->isLoopable()) {
readPos=sample->loopStart;
pcmMem[memPos++]=((unsigned char)sample->data8[readPos]+0x80);