diff options
Diffstat (limited to 'src/devices/bus/nubus')
-rw-r--r-- | src/devices/bus/nubus/nubus.cpp | 56 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus.h | 51 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus_48gc.cpp | 19 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus_asntmc3b.cpp | 13 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus_cb264.cpp | 15 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus_image.cpp | 7 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus_m2hires.cpp | 15 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus_m2video.cpp | 15 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus_radiustpd.cpp | 13 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus_spec8.cpp | 15 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus_specpdq.cpp | 99 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus_vikbw.cpp | 15 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus_wsportrait.cpp | 15 | ||||
-rw-r--r-- | src/devices/bus/nubus/pds30_30hr.cpp | 15 | ||||
-rw-r--r-- | src/devices/bus/nubus/pds30_cb264.cpp | 15 | ||||
-rw-r--r-- | src/devices/bus/nubus/pds30_mc30.cpp | 15 | ||||
-rw-r--r-- | src/devices/bus/nubus/pds30_procolor816.cpp | 15 | ||||
-rw-r--r-- | src/devices/bus/nubus/pds30_sigmalview.cpp | 15 |
18 files changed, 209 insertions, 214 deletions
diff --git a/src/devices/bus/nubus/nubus.cpp b/src/devices/bus/nubus/nubus.cpp index b0fc2a4667d..dc7db80a2ef 100644 --- a/src/devices/bus/nubus/nubus.cpp +++ b/src/devices/bus/nubus/nubus.cpp @@ -70,23 +70,24 @@ nubus_device::nubus_device(const machine_config &mconfig, const char *tag, devic nubus_device::nubus_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), - m_maincpu(nullptr), + m_space(*this, finder_base::DUMMY_TAG, -1), m_out_irq9_cb(*this), m_out_irqa_cb(*this), m_out_irqb_cb(*this), m_out_irqc_cb(*this), m_out_irqd_cb(*this), - m_out_irqe_cb(*this), - m_cputag(nullptr) + m_out_irqe_cb(*this) { } + //------------------------------------------------- -// device_start - device-specific startup +// device_resolve_objects - resolve objects that +// may be needed for other devices to set +// initial conditions at start time //------------------------------------------------- -void nubus_device::device_start() +void nubus_device::device_resolve_objects() { - m_maincpu = machine().device<cpu_device>(m_cputag); // resolve callbacks m_out_irq9_cb.resolve_safe(); m_out_irqa_cb.resolve_safe(); @@ -97,10 +98,10 @@ void nubus_device::device_start() } //------------------------------------------------- -// device_reset - device-specific reset +// device_start - device-specific startup //------------------------------------------------- -void nubus_device::device_reset() +void nubus_device::device_start() { } @@ -111,15 +112,14 @@ void nubus_device::add_nubus_card(device_nubus_card_interface *card) void nubus_device::install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, uint32_t mask) { - m_maincpu = machine().device<cpu_device>(m_cputag); - int buswidth = m_maincpu->space_config(AS_PROGRAM)->data_width(); + int buswidth = m_space->data_width(); switch(buswidth) { case 32: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); + m_space->install_readwrite_handler(start, end, rhandler, whandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); + m_space->install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -128,15 +128,14 @@ void nubus_device::install_device(offs_t start, offs_t end, read8_delegate rhand void nubus_device::install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, uint32_t mask) { - m_maincpu = machine().device<cpu_device>(m_cputag); - int buswidth = m_maincpu->space_config(AS_PROGRAM)->data_width(); + int buswidth = m_space->data_width(); switch(buswidth) { case 32: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); + m_space->install_readwrite_handler(start, end, rhandler, whandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); + m_space->install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -145,15 +144,14 @@ void nubus_device::install_device(offs_t start, offs_t end, read16_delegate rhan void nubus_device::install_device(offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler, uint32_t mask) { - m_maincpu = machine().device<cpu_device>(m_cputag); - int buswidth = m_maincpu->space_config(AS_PROGRAM)->data_width(); + int buswidth = m_space->data_width(); switch(buswidth) { case 32: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); + m_space->install_readwrite_handler(start, end, rhandler, whandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); + m_space->install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -162,15 +160,14 @@ void nubus_device::install_device(offs_t start, offs_t end, read32_delegate rhan void nubus_device::install_readonly_device(offs_t start, offs_t end, read32_delegate rhandler, uint32_t mask) { - m_maincpu = machine().device<cpu_device>(m_cputag); - int buswidth = m_maincpu->space_config(AS_PROGRAM)->data_width(); + int buswidth = m_space->data_width(); switch(buswidth) { case 32: - m_maincpu->space(AS_PROGRAM).install_read_handler(start, end, rhandler, mask); + m_space->install_read_handler(start, end, rhandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_read_handler(start, end, rhandler, ((uint64_t)mask<<32)|mask); + m_space->install_read_handler(start, end, rhandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -179,15 +176,14 @@ void nubus_device::install_readonly_device(offs_t start, offs_t end, read32_dele void nubus_device::install_writeonly_device(offs_t start, offs_t end, write32_delegate whandler, uint32_t mask) { - m_maincpu = machine().device<cpu_device>(m_cputag); - int buswidth = m_maincpu->space_config(AS_PROGRAM)->data_width(); + int buswidth = m_space->data_width(); switch(buswidth) { case 32: - m_maincpu->space(AS_PROGRAM).install_write_handler(start, end, whandler, mask); + m_space->install_write_handler(start, end, whandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_write_handler(start, end, whandler, ((uint64_t)mask<<32)|mask); + m_space->install_write_handler(start, end, whandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -197,9 +193,7 @@ void nubus_device::install_writeonly_device(offs_t start, offs_t end, write32_de void nubus_device::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data) { // printf("install_bank: %s @ %x->%x\n", tag, start, end); - m_maincpu = machine().device<cpu_device>(m_cputag); - address_space &space = m_maincpu->space(AS_PROGRAM); - space.install_readwrite_bank(start, end, 0, tag ); + m_space->install_readwrite_bank(start, end, 0, tag); machine().root_device().membank(siblingtag(tag).c_str())->set_base(data); } diff --git a/src/devices/bus/nubus/nubus.h b/src/devices/bus/nubus/nubus.h index 919f989ebfb..a1b9496fcf8 100644 --- a/src/devices/bus/nubus/nubus.h +++ b/src/devices/bus/nubus/nubus.h @@ -14,44 +14,6 @@ #pragma once - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_NUBUS_CPU(_cputag) \ - downcast<nubus_device &>(*device).set_cputag(_cputag); - -#define MCFG_NUBUS_OUT_IRQ9_CB(_devcb) \ - downcast<nubus_device &>(*device).set_out_irq9_callback(DEVCB_##_devcb); - -#define MCFG_NUBUS_OUT_IRQA_CB(_devcb) \ - downcast<nubus_device &>(*device).set_out_irqa_callback(DEVCB_##_devcb); - -#define MCFG_NUBUS_OUT_IRQB_CB(_devcb) \ - downcast<nubus_device &>(*device).set_out_irqb_callback(DEVCB_##_devcb); - -#define MCFG_NUBUS_OUT_IRQC_CB(_devcb) \ - downcast<nubus_device &>(*device).set_out_irqc_callback(DEVCB_##_devcb); - -#define MCFG_NUBUS_OUT_IRQD_CB(_devcb) \ - downcast<nubus_device &>(*device).set_out_irqd_callback(DEVCB_##_devcb); - -#define MCFG_NUBUS_OUT_IRQE_CB(_devcb) \ - downcast<nubus_device &>(*device).set_out_irqe_callback(DEVCB_##_devcb); - -#define MCFG_NUBUS_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot) \ - MCFG_DEVICE_ADD(_tag, NUBUS_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \ - downcast<nubus_slot_device &>(*device).set_nubus_slot(_nbtag, _tag); -#define MCFG_NUBUS_SLOT_REMOVE(_tag) \ - MCFG_DEVICE_REMOVE(_tag) - -#define MCFG_NUBUS_ONBOARD_ADD(_nbtag, _tag, _dev_type, _def_inp) \ - MCFG_DEVICE_ADD(_tag, _dev_type, 0) \ - MCFG_DEVICE_INPUT_DEFAULTS(_def_inp) \ - downcast<device_nubus_card_interface &>(*device).set_nubus_tag(_nbtag, _tag); - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -100,13 +62,7 @@ public: ~nubus_device() { m_device_list.detach_all(); } // inline configuration - void set_cputag(const char *tag) { m_cputag = tag; } - template <class Object> devcb_base &set_out_irq9_callback(Object &&cb) { return m_out_irq9_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_out_irqa_callback(Object &&cb) { return m_out_irqa_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_out_irqb_callback(Object &&cb) { return m_out_irqb_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_out_irqc_callback(Object &&cb) { return m_out_irqc_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_out_irqd_callback(Object &&cb) { return m_out_irqd_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_out_irqe_callback(Object &&cb) { return m_out_irqe_cb.set_callback(std::forward<Object>(cb)); } + template <typename T> void set_space(T &&tag, int spacenum) { m_space.set_tag(std::forward<T>(tag), spacenum); } auto out_irq9_callback() { return m_out_irq9_cb.bind(); } auto out_irqa_callback() { return m_out_irqa_cb.bind(); } auto out_irqb_callback() { return m_out_irqb_cb.bind(); } @@ -134,11 +90,11 @@ protected: nubus_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); // device-level overrides + virtual void device_resolve_objects() override; virtual void device_start() override; - virtual void device_reset() override; // internal state - cpu_device *m_maincpu; + required_address_space m_space; devcb_write_line m_out_irq9_cb; devcb_write_line m_out_irqa_cb; @@ -148,7 +104,6 @@ protected: devcb_write_line m_out_irqe_cb; simple_list<device_nubus_card_interface> m_device_list; - const char *m_cputag; }; diff --git a/src/devices/bus/nubus/nubus_48gc.cpp b/src/devices/bus/nubus/nubus_48gc.cpp index e089e1986db..86f4fca21ec 100644 --- a/src/devices/bus/nubus/nubus_48gc.cpp +++ b/src/devices/bus/nubus/nubus_48gc.cpp @@ -39,15 +39,16 @@ DEFINE_DEVICE_TYPE(NUBUS_824GC, nubus_824gc_device, "nb_824gc", "Apple 8*24 vide // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(jmfb_device::device_add_mconfig) - MCFG_SCREEN_ADD(GC48_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, jmfb_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) -// MCFG_SCREEN_SIZE(1152, 870) -// MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 870-1) -// MCFG_SCREEN_REFRESH_RATE(75) -// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1260)) -MACHINE_CONFIG_END +void jmfb_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, GC48_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(jmfb_device::screen_update)); + screen.set_raw(25175000, 800, 0, 640, 525, 0, 480); +// screen.set_size(1152, 870); +// screen.set_visarea(0, 1152-1, 0, 870-1); +// screen.set_refresh_hz(75); +// screen.set_vblank_time(ATTOSECONDS_IN_USEC(1260)); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_asntmc3b.cpp b/src/devices/bus/nubus/nubus_asntmc3b.cpp index 46f9d382eb8..f6c0135af5f 100644 --- a/src/devices/bus/nubus/nubus_asntmc3b.cpp +++ b/src/devices/bus/nubus/nubus_asntmc3b.cpp @@ -41,12 +41,13 @@ DEFINE_DEVICE_TYPE(NUBUS_APPLEENET, nubus_appleenet_device, "nb_aenet", "Apple N // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_mac8390_device::device_add_mconfig) - MCFG_DEVICE_ADD(MAC8390_839X, DP8390D, 0) - MCFG_DP8390D_IRQ_CB(WRITELINE(*this, nubus_mac8390_device, dp_irq_w)) - MCFG_DP8390D_MEM_READ_CB(READ8(*this, nubus_mac8390_device, dp_mem_read)) - MCFG_DP8390D_MEM_WRITE_CB(WRITE8(*this, nubus_mac8390_device, dp_mem_write)) -MACHINE_CONFIG_END +void nubus_mac8390_device::device_add_mconfig(machine_config &config) +{ + DP8390D(config, m_dp83902, 0); + m_dp83902->irq_callback().set(FUNC(nubus_mac8390_device::dp_irq_w)); + m_dp83902->mem_read_callback().set(FUNC(nubus_mac8390_device::dp_mem_read)); + m_dp83902->mem_write_callback().set(FUNC(nubus_mac8390_device::dp_mem_write)); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_cb264.cpp b/src/devices/bus/nubus/nubus_cb264.cpp index 9efb5e6d088..01bff0877da 100644 --- a/src/devices/bus/nubus/nubus_cb264.cpp +++ b/src/devices/bus/nubus/nubus_cb264.cpp @@ -40,13 +40,14 @@ DEFINE_DEVICE_TYPE(NUBUS_CB264, nubus_cb264_device, "nb_c264", "RasterOps ColorB // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_cb264_device::device_add_mconfig) - MCFG_SCREEN_ADD( CB264_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_cb264_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END +void nubus_cb264_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, CB264_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_cb264_device::screen_update)); + screen.set_raw(25175000, 800, 0, 640, 525, 0, 480); + screen.set_size(1024, 768); + screen.set_visarea(0, 640-1, 0, 480-1); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_image.cpp b/src/devices/bus/nubus/nubus_image.cpp index 1618bda4da7..8e2d39fb943 100644 --- a/src/devices/bus/nubus/nubus_image.cpp +++ b/src/devices/bus/nubus/nubus_image.cpp @@ -130,9 +130,10 @@ DEFINE_DEVICE_TYPE(NUBUS_IMAGE, nubus_image_device, "nb_image", "NuBus Disk Imag // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_image_device::device_add_mconfig) - MCFG_DEVICE_ADD(IMAGE_DISK0_TAG, MESSIMG_DISK, 0) -MACHINE_CONFIG_END +void nubus_image_device::device_add_mconfig(machine_config &config) +{ + MESSIMG_DISK(config, IMAGE_DISK0_TAG, 0); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_m2hires.cpp b/src/devices/bus/nubus/nubus_m2hires.cpp index 6ac472eeb5b..c575f7d94b1 100644 --- a/src/devices/bus/nubus/nubus_m2hires.cpp +++ b/src/devices/bus/nubus/nubus_m2hires.cpp @@ -36,13 +36,14 @@ DEFINE_DEVICE_TYPE(NUBUS_M2HIRES, nubus_m2hires_device, "nb_m2hr", "Macintosh II // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_m2hires_device::device_add_mconfig) - MCFG_SCREEN_ADD( M2HIRES_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_m2hires_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END +void nubus_m2hires_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, M2HIRES_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_m2hires_device::screen_update)); + screen.set_raw(25175000, 800, 0, 640, 525, 0, 480); + screen.set_size(1024, 768); + screen.set_visarea(0, 640-1, 0, 480-1); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_m2video.cpp b/src/devices/bus/nubus/nubus_m2video.cpp index d7eea8cf22e..b16391b640d 100644 --- a/src/devices/bus/nubus/nubus_m2video.cpp +++ b/src/devices/bus/nubus/nubus_m2video.cpp @@ -38,13 +38,14 @@ DEFINE_DEVICE_TYPE(NUBUS_M2VIDEO, nubus_m2video_device, "nb_m2vc", "Macintosh II // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_m2video_device::device_add_mconfig) - MCFG_SCREEN_ADD(M2VIDEO_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_m2video_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END +void nubus_m2video_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, M2VIDEO_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_m2video_device::screen_update)); + screen.set_raw(25175000, 800, 0, 640, 525, 0, 480); + screen.set_size(1024, 768); + screen.set_visarea(0, 640-1, 0, 480-1); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_radiustpd.cpp b/src/devices/bus/nubus/nubus_radiustpd.cpp index 98a3ab3e514..1ee2e0cb7fb 100644 --- a/src/devices/bus/nubus/nubus_radiustpd.cpp +++ b/src/devices/bus/nubus/nubus_radiustpd.cpp @@ -37,13 +37,12 @@ DEFINE_DEVICE_TYPE(NUBUS_RADIUSTPD, nubus_radiustpd_device, "nb_rtpd", "Radius T // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_radiustpd_device::device_add_mconfig) - MCFG_SCREEN_ADD( RADIUSTPD_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_radiustpd_device, screen_update) - MCFG_SCREEN_SIZE(1280, 960) - MCFG_SCREEN_REFRESH_RATE(70) - MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 880-1) -MACHINE_CONFIG_END +void nubus_radiustpd_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, RADIUSTPD_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_radiustpd_device::screen_update)); + screen.set_raw(99.522_MHz_XTAL, 1536, 0, 1152, 900, 0, 880); // 64.79 kHz horizontal, 72 Hz refresh +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_spec8.cpp b/src/devices/bus/nubus/nubus_spec8.cpp index d3d45d9b076..1353d3b9a9d 100644 --- a/src/devices/bus/nubus/nubus_spec8.cpp +++ b/src/devices/bus/nubus/nubus_spec8.cpp @@ -40,13 +40,14 @@ DEFINE_DEVICE_TYPE(NUBUS_SPEC8S3, nubus_spec8s3_device, "nb_sp8s3", "SuperMac Sp // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_spec8s3_device::device_add_mconfig) - MCFG_SCREEN_ADD( SPEC8S3_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_spec8s3_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 768-1) -MACHINE_CONFIG_END +void nubus_spec8s3_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, SPEC8S3_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_spec8s3_device::screen_update)); + screen.set_raw(25175000, 800, 0, 640, 525, 0, 480); + screen.set_size(1024, 768); + screen.set_visarea(0, 1024-1, 0, 768-1); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_specpdq.cpp b/src/devices/bus/nubus/nubus_specpdq.cpp index d9e463e7fbf..2e09a258bd2 100644 --- a/src/devices/bus/nubus/nubus_specpdq.cpp +++ b/src/devices/bus/nubus/nubus_specpdq.cpp @@ -29,6 +29,9 @@ #include "nubus_specpdq.h" #include "screen.h" +//#define VERBOSE 1 +#include "logmacro.h" + #define SPECPDQ_SCREEN_NAME "specpdq_screen" #define SPECPDQ_ROM_REGION "specpdq_rom" @@ -51,15 +54,16 @@ DEFINE_DEVICE_TYPE(NUBUS_SPECPDQ, nubus_specpdq_device, "nb_spdq", "SuperMac Spe // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_specpdq_device::device_add_mconfig) - MCFG_SCREEN_ADD( SPECPDQ_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_specpdq_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1280,1024) - MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 844-1) +void nubus_specpdq_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, SPECPDQ_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_specpdq_device::screen_update)); + screen.set_raw(25175000, 800, 0, 640, 525, 0, 480); + screen.set_size(1280, 1024); + screen.set_visarea(0, 1152-1, 0, 844-1); - MCFG_PALETTE_ADD("palette", 256) -MACHINE_CONFIG_END + PALETTE(config, m_palette).set_entries(256); +} //------------------------------------------------- // rom_region - device-specific ROM region @@ -242,7 +246,7 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w ) switch (offset) { case 0xc0054: // mode 1 -// logerror("%x to mode1\n", data); + LOG("%x to mode1\n", data); break; case 0xc005c: // interrupt control @@ -261,7 +265,7 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w ) break; case 0xc007a: -// logerror("%x to mode2\n", data); + LOG("%x to mode2\n", data); switch (data) { @@ -278,11 +282,11 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w ) break; } -// logerror("m_mode = %d\n", m_mode); + LOG("m_mode = %d\n", m_mode); break; case 0x120000: // DAC address -// logerror("%08x to DAC control %s\n", data,machine().describe_context()); + LOG("%08x to DAC control %s\n", data,machine().describe_context()); m_clutoffs = ((data>>8)&0xff)^0xff; break; @@ -291,7 +295,7 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w ) if (m_count == 3) { -// logerror("RAMDAC: color %d = %02x %02x %02x %s\n", m_clutoffs, m_colors[0], m_colors[1], m_colors[2], machine().describe_context()); + LOG("RAMDAC: color %d = %02x %02x %02x %s\n", m_clutoffs, m_colors[0], m_colors[1], m_colors[2], machine().describe_context()); m_palette->set_pen_color(m_clutoffs, rgb_t(m_colors[0], m_colors[1], m_colors[2])); m_palette_val[m_clutoffs] = rgb_t(m_colors[0], m_colors[1], m_colors[2]); m_clutoffs++; @@ -368,7 +372,10 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w ) case 0x18103d: case 0x18103e: case 0x18103f: -// logerror("Pattern %08x @ %x\n", data ^ 0xffffffff, offset); + if(offset == 0x181000) { + machine().debug_break(); + LOG("Pattern %08x @ %x\n", data ^ 0xffffffff, offset); + } m_fillbytes[((offset&0x3f)*4)] = ((data>>24) & 0xff) ^ 0xff; m_fillbytes[((offset&0x3f)*4)+1] = ((data>>16) & 0xff) ^ 0xff; m_fillbytes[((offset&0x3f)*4)+2] = ((data>>8) & 0xff) ^ 0xff; @@ -377,81 +384,107 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w ) // blitter control case 0x182006: -// logerror("%08x (%d) to blitter ctrl 1 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context()); + LOG("%08x (%d) to blitter ctrl 1 %s rectangle\n", data^0xffffffff, data^0xffffffff, machine().describe_context()); break; case 0x182008: -// logerror("%08x (%d) to blitter ctrl 2 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context()); + LOG("%08x (%d) to blitter ctrl 2 %s rectangle\n", data^0xffffffff, data^0xffffffff, machine().describe_context()); m_patofsx = (data ^ 0xffffffff) & 7; m_patofsy = ((data ^ 0xffffffff)>>3) & 7; break; case 0x18200e: -// logerror("%08x (%d) to blitter ctrl 3 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context()); + LOG("%08x (%d) to blitter ctrl 3 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context()); m_width = data ^ 0xffffffff; break; case 0x18200b: -// logerror("%08x (%d) to blitter ctrl 4 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context()); + LOG("%08x (%d) to blitter ctrl 4 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context()); m_height = (data ^ 0xffffffff) & 0xffff; break; case 0x18200a: data ^= 0xffffffff; -// logerror("%08x to blitter ctrl 5 %s\n", data, machine().describe_context()); + LOG("%08x to blitter ctrl 5 %s\n", data, machine().describe_context()); m_vram_src = data>>2; break; case 0x182009: data ^= 0xffffffff; -// logerror("%08x to blitter ctrl 6 %s\n", data, machine().describe_context()); + LOG("%08x to blitter ctrl 6 %s\n", data, machine().describe_context()); m_vram_addr = data>>2; break; case 0x182007: data ^= 0xffffffff; -// logerror("%08x to blitter ctrl 7 %s\n", data, machine().describe_context()); + LOG("%08x to blitter ctrl 7 %s\n", data, machine().describe_context()); // fill rectangle if (data == 2) { int x, y; - uint8_t *vram = &m_vram[m_vram_addr + m_patofsx]; // m_vram_addr is missing the low 2 bits, we add them back here + uint8_t *vram = &m_vram[m_vram_addr & ~3]; -// logerror("Fill rectangle with %02x %02x %02x %02x, width %d height %d\n", m_fillbytes[0], m_fillbytes[1], m_fillbytes[2], m_fillbytes[3], m_width, m_height); + int ddx = m_vram_addr & 3; - for (y = 0; y < m_height; y++) + LOG("Fill rectangle with %02x %02x %02x %02x, adr %x (%d, %d) width %d height %d delta %d %d\n", m_fillbytes[0], m_fillbytes[1], m_fillbytes[2], m_fillbytes[3], m_vram_addr, m_vram_addr % 1152, m_vram_addr / 1152, m_width, m_height, m_patofsx, m_patofsy); + + for (y = 0; y <= m_height; y++) { - for (x = 0; x < m_width; x++) + for (x = 0; x <= m_width; x++) + { + vram[(y * 1152)+BYTE4_XOR_BE(x + ddx)] = m_fillbytes[((m_patofsx + x) & 0x1f)+(((m_patofsy + y) & 0x7) << 5)]; + } + } + } + else if (data == 0x100) + { + int x, y; + uint8_t *vram = &m_vram[m_vram_addr & ~3]; + uint8_t *vramsrc = &m_vram[m_vram_src & ~3]; + + int sdx = m_vram_src & 3; + int ddx = m_vram_addr & 3; + + LOG("Copy rectangle forwards, width %d height %d dst %x (%d, %d) src %x (%d, %d)\n", m_width, m_height, m_vram_addr, m_vram_addr % 1152, m_vram_addr / 1152, m_vram_src, m_vram_src % 1152, m_vram_src / 1152); + + for (y = 0; y <= m_height; y++) + { + for (x = 0; x <= m_width; x++) { - vram[(y * 1152)+x] = m_fillbytes[((m_patofsx + x) & 0x1f)+(((m_patofsy + y) & 0x7)*32)]; + vram[(y * 1152)+BYTE4_XOR_BE(x + ddx)] = vramsrc[(y * 1152)+BYTE4_XOR_BE(x + sdx)]; } } + (void)vramsrc; (void)sdx; } - else if ((data == 0x101) || (data == 0x100)) + else if (data == 0x101) { int x, y; - uint8_t *vram = &m_vram[m_vram_addr]; - uint8_t *vramsrc = &m_vram[m_vram_src]; + uint8_t *vram = &m_vram[m_vram_addr & ~3]; + uint8_t *vramsrc = &m_vram[m_vram_src & ~3]; + + int sdx = m_vram_src & 3; + int ddx = m_vram_addr & 3; -// logerror("Copy rectangle, width %d height %d src %x dst %x\n", m_width, m_height, m_vram_addr, m_vram_src); + LOG("Copy rectangle backwards, width %d height %d dst %x (%d, %d) src %x (%d, %d)\n", m_width, m_height, m_vram_addr, m_vram_addr % 1152, m_vram_addr / 1152, m_vram_src, m_vram_src % 1152, m_vram_src / 1152); for (y = 0; y < m_height; y++) { for (x = 0; x < m_width; x++) { - vram[(y * 1152)+x] = vramsrc[(y * 1152)+x]; + vram[(-y * 1152)+BYTE4_XOR_BE(-x + ddx)] = vramsrc[(-y * 1152)+BYTE4_XOR_BE(-x + sdx)]; } } + (void)vramsrc; (void)sdx; } else { - logerror("Unknown blitter command %08x\n", data); + LOG("Unknown blitter command %08x\n", data); } break; default: -// logerror("specpdq_w: %08x @ %x (mask %08x %s)\n", data^0xffffffff, offset, mem_mask, machine().describe_context()); + LOG("specpdq_w: %08x @ %x (mask %08x %s)\n", data^0xffffffff, offset, mem_mask, machine().describe_context()); break; } } diff --git a/src/devices/bus/nubus/nubus_vikbw.cpp b/src/devices/bus/nubus/nubus_vikbw.cpp index 040f452b2d2..ab3af18fe72 100644 --- a/src/devices/bus/nubus/nubus_vikbw.cpp +++ b/src/devices/bus/nubus/nubus_vikbw.cpp @@ -36,13 +36,14 @@ DEFINE_DEVICE_TYPE(NUBUS_VIKBW, nubus_vikbw_device, "nb_vikbw", "Moniterm Viking // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_vikbw_device::device_add_mconfig) - MCFG_SCREEN_ADD( VIKBW_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_vikbw_device, screen_update) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 768-1) - MCFG_SCREEN_REFRESH_RATE(70) -MACHINE_CONFIG_END +void nubus_vikbw_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, VIKBW_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_vikbw_device::screen_update)); + screen.set_size(1024, 768); + screen.set_visarea(0, 1024-1, 0, 768-1); + screen.set_refresh_hz(70); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_wsportrait.cpp b/src/devices/bus/nubus/nubus_wsportrait.cpp index 19c25347738..12702c052a6 100644 --- a/src/devices/bus/nubus/nubus_wsportrait.cpp +++ b/src/devices/bus/nubus/nubus_wsportrait.cpp @@ -39,13 +39,14 @@ DEFINE_DEVICE_TYPE(NUBUS_WSPORTRAIT, nubus_wsportrait_device, "nb_wspt", "Macint // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_wsportrait_device::device_add_mconfig) - MCFG_SCREEN_ADD( WSPORTRAIT_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_wsportrait_device, screen_update) - MCFG_SCREEN_SIZE(1024,960) - MCFG_SCREEN_REFRESH_RATE(75.0) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 870-1) -MACHINE_CONFIG_END +void nubus_wsportrait_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, WSPORTRAIT_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_wsportrait_device::screen_update)); + screen.set_size(1024, 960); + screen.set_refresh_hz(75.0); + screen.set_visarea(0, 640-1, 0, 870-1); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/pds30_30hr.cpp b/src/devices/bus/nubus/pds30_30hr.cpp index 8888c50b5fa..190872708f6 100644 --- a/src/devices/bus/nubus/pds30_30hr.cpp +++ b/src/devices/bus/nubus/pds30_30hr.cpp @@ -39,13 +39,14 @@ DEFINE_DEVICE_TYPE(PDS030_XCEED30HR, nubus_xceed30hr_device, "pd3_30hr", "Micron // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_xceed30hr_device::device_add_mconfig) - MCFG_SCREEN_ADD( XCEED30HR_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_xceed30hr_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END +void nubus_xceed30hr_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, XCEED30HR_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_xceed30hr_device::screen_update)); + screen.set_raw(25175000, 800, 0, 640, 525, 0, 480); + screen.set_size(1024, 768); + screen.set_visarea(0, 640-1, 0, 480-1); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/pds30_cb264.cpp b/src/devices/bus/nubus/pds30_cb264.cpp index 6ec398a5257..4d153596fe0 100644 --- a/src/devices/bus/nubus/pds30_cb264.cpp +++ b/src/devices/bus/nubus/pds30_cb264.cpp @@ -32,13 +32,14 @@ DEFINE_DEVICE_TYPE(PDS030_CB264SE30, nubus_cb264se30_device, "pd3_c264", "Raster // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_cb264se30_device::device_add_mconfig) - MCFG_SCREEN_ADD( CB264SE30_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_cb264se30_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END +void nubus_cb264se30_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, CB264SE30_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_cb264se30_device::screen_update)); + screen.set_raw(25175000, 800, 0, 640, 525, 0, 480); + screen.set_size(1024, 768); + screen.set_visarea(0, 640-1, 0, 480-1); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/pds30_mc30.cpp b/src/devices/bus/nubus/pds30_mc30.cpp index a314b7f9981..6770b517deb 100644 --- a/src/devices/bus/nubus/pds30_mc30.cpp +++ b/src/devices/bus/nubus/pds30_mc30.cpp @@ -35,13 +35,14 @@ DEFINE_DEVICE_TYPE(PDS030_XCEEDMC30, nubus_xceedmc30_device, "pd3_mclr", "Micron // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_xceedmc30_device::device_add_mconfig) - MCFG_SCREEN_ADD( XCEEDMC30_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_xceedmc30_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END +void nubus_xceedmc30_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, XCEEDMC30_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_xceedmc30_device::screen_update)); + screen.set_raw(25175000, 800, 0, 640, 525, 0, 480); + screen.set_size(1024, 768); + screen.set_visarea(0, 640-1, 0, 480-1); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/pds30_procolor816.cpp b/src/devices/bus/nubus/pds30_procolor816.cpp index db1c02fea31..440ba6c86d7 100644 --- a/src/devices/bus/nubus/pds30_procolor816.cpp +++ b/src/devices/bus/nubus/pds30_procolor816.cpp @@ -38,13 +38,14 @@ DEFINE_DEVICE_TYPE(PDS030_PROCOLOR816, nubus_procolor816_device, "pd3_pc16", "La // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_procolor816_device::device_add_mconfig) - MCFG_SCREEN_ADD( PROCOLOR816_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_procolor816_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END +void nubus_procolor816_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, PROCOLOR816_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_procolor816_device::screen_update)); + screen.set_raw(25175000, 800, 0, 640, 525, 0, 480); + screen.set_size(1024, 768); + screen.set_visarea(0, 640-1, 0, 480-1); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/pds30_sigmalview.cpp b/src/devices/bus/nubus/pds30_sigmalview.cpp index ea05362d8ea..51f27a03713 100644 --- a/src/devices/bus/nubus/pds30_sigmalview.cpp +++ b/src/devices/bus/nubus/pds30_sigmalview.cpp @@ -32,13 +32,14 @@ DEFINE_DEVICE_TYPE(PDS030_LVIEW, nubus_lview_device, "pd3_lviw", "Sigma Designs // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nubus_lview_device::device_add_mconfig) - MCFG_SCREEN_ADD( LVIEW_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_lview_device, screen_update) - MCFG_SCREEN_SIZE(832,600) - MCFG_SCREEN_REFRESH_RATE(70) - MCFG_SCREEN_VISIBLE_AREA(0, 832-1, 0, 600-1) -MACHINE_CONFIG_END +void nubus_lview_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, LVIEW_SCREEN_NAME, SCREEN_TYPE_RASTER)); + screen.set_screen_update(FUNC(nubus_lview_device::screen_update)); + screen.set_size(832, 600); + screen.set_refresh_hz(70); + screen.set_visarea(0, 832-1, 0, 600-1); +} //------------------------------------------------- // rom_region - device-specific ROM region |