diff --git a/source/Memory.cpp b/source/Memory.cpp index 2483daf7..14bd34cb 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -816,7 +816,7 @@ static BYTE __stdcall IO_Cxxx(WORD programcounter, WORD address, BYTE write, BYT if ((address >= APPLE_SLOT_BEGIN) && (address <= APPLE_SLOT_END)) { const UINT uSlot = (address>>8)&0x7; - if (uSlot != 3) + if (IS_APPLE2 || uSlot != SLOT3) { if (ExpansionRom[uSlot]) IO_SELECT |= 1<>8)&0x7; const bool bPeripheralSlotRomEnabled = IS_APPLE2 ? true // A][ : // A//e or above - ( !SW_INTCXROM && // Peripheral (card) ROMs enabled in $C100..$C7FF - !(!SW_SLOTC3ROM && uSlot == 3) ); // Internal C3 ROM disabled in $C300 when slot == 3 + ( !SW_INTCXROM && // Peripheral (card) ROMs enabled in $C100..$C7FF + !(!SW_SLOTC3ROM && uSlot == SLOT3) ); // Internal C3 ROM disabled in $C300 when slot == 3 // Fix for GH#149 and GH#164 if (bPeripheralSlotRomEnabled && !IsCardInSlot(uSlot)) // Slot is empty @@ -1001,7 +1001,7 @@ void RegisterIoHandler(UINT uSlot, iofunction IOReadC0, iofunction IOWriteC0, io IORead[uSlot+8] = IOReadC0; IOWrite[uSlot+8] = IOWriteC0; - if (uSlot == 0) // Don't trash C0xx handlers + if (uSlot == SLOT0) // Don't trash C0xx handlers return; // diff --git a/source/Tfe/tfearch.cpp b/source/Tfe/tfearch.cpp index fe27dd04..f0c42cbd 100644 --- a/source/Tfe/tfearch.cpp +++ b/source/Tfe/tfearch.cpp @@ -333,8 +333,13 @@ pcap_t * TfePcapOpenAdapter(const std::string & interface_name) } if (!found) { +#if 1 + // TC: Don't take the first adapter, as this could be any NIC (eg. WAN miniport, Bluetooth, loopback etc) + return NULL; +#else /* just take the first adapter */ TfePcapDevice = TfePcapAlldevs; +#endif } } @@ -361,7 +366,7 @@ pcap_t * TfePcapOpenAdapter(const std::string & interface_name) return NULL; } - if(g_fh) fprintf(g_fh, "PCAP: Successfully opened adapter: '%s'\n", TfePcapDevice->name); + if(g_fh) fprintf(g_fh, "PCAP: Successfully opened adapter: '%s' (%s)\n", TfePcapDevice->name, TfePcapDevice->description); tfe_arch_enumadapter_close(); return TfePcapFP; diff --git a/source/Uthernet1.cpp b/source/Uthernet1.cpp index 1c9707e3..b016b45a 100644 --- a/source/Uthernet1.cpp +++ b/source/Uthernet1.cpp @@ -37,6 +37,7 @@ #include "Tfe/tfesupp.h" #include "Tfe/NetworkBackend.h" #include "Tfe/PCapBackend.h" +#include "../Windows/Win32Frame.h" /* Makros for reading and writing the visible TFE register: */ #define GET_TFE_8( _xxx_ ) \ @@ -1017,6 +1018,13 @@ void Uthernet1::InitializeIO(LPBYTE pCxRomPeripheral) { RegisterIoHandler(m_slot, TfeIo, TfeIo, TfeIoCxxx, TfeIoCxxx, this, NULL); } + else + { + // Interface doesn't exist or user picked an interface that isn't Ethernet! + // . So setup as a "null" card: I/O reads from floating bus & writes go to null + RegisterIoHandler(m_slot, IO_Null, IO_Null, TfeIoCxxx, TfeIoCxxx, this, NULL); + Win32Frame::GetWin32Frame().FrameMessageBox("Reconfigure the Interface via 'Ethernet Settings'.", "Uthernet 1 interface isn't valid!", MB_ICONEXCLAMATION | MB_SETFOREGROUND); + } } void Uthernet1::Reset(const bool powerCycle) diff --git a/source/Uthernet2.cpp b/source/Uthernet2.cpp index d43e23e6..79be63d3 100644 --- a/source/Uthernet2.cpp +++ b/source/Uthernet2.cpp @@ -1469,7 +1469,7 @@ BYTE __stdcall u2_C0(WORD programcounter, WORD address, BYTE write, BYTE value, void Uthernet2::InitializeIO(LPBYTE pCxRomPeripheral) { - RegisterIoHandler(m_slot, u2_C0, u2_C0, nullptr, nullptr, this, nullptr); + RegisterIoHandler(m_slot, u2_C0, u2_C0, IO_Null, IO_Null, this, nullptr); } void Uthernet2::getMACAddress(const uint32_t address, const MACAddress * & mac)