mirror of
https://github.com/holub/mame
synced 2025-06-07 05:13:46 +03:00
pci: correct upcalls, add ymp21 and ds2416 skeletons
This commit is contained in:
parent
6756086627
commit
43352d46b1
@ -5432,7 +5432,11 @@ if (BUSES["PCI"]~=null) then
|
|||||||
MAME_DIR .. "src/devices/bus/pci/mga2064w.h",
|
MAME_DIR .. "src/devices/bus/pci/mga2064w.h",
|
||||||
MAME_DIR .. "src/devices/bus/pci/promotion.cpp",
|
MAME_DIR .. "src/devices/bus/pci/promotion.cpp",
|
||||||
MAME_DIR .. "src/devices/bus/pci/promotion.h",
|
MAME_DIR .. "src/devices/bus/pci/promotion.h",
|
||||||
|
MAME_DIR .. "src/devices/bus/pci/ymp21.cpp",
|
||||||
|
MAME_DIR .. "src/devices/bus/pci/ymp21.h",
|
||||||
MAME_DIR .. "src/devices/bus/pci/sw1000xg.cpp",
|
MAME_DIR .. "src/devices/bus/pci/sw1000xg.cpp",
|
||||||
MAME_DIR .. "src/devices/bus/pci/sw1000xg.h",
|
MAME_DIR .. "src/devices/bus/pci/sw1000xg.h",
|
||||||
|
MAME_DIR .. "src/devices/bus/pci/ds2416.cpp",
|
||||||
|
MAME_DIR .. "src/devices/bus/pci/ds2416.h",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
23
src/devices/bus/pci/ds2416.cpp
Normal file
23
src/devices/bus/pci/ds2416.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// license:BSD-3-Clause
|
||||||
|
// copyright-holders:Olivier Galibert
|
||||||
|
|
||||||
|
#include "emu.h"
|
||||||
|
#include "ds2416.h"
|
||||||
|
|
||||||
|
DEFINE_DEVICE_TYPE(DS2416, ds2416_device, "ds2416", "Yamaha DS2416")
|
||||||
|
|
||||||
|
ds2416_device::ds2416_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||||
|
: ymp21_device(mconfig, DS2416, tag, owner, clock)
|
||||||
|
{
|
||||||
|
set_ids(0x10732000, 0x00, 0x040100, 0x10732000);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ds2416_device::device_start()
|
||||||
|
{
|
||||||
|
ymp21_device::device_start();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ds2416_device::device_reset()
|
||||||
|
{
|
||||||
|
ymp21_device::device_reset();
|
||||||
|
}
|
22
src/devices/bus/pci/ds2416.h
Normal file
22
src/devices/bus/pci/ds2416.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// license:BSD-3-Clause
|
||||||
|
// copyright-holders:Olivier Galibert
|
||||||
|
|
||||||
|
#ifndef MAME_SOUND_DS2416_H
|
||||||
|
#define MAME_SOUND_DS2416_H
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "ymp21.h"
|
||||||
|
|
||||||
|
class ds2416_device : public ymp21_device {
|
||||||
|
public:
|
||||||
|
ds2416_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void device_start() override;
|
||||||
|
virtual void device_reset() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
DECLARE_DEVICE_TYPE(DS2416, ds2416_device)
|
||||||
|
|
||||||
|
#endif
|
@ -50,7 +50,7 @@ const tiny_rom_entry *geforce256_device::device_rom_region() const
|
|||||||
|
|
||||||
void geforce256_device::device_start()
|
void geforce256_device::device_start()
|
||||||
{
|
{
|
||||||
pci_device::device_start();
|
pci_card_device::device_start();
|
||||||
|
|
||||||
add_map( 16*1024*1024, M_MEM, FUNC(geforce256_device::mmio_map));
|
add_map( 16*1024*1024, M_MEM, FUNC(geforce256_device::mmio_map));
|
||||||
add_map(128*1024*1024, M_MEM, FUNC(geforce256_device::vram_aperture_map));
|
add_map(128*1024*1024, M_MEM, FUNC(geforce256_device::vram_aperture_map));
|
||||||
|
@ -63,7 +63,7 @@ void mga2064w_device::device_add_mconfig(machine_config &config)
|
|||||||
|
|
||||||
void mga2064w_device::device_start()
|
void mga2064w_device::device_start()
|
||||||
{
|
{
|
||||||
pci_device::device_start();
|
pci_card_device::device_start();
|
||||||
// NB: following is swapped on G400
|
// NB: following is swapped on G400
|
||||||
add_map( 16*1024, M_MEM, FUNC(mga2064w_device::mgabase1_map));
|
add_map( 16*1024, M_MEM, FUNC(mga2064w_device::mgabase1_map));
|
||||||
add_map(8*1024*1024, M_MEM, FUNC(mga2064w_device::mgabase2_map));
|
add_map(8*1024*1024, M_MEM, FUNC(mga2064w_device::mgabase2_map));
|
||||||
@ -74,7 +74,7 @@ void mga2064w_device::device_start()
|
|||||||
|
|
||||||
void mga2064w_device::device_reset()
|
void mga2064w_device::device_reset()
|
||||||
{
|
{
|
||||||
pci_device::device_reset();
|
pci_card_device::device_reset();
|
||||||
|
|
||||||
// INTA#
|
// INTA#
|
||||||
intr_pin = 1;
|
intr_pin = 1;
|
||||||
@ -91,7 +91,7 @@ device_memory_interface::space_config_vector mga2064w_device::memory_space_confi
|
|||||||
|
|
||||||
void mga2064w_device::config_map(address_map &map)
|
void mga2064w_device::config_map(address_map &map)
|
||||||
{
|
{
|
||||||
pci_device::config_map(map);
|
pci_card_device::config_map(map);
|
||||||
// map(0x40, 0x43) OPTION
|
// map(0x40, 0x43) OPTION
|
||||||
map(0x44, 0x47).rw(FUNC(mga2064w_device::mga_index_r), FUNC(mga2064w_device::mga_index_w));
|
map(0x44, 0x47).rw(FUNC(mga2064w_device::mga_index_r), FUNC(mga2064w_device::mga_index_w));
|
||||||
map(0x48, 0x4b).rw(FUNC(mga2064w_device::mga_data_r), FUNC(mga2064w_device::mga_data_w));
|
map(0x48, 0x4b).rw(FUNC(mga2064w_device::mga_data_r), FUNC(mga2064w_device::mga_data_w));
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include "geforce.h"
|
#include "geforce.h"
|
||||||
#include "mga2064w.h"
|
#include "mga2064w.h"
|
||||||
#include "promotion.h"
|
#include "promotion.h"
|
||||||
|
#include "ds2416.h"
|
||||||
#include "sw1000xg.h"
|
#include "sw1000xg.h"
|
||||||
|
|
||||||
DEFINE_DEVICE_TYPE(PCI_SLOT, pci_slot_device, "pci_slot", "PCI extension motherboard port")
|
DEFINE_DEVICE_TYPE(PCI_SLOT, pci_slot_device, "pci_slot", "PCI extension motherboard port")
|
||||||
@ -84,8 +85,11 @@ void pci_cards(device_slot_interface &device)
|
|||||||
device.option_add("quadro", QUADRO);
|
device.option_add("quadro", QUADRO);
|
||||||
device.option_add("mga2064w", MGA2064W);
|
device.option_add("mga2064w", MGA2064W);
|
||||||
device.option_add("promotion3210", PROMOTION3210);
|
device.option_add("promotion3210", PROMOTION3210);
|
||||||
|
|
||||||
// 0x04 - multimedia controllers
|
// 0x04 - multimedia controllers
|
||||||
device.option_add("sw1000xg", SW1000XG);
|
device.option_add("sw1000xg", SW1000XG);
|
||||||
|
device.option_add("ds2416", DS2416);
|
||||||
|
|
||||||
// 0x05 - memory controllers
|
// 0x05 - memory controllers
|
||||||
// 0x06 - bridge devices
|
// 0x06 - bridge devices
|
||||||
// 0x07 - simple communication controllers
|
// 0x07 - simple communication controllers
|
||||||
|
@ -78,7 +78,7 @@ void riva128_device::device_add_mconfig(machine_config &config)
|
|||||||
|
|
||||||
void riva128_device::device_start()
|
void riva128_device::device_start()
|
||||||
{
|
{
|
||||||
pci_device::device_start();
|
pci_card_device::device_start();
|
||||||
|
|
||||||
add_map( 16*1024*1024, M_MEM, FUNC(riva128_device::mmio_map));
|
add_map( 16*1024*1024, M_MEM, FUNC(riva128_device::mmio_map));
|
||||||
add_map(128*1024*1024, M_MEM, FUNC(riva128_device::vram_aperture_map));
|
add_map(128*1024*1024, M_MEM, FUNC(riva128_device::vram_aperture_map));
|
||||||
@ -96,7 +96,7 @@ void riva128_device::device_start()
|
|||||||
|
|
||||||
void riva128_device::device_reset()
|
void riva128_device::device_reset()
|
||||||
{
|
{
|
||||||
pci_device::device_reset();
|
pci_card_device::device_reset();
|
||||||
|
|
||||||
// TODO: to be checked
|
// TODO: to be checked
|
||||||
command = 0x0000;
|
command = 0x0000;
|
||||||
@ -110,7 +110,7 @@ void riva128_device::device_reset()
|
|||||||
// TODO: counter-check everything
|
// TODO: counter-check everything
|
||||||
void riva128_device::config_map(address_map &map)
|
void riva128_device::config_map(address_map &map)
|
||||||
{
|
{
|
||||||
pci_device::config_map(map);
|
pci_card_device::config_map(map);
|
||||||
map(0x34, 0x34).lr8(NAME([] () { return 0x44; }));
|
map(0x34, 0x34).lr8(NAME([] () { return 0x44; }));
|
||||||
|
|
||||||
// map(0x40, 0x43) subsystem ID alias (writeable)
|
// map(0x40, 0x43) subsystem ID alias (writeable)
|
||||||
|
@ -71,7 +71,7 @@ const tiny_rom_entry *rivatnt_device::device_rom_region() const
|
|||||||
// NV4 removes the indirect_io_map from NV3
|
// NV4 removes the indirect_io_map from NV3
|
||||||
void rivatnt_device::device_start()
|
void rivatnt_device::device_start()
|
||||||
{
|
{
|
||||||
pci_device::device_start();
|
pci_card_device::device_start();
|
||||||
|
|
||||||
add_map( 16*1024*1024, M_MEM, FUNC(rivatnt_device::mmio_map));
|
add_map( 16*1024*1024, M_MEM, FUNC(rivatnt_device::mmio_map));
|
||||||
add_map(128*1024*1024, M_MEM, FUNC(rivatnt_device::vram_aperture_map));
|
add_map(128*1024*1024, M_MEM, FUNC(rivatnt_device::vram_aperture_map));
|
||||||
@ -119,7 +119,7 @@ const tiny_rom_entry *rivatnt2_device::device_rom_region() const
|
|||||||
// All NV5 definitely wants 64K ROM BIOS (would fail CRC checks)
|
// All NV5 definitely wants 64K ROM BIOS (would fail CRC checks)
|
||||||
void rivatnt2_device::device_start()
|
void rivatnt2_device::device_start()
|
||||||
{
|
{
|
||||||
pci_device::device_start();
|
pci_card_device::device_start();
|
||||||
|
|
||||||
add_map( 16*1024*1024, M_MEM, FUNC(rivatnt2_device::mmio_map));
|
add_map( 16*1024*1024, M_MEM, FUNC(rivatnt2_device::mmio_map));
|
||||||
add_map(128*1024*1024, M_MEM, FUNC(rivatnt2_device::vram_aperture_map));
|
add_map(128*1024*1024, M_MEM, FUNC(rivatnt2_device::vram_aperture_map));
|
||||||
|
@ -7,36 +7,17 @@
|
|||||||
DEFINE_DEVICE_TYPE(SW1000XG, sw1000xg_device, "sw1000xg", "Yamaha SW1000XG")
|
DEFINE_DEVICE_TYPE(SW1000XG, sw1000xg_device, "sw1000xg", "Yamaha SW1000XG")
|
||||||
|
|
||||||
sw1000xg_device::sw1000xg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
sw1000xg_device::sw1000xg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||||
: pci_card_device(mconfig, SW1000XG, tag, owner, clock)
|
: ymp21_device(mconfig, SW1000XG, tag, owner, clock)
|
||||||
{
|
{
|
||||||
set_ids(0x10731000, 0x00, 0x040100, 0x10731000);
|
set_ids(0x10731000, 0x00, 0x040100, 0x10731000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sw1000xg_device::device_start()
|
void sw1000xg_device::device_start()
|
||||||
{
|
{
|
||||||
pci_device::device_start();
|
ymp21_device::device_start();
|
||||||
add_map(0x40000, M_MEM, FUNC(sw1000xg_device::map));
|
|
||||||
intr_pin = 0x01;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sw1000xg_device::device_reset()
|
void sw1000xg_device::device_reset()
|
||||||
{
|
{
|
||||||
|
ymp21_device::device_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void sw1000xg_device::map(address_map &map)
|
|
||||||
{
|
|
||||||
map(0x00000, 0x3ffff).rw(FUNC(sw1000xg_device::read), FUNC(sw1000xg_device::write));
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 sw1000xg_device::read(offs_t offset, u32 mem_mask)
|
|
||||||
{
|
|
||||||
logerror("ym read %05x %08x\n", offset*4, mem_mask);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void sw1000xg_device::write(offs_t offset, u32 data, u32 mem_mask)
|
|
||||||
{
|
|
||||||
logerror("ym write %05x, %08x %08x\n", offset*4, data, mem_mask);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,21 +6,15 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "pci_slot.h"
|
#include "ymp21.h"
|
||||||
|
|
||||||
class sw1000xg_device : public pci_card_device {
|
class sw1000xg_device : public ymp21_device {
|
||||||
public:
|
public:
|
||||||
sw1000xg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
sw1000xg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
virtual void device_reset() override;
|
virtual void device_reset() override;
|
||||||
|
|
||||||
private:
|
|
||||||
void map(address_map &map);
|
|
||||||
|
|
||||||
u32 read(offs_t offset, u32 mem_mask);
|
|
||||||
void write(offs_t offset, u32 data, u32 mem_mask);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DECLARE_DEVICE_TYPE(SW1000XG, sw1000xg_device)
|
DECLARE_DEVICE_TYPE(SW1000XG, sw1000xg_device)
|
||||||
|
@ -61,7 +61,7 @@ void virge_pci_device::lfb_map(address_map& map)
|
|||||||
|
|
||||||
void virge_pci_device::config_map(address_map &map)
|
void virge_pci_device::config_map(address_map &map)
|
||||||
{
|
{
|
||||||
pci_device::config_map(map);
|
pci_card_device::config_map(map);
|
||||||
map(0x10, 0x13).rw(FUNC(virge_pci_device::base_address_r),FUNC(virge_pci_device::base_address_w));
|
map(0x10, 0x13).rw(FUNC(virge_pci_device::base_address_r),FUNC(virge_pci_device::base_address_w));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ void virge_pci_device::postload()
|
|||||||
void virge_pci_device::device_start()
|
void virge_pci_device::device_start()
|
||||||
{
|
{
|
||||||
set_ids(0x53335631, 0x00, 0x030000, 0x000000);
|
set_ids(0x53335631, 0x00, 0x030000, 0x000000);
|
||||||
pci_device::device_start();
|
pci_card_device::device_start();
|
||||||
|
|
||||||
add_rom(m_bios->base(),0x8000);
|
add_rom(m_bios->base(),0x8000);
|
||||||
expansion_rom_base = 0xc0000;
|
expansion_rom_base = 0xc0000;
|
||||||
@ -157,7 +157,7 @@ void virge_pci_device::device_start()
|
|||||||
void virgedx_pci_device::device_start()
|
void virgedx_pci_device::device_start()
|
||||||
{
|
{
|
||||||
set_ids(0x53338a01, 0x00, 0x030000, 0x000000);
|
set_ids(0x53338a01, 0x00, 0x030000, 0x000000);
|
||||||
pci_device::device_start();
|
pci_card_device::device_start();
|
||||||
|
|
||||||
add_rom(m_bios->base(),0x8000);
|
add_rom(m_bios->base(),0x8000);
|
||||||
expansion_rom_base = 0xc0000;
|
expansion_rom_base = 0xc0000;
|
||||||
|
40
src/devices/bus/pci/ymp21.cpp
Normal file
40
src/devices/bus/pci/ymp21.cpp
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
// license:BSD-3-Clause
|
||||||
|
// copyright-holders:Olivier Galibert
|
||||||
|
|
||||||
|
#include "emu.h"
|
||||||
|
#include "ymp21.h"
|
||||||
|
|
||||||
|
ymp21_device::ymp21_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||||
|
: pci_card_device(mconfig, type, tag, owner, clock)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void ymp21_device::device_start()
|
||||||
|
{
|
||||||
|
pci_card_device::device_start();
|
||||||
|
add_map(0x40000, M_MEM, FUNC(ymp21_device::map));
|
||||||
|
intr_pin = 0x01;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ymp21_device::device_reset()
|
||||||
|
{
|
||||||
|
pci_card_device::device_reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ymp21_device::map(address_map &map)
|
||||||
|
{
|
||||||
|
map(0x00000, 0x3ffff).rw(FUNC(ymp21_device::read), FUNC(ymp21_device::write));
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 ymp21_device::read(offs_t offset, u32 mem_mask)
|
||||||
|
{
|
||||||
|
logerror("ym read %05x %08x\n", offset*4, mem_mask);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ymp21_device::write(offs_t offset, u32 data, u32 mem_mask)
|
||||||
|
{
|
||||||
|
logerror("ym write %05x, %08x %08x\n", offset*4, data, mem_mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
27
src/devices/bus/pci/ymp21.h
Normal file
27
src/devices/bus/pci/ymp21.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// license:BSD-3-Clause
|
||||||
|
// copyright-holders:Olivier Galibert
|
||||||
|
|
||||||
|
// PCI interfacing gate array common to the sw1000xg and the ds2416
|
||||||
|
|
||||||
|
#ifndef MAME_SOUND_YMP21_H
|
||||||
|
#define MAME_SOUND_YMP21_H
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "pci_slot.h"
|
||||||
|
|
||||||
|
class ymp21_device : public pci_card_device {
|
||||||
|
protected:
|
||||||
|
ymp21_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||||
|
|
||||||
|
virtual void device_start() override;
|
||||||
|
virtual void device_reset() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void map(address_map &map);
|
||||||
|
|
||||||
|
u32 read(offs_t offset, u32 mem_mask);
|
||||||
|
void write(offs_t offset, u32 data, u32 mem_mask);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user