diff options
author | 2023-09-19 17:33:49 -0400 | |
---|---|---|
committer | 2023-09-19 17:33:49 -0400 | |
commit | f32bb79e8541ba96d3a8144b220c48fb7536ba4b (patch) | |
tree | 0f8af1a416aa560598961ebda928d34b133c0bfa /src/devices/bus/isa | |
parent | 8e838e96c6810d81939a20dd45d7bfccc34044ef (diff) |
Change parameter type for device_network_interface::set_mac from char * to u8 *
Diffstat (limited to 'src/devices/bus/isa')
-rw-r--r-- | src/devices/bus/isa/3c503.cpp | 9 | ||||
-rw-r--r-- | src/devices/bus/isa/ne1000.cpp | 7 | ||||
-rw-r--r-- | src/devices/bus/isa/ne2000.cpp | 7 |
3 files changed, 17 insertions, 6 deletions
diff --git a/src/devices/bus/isa/3c503.cpp b/src/devices/bus/isa/3c503.cpp index 041b403cabb..6c5e812177b 100644 --- a/src/devices/bus/isa/3c503.cpp +++ b/src/devices/bus/isa/3c503.cpp @@ -3,6 +3,8 @@ #include "emu.h" #include "3c503.h" +#include "multibyte.h" + #define SADDR 0xcc000 void el2_3c503_device::device_add_mconfig(machine_config &config) @@ -24,10 +26,13 @@ el2_3c503_device::el2_3c503_device(const machine_config& mconfig, const char* ta } void el2_3c503_device::device_start() { - char mac[7]; + uint8_t mac[6]; uint32_t num = machine().rand(); memset(m_prom, 0x57, 16); - snprintf(mac, std::size(mac), "\x02\x60\x8c%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff); + mac[0] = 0x02; + mac[1] = 0x60; + mac[2] = 0x8c; + put_u24be(mac+3, num); memcpy(m_prom, mac, 6); memset(m_rom, 0, 8*1024); // empty m_dp8390->set_mac(mac); diff --git a/src/devices/bus/isa/ne1000.cpp b/src/devices/bus/isa/ne1000.cpp index a290b076628..62c7187e377 100644 --- a/src/devices/bus/isa/ne1000.cpp +++ b/src/devices/bus/isa/ne1000.cpp @@ -3,6 +3,8 @@ #include "emu.h" #include "ne1000.h" +#include "multibyte.h" + DEFINE_DEVICE_TYPE(NE1000, ne1000_device, "ne1000", "NE1000 Network Adapter") @@ -23,10 +25,11 @@ ne1000_device::ne1000_device(const machine_config &mconfig, const char *tag, dev } void ne1000_device::device_start() { - char mac[7]; + uint8_t mac[6]; uint32_t num = machine().rand(); memset(m_prom, 0x57, 16); - sprintf(mac+2, "\x1b%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff); + mac[2] = 0x1b; + put_u24be(mac+3, num); mac[0] = 0; mac[1] = 0; // avoid gcc warning memcpy(m_prom, mac, 6); m_dp8390->set_mac(mac); diff --git a/src/devices/bus/isa/ne2000.cpp b/src/devices/bus/isa/ne2000.cpp index efd448fe3da..452aceb55c5 100644 --- a/src/devices/bus/isa/ne2000.cpp +++ b/src/devices/bus/isa/ne2000.cpp @@ -3,6 +3,8 @@ #include "emu.h" #include "ne2000.h" +#include "multibyte.h" + DEFINE_DEVICE_TYPE(NE2000, ne2000_device, "ne2000", "NE2000 Network Adapter") @@ -23,10 +25,11 @@ ne2000_device::ne2000_device(const machine_config& mconfig, const char* tag, dev } void ne2000_device::device_start() { - char mac[7]; + uint8_t mac[6]; uint32_t num = machine().rand(); memset(m_prom, 0x57, 16); - sprintf(mac+2, "\x1b%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff); + mac[2] = 0x1b; + put_u24be(mac+3, num); mac[0] = 0; mac[1] = 0; // avoid gcc warning memcpy(m_prom, mac, 6); m_dp8390->set_mac(mac); |