mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-22 11:29:24 +01:00
More client-side sound implementation (not done yet)
This commit is contained in:
parent
4a7efdbb68
commit
e65c29ed4c
@ -327,6 +327,7 @@ void MOS6510::write_byte_io(uint16 adr, uint8 byte)
|
||||
case 0x5:
|
||||
case 0x6:
|
||||
case 0x7:
|
||||
if (this->network_connection_type != CLIENT)
|
||||
TheSID->WriteRegister(adr & 0x1f, byte);
|
||||
return;
|
||||
case 0x8: // Color RAM
|
||||
|
@ -427,8 +427,6 @@ void Network::FlushSound(void)
|
||||
struct NetworkUpdateSound *snd = (NetworkUpdateSound *)dst->data;
|
||||
struct NetworkUpdateSoundInfo *snd_info = snd->info;
|
||||
|
||||
if (SDL_GetTicks() - this->sound_last_send < 125)
|
||||
return;
|
||||
snd->flags = 0;
|
||||
snd->n_items = this->sound_head - this->sound_tail;
|
||||
|
||||
|
@ -445,6 +445,7 @@ private:
|
||||
#if defined(__linux__) || defined(GEKKO)
|
||||
int devfd, sndbufsize, buffer_rate;
|
||||
int16 *sound_buffer;
|
||||
uint32 linecnt;
|
||||
#endif
|
||||
|
||||
#ifdef SUN
|
||||
|
@ -47,6 +47,7 @@ void DigitalRenderer::init_sound(void)
|
||||
int arg;
|
||||
unsigned long format;
|
||||
|
||||
linecnt = 0;
|
||||
ready = false;
|
||||
devfd = open("/dev/dsp", O_WRONLY);
|
||||
if (devfd < 0)
|
||||
@ -144,9 +145,12 @@ void DigitalRenderer::EmulateLine(void)
|
||||
{
|
||||
if (!ready)
|
||||
return;
|
||||
if (TheC64->network_connection_type == MASTER)
|
||||
/* Flush network sound every ~100ms */
|
||||
if (TheC64->network_connection_type == MASTER &&
|
||||
this->linecnt % 2048 == 0)
|
||||
TheC64->peer->FlushSound();
|
||||
this->PushVolume(volume);
|
||||
this->linecnt++;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user