mirror of https://github.com/stella-emu/stella.git
Merge branch 'master' of https://github.com/stella-emu/stella
This commit is contained in:
commit
0d0125fa71
|
@ -53,7 +53,7 @@ using Common::Base;
|
|||
#endif
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt16 rom_size,
|
||||
Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size,
|
||||
const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack,
|
||||
bool traponfatal, Thumbulator::ConfigureFor configurefor,
|
||||
Cartridge* cartridge)
|
||||
|
@ -67,7 +67,7 @@ Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt16 rom_size
|
|||
configuration(configurefor),
|
||||
myCartridge(cartridge)
|
||||
{
|
||||
for(uInt16 i = 0; i < romSize / 2; ++i)
|
||||
for(uInt32 i = 0; i < romSize / 2; ++i)
|
||||
decodedRom[i] = decodeInstructionWord(CONV_RAMROM(rom[i]));
|
||||
|
||||
setConsoleTiming(ConsoleTiming::ntsc);
|
||||
|
|
|
@ -35,8 +35,8 @@ class Cartridge;
|
|||
#define NO_THUMB_STATS
|
||||
#endif
|
||||
|
||||
#define ROMADDMASK 0x7FFFF
|
||||
#define RAMADDMASK 0x7FFF
|
||||
#define ROMADDMASK 0x7FFFF
|
||||
#define RAMADDMASK 0x7FFF
|
||||
|
||||
#define ROMSIZE (ROMADDMASK+1) // 512KB
|
||||
#define RAMSIZE (RAMADDMASK+1) // 32KB
|
||||
|
@ -60,7 +60,7 @@ class Thumbulator
|
|||
DPCplus // cartridges of type DPC+
|
||||
};
|
||||
|
||||
Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt16 rom_size,
|
||||
Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size,
|
||||
const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack,
|
||||
bool traponfatal, Thumbulator::ConfigureFor configurefor,
|
||||
Cartridge* cartridge);
|
||||
|
@ -188,7 +188,7 @@ class Thumbulator
|
|||
|
||||
private:
|
||||
const uInt16* rom{nullptr};
|
||||
uInt16 romSize{0};
|
||||
uInt32 romSize{0};
|
||||
uInt32 cBase{0};
|
||||
uInt32 cStart{0};
|
||||
uInt32 cStack{0};
|
||||
|
|
|
@ -101,7 +101,7 @@ StringList SerialPortMACOS::portNames()
|
|||
|
||||
// Get all possible devices in the '/dev' directory
|
||||
FilesystemNode::NameFilter filter = [](const FilesystemNode& node) {
|
||||
return BSPF::startsWithIgnoreCase(node.getPath(), "/dev/tty.usb");
|
||||
return BSPF::startsWithIgnoreCase(node.getPath(), "/dev/cu.usb");
|
||||
};
|
||||
FSList portList;
|
||||
portList.reserve(16);
|
||||
|
@ -111,8 +111,20 @@ StringList SerialPortMACOS::portNames()
|
|||
|
||||
// Add only those that can be opened
|
||||
for(const auto& port: portList)
|
||||
if(openPort(port.getPath()))
|
||||
if(isValid(port.getPath()))
|
||||
ports.emplace_back(port.getPath());
|
||||
|
||||
return ports;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool SerialPortMACOS::isValid(const string& port) const
|
||||
{
|
||||
// For now, we can only detect whether the port could be opened
|
||||
// Eventually we may extend this to do more intensive checks
|
||||
int handle = open(port.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK);
|
||||
if(handle > 0)
|
||||
close(handle);
|
||||
|
||||
return handle > 0;
|
||||
}
|
||||
|
|
|
@ -69,6 +69,15 @@ class SerialPortMACOS : public SerialPort
|
|||
*/
|
||||
StringList portNames() override;
|
||||
|
||||
private:
|
||||
/**
|
||||
Tests whether this port can be opened, and is a valid
|
||||
serial port.
|
||||
|
||||
@return True if valid, else false
|
||||
*/
|
||||
bool isValid(const string& port) const;
|
||||
|
||||
private:
|
||||
// File descriptor for serial connection
|
||||
int myHandle{0};
|
||||
|
|
Loading…
Reference in New Issue