From 116a73910a52048a75f673bfdf1083e98c7243a2 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Sun, 19 Jun 2016 17:44:18 +1000 Subject: [PATCH] hp_taco: This compiles too. Unable to test because hp9845 is not working. --- src/devices/machine/hp_taco.cpp | 13 +++++-------- src/devices/machine/hp_taco.h | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/devices/machine/hp_taco.cpp b/src/devices/machine/hp_taco.cpp index c0f62514653..e8d8e8651d5 100644 --- a/src/devices/machine/hp_taco.cpp +++ b/src/devices/machine/hp_taco.cpp @@ -1686,17 +1686,16 @@ void hp_taco_device::call_unload() set_tape_present(false); } -int hp_taco_device::call_display_taco(std::string& s) +std::string hp_taco_device::call_display() { + std::string buffer; // Mostly lifted from cassette_image_device::call_display ;) // Do not show anything if image not loaded or tape not moving if (!exists() || m_start_time.is_never()) { - return -1; + return buffer; } - char buffer[ 64 ]; - char track = BIT(m_status_reg , STATUS_TRACKB_BIT) ? 'B' : 'A'; char r_w = m_tape_wr ? 'W' : 'R'; char m1; @@ -1712,12 +1711,10 @@ int hp_taco_device::call_display_taco(std::string& s) int pos_in = current_tape_pos() / ONE_INCH_POS; - snprintf(buffer , sizeof(buffer) , "%c %c %c%c [%04d/1824]" , track , r_w , m1 , m2 , pos_in); - - s = buffer; + buffer = string_format("%c %c %c%c [%04d/1824]" , track , r_w , m1 , m2 , pos_in); // Not correct when there are 2 or more instances of TACO - return 0; + return buffer; } const char *hp_taco_device::file_extensions() const diff --git a/src/devices/machine/hp_taco.h b/src/devices/machine/hp_taco.h index 0aeb41c9c36..e8a4f06cb65 100644 --- a/src/devices/machine/hp_taco.h +++ b/src/devices/machine/hp_taco.h @@ -47,7 +47,7 @@ public: virtual bool call_load() override; virtual bool call_create(int format_type, option_resolution *format_options) override; virtual void call_unload() override; - virtual int call_display_taco(std::string& s); + virtual std::string call_display() override; virtual iodevice_t image_type() const override { return IO_MAGTAPE; } virtual bool is_readable() const override { return true; } virtual bool is_writeable() const override { return true; }