mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-27 06:53:01 +00:00
YM2612: implement 30xx on ExtCh
This commit is contained in:
parent
97d44d9a26
commit
233431c2cc
1 changed files with 12 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "genesisext.h"
|
||||
#include "../engine.h"
|
||||
#include "../../ta-log.h"
|
||||
#include <math.h>
|
||||
|
||||
#define CHIP_FREQBASE fmFreqBase
|
||||
|
@ -576,6 +577,7 @@ void DivPlatformGenesisExt::tick(bool sysTick) {
|
|||
|
||||
bool writeNoteOn=false;
|
||||
unsigned char writeMask=2;
|
||||
unsigned char hardResetMask=0;
|
||||
if (extMode) for (int i=0; i<4; i++) {
|
||||
if (opChan[i].freqChanged) {
|
||||
if (parent->song.linearPitch==2) {
|
||||
|
@ -603,10 +605,15 @@ void DivPlatformGenesisExt::tick(bool sysTick) {
|
|||
writeNoteOn=true;
|
||||
if (opChan[i].mask) {
|
||||
writeMask|=1<<(4+i);
|
||||
if (opChan[i].hardReset) {
|
||||
hardResetMask|=1<<(4+i);
|
||||
}
|
||||
}
|
||||
if (!opChan[i].hardReset) {
|
||||
opChan[i].keyOn=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (extMode) {
|
||||
if (chan[csmChan].freqChanged) {
|
||||
|
@ -638,7 +645,9 @@ void DivPlatformGenesisExt::tick(bool sysTick) {
|
|||
(writeMask&0x40)?'3':'-',
|
||||
(writeMask&0x80)?'4':'-'
|
||||
);*/
|
||||
writeMask^=hardResetMask;
|
||||
immWrite(0x28,writeMask);
|
||||
writeMask^=hardResetMask;
|
||||
|
||||
// hard reset handling
|
||||
if (mustHardReset) {
|
||||
|
@ -648,9 +657,11 @@ void DivPlatformGenesisExt::tick(bool sysTick) {
|
|||
for (int i=0; i<4; i++) {
|
||||
if (opChan[i].keyOn && opChan[i].hardReset) {
|
||||
// restore SL/RR
|
||||
logV("eco: %d",extChanOffs);
|
||||
unsigned short baseAddr=chanOffs[extChanOffs]|opOffs[i];
|
||||
DivInstrumentFM::Operator& op=chan[extChanOffs].state.op[i];
|
||||
immWrite(baseAddr+ADDR_SL_RR,(op.rr&15)|(op.sl<<4));
|
||||
opChan[i].keyOn=false;
|
||||
}
|
||||
}
|
||||
immWrite(0x28,writeMask);
|
||||
|
|
Loading…
Reference in a new issue