From 4a7efdbb68cc07104eb1acc232fa1001016ba7e2 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Thu, 5 Nov 2009 06:24:36 +0000 Subject: [PATCH] Add function to unqueue the current sound info (for the client). Still needs code to actually push the data to the client! --- Src/Network.cpp | 12 ++++++++++++ Src/Network.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/Src/Network.cpp b/Src/Network.cpp index 58b1470..0f9aaa7 100644 --- a/Src/Network.cpp +++ b/Src/Network.cpp @@ -458,6 +458,18 @@ void Network::FlushSound(void) bytes = 0; } +struct NetworkUpdateSoundInfo *Network::UnqueueSound() +{ + struct NetworkUpdateSoundInfo *out; + + + if (this->sound_tail == this->sound_head) + return NULL; + out = &this->sound_active[this->sound_tail]; + this->sound_tail = (this->sound_tail + 1) % NETWORK_SOUND_BUF_SIZE; + + return out; +} void Network::EncodeJoystickUpdate(Uint8 v) { diff --git a/Src/Network.h b/Src/Network.h index f31b78a..f27233b 100644 --- a/Src/Network.h +++ b/Src/Network.h @@ -183,6 +183,8 @@ public: void FlushSound(void); + struct NetworkUpdateSoundInfo *UnqueueSound(); + bool DecodeUpdate(C64Display *display, uint8 *js, MOS6581 *dst);