diff --git a/src/asm/68k/amigatest/player.s b/src/asm/68k/amigatest/player.s index 185b0730a..9234b17bd 100644 --- a/src/asm/68k/amigatest/player.s +++ b/src/asm/68k/amigatest/player.s @@ -170,7 +170,7 @@ testChannel: or.b (a2)+,d2 lsl.l #8,d2 or.b (a2)+,d2 - lea sampleData(pc),a0 + lea sampleData,a0 add.l a0,d2 lea chipBase,a0 move.b d1,d0 diff --git a/src/engine/platform/amiga.cpp b/src/engine/platform/amiga.cpp index ac67460b3..83d9edbe2 100644 --- a/src/engine/platform/amiga.cpp +++ b/src/engine/platform/amiga.cpp @@ -404,6 +404,29 @@ void DivPlatformAmiga::tick(bool sysTick) { chan[i].keyOn=true; } } + } + + unsigned short dmaOff=0; + unsigned short dmaOn=0; + for (int i=0; i<4; i++) { + if (chan[i].keyOn || chan[i].keyOff) { + chWrite(i,6,1); + dmaOff|=1<=0 && chan[i].samplesong.sampleLen) { + DivSample* s=parent->getSample(chan[i].sample); + if (s->centerRate<1) { + off=1.0; + } else { + off=8363.0/(double)s->centerRate; + } + } if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) { //DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_AMIGA); chan[i].freq=off*parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,0,chan[i].pitch2,chipClock,CHIP_DIVIDER); @@ -413,7 +436,6 @@ void DivPlatformAmiga::tick(bool sysTick) { chWrite(i,6,chan[i].freq); if (chan[i].keyOn) { - rWrite(0x96,1<=0 && chan[i].samplesong.sampleLen) { DivSample* s=parent->getSample(chan[i].sample); @@ -454,7 +476,7 @@ void DivPlatformAmiga::tick(bool sysTick) { } } - rWrite(0x96,0x8000|(1<isLoopable()) { int loopPos=(sampleOff[chan[i].sample]+s->getLoopStartPosition(DIV_SAMPLE_DEPTH_8BIT))&(~1); int loopEnd=(s->getLoopEndPosition(DIV_SAMPLE_DEPTH_8BIT)-s->getLoopStartPosition(DIV_SAMPLE_DEPTH_8BIT))>>1; @@ -466,10 +488,6 @@ void DivPlatformAmiga::tick(bool sysTick) { chan[i].irLocL=0x400; chan[i].irLen=1; } - if (dumpWrites) { - addWrite(0x200+i,(chan[i].irLocH<<16)|chan[i].irLocL); - addWrite(0x204+i,chan[i].irLen); - } rWrite(0x9a,0x8000|(128<