diff options
author | Vas Crabb <vas@vastheman.com> | 2017-05-20 15:31:24 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2017-05-20 15:31:24 +1000 |
commit | a0a94606b68bd0bad6727e542d3f939c3690a070 (patch) | |
tree | 2903d72f80d045d7c0378f84e3a70687ea62c3aa | |
parent | 335651bd7902d62abf21e760208fa6c921663ee6 (diff) |
cleanup (nw)
-rw-r--r-- | src/mame/drivers/zexall.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mame/drivers/zexall.cpp b/src/mame/drivers/zexall.cpp index c33df0f6be5..1e246f7d7d7 100644 --- a/src/mame/drivers/zexall.cpp +++ b/src/mame/drivers/zexall.cpp @@ -24,6 +24,9 @@ One i/o port is used: #include "cpu/z80/z80.h" #include "machine/terminal.h" +#include <sstream> + + #define TERMINAL_TAG "terminal" class zexall_state : public driver_device @@ -53,7 +56,7 @@ private: uint8_t m_out_req_last; // old value at 0xFFFE before the most recent write uint8_t m_out_ack; // byte written to 0xFFFC virtual void machine_reset() override; - std::string m_outstring; + std::ostringstream m_outstring; }; DRIVER_INIT_MEMBER(zexall_state,zexall) @@ -71,7 +74,7 @@ void zexall_state::machine_reset() uint8_t *ram = m_main_ram; /* fill main ram with zexall code */ memcpy(ram, rom, 0x228a); - m_outstring.clear(); + m_outstring.str(""); } READ8_MEMBER( zexall_state::zexall_output_ack_r ) @@ -81,13 +84,11 @@ READ8_MEMBER( zexall_state::zexall_output_ack_r ) { m_terminal->write(space,0,m_out_data); // turn text into a string for logerror - char temp[2]; - sprintf(temp,"%c",m_out_data); - m_outstring.append(temp); + m_outstring.put(char(m_out_data)); if (m_out_data == 0x0a) { - logerror(m_outstring.c_str()); - m_outstring.clear(); + logerror("%s", m_outstring.str()); + m_outstring.str(""); } m_out_req_last = m_out_req; m_out_ack++; |