diff options
author | Olivier Galibert <galibert@pobox.com> | 2018-08-11 21:11:01 +0200 |
---|---|---|
committer | Olivier Galibert <galibert@pobox.com> | 2018-08-11 22:23:31 +0200 |
commit | 881bb3c904a03fe09792d860944a745be941115b (patch) | |
tree | 02173eccdd801a2fe0cc25ebd5cdf63460ccf8b8 | |
parent | e3f58dd3bf8ba9af6c220b6c90328bbd8b0c8ddc (diff) |
apollo: get rid of deprecation messages (nw)
-rw-r--r-- | src/mame/drivers/apollo.cpp | 22 | ||||
-rw-r--r-- | src/mame/includes/apollo.h | 28 | ||||
-rw-r--r-- | src/mame/machine/apollo.cpp | 10 | ||||
-rw-r--r-- | src/mame/video/apollo.cpp | 5 |
4 files changed, 34 insertions, 31 deletions
diff --git a/src/mame/drivers/apollo.cpp b/src/mame/drivers/apollo.cpp index 2207bb82dd4..731f7dceb55 100644 --- a/src/mame/drivers/apollo.cpp +++ b/src/mame/drivers/apollo.cpp @@ -130,20 +130,12 @@ static uint32_t log_line_counter = 0; cpu_context - return a string describing which CPU is currently executing and their PC ***************************************************************************/ -const char *apollo_cpu_context(device_t *cpu) { - static char statebuf[64]; /* string buffer containing state description */ +std::string apollo_cpu_context(running_machine &machine) { + osd_ticks_t t = osd_ticks(); + int s = (t / osd_ticks_per_second()) % 3600; + int ms = (t / (osd_ticks_per_second() / 1000)) % 1000; - /* if we have an executing CPU, output data */ - if (cpu != nullptr) { - osd_ticks_t t = osd_ticks(); - int s = (t / osd_ticks_per_second()) % 3600; - int ms = (t / (osd_ticks_per_second() / 1000)) % 1000; - - sprintf(statebuf, "%s %d.%03d", cpu->machine().describe_context().c_str(), s, ms); - } else { - strcpy(statebuf, "(no context)"); - } - return statebuf; + return util::string_format("%s %d.%03d", machine.describe_context().c_str(), s, ms); } /*------------------------------------------------- @@ -941,8 +933,8 @@ WRITE_LINE_MEMBER(apollo_state::apollo_reset_instr_callback) if (!apollo_is_dsp3x00()) { - machine().device(APOLLO_SCREEN_TAG)->reset(); - machine().device(APOLLO_KBD_TAG )->reset(); + m_graphics->reset(); + m_keyboard->reset(); #ifdef APOLLO_XXL machine().device(APOLLO_STDIO_TAG )->reset(); #endif diff --git a/src/mame/includes/apollo.h b/src/mame/includes/apollo.h index 86381bf981e..3339e0f760f 100644 --- a/src/mame/includes/apollo.h +++ b/src/mame/includes/apollo.h @@ -31,6 +31,7 @@ #include "bus/isa/isa.h" #include "bus/isa/isa_cards.h" #include "bus/isa/3c505.h" +#include "bus/isa/omti8621.h" #include "bus/rs232/rs232.h" @@ -43,16 +44,16 @@ #define LOG(x) { logerror x; logerror ("\n"); apollo_check_log(); } #define LOG1(x) { if (VERBOSE > 0) LOG(x) } #define LOG2(x) { if (VERBOSE > 1) LOG(x) } -#define CLOG(x) { machine().logerror ("%s - %s: ", apollo_cpu_context(machine().device(MAINCPU)), tag()); machine().logerror x; machine().logerror ("\n"); apollo_check_log(); } +#define CLOG(x) { machine().logerror ("%s - %s: ", apollo_cpu_context(machine()), tag()); machine().logerror x; machine().logerror ("\n"); apollo_check_log(); } #define CLOG1(x) { if (VERBOSE > 0) CLOG(x) } #define CLOG2(x) { if (VERBOSE > 1) CLOG(x) } -#define DLOG(x) { device->logerror ("%s - %s: ", apollo_cpu_context(device->machine().device(MAINCPU)), device->tag()); device->logerror x; device->logerror ("\n"); apollo_check_log(); } +#define DLOG(x) { device->logerror ("%s - %s: ", apollo_cpu_context(device->machine()), device->tag()); device->logerror x; device->logerror ("\n"); apollo_check_log(); } #define DLOG1(x) { if (VERBOSE > 0) DLOG(x) } #define DLOG2(x) { if (VERBOSE > 1) DLOG(x) } -#define MLOG(x) { machine().logerror ("%s: ", apollo_cpu_context(machine().device(MAINCPU))); machine().logerror x; machine().logerror ("\n"); apollo_check_log(); } +#define MLOG(x) { machine().logerror ("%s: ", apollo_cpu_context(machine())); machine().logerror x; machine().logerror ("\n"); apollo_check_log(); } #define MLOG1(x) { if (VERBOSE > 0) MLOG(x) } #define MLOG2(x) { if (VERBOSE > 1) MLOG(x) } -#define SLOG(x) { machine().logerror ("%s: ", apollo_cpu_context(m_maincpu));machine().logerror x; machine().logerror ("\n"); apollo_check_log(); } +#define SLOG(x) { machine().logerror ("%s: ", apollo_cpu_context(machine()));machine().logerror x; machine().logerror ("\n"); apollo_check_log(); } #define SLOG1(x) { if (VERBOSE > 0) SLOG(x) } #define SLOG2(x) { if (VERBOSE > 1) SLOG(x) } @@ -65,7 +66,7 @@ /*----------- drivers/apollo.c -----------*/ // return the current CPU context for log file entries -const char *apollo_cpu_context(device_t *cpu); +std::string apollo_cpu_context(running_machine &machine); // enable/disable the FPU void apollo_set_cpu_has_fpu(m68000_base_device *device, int onoff); @@ -100,7 +101,6 @@ void apollo_set_cache_status_register(device_t *device,uint8_t mask, uint8_t dat #define APOLLO_CONF_TAG "conf" #define APOLLO_DMA1_TAG "dma8237_1" #define APOLLO_DMA2_TAG "dma8237_2" -#define APOLLO_KBD_TAG "kbd" #define APOLLO_STDIO_TAG "stdio" #define APOLLO_PIC1_TAG "pic8259_master" #define APOLLO_PIC2_TAG "pic8259_slave" @@ -111,10 +111,15 @@ void apollo_set_cache_status_register(device_t *device,uint8_t mask, uint8_t dat #define APOLLO_ETH_TAG "3c505" #define APOLLO_NI_TAG "node_id" #define APOLLO_ISA_TAG "isabus" +#define APOLLO_SCREEN_TAG "apollo_screen" +#define APOLLO_KBD_TAG "kbd" + // forward declaration class apollo_sio; class apollo_ni; +class apollo_graphics_15i; +class apollo_kbd_device; class apollo_state : public driver_device { @@ -132,7 +137,9 @@ public: m_sio2(*this, APOLLO_SIO2_TAG), m_rtc(*this, APOLLO_RTC_TAG), m_node_id(*this, APOLLO_NI_TAG), - m_isa(*this, APOLLO_ISA_TAG) + m_isa(*this, APOLLO_ISA_TAG), + m_graphics(*this, APOLLO_SCREEN_TAG), + m_keyboard(*this, APOLLO_KBD_TAG) { } required_device<m68000_base_device> m_maincpu; @@ -148,6 +155,8 @@ public: required_device<mc146818_device> m_rtc; required_device<apollo_ni> m_node_id; required_device<isa16_device> m_isa; + optional_device<apollo_graphics_15i> m_graphics; + optional_device<apollo_kbd_device> m_keyboard; DECLARE_WRITE16_MEMBER(apollo_csr_status_register_w); DECLARE_READ16_MEMBER(apollo_csr_status_register_r); @@ -408,6 +417,7 @@ protected: virtual void device_reset() override; private: + optional_device<omti8621_apollo_device> m_wdc; void set_node_id(uint32_t node_id); uint32_t m_node_id; }; @@ -417,8 +427,6 @@ DECLARE_DEVICE_TYPE(APOLLO_NI, apollo_ni) /*----------- video/apollo.c -----------*/ -#define APOLLO_SCREEN_TAG "apollo_screen" - class apollo_graphics_15i : public device_t { public: @@ -450,6 +458,8 @@ public: int is_mono() { return m_n_planes == 1; } protected: + required_device<screen_device> m_screen; + apollo_graphics_15i(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, device_type type); // device-level overrides diff --git a/src/mame/machine/apollo.cpp b/src/mame/machine/apollo.cpp index 19cd876ab76..6dfaa6d24e6 100644 --- a/src/mame/machine/apollo.cpp +++ b/src/mame/machine/apollo.cpp @@ -853,7 +853,8 @@ DEFINE_DEVICE_TYPE(APOLLO_NI, apollo_ni, "node_id", "Apollo Node ID") apollo_ni::apollo_ni(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APOLLO_NI, tag, owner, clock), - device_image_interface(mconfig, *this) + device_image_interface(mconfig, *this), + m_wdc(*this, ":isa1:wdc") { } @@ -1012,19 +1013,18 @@ void apollo_ni::call_unload() void apollo_ni::set_node_id_from_disk() { - omti8621_apollo_device *omti8621 = machine().device<omti8621_apollo_device>("isa1:wdc"); uint8_t db[0x50]; // check label of physical volume and get sector data of logical volume 1 // Note: sector data starts with 32 byte block header // set node ID from UID of logical volume 1 of logical unit 0 - if (omti8621 - && omti8621->get_sector(0, db, sizeof(db), 0) == sizeof(db) + if (m_wdc + && m_wdc->get_sector(0, db, sizeof(db), 0) == sizeof(db) && memcmp(db + 0x22, "APOLLO", 6) == 0) { uint16_t sector1 = apollo_is_dn5500() ? 4 : 1; - if (omti8621->get_sector(sector1, db, sizeof(db), 0) == sizeof(db)) + if (m_wdc->get_sector(sector1, db, sizeof(db), 0) == sizeof(db)) { // set node_id from UID of logical volume 1 of logical unit 0 m_node_id = (((db[0x49] << 8) | db[0x4a]) << 8) | db[0x4b]; diff --git a/src/mame/video/apollo.cpp b/src/mame/video/apollo.cpp index 2e5948c5191..981b2048f0d 100644 --- a/src/mame/video/apollo.cpp +++ b/src/mame/video/apollo.cpp @@ -1704,8 +1704,7 @@ void apollo_graphics_15i::register_vblank_callback() MLOG1(("register_vblank_callback")); /* register for VBLANK callbacks */ - screen_device *screen = (screen_device *)machine().device(VIDEO_SCREEN_TAG); - screen->register_vblank_callback(vblank_state_delegate(&apollo_graphics_15i::vblank_state_changed,this)); + m_screen->register_vblank_callback(vblank_state_delegate(&apollo_graphics_15i::vblank_state_changed,this)); } @@ -1725,6 +1724,7 @@ DEFINE_DEVICE_TYPE(APOLLO_GRAPHICS, apollo_graphics_15i, "apollo_graphics_15i", apollo_graphics_15i::apollo_graphics_15i(const machine_config &mconfig,const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APOLLO_GRAPHICS, tag, owner, clock), + m_screen(*this, "^" VIDEO_SCREEN_TAG), m_lut_fifo(nullptr), m_bt458(nullptr) { @@ -1732,6 +1732,7 @@ apollo_graphics_15i::apollo_graphics_15i(const machine_config &mconfig,const cha apollo_graphics_15i::apollo_graphics_15i(const machine_config &mconfig,const char *tag, device_t *owner, uint32_t clock, device_type type) : device_t(mconfig, type, tag, owner, clock), + m_screen(*this, "^" VIDEO_SCREEN_TAG), m_lut_fifo(nullptr), m_bt458(nullptr) { |