From 1b83ee8fd3151ce96106a5d2f71f8eb9044fb2ad Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 17 May 2017 21:57:12 +0200 Subject: [PATCH] Split off the Network configuration from Other peripherals in the Settings dialog and made PCap device configurable; Overhauled the configuration files so that the global variables are now subdivided into sections; Fixed CD-ROM MODE SENSE page 0x2A which was being incorrectly reported as not implemented, fixes among other things Rayman 1 and Spellcross: The Last Battle (both now see the CD-ROM and play CD Audio fine). --- src/net_slirp.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/net_slirp.c b/src/net_slirp.c index 43574eccf..8e3056e9a 100644 --- a/src/net_slirp.c +++ b/src/net_slirp.c @@ -29,7 +29,31 @@ static queueADT slirpq; /* SLiRP library handle */ static thread_t *poll_tid; static NETRXCB poll_rx; /* network RX function to call */ static void *poll_arg; /* network RX function arg */ -static int fizz; + + +#ifdef WALTJE +int slirp_do_log = 1; +# define ENABLE_SLIRP_LOG +#else +int slirp_do_log = 0; +#endif + + +static void +slirp_log(const char *format, ...) +{ +#ifdef ENABLE_SLIRP_LOG + va_list ap; + + if (slirp_do_log) { + va_start(ap, format); + vprintf(format, ap); + va_end(ap); + fflush(stdout); + } +#endif +} +#define pclog slirp_log /* Instead of calling this and crashing some times @@ -77,10 +101,7 @@ poll_thread(void *arg) pclog("SLiRP: poll event is %08lx\n", evt); while (slirpq != NULL) { - if (++fizz > 1200) { - fizz = 0; - slirp_tic(); - } + slirp_tic(); /* Wait for the next packet to arrive. */ if (QueuePeek(slirpq) == 0) { @@ -124,8 +145,6 @@ network_slirp_setup(uint8_t *mac, NETRXCB func, void *arg) slirpq = QueueCreate(); pclog(" Packet queue is at %08lx\n", &slirpq); - fizz = 0; - /* Save the callback info. */ poll_rx = func; poll_arg = arg;