mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2025-04-21 03:51:37 +02:00
Fix sending of the data
This commit is contained in:
parent
1a9c4b8c1d
commit
f4357b88bd
@ -536,6 +536,7 @@ void C64::network_vblank()
|
||||
* if this is the master or not) */
|
||||
if (this->network_connection_type == MASTER)
|
||||
{
|
||||
remote->FlushSound();
|
||||
/* Skip this frame if the data rate is too high */
|
||||
if (remote->ThrottleTraffic())
|
||||
has_throttled = true;
|
||||
|
@ -415,7 +415,7 @@ void Network::EnqueueSound(uint32 linecnt_diff, uint8 adr, uint8 val)
|
||||
this->sound_head = 0;
|
||||
|
||||
/* Head has reached tail */
|
||||
if (this->sound_head >= this->sound_tail)
|
||||
if (this->sound_head == this->sound_tail)
|
||||
this->sound_tail = (this->sound_head + 1) % NETWORK_SOUND_BUF_SIZE;
|
||||
}
|
||||
|
||||
@ -453,11 +453,9 @@ void Network::FlushSound(void)
|
||||
}
|
||||
this->sound_tail = (this->sound_tail + snd->n_items) % NETWORK_SOUND_BUF_SIZE;
|
||||
|
||||
/* Reset the buffer again */
|
||||
printf("Flushing sound (%d bytes in %d ms)\n", bytes, SDL_GetTicks() - this->sound_last_send);
|
||||
this->sound_last_send = SDL_GetTicks();
|
||||
|
||||
InitNetworkUpdate(dst, SOUND_UPDATE,
|
||||
InitNetworkUpdate(dst, SOUND_UPDATE, sizeof(NetworkUpdate) +
|
||||
sizeof(NetworkUpdateSound) + sizeof(NetworkUpdateSoundInfo) * snd->n_items);
|
||||
this->AddNetworkUpdate(dst);
|
||||
|
||||
@ -811,7 +809,7 @@ bool Network::DeMarshalData(NetworkUpdate *p)
|
||||
|
||||
cur->delay_cycles = ntohs(cur->delay_cycles);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
/* Unknown data... */
|
||||
printf("Got unknown data: %d\n", p->type);
|
||||
|
@ -146,10 +146,7 @@ void DigitalRenderer::EmulateLine(void)
|
||||
if (!ready)
|
||||
return;
|
||||
/* Flush network sound every ~100ms */
|
||||
if (TheC64->network_connection_type == MASTER &&
|
||||
this->linecnt % 2048 == 0)
|
||||
TheC64->peer->FlushSound();
|
||||
else if (TheC64->network_connection_type == CLIENT)
|
||||
if (TheC64->network_connection_type == CLIENT)
|
||||
{
|
||||
static NetworkUpdateSoundInfo *cur = NULL;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user