YM2608-LLE, part 5

This commit is contained in:
tildearrow 2024-04-26 19:52:43 -05:00
parent 06aed6dacc
commit 770d18a939
2 changed files with 16 additions and 6 deletions

View file

@ -386,9 +386,11 @@ void FMOPNA_2612_Clock(fmopna_2612_t* chip, int clk)
#ifdef FMOPNA_YM2608
if (chip->mclk1)
{
int addr2d = chip->write1_en && ADDRESS_MATCH(0x2d);
int addr2e = chip->write1_en && ADDRESS_MATCH(0x2e);
int addr2f = chip->write1_en && ADDRESS_MATCH(0x2f);
// tildearrow: I changed these to write0_en because write1_en was
// causing huge problems.
int addr2d = chip->write0_en && ADDRESS_MATCH(0x2d);
int addr2e = chip->write0_en && ADDRESS_MATCH(0x2e);
int addr2f = chip->write0_en && ADDRESS_MATCH(0x2f);
chip->prescaler_sel[0] = chip->prescaler_sel[1];
if (addr2f)
chip->prescaler_sel[0] = 0;

View file

@ -505,6 +505,12 @@ void DivPlatformYM2608::acquire_lle(short** buf, size_t len) {
if (canWeWrite) {
if (delay>0) {
if (delay==3) {
fm_lle.input.cs=1;
fm_lle.input.rd=1;
fm_lle.input.wr=1;
fm_lle.input.a0=0;
fm_lle.input.a1=0;
//logV("preparing a delay");
delay=0;
} else {
fm_lle.input.cs=0;
@ -513,6 +519,7 @@ void DivPlatformYM2608::acquire_lle(short** buf, size_t len) {
fm_lle.input.a0=0;
fm_lle.input.a1=0;
fm_lle.input.data=0;
//logV("preparing a read");
delay=1;
}
} else if (!writes.empty()) {
@ -527,7 +534,7 @@ void DivPlatformYM2608::acquire_lle(short** buf, size_t len) {
delay=2;
//logV("%.2x",w.val);
//logV("VAL %.2x",w.val);
regPool[w.addr&0x1ff]=w.val;
writes.pop_front();
@ -541,7 +548,7 @@ void DivPlatformYM2608::acquire_lle(short** buf, size_t len) {
delay=2;
//logV("%.2x =",w.addr);
//logV("ADDR %.2x =",w.addr);
w.addrOrVal=true;
}
@ -551,6 +558,7 @@ void DivPlatformYM2608::acquire_lle(short** buf, size_t len) {
fm_lle.input.wr=1;
fm_lle.input.a0=0;
fm_lle.input.a1=0;
//logV("nothing to do");
}
}
@ -562,7 +570,7 @@ void DivPlatformYM2608::acquire_lle(short** buf, size_t len) {
// check busy status here
//if (!(fm_lle.o_data&0x80)) {
if (!fm_lle.busy_cnt_en[1]) {
delay=0;
delay=3;
} else {
//logV("AM BUSY");
}