From 817d066a57bd6abf97cb4050d214876baa24b500 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 24 Nov 2023 04:19:58 -0500 Subject: [PATCH] OPL: YM3812-LLE, part 2 --- extern/YM3812-LLE/fmopl2.c | 2 ++ extern/YM3812-LLE/fmopl2.h | 2 ++ src/engine/platform/opl.cpp | 23 +++++++++++++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/extern/YM3812-LLE/fmopl2.c b/extern/YM3812-LLE/fmopl2.c index a1a08f5c5..5245f1d50 100644 --- a/extern/YM3812-LLE/fmopl2.c +++ b/extern/YM3812-LLE/fmopl2.c @@ -1392,6 +1392,8 @@ void FMOPL2_Clock(fmopl2_t *chip) int value = chip->fsm_out[8] ? 0 : chip->accm_value[1]; value += add; + chip->op_value_debug = add; + int sign = ((chip->accm_top & 64) != 0 && !chip->accm_clamplow) || chip->accm_clamphigh; int top_unsigned = chip->accm_top & 63; diff --git a/extern/YM3812-LLE/fmopl2.h b/extern/YM3812-LLE/fmopl2.h index 0f6fdd88e..c94c1770d 100644 --- a/extern/YM3812-LLE/fmopl2.h +++ b/extern/YM3812-LLE/fmopl2.h @@ -268,6 +268,8 @@ typedef struct int o_write1; int o_data_latch; + int op_value_debug; + } fmopl2_t; // modification diff --git a/src/engine/platform/opl.cpp b/src/engine/platform/opl.cpp index f2fd6cd36..06113095b 100644 --- a/src/engine/platform/opl.cpp +++ b/src/engine/platform/opl.cpp @@ -506,7 +506,14 @@ void DivPlatformOPL::acquire_ymfm3(short** buf, size_t len) { } void DivPlatformOPL::acquire_nukedLLE2(short** buf, size_t len) { + int chOut[11]; for (size_t h=0; h=0 && curCycle<9) { + // TODO: this + } + if (!(++subCycle&3)) curCycle++; + if (fm_lle2.o_sy && !lastSY) { dacVal>>=1; dacVal|=(fm_lle2.o_mo&1)<<17; @@ -570,6 +584,11 @@ void DivPlatformOPL::acquire_nukedLLE2(short** buf, size_t len) { } buf[0][h]=dacOut; + //buf[0][h]=((fm_lle2.op_value+0x1000)&0x1fff)-0x1000; + + for (int i=0; i<11; i++) { + oscBuf[i]->data[oscBuf[i]->needle++]=chOut[i]; + } } }