mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-01 10:32:40 +00:00
YM2608-LLE, part 5
This commit is contained in:
parent
06aed6dacc
commit
770d18a939
2 changed files with 16 additions and 6 deletions
8
extern/YM2608-LLE/fmopna_impl.c
vendored
8
extern/YM2608-LLE/fmopna_impl.c
vendored
|
@ -386,9 +386,11 @@ void FMOPNA_2612_Clock(fmopna_2612_t* chip, int clk)
|
||||||
#ifdef FMOPNA_YM2608
|
#ifdef FMOPNA_YM2608
|
||||||
if (chip->mclk1)
|
if (chip->mclk1)
|
||||||
{
|
{
|
||||||
int addr2d = chip->write1_en && ADDRESS_MATCH(0x2d);
|
// tildearrow: I changed these to write0_en because write1_en was
|
||||||
int addr2e = chip->write1_en && ADDRESS_MATCH(0x2e);
|
// causing huge problems.
|
||||||
int addr2f = chip->write1_en && ADDRESS_MATCH(0x2f);
|
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];
|
chip->prescaler_sel[0] = chip->prescaler_sel[1];
|
||||||
if (addr2f)
|
if (addr2f)
|
||||||
chip->prescaler_sel[0] = 0;
|
chip->prescaler_sel[0] = 0;
|
||||||
|
|
|
@ -505,6 +505,12 @@ void DivPlatformYM2608::acquire_lle(short** buf, size_t len) {
|
||||||
if (canWeWrite) {
|
if (canWeWrite) {
|
||||||
if (delay>0) {
|
if (delay>0) {
|
||||||
if (delay==3) {
|
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;
|
delay=0;
|
||||||
} else {
|
} else {
|
||||||
fm_lle.input.cs=0;
|
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.a0=0;
|
||||||
fm_lle.input.a1=0;
|
fm_lle.input.a1=0;
|
||||||
fm_lle.input.data=0;
|
fm_lle.input.data=0;
|
||||||
|
//logV("preparing a read");
|
||||||
delay=1;
|
delay=1;
|
||||||
}
|
}
|
||||||
} else if (!writes.empty()) {
|
} else if (!writes.empty()) {
|
||||||
|
@ -527,7 +534,7 @@ void DivPlatformYM2608::acquire_lle(short** buf, size_t len) {
|
||||||
|
|
||||||
delay=2;
|
delay=2;
|
||||||
|
|
||||||
//logV("%.2x",w.val);
|
//logV("VAL %.2x",w.val);
|
||||||
|
|
||||||
regPool[w.addr&0x1ff]=w.val;
|
regPool[w.addr&0x1ff]=w.val;
|
||||||
writes.pop_front();
|
writes.pop_front();
|
||||||
|
@ -541,7 +548,7 @@ void DivPlatformYM2608::acquire_lle(short** buf, size_t len) {
|
||||||
|
|
||||||
delay=2;
|
delay=2;
|
||||||
|
|
||||||
//logV("%.2x =",w.addr);
|
//logV("ADDR %.2x =",w.addr);
|
||||||
|
|
||||||
w.addrOrVal=true;
|
w.addrOrVal=true;
|
||||||
}
|
}
|
||||||
|
@ -551,6 +558,7 @@ void DivPlatformYM2608::acquire_lle(short** buf, size_t len) {
|
||||||
fm_lle.input.wr=1;
|
fm_lle.input.wr=1;
|
||||||
fm_lle.input.a0=0;
|
fm_lle.input.a0=0;
|
||||||
fm_lle.input.a1=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
|
// check busy status here
|
||||||
//if (!(fm_lle.o_data&0x80)) {
|
//if (!(fm_lle.o_data&0x80)) {
|
||||||
if (!fm_lle.busy_cnt_en[1]) {
|
if (!fm_lle.busy_cnt_en[1]) {
|
||||||
delay=0;
|
delay=3;
|
||||||
} else {
|
} else {
|
||||||
//logV("AM BUSY");
|
//logV("AM BUSY");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue