From 36513259402083600b20381adc2926a10b1714ef Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 6 Mar 2023 04:21:10 -0500 Subject: [PATCH] SN: register view? --- src/engine/platform/sms.cpp | 33 +++++++++++++++++++++++++++++++++ src/engine/platform/sms.h | 5 +++++ 2 files changed, 38 insertions(+) diff --git a/src/engine/platform/sms.cpp b/src/engine/platform/sms.cpp index 518dd6e7..f8858aab 100644 --- a/src/engine/platform/sms.cpp +++ b/src/engine/platform/sms.cpp @@ -43,6 +43,23 @@ float DivPlatformSMS::getPostAmp() { return 1.5f; } +void DivPlatformSMS::poolWrite(unsigned short a, unsigned char v) { + if (a) { + regPool[9]=v; + } else { + if (v>=0x80) { + regPool[(v>>4)&7]&=~15; + regPool[(v>>4)&7]|=v&15; + chanLatch=(v>>5)&3; + } else { + regPool[chanLatch<<1]&=15; + regPool[chanLatch<<1]|=((v&15)<<4); + regPool[1+(chanLatch<<1)]&=15; + regPool[1+(chanLatch<<1)]|=v&0xf0; + } + } +} + void DivPlatformSMS::acquire_nuked(short** buf, size_t len) { int oL=0; int oR=0; @@ -54,6 +71,9 @@ void DivPlatformSMS::acquire_nuked(short** buf, size_t len) { } else if (w.addr==1) { YMPSG_WriteStereo(&sn_nuked,w.val); } + + poolWrite(w.addr,w.val); + writes.pop(); } YMPSG_Clock(&sn_nuked); @@ -97,6 +117,9 @@ void DivPlatformSMS::acquire_mame(short** buf, size_t len) { else if (w.addr==0) { sn->write(w.val); } + + poolWrite(w.addr,w.val); + writes.pop(); } for (size_t h=0; h