mirror of
https://github.com/holub/mame
synced 2025-06-01 10:31:48 +03:00
Removed first_screen from iq151 bus devices and esrip CPU core, nw
This commit is contained in:
parent
81a35fb46e
commit
773eb4b4a7
@ -52,11 +52,12 @@ void iq151_grafik_device::device_start()
|
||||
|
||||
void iq151_grafik_device::device_reset()
|
||||
{
|
||||
screen_device *screen = machine().first_screen();
|
||||
|
||||
// if required adjust screen size
|
||||
if (screen->visible_area().max_x < 64*8-1)
|
||||
screen->set_visible_area(0, 64*8-1, 0, 32*8-1);
|
||||
if (m_screen != nullptr && m_screen->visible_area().max_x < 64*8-1)
|
||||
{
|
||||
printf("adjusting screen size\n");
|
||||
m_screen->set_visible_area(0, 64*8-1, 0, 32*8-1);
|
||||
}
|
||||
|
||||
memset(m_videoram, 0x00, sizeof(m_videoram));
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ DEFINE_DEVICE_TYPE(IQ151CART_SLOT, iq151cart_slot_device, "iq151cart_slot", "IQ1
|
||||
|
||||
device_iq151cart_interface::device_iq151cart_interface(const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig, device)
|
||||
, m_screen(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@ -52,17 +53,18 @@ device_iq151cart_interface::~device_iq151cart_interface()
|
||||
//-------------------------------------------------
|
||||
// iq151cart_slot_device - constructor
|
||||
//-------------------------------------------------
|
||||
iq151cart_slot_device::iq151cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, IQ151CART_SLOT, tag, owner, clock),
|
||||
device_slot_interface(mconfig, *this),
|
||||
device_image_interface(mconfig, *this),
|
||||
m_out_irq0_cb(*this),
|
||||
m_out_irq1_cb(*this),
|
||||
m_out_irq2_cb(*this),
|
||||
m_out_irq3_cb(*this),
|
||||
m_out_irq4_cb(*this),
|
||||
m_out_drq_cb(*this),
|
||||
m_cart(nullptr)
|
||||
iq151cart_slot_device::iq151cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, IQ151CART_SLOT, tag, owner, clock)
|
||||
, device_slot_interface(mconfig, *this)
|
||||
, device_image_interface(mconfig, *this)
|
||||
, m_out_irq0_cb(*this)
|
||||
, m_out_irq1_cb(*this)
|
||||
, m_out_irq2_cb(*this)
|
||||
, m_out_irq3_cb(*this)
|
||||
, m_out_irq4_cb(*this)
|
||||
, m_out_drq_cb(*this)
|
||||
, m_cart(nullptr)
|
||||
, m_screen(*this, finder_base::DUMMY_TAG)
|
||||
{
|
||||
}
|
||||
|
||||
@ -82,6 +84,8 @@ iq151cart_slot_device::~iq151cart_slot_device()
|
||||
void iq151cart_slot_device::device_start()
|
||||
{
|
||||
m_cart = dynamic_cast<device_iq151cart_interface *>(get_card_device());
|
||||
if (m_cart)
|
||||
m_cart->set_screen_device(m_screen);
|
||||
|
||||
// resolve callbacks
|
||||
m_out_irq0_cb.resolve_safe();
|
||||
|
@ -48,6 +48,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "softlist_dev.h"
|
||||
#include "screen.h"
|
||||
|
||||
/***************************************************************************
|
||||
TYPE DEFINITIONS
|
||||
@ -67,12 +68,15 @@ public:
|
||||
virtual void io_read(offs_t offset, uint8_t &data) { }
|
||||
virtual void io_write(offs_t offset, uint8_t data) { }
|
||||
virtual uint8_t* get_cart_base() { return nullptr; }
|
||||
virtual void set_screen_device(screen_device *screen) { m_screen = screen; }
|
||||
|
||||
// video update
|
||||
virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect) { }
|
||||
|
||||
protected:
|
||||
device_iq151cart_interface(const machine_config &mconfig, device_t &device);
|
||||
|
||||
screen_device *m_screen;
|
||||
};
|
||||
|
||||
// ======================> iq151cart_slot_device
|
||||
@ -86,6 +90,7 @@ public:
|
||||
iq151cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
virtual ~iq151cart_slot_device();
|
||||
|
||||
void set_screen_tag(const char *tag) { m_screen.set_tag(tag); }
|
||||
template <class Object> devcb_base &set_out_irq0_callback(Object &&cb) { return m_out_irq0_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_out_irq1_callback(Object &&cb) { return m_out_irq1_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_out_irq2_callback(Object &&cb) { return m_out_irq2_cb.set_callback(std::forward<Object>(cb)); }
|
||||
@ -101,11 +106,11 @@ public:
|
||||
virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
|
||||
|
||||
virtual iodevice_t image_type() const override { return IO_CARTSLOT; }
|
||||
virtual bool is_readable() const override { return 1; }
|
||||
virtual bool is_writeable() const override { return 0; }
|
||||
virtual bool is_creatable() const override { return 0; }
|
||||
virtual bool must_be_loaded() const override { return 0; }
|
||||
virtual bool is_reset_on_load() const override { return 1; }
|
||||
virtual bool is_readable() const override { return true; }
|
||||
virtual bool is_writeable() const override { return false; }
|
||||
virtual bool is_creatable() const override { return false; }
|
||||
virtual bool must_be_loaded() const override { return false; }
|
||||
virtual bool is_reset_on_load() const override { return true; }
|
||||
virtual const char *image_interface() const override { return "iq151_cart"; }
|
||||
virtual const char *file_extensions() const override { return "bin,rom"; }
|
||||
|
||||
@ -126,7 +131,8 @@ public:
|
||||
devcb_write_line m_out_irq4_cb;
|
||||
devcb_write_line m_out_drq_cb;
|
||||
|
||||
device_iq151cart_interface* m_cart;
|
||||
device_iq151cart_interface* m_cart;
|
||||
required_device<screen_device> m_screen;
|
||||
};
|
||||
|
||||
|
||||
@ -156,4 +162,7 @@ DECLARE_DEVICE_TYPE(IQ151CART_SLOT, iq151cart_slot_device)
|
||||
#define MCFG_IQ151CART_SLOT_OUT_DRQ_CB(_devcb) \
|
||||
devcb = &downcast<iq151cart_slot_device &>(*device).set_out_drq_callback(DEVCB_##_devcb);
|
||||
|
||||
#define MCFG_IQ151CART_SLOT_SCREEN_TAG(screen_tag) \
|
||||
downcast<iq151cart_slot_device &>(*device).set_screen_tag(("^" screen_tag));
|
||||
|
||||
#endif // MAME_BUS_IQ151_IQ151_H
|
||||
|
@ -76,11 +76,12 @@ void iq151_video32_device::device_start()
|
||||
|
||||
void iq151_video32_device::device_reset()
|
||||
{
|
||||
screen_device *screen = machine().first_screen();
|
||||
|
||||
// if required adjust screen size
|
||||
if (screen->visible_area().max_x < 32*8 - 1)
|
||||
screen->set_visible_area(0, 32*8-1, 0, 32*8-1);
|
||||
if (m_screen != nullptr && m_screen->visible_area().max_x < 32*8 - 1)
|
||||
{
|
||||
printf("Setting visible area to 32\n");
|
||||
m_screen->set_visible_area(0, 32*8-1, 0, 32*8-1);
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -76,11 +76,12 @@ void iq151_video64_device::device_start()
|
||||
|
||||
void iq151_video64_device::device_reset()
|
||||
{
|
||||
screen_device *screen = machine().first_screen();
|
||||
|
||||
// if required adjust screen size
|
||||
if (screen->visible_area().max_x < 64*6 - 1)
|
||||
screen->set_visible_area(0, 64*6-1, 0, 32*8-1);
|
||||
if (m_screen != nullptr && m_screen->visible_area().max_x < 64*6 - 1)
|
||||
{
|
||||
printf("Setting visible area\n");
|
||||
m_screen->set_visible_area(0, 64*6-1, 0, 32*8-1);
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -388,7 +388,7 @@ util::disasm_interface *esrip_device::create_disassembler()
|
||||
|
||||
int esrip_device::get_hblank() const
|
||||
{
|
||||
return machine().first_screen()->hblank();
|
||||
return m_screen->hblank();
|
||||
}
|
||||
|
||||
/* Return the state of the LBRM line (Y-scaling related) */
|
||||
@ -1669,12 +1669,13 @@ DEFINE_DEVICE_TYPE(ESRIP, esrip_device, "esrip", "Entertainment Sciences RIP")
|
||||
//-------------------------------------------------
|
||||
|
||||
esrip_device::esrip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: cpu_device(mconfig, ESRIP, tag, owner, clock),
|
||||
m_program_config("program", ENDIANNESS_BIG, 64, 9, -3),
|
||||
m_fdt_r(*this),
|
||||
m_fdt_w(*this),
|
||||
m_status_in(*this),
|
||||
m_lbrm_prom(nullptr)
|
||||
: cpu_device(mconfig, ESRIP, tag, owner, clock)
|
||||
, m_program_config("program", ENDIANNESS_BIG, 64, 9, -3)
|
||||
, m_fdt_r(*this)
|
||||
, m_fdt_w(*this)
|
||||
, m_status_in(*this)
|
||||
, m_screen(*this, finder_base::DUMMY_TAG)
|
||||
, m_lbrm_prom(nullptr)
|
||||
{
|
||||
// build the opcode table
|
||||
for (int op = 0; op < 24; op++)
|
||||
|
@ -34,6 +34,8 @@
|
||||
#define MCFG_ESRIP_LBRM_PROM(_tag) \
|
||||
downcast<esrip_device &>(*device).lbrm_prom(_tag);
|
||||
|
||||
#define MCFG_ESRIP_SCREEN(screen_tag) \
|
||||
downcast<esrip_device &>(*device).set_screen_tag(("^" screen_tag));
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
@ -54,6 +56,7 @@ public:
|
||||
esrip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// inline configuration helpers
|
||||
void set_screen_tag(const char *tag) { m_screen.set_tag(tag); }
|
||||
template <class Object> devcb_base &set_fdt_r_callback(Object &&cb) { return m_fdt_r.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_fdt_w_callback(Object &&cb) { return m_fdt_w.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_status_in_callback(Object &&cb) { return m_status_in.set_callback(std::forward<Object>(cb)); }
|
||||
@ -201,6 +204,7 @@ protected:
|
||||
devcb_write16 m_fdt_w;
|
||||
devcb_read8 m_status_in;
|
||||
draw_delegate m_draw;
|
||||
required_device<screen_device> m_screen;
|
||||
const char *m_lbrm_prom;
|
||||
|
||||
typedef void (esrip_device::*ophandler)(uint16_t inst);
|
||||
|
@ -676,6 +676,7 @@ MACHINE_CONFIG_START(esripsys_state::esripsys)
|
||||
MCFG_ESRIP_STATUS_IN_CALLBACK(READ8(esripsys_state, rip_status_in))
|
||||
MCFG_ESRIP_DRAW_CALLBACK_OWNER(esripsys_state, esripsys_draw)
|
||||
MCFG_ESRIP_LBRM_PROM("proms")
|
||||
MCFG_ESRIP_SCREEN("screen")
|
||||
|
||||
MCFG_CPU_ADD("sound_cpu", MC6809E, XTAL(8'000'000) / 4)
|
||||
MCFG_CPU_PROGRAM_MAP(sound_cpu_map)
|
||||
|
@ -426,6 +426,7 @@ MACHINE_CONFIG_START(iq151_state::iq151)
|
||||
/* cartridge */
|
||||
MCFG_DEVICE_ADD("slot1", IQ151CART_SLOT, 0)
|
||||
MCFG_DEVICE_SLOT_INTERFACE(iq151_cart, nullptr, false)
|
||||
MCFG_IQ151CART_SLOT_SCREEN_TAG("screen")
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ0_CB(DEVWRITELINE("pic8259", pic8259_device, ir0_w))
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ1_CB(DEVWRITELINE("pic8259", pic8259_device, ir1_w))
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ2_CB(DEVWRITELINE("pic8259", pic8259_device, ir2_w))
|
||||
@ -433,6 +434,7 @@ MACHINE_CONFIG_START(iq151_state::iq151)
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ4_CB(DEVWRITELINE("pic8259", pic8259_device, ir4_w))
|
||||
MCFG_DEVICE_ADD("slot2", IQ151CART_SLOT, 0)
|
||||
MCFG_DEVICE_SLOT_INTERFACE(iq151_cart, nullptr, false)
|
||||
MCFG_IQ151CART_SLOT_SCREEN_TAG("screen")
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ0_CB(DEVWRITELINE("pic8259", pic8259_device, ir0_w))
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ1_CB(DEVWRITELINE("pic8259", pic8259_device, ir1_w))
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ2_CB(DEVWRITELINE("pic8259", pic8259_device, ir2_w))
|
||||
@ -440,6 +442,7 @@ MACHINE_CONFIG_START(iq151_state::iq151)
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ4_CB(DEVWRITELINE("pic8259", pic8259_device, ir4_w))
|
||||
MCFG_DEVICE_ADD("slot3", IQ151CART_SLOT, 0)
|
||||
MCFG_DEVICE_SLOT_INTERFACE(iq151_cart, nullptr, false)
|
||||
MCFG_IQ151CART_SLOT_SCREEN_TAG("screen")
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ0_CB(DEVWRITELINE("pic8259", pic8259_device, ir0_w))
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ1_CB(DEVWRITELINE("pic8259", pic8259_device, ir1_w))
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ2_CB(DEVWRITELINE("pic8259", pic8259_device, ir2_w))
|
||||
@ -447,6 +450,7 @@ MACHINE_CONFIG_START(iq151_state::iq151)
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ4_CB(DEVWRITELINE("pic8259", pic8259_device, ir4_w))
|
||||
MCFG_DEVICE_ADD("slot4", IQ151CART_SLOT, 0)
|
||||
MCFG_DEVICE_SLOT_INTERFACE(iq151_cart, nullptr, false)
|
||||
MCFG_IQ151CART_SLOT_SCREEN_TAG("screen")
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ0_CB(DEVWRITELINE("pic8259", pic8259_device, ir0_w))
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ1_CB(DEVWRITELINE("pic8259", pic8259_device, ir1_w))
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ2_CB(DEVWRITELINE("pic8259", pic8259_device, ir2_w))
|
||||
@ -454,6 +458,7 @@ MACHINE_CONFIG_START(iq151_state::iq151)
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ4_CB(DEVWRITELINE("pic8259", pic8259_device, ir4_w))
|
||||
MCFG_DEVICE_ADD("slot5", IQ151CART_SLOT, 0)
|
||||
MCFG_DEVICE_SLOT_INTERFACE(iq151_cart, "video32", false)
|
||||
MCFG_IQ151CART_SLOT_SCREEN_TAG("screen")
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ0_CB(DEVWRITELINE("pic8259", pic8259_device, ir0_w))
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ1_CB(DEVWRITELINE("pic8259", pic8259_device, ir1_w))
|
||||
MCFG_IQ151CART_SLOT_OUT_IRQ2_CB(DEVWRITELINE("pic8259", pic8259_device, ir2_w))
|
||||
|
Loading…
Reference in New Issue
Block a user