From 0209c7eb86d508ac5c002a7fd4ec9f9ea9ab0f81 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sat, 7 Nov 2009 10:03:49 +0000 Subject: [PATCH] More debugging, allow writes from the client --- Src/CPUC64_SC.cpp | 4 +++- Src/Network.cpp | 6 +++--- Src/SID.cpp | 2 -- Src/SID_linux.h | 4 ---- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Src/CPUC64_SC.cpp b/Src/CPUC64_SC.cpp index c51580c..a2ea434 100644 --- a/Src/CPUC64_SC.cpp +++ b/Src/CPUC64_SC.cpp @@ -330,6 +330,7 @@ inline uint16 MOS6510::read_word(uint16 adr) } +extern C64 *TheC64; /* * Write a byte to I/O space */ @@ -352,7 +353,8 @@ inline void MOS6510::write_byte_io(uint16 adr, uint8 byte) case 0x5: case 0x6: case 0x7: - TheSID->WriteRegister(adr & 0x1f, byte); + if (TheC64->network_connection_type != CLIENT) + TheSID->WriteRegister(adr & 0x1f, byte); return; case 0x8: // Color RAM case 0x9: diff --git a/Src/Network.cpp b/Src/Network.cpp index 1cc71db..f09f983 100644 --- a/Src/Network.cpp +++ b/Src/Network.cpp @@ -405,8 +405,8 @@ void Network::EnqueueSound(uint32 linecnt_diff, uint8 adr, uint8 val) { NetworkUpdateSoundInfo *cur = &this->sound_active[this->sound_head]; - if (linecnt_diff > 255) - linecnt_diff = 255; + if (linecnt_diff > 400) + linecnt_diff = 400; cur->adr = adr; cur->val = val; cur->delay_cycles = linecnt_diff; @@ -426,7 +426,7 @@ void Network::RegisterSidWrite(uint32 linecnt, uint8 adr, uint8 val) { this->EnqueueSound(linecnt - this->sound_last_cycles, adr, val); - printf("Enqueuing write: %d\n", linecnt - this->sound_last_cycles); + printf("Enqueuing write: %04d:%02x:%02x\n", linecnt - this->sound_last_cycles, adr, val); /* Update the cycle counter */ sound_last_cycles = linecnt; bytes += sizeof(NetworkUpdateSound); diff --git a/Src/SID.cpp b/Src/SID.cpp index 9b73f3e..902f6e1 100644 --- a/Src/SID.cpp +++ b/Src/SID.cpp @@ -922,8 +922,6 @@ void DigitalRenderer::WriteRegister(uint16 adr, uint8 byte) if (TheC64) { if (TheC64->network_connection_type == MASTER) TheC64->peer->RegisterSidWrite(this->linecnt, adr, byte); - else if (TheC64->network_connection_type == CLIENT) - return; } int v = adr/7; // Voice number diff --git a/Src/SID_linux.h b/Src/SID_linux.h index a72de5e..b4c9b67 100644 --- a/Src/SID_linux.h +++ b/Src/SID_linux.h @@ -152,8 +152,6 @@ void DigitalRenderer::EmulateLine(void) if (!cur) { cur = TheC64->peer->DequeueSound(); - if (cur) - printf("delaying: %d\n", cur->delay_cycles); } while (cur) { @@ -165,8 +163,6 @@ void DigitalRenderer::EmulateLine(void) printf("Writing %02x:%02x\n", cur->adr, cur->val); this->WriteRegister(cur->adr, cur->val); cur = TheC64->peer->DequeueSound(); - if (cur) - printf("delay 2: %d\n", cur->delay_cycles); } } this->PushVolume(volume);