why again

This commit is contained in:
AArt1256 2024-09-02 11:43:01 +03:00
parent f415e4c9a1
commit d3d7c741a6
2 changed files with 8 additions and 10 deletions

View file

@ -3,8 +3,6 @@
#include "supervision.h" #include "supervision.h"
enum {FALSE, TRUE};
#include <string.h> #include <string.h>
#define SV_SAMPLE_RATE ((svision->UNSCALED_CLOCK)/64) #define SV_SAMPLE_RATE ((svision->UNSCALED_CLOCK)/64)
@ -71,7 +69,7 @@ void supervision_sound_stream_update(struct svision_t *svision, uint8 *stream, u
chout[j] = 0; chout[j] = 0;
if (svision->ch[j].size != 0) { if (svision->ch[j].size != 0) {
if (svision->ch[j].on || channel->count != 0) { if (svision->ch[j].on || channel->count != 0) {
BOOL on = FALSE; BOOL on = 0;
switch (svision->ch[j].waveform) { switch (svision->ch[j].waveform) {
case 0: // 12.5% case 0: // 12.5%
on = svision->ch[j].pos < (28 * svision->ch[j].size) >> 5; on = svision->ch[j].pos < (28 * svision->ch[j].size) >> 5;
@ -106,7 +104,7 @@ void supervision_sound_stream_update(struct svision_t *svision, uint8 *stream, u
// Transition from off to on // Transition from off to on
if (channel->on) { if (channel->on) {
memcpy(&svision->ch[j], channel, sizeof(svision->ch[j])); memcpy(&svision->ch[j], channel, sizeof(svision->ch[j]));
channel->on = FALSE; channel->on = 0;
} }
} }
} }
@ -160,7 +158,7 @@ void supervision_sound_stream_update(struct svision_t *svision, uint8 *stream, u
} }
svision->m_dma.pos += svision->m_dma.step; svision->m_dma.pos += svision->m_dma.step;
if (svision->m_dma.pos >= svision->m_dma.size) { if (svision->m_dma.pos >= svision->m_dma.size) {
svision->m_dma.on = FALSE; svision->m_dma.on = 0;
} }
} }

View file

@ -57,12 +57,12 @@ const char** DivPlatformSupervision::getRegisterSheet() {
} }
void DivPlatformSupervision::acquire(short** buf, size_t len) { void DivPlatformSupervision::acquire(short** buf, size_t len) {
for (size_t h=0; h<len; h++) { int mask_bits=0;
int mask_bits=0; for (int i=0; i<4; i++)
for (int i=0; i<4; i++) mask_bits |= isMuted[i]?0:8>>i;
mask_bits |= isMuted[i]?0:8>>i; supervision_set_mute_mask(&svision,mask_bits);
supervision_set_mute_mask(&svision,mask_bits);
for (size_t h=0; h<len; h++) {
while (!writes.empty()) { while (!writes.empty()) {
QueuedWrite w=writes.front(); QueuedWrite w=writes.front();
supervision_memorymap_registers_write(&svision,w.addr|0x2000,w.val); supervision_memorymap_registers_write(&svision,w.addr|0x2000,w.val);