summaryrefslogtreecommitdiffstatshomepage
path: root/scripts/src
Commit message (Expand)AuthorAgeFilesLines
...
* Merge pull request #2695 from shattered/_eef7cb7 Joakim Larsson Edström2017-10-081-0/+2
|\
| * vme_hcpu30: Besta HCPU30 VME board, skeleton driver. Sergey Svishchev2017-10-031-0/+2
* | abc800: Added skeleton for Databoard 4112-23 floppy disk controller. [Curt Co... Curt Coder2017-10-041-0/+2
* | abc800: Fixed Turbo Kontroller name to UNI DISK and identified CPU type. [Cur... Curt Coder2017-10-031-2/+2
* | Support for HP85 tapes added to imgtool (#2688) fulivi2017-10-031-1/+2
|/
* use 'sh' instead of 'superh' David Haywood2017-10-021-31/+31
* move sh2 / sh4 to a folder called superh David Haywood2017-10-021-44/+32
* Remove timer_device from emu.h and move it out of src/emu (nw) AJR2017-10-012-2/+2
* abc310: Added 80286 2nd processor. Nigel Barnes2017-10-021-0/+2
* am9513: New device AJR2017-09-221-0/+12
* deco32: Improvements and cleanups Dirk Best2017-09-221-0/+12
* Wrote a new device for TA7630, hooked it up to buggychl.cpp (nw) angelosa2017-09-221-0/+12
* spectrum: Added expansion slot, and devices: Nigel Barnes2017-09-211-0/+34
* Attempted to sanitize/rationalize how we access UTF-8 command line arguments ... npwoods2017-09-185-19/+1
* hp9k_3xx: add 98603 ROM card Sven Schnelle2017-09-061-0/+2
* apple2: Preliminary support for the Synetix SuperSprite card. [Golden Child, ... arbee2017-08-301-0/+2
* hp85: support of opt. ROMs (#2604) fulivi2017-08-291-0/+11
* bbc: Added various 2nd processors as Tube slot devices: Nigel Barnes2017-08-251-0/+10
* tube: New TUBE device. Acorn Tube ULA for use in Acorn 2nd Processors Nigel Barnes2017-08-251-0/+12
* bbc: BeebSID slot device for the 1MHz bus. Nigel Barnes2017-08-241-1/+3
* Modification for Android build (NDK r14b, build-tools 21.1.2 and gradle 2.2.1... Miso Kim2017-08-231-2/+6
* new drivers for "Control ID x628" fingerprint-reader and for the NT7534 LCD c... Felipe Corrêa da Silva Sanches2017-08-231-0/+12
* clean up some of the UI filter stuff, show list descriptions rather than name... Vas Crabb2017-08-181-2/+0
* hp85: implemented tape drive fulivi2017-08-161-0/+12
* hp9845: re-factored handling of HTI images into a dedicated format module fulivi2017-08-161-0/+12
* psi98: Add HLE ASCII keyboard and make it default Dirk Best2017-08-101-0/+2
* psi98: Add keyboard slot interface, create skeleton for keyboard Dirk Best2017-08-101-0/+14
* Added a very preliminary PC9801 AMD98 sound board emulation [Angelo Salese] angelosa2017-08-061-0/+2
* Create explicit i386dasm include for x86 DRC (nw) AJR2017-08-011-1/+2
* need this for debug trace logging on DRC cores (nw) Vas Crabb2017-08-011-1/+1
* Fix single build for i386-based drivers (nw) AJR2017-07-311-1/+1
* In the windows debugger log window add a Log/Clear menu to remove all logged ... yz70s2017-07-301-0/+2
* New 74LS259/9334/CD4099 devices AJR2017-07-251-14/+12
* Fix include path with USE_LIBSDL on macOS Joshua Root2017-07-221-1/+1
* sda5708: NEW DEVICE Siemens SDA5708 8 character 7x5 dot matrix LED display (nw) Joakim Larsson Edstrom2017-07-171-0/+11
* Export soft_reset, hard_reset, exit, load, and save functions for Emscripten ... James Baicoianu2017-07-151-1/+1
* Fix save/load states in Emscripten build (#2470) James Baicoianu2017-07-151-1/+1
* intellec4: implement imm4-22 program/data storage module Vas Crabb2017-07-151-0/+2
* intellec4: implememnt PROM memory module Vas Crabb2017-07-131-0/+2
* intellec4: add high-speed paper tape reader card (installed in slot j7 by def... Vas Crabb2017-07-131-0/+2
* ti99: Moved Hexbus one level up Michael Zapf2017-07-101-5/+13
* i82586: intel 82586/82596 ethernet controllers, skeleton only (nw) (#2456) Patrick Mackinlay2017-07-101-0/+12
* Merge pull request #2452 from JoakimLarsson/fccpu1_3 Joakim Larsson Edström2017-07-081-0/+12
|\
| * mc14411: NEW DEVICE Motorola MC14411 Bit Rate Generator Joakim Larsson Edstrom2017-07-081-0/+12
* | Begin of HP80 emulation (#2448) fulivi2017-07-081-0/+16
|/
* create c-chip device with correct CPU type in it and a bunch of notes (pinout... David Haywood2017-07-051-0/+2
* intlc440 improvements: Vas Crabb2017-07-011-0/+13
* r9751: Add initial SMIOC device (#2423) Brandon Munger2017-06-301-0/+12
* pc9801: move cbus to bus and add WIP mpu401 [Carl] cracyc2017-06-261-0/+20
* Rewrote 4004 core and disassembler: Vas Crabb2017-06-271-7/+7
"> virtual std::error_condition truncate(std::uint64_t offset) noexcept override { // doesn't make sense for a socket return std::errc::bad_file_descriptor; } virtual std::error_condition flush() noexcept override { // no buffers to flush return std::error_condition(); } static std::error_condition wsa_error_to_file_error(int err) { // TODO: determine if there's a better way to do this switch (err) { case 0: return std::error_condition(); case WSA_NOT_ENOUGH_MEMORY: return std::errc::not_enough_memory; case WSA_INVALID_PARAMETER: return std::errc::invalid_argument; case WSAEINTR: return std::errc::interrupted; case WSAEBADF: return std::errc::bad_file_descriptor; case WSAEACCES: return std::errc::permission_denied; case WSAEFAULT: return std::errc::bad_address; case WSAEINVAL: return std::errc::invalid_argument; case WSAEMFILE: return std::errc::too_many_files_open; case WSAENETRESET: return std::errc::network_reset; case WSAECONNABORTED: return std::errc::connection_aborted; case WSAEWOULDBLOCK: return std::errc::operation_would_block; case WSAEINPROGRESS: return std::errc::operation_in_progress; case WSAEALREADY: return std::errc::connection_already_in_progress; case WSAENOTSOCK: return std::errc::not_a_socket; case WSAEDESTADDRREQ: return std::errc::destination_address_required; case WSAEMSGSIZE: return std::errc::message_size; case WSAEPROTOTYPE: return std::errc::wrong_protocol_type; case WSAENOPROTOOPT: return std::errc::no_protocol_option; case WSAEPROTONOSUPPORT: return std::errc::protocol_not_supported; case WSAEOPNOTSUPP: return std::errc::operation_not_supported; case WSAEAFNOSUPPORT: return std::errc::address_family_not_supported; case WSAEADDRINUSE: return std::errc::address_in_use; case WSAEADDRNOTAVAIL: return std::errc::address_not_available; case WSAENETDOWN: return std::errc::network_down; case WSAENETUNREACH: return std::errc::network_unreachable; case WSAECONNRESET: return std::errc::connection_reset; case WSAENOBUFS: return std::errc::no_buffer_space; case WSAEISCONN: return std::errc::already_connected; case WSAENOTCONN: return std::errc::not_connected; case WSAETIMEDOUT: return std::errc::timed_out; case WSAECONNREFUSED: return std::errc::connection_refused; case WSAEHOSTUNREACH: return std::errc::host_unreachable; case WSAECANCELLED: return std::errc::operation_canceled; // TODO: better default error code? default: return std::errc::io_error; } } private: SOCKET m_socket; bool m_listening; }; } // anonymous namespace bool win_init_sockets() noexcept { WSADATA wsaData; WORD const version = MAKEWORD(2, 0); int const error = WSAStartup(version, &wsaData); // check for error if (error) { // error occurred return false; } // check for correct version if (LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion ) != 0) { // incorrect WinSock version WSACleanup(); return false; } // WinSock has been initialized return true; } void win_cleanup_sockets() noexcept { WSACleanup(); } bool win_check_socket_path(std::string const &path) noexcept { if (strncmp(path.c_str(), winfile_socket_identifier, strlen(winfile_socket_identifier)) == 0 && strchr(path.c_str(), ':') != nullptr) return true; return false; } std::error_condition win_open_socket(std::string const &path, std::uint32_t openflags, osd_file::ptr &file, std::uint64_t &filesize) noexcept { char hostname[256]; int port; std::sscanf(&path[strlen(winfile_socket_identifier)], "%255[^:]:%d", hostname, &port); struct hostent const *const localhost = gethostbyname(hostname); if (!localhost) return std::errc::no_such_file_or_directory; struct sockaddr_in sai; memset(&sai, 0, sizeof(sai)); sai.sin_family = AF_INET; sai.sin_port = htons(port); sai.sin_addr = *reinterpret_cast<struct in_addr *>(localhost->h_addr); SOCKET sock = socket(AF_INET, SOCK_STREAM, 0); if (INVALID_SOCKET == sock) return win_osd_socket::wsa_error_to_file_error(WSAGetLastError()); int const flag = 1; if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<const char *>(&flag), sizeof(flag)) == SOCKET_ERROR) { int const err = WSAGetLastError(); closesocket(sock); return win_osd_socket::wsa_error_to_file_error(err); } // listening socket support osd_file::ptr result; if (openflags & OPEN_FLAG_CREATE) { //printf("Listening for client at '%s' on port '%d'\n", hostname, port); // bind socket... if (bind(sock, reinterpret_cast<struct sockaddr const *>(&sai), sizeof(sai)) == SOCKET_ERROR) { int const err = WSAGetLastError(); closesocket(sock); return win_osd_socket::wsa_error_to_file_error(err); } // start to listen... if (listen(sock, 1) == SOCKET_ERROR) { int const err = WSAGetLastError(); closesocket(sock); return win_osd_socket::wsa_error_to_file_error(err); } // mark socket as "listening" result.reset(new (std::nothrow) win_osd_socket(sock, true)); } else { //printf("Connecting to server '%s' on port '%d'\n", hostname, port); if (connect(sock, reinterpret_cast<struct sockaddr const *>(&sai), sizeof(sai)) == SOCKET_ERROR) { int const err = WSAGetLastError(); closesocket(sock); return win_osd_socket::wsa_error_to_file_error(err); } result.reset(new (std::nothrow) win_osd_socket(sock, false)); } if (!result) { closesocket(sock); return std::errc::not_enough_memory; } file = std::move(result); filesize = 0; return std::error_condition(); }