mirror of
https://github.com/holub/mame
synced 2025-10-09 17:53:01 +03:00
pc_vga.cpp: machine().device cleanups (nw)
This commit is contained in:
parent
a0669cac2c
commit
83805a56ef
@ -49,14 +49,10 @@ mach32_device::mach32_device(const machine_config &mconfig, device_type type, co
|
|||||||
|
|
||||||
MACHINE_CONFIG_START(mach32_device::device_add_mconfig)
|
MACHINE_CONFIG_START(mach32_device::device_add_mconfig)
|
||||||
MCFG_DEVICE_ADD("8514a", ATIMACH32_8514A, 0)
|
MCFG_DEVICE_ADD("8514a", ATIMACH32_8514A, 0)
|
||||||
|
downcast<ibm8514a_device*>(device)->set_vga(DEVICE_SELF);
|
||||||
MCFG_EEPROM_SERIAL_93C56_ADD("ati_eeprom")
|
MCFG_EEPROM_SERIAL_93C56_ADD("ati_eeprom")
|
||||||
MACHINE_CONFIG_END
|
MACHINE_CONFIG_END
|
||||||
|
|
||||||
void mach32_8514a_device::device_config_complete()
|
|
||||||
{
|
|
||||||
m_vga = dynamic_cast<mach32_device*>(owner());
|
|
||||||
}
|
|
||||||
|
|
||||||
void mach32_8514a_device::device_start()
|
void mach32_8514a_device::device_start()
|
||||||
{
|
{
|
||||||
mach8_device::device_start();
|
mach8_device::device_start();
|
||||||
@ -339,14 +335,10 @@ mach64_device::mach64_device(const machine_config &mconfig, device_type type, co
|
|||||||
|
|
||||||
MACHINE_CONFIG_START(mach64_device::device_add_mconfig)
|
MACHINE_CONFIG_START(mach64_device::device_add_mconfig)
|
||||||
MCFG_DEVICE_ADD("8514a", ATIMACH64_8514A, 0)
|
MCFG_DEVICE_ADD("8514a", ATIMACH64_8514A, 0)
|
||||||
|
downcast<ibm8514a_device*>(device)->set_vga(DEVICE_SELF);
|
||||||
MCFG_EEPROM_SERIAL_93C56_ADD("ati_eeprom")
|
MCFG_EEPROM_SERIAL_93C56_ADD("ati_eeprom")
|
||||||
MACHINE_CONFIG_END
|
MACHINE_CONFIG_END
|
||||||
|
|
||||||
void mach64_8514a_device::device_config_complete()
|
|
||||||
{
|
|
||||||
m_vga = dynamic_cast<mach64_device*>(owner());
|
|
||||||
}
|
|
||||||
|
|
||||||
void mach64_8514a_device::device_start()
|
void mach64_8514a_device::device_start()
|
||||||
{
|
{
|
||||||
mach32_8514a_device::device_start();
|
mach32_8514a_device::device_start();
|
||||||
|
@ -39,7 +39,6 @@ protected:
|
|||||||
|
|
||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
virtual void device_reset() override;
|
virtual void device_reset() override;
|
||||||
virtual void device_config_complete() override;
|
|
||||||
|
|
||||||
uint16_t m_chip_ID;
|
uint16_t m_chip_ID;
|
||||||
uint16_t m_membounds;
|
uint16_t m_membounds;
|
||||||
@ -198,7 +197,6 @@ protected:
|
|||||||
|
|
||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
virtual void device_reset() override;
|
virtual void device_reset() override;
|
||||||
virtual void device_config_complete() override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// main SVGA device
|
// main SVGA device
|
||||||
|
@ -184,6 +184,7 @@ ibm8514a_device::ibm8514a_device(const machine_config &mconfig, const char *tag,
|
|||||||
|
|
||||||
ibm8514a_device::ibm8514a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
ibm8514a_device::ibm8514a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||||
: device_t(mconfig, type, tag, owner, clock)
|
: device_t(mconfig, type, tag, owner, clock)
|
||||||
|
, m_vga(*this, finder_base::DUMMY_TAG)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -415,14 +416,6 @@ void ibm8514a_device::device_start()
|
|||||||
ibm8514.write_mask = 0xffffffff;
|
ibm8514.write_mask = 0xffffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ibm8514a_device::device_config_complete()
|
|
||||||
{
|
|
||||||
if(m_vga_tag.length() != 0)
|
|
||||||
{
|
|
||||||
m_vga = machine().device<svga_device>(m_vga_tag.c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void mach8_device::device_start()
|
void mach8_device::device_start()
|
||||||
{
|
{
|
||||||
ibm8514a_device::device_start();
|
ibm8514a_device::device_start();
|
||||||
@ -3311,7 +3304,7 @@ READ8_MEMBER(ati_vga_device::port_03c0_r)
|
|||||||
|
|
||||||
void ibm8514a_device::ibm8514_write_fg(uint32_t offset)
|
void ibm8514a_device::ibm8514_write_fg(uint32_t offset)
|
||||||
{
|
{
|
||||||
address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
|
address_space &space = machine().dummy_space();
|
||||||
offset %= m_vga->vga.svga_intf.vram_size;
|
offset %= m_vga->vga.svga_intf.vram_size;
|
||||||
uint8_t dst = m_vga->mem_linear_r(space,offset,0xff);
|
uint8_t dst = m_vga->mem_linear_r(space,offset,0xff);
|
||||||
uint8_t src = 0;
|
uint8_t src = 0;
|
||||||
@ -3400,7 +3393,7 @@ void ibm8514a_device::ibm8514_write_fg(uint32_t offset)
|
|||||||
|
|
||||||
void ibm8514a_device::ibm8514_write_bg(uint32_t offset)
|
void ibm8514a_device::ibm8514_write_bg(uint32_t offset)
|
||||||
{
|
{
|
||||||
address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
|
address_space &space = machine().dummy_space();
|
||||||
offset %= m_vga->vga.svga_intf.vram_size;
|
offset %= m_vga->vga.svga_intf.vram_size;
|
||||||
uint8_t dst = m_vga->mem_linear_r(space,offset,0xff);
|
uint8_t dst = m_vga->mem_linear_r(space,offset,0xff);
|
||||||
uint8_t src = 0;
|
uint8_t src = 0;
|
||||||
@ -3530,8 +3523,7 @@ void ibm8514a_device::ibm8514_write(uint32_t offset, uint32_t src)
|
|||||||
ibm8514.src_x = 0;
|
ibm8514.src_x = 0;
|
||||||
break;
|
break;
|
||||||
case 0x00c0: // use source plane
|
case 0x00c0: // use source plane
|
||||||
address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
|
if (m_vga->mem_linear_r(machine().dummy_space(), src, 0xff) != 0x00)
|
||||||
if(m_vga->mem_linear_r(space,src,0xff) != 0x00)
|
|
||||||
ibm8514_write_fg(offset);
|
ibm8514_write_fg(offset);
|
||||||
else
|
else
|
||||||
ibm8514_write_bg(offset);
|
ibm8514_write_bg(offset);
|
||||||
|
@ -278,8 +278,8 @@ class ibm8514a_device : public device_t
|
|||||||
public:
|
public:
|
||||||
ibm8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
ibm8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
|
|
||||||
void set_vga(const char* tag) { m_vga_tag.assign(tag); }
|
void set_vga(const char *tag) { m_vga.set_tag(tag); }
|
||||||
void set_vga_owner() { m_vga = dynamic_cast<svga_device*>(owner()); }
|
void set_vga_owner() { m_vga.set_tag(DEVICE_SELF); }
|
||||||
|
|
||||||
void enabled();
|
void enabled();
|
||||||
|
|
||||||
@ -395,13 +395,11 @@ protected:
|
|||||||
ibm8514a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
ibm8514a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||||
|
|
||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
virtual void device_config_complete() override;
|
|
||||||
void ibm8514_write(uint32_t offset, uint32_t src);
|
void ibm8514_write(uint32_t offset, uint32_t src);
|
||||||
void ibm8514_write_fg(uint32_t offset);
|
void ibm8514_write_fg(uint32_t offset);
|
||||||
void ibm8514_write_bg(uint32_t offset);
|
void ibm8514_write_bg(uint32_t offset);
|
||||||
|
|
||||||
svga_device* m_vga; // for pass-through
|
required_device<svga_device> m_vga; // for pass-through
|
||||||
std::string m_vga_tag; // pass-through device tag
|
|
||||||
private:
|
private:
|
||||||
void ibm8514_draw_vector(uint8_t len, uint8_t dir, bool draw);
|
void ibm8514_draw_vector(uint8_t len, uint8_t dir, bool draw);
|
||||||
void ibm8514_wait_draw_ssv();
|
void ibm8514_wait_draw_ssv();
|
||||||
|
Loading…
Reference in New Issue
Block a user