YM2612: prepare to implement CSM on ymfm
This commit is contained in:
parent
332c6edbed
commit
f132717502
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "genesis.h"
|
||||
#include "../engine.h"
|
||||
#include "../../ta-log.h"
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
|
@ -27,6 +28,22 @@
|
|||
|
||||
#define IS_REALLY_MUTED(x) (isMuted[x] && (x<5 || !softPCM || (isMuted[5] && isMuted[6])))
|
||||
|
||||
void DivYM2612Interface::ymfm_set_timer(uint32_t tnum, int32_t duration_in_clocks) {
|
||||
if (tnum==1) {
|
||||
countB=duration_in_clocks;
|
||||
} else if (tnum==0) {
|
||||
countA=duration_in_clocks;
|
||||
}
|
||||
logV("ymfm_set_timer(%d,%d)",tnum,duration_in_clocks);
|
||||
}
|
||||
|
||||
void DivYM2612Interface::clock() {
|
||||
if (countA>=0) {
|
||||
countA-=144;
|
||||
if (countA<0) m_engine->engine_timer_expired(0);
|
||||
}
|
||||
}
|
||||
|
||||
void DivPlatformGenesis::processDAC(int iRate) {
|
||||
if (softPCM) {
|
||||
softPCMTimer+=chipClock/576;
|
||||
|
@ -192,6 +209,7 @@ void DivPlatformGenesis::acquire_ymfm(short* bufL, short* bufR, size_t start, si
|
|||
lastBusy=1;
|
||||
}
|
||||
|
||||
iface.clock();
|
||||
if (ladder) {
|
||||
fm_ymfm->generate(&out_ymfm);
|
||||
} else {
|
||||
|
|
|
@ -26,7 +26,15 @@
|
|||
|
||||
|
||||
class DivYM2612Interface: public ymfm::ymfm_interface {
|
||||
int countA, countB;
|
||||
|
||||
public:
|
||||
void clock();
|
||||
void ymfm_set_timer(uint32_t tnum, int32_t duration_in_clocks);
|
||||
DivYM2612Interface():
|
||||
ymfm::ymfm_interface(),
|
||||
countA(-1),
|
||||
countB(-1) {}
|
||||
};
|
||||
|
||||
class DivPlatformGenesis: public DivPlatformOPN {
|
||||
|
|
Loading…
Reference in New Issue