mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-24 20:37:00 +01:00
Move network-related sound stuff to common code (so that it will work
on all platforms)
This commit is contained in:
parent
32a405739b
commit
ecec8b6134
29
Src/SID.cpp
29
Src/SID.cpp
@ -912,6 +912,35 @@ void DigitalRenderer::Reset(void)
|
||||
|
||||
#include "C64.h"
|
||||
extern C64 *TheC64;
|
||||
/*
|
||||
* Fill buffer (for Unix sound routines), sample volume (for sampled voice)
|
||||
*/
|
||||
|
||||
void MOS6581::EmulateLine(void)
|
||||
{
|
||||
if (the_renderer != NULL)
|
||||
the_renderer->EmulateLine();
|
||||
/* Flush network sound every ~100ms */
|
||||
if (TheC64->network_connection_type == CLIENT)
|
||||
{
|
||||
static NetworkUpdateSoundInfo *cur = NULL;
|
||||
|
||||
if (!cur) {
|
||||
cur = TheC64->peer->DequeueSound();
|
||||
}
|
||||
|
||||
while (cur) {
|
||||
if (cur->delay_cycles > 0)
|
||||
cur->delay_cycles--;
|
||||
if (cur->delay_cycles != 0)
|
||||
break;
|
||||
/* Delayed long enough - write to the SID! */
|
||||
this->WriteRegister(cur->adr, cur->val);
|
||||
cur = TheC64->peer->DequeueSound();
|
||||
}
|
||||
}
|
||||
TheC64->linecnt++;
|
||||
}
|
||||
|
||||
void DigitalRenderer::WriteRegister(uint16 adr, uint8 byte)
|
||||
{
|
||||
|
11
Src/SID.h
11
Src/SID.h
@ -113,17 +113,6 @@ struct MOS6581State {
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Fill buffer (for Unix sound routines), sample volume (for sampled voice)
|
||||
*/
|
||||
|
||||
inline void MOS6581::EmulateLine(void)
|
||||
{
|
||||
if (the_renderer != NULL)
|
||||
the_renderer->EmulateLine();
|
||||
}
|
||||
|
||||
|
||||
inline void MOS6581::PushVolume(uint8 vol)
|
||||
{
|
||||
if (the_renderer != NULL)
|
||||
|
@ -142,30 +142,9 @@ void DigitalRenderer::PushVolume(uint8 vol)
|
||||
|
||||
void DigitalRenderer::EmulateLine(void)
|
||||
{
|
||||
// if (!ready)
|
||||
//return;
|
||||
/* Flush network sound every ~100ms */
|
||||
if (TheC64->network_connection_type == CLIENT)
|
||||
{
|
||||
static NetworkUpdateSoundInfo *cur = NULL;
|
||||
|
||||
if (!cur) {
|
||||
cur = TheC64->peer->DequeueSound();
|
||||
}
|
||||
|
||||
while (cur) {
|
||||
if (cur->delay_cycles > 0)
|
||||
cur->delay_cycles--;
|
||||
if (cur->delay_cycles != 0)
|
||||
break;
|
||||
/* Delayed long enough - write to the SID! */
|
||||
printf("Writing %02x:%02x\n", cur->adr, cur->val);
|
||||
this->WriteRegister(cur->adr, cur->val);
|
||||
cur = TheC64->peer->DequeueSound();
|
||||
}
|
||||
}
|
||||
if (!ready)
|
||||
return;
|
||||
this->PushVolume(volume);
|
||||
TheC64->linecnt++;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user