bus/pci: Make #include guards match paths, sort filenames.

This commit is contained in:
Vas Crabb 2024-01-20 06:42:23 +11:00
parent 705922f609
commit 8f98b61a7e
23 changed files with 118 additions and 106 deletions

View File

@ -5420,33 +5420,33 @@ if (BUSES["PCI"]~=null) then
files { files {
MAME_DIR .. "src/devices/bus/pci/pci_slot.cpp", MAME_DIR .. "src/devices/bus/pci/pci_slot.cpp",
MAME_DIR .. "src/devices/bus/pci/pci_slot.h", MAME_DIR .. "src/devices/bus/pci/pci_slot.h",
MAME_DIR .. "src/devices/bus/pci/virge_pci.cpp", MAME_DIR .. "src/devices/bus/pci/ds2416.cpp",
MAME_DIR .. "src/devices/bus/pci/virge_pci.h", MAME_DIR .. "src/devices/bus/pci/ds2416.h",
MAME_DIR .. "src/devices/bus/pci/riva128.cpp",
MAME_DIR .. "src/devices/bus/pci/riva128.h",
MAME_DIR .. "src/devices/bus/pci/rivatnt.cpp",
MAME_DIR .. "src/devices/bus/pci/rivatnt.h",
MAME_DIR .. "src/devices/bus/pci/geforce.cpp", MAME_DIR .. "src/devices/bus/pci/geforce.cpp",
MAME_DIR .. "src/devices/bus/pci/geforce.h", MAME_DIR .. "src/devices/bus/pci/geforce.h",
MAME_DIR .. "src/devices/bus/pci/mga2064w.cpp", MAME_DIR .. "src/devices/bus/pci/mga2064w.cpp",
MAME_DIR .. "src/devices/bus/pci/mga2064w.h", MAME_DIR .. "src/devices/bus/pci/mga2064w.h",
MAME_DIR .. "src/devices/bus/pci/opti82c861.cpp",
MAME_DIR .. "src/devices/bus/pci/opti82c861.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/riva128.cpp",
MAME_DIR .. "src/devices/bus/pci/ymp21.h", MAME_DIR .. "src/devices/bus/pci/riva128.h",
MAME_DIR .. "src/devices/bus/pci/sw1000xg.cpp", MAME_DIR .. "src/devices/bus/pci/rivatnt.cpp",
MAME_DIR .. "src/devices/bus/pci/sw1000xg.h", MAME_DIR .. "src/devices/bus/pci/rivatnt.h",
MAME_DIR .. "src/devices/bus/pci/ds2416.cpp",
MAME_DIR .. "src/devices/bus/pci/ds2416.h",
MAME_DIR .. "src/devices/bus/pci/sonicvibes.cpp",
MAME_DIR .. "src/devices/bus/pci/sonicvibes.h",
MAME_DIR .. "src/devices/bus/pci/zr36057.cpp",
MAME_DIR .. "src/devices/bus/pci/zr36057.h",
MAME_DIR .. "src/devices/bus/pci/rtl8029as_pci.cpp", MAME_DIR .. "src/devices/bus/pci/rtl8029as_pci.cpp",
MAME_DIR .. "src/devices/bus/pci/rtl8029as_pci.h", MAME_DIR .. "src/devices/bus/pci/rtl8029as_pci.h",
MAME_DIR .. "src/devices/bus/pci/rtl8139_pci.cpp", MAME_DIR .. "src/devices/bus/pci/rtl8139_pci.cpp",
MAME_DIR .. "src/devices/bus/pci/rtl8139_pci.h", MAME_DIR .. "src/devices/bus/pci/rtl8139_pci.h",
MAME_DIR .. "src/devices/bus/pci/opti82c861.cpp", MAME_DIR .. "src/devices/bus/pci/sonicvibes.cpp",
MAME_DIR .. "src/devices/bus/pci/opti82c861.h", MAME_DIR .. "src/devices/bus/pci/sonicvibes.h",
MAME_DIR .. "src/devices/bus/pci/sw1000xg.cpp",
MAME_DIR .. "src/devices/bus/pci/sw1000xg.h",
MAME_DIR .. "src/devices/bus/pci/virge_pci.cpp",
MAME_DIR .. "src/devices/bus/pci/virge_pci.h",
MAME_DIR .. "src/devices/bus/pci/ymp21.cpp",
MAME_DIR .. "src/devices/bus/pci/ymp21.h",
MAME_DIR .. "src/devices/bus/pci/zr36057.cpp",
MAME_DIR .. "src/devices/bus/pci/zr36057.h",
} }
end end

View File

@ -1,8 +1,8 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:Olivier Galibert // copyright-holders:Olivier Galibert
#ifndef MAME_SOUND_DS2416_H #ifndef MAME_BUS_PCI_DS2416_H
#define MAME_SOUND_DS2416_H #define MAME_BUS_PCI_DS2416_H
#pragma once #pragma once

View File

@ -1,14 +1,16 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders: Angelo Salese // copyright-holders: Angelo Salese
#ifndef MAME_VIDEO_GEFORCE_H #ifndef MAME_BUS_PCI_GEFORCE_H
#define MAME_VIDEO_GEFORCE_H #define MAME_BUS_PCI_GEFORCE_H
#pragma once #pragma once
#include "rivatnt.h"
#include "machine/pci.h" #include "machine/pci.h"
#include "video/pc_vga_nvidia.h" #include "video/pc_vga_nvidia.h"
#include "rivatnt.h"
class geforce256_device : public rivatnt2_device class geforce256_device : public rivatnt2_device
{ {
@ -47,4 +49,4 @@ DECLARE_DEVICE_TYPE(GEFORCE256_DDR, geforce256_ddr_device)
DECLARE_DEVICE_TYPE(QUADRO, quadro_device) DECLARE_DEVICE_TYPE(QUADRO, quadro_device)
#endif // MAME_VIDEO_GEFORCE_H #endif // MAME_BUS_PCI_GEFORCE_H

View File

@ -1,13 +1,15 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:Olivier Galibert, Angelo Salese // copyright-holders:Olivier Galibert, Angelo Salese
#ifndef MAME_VIDEO_MGA2064W_H #ifndef MAME_BUS_PCI_MGA2064W_H
#define MAME_VIDEO_MGA2064W_H #define MAME_BUS_PCI_MGA2064W_H
#pragma once #pragma once
#include "pci_slot.h" #include "pci_slot.h"
#include "video/pc_vga_matrox.h" #include "video/pc_vga_matrox.h"
class mga2064w_device : public pci_card_device, public device_memory_interface { class mga2064w_device : public pci_card_device, public device_memory_interface {
public: public:
mga2064w_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); mga2064w_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@ -92,4 +94,4 @@ private:
DECLARE_DEVICE_TYPE(MGA2064W, mga2064w_device); DECLARE_DEVICE_TYPE(MGA2064W, mga2064w_device);
#endif // MAME_VIDEO_MGA2064W_H #endif // MAME_BUS_PCI_MGA2064W_H

View File

@ -1,8 +1,8 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders: R. Belmont // copyright-holders: R. Belmont
#ifndef MAME_MACHINE_OPTI82C861_H #ifndef MAME_BUS_PCI_OPTI82C861_H
#define MAME_MACHINE_OPTI82C861_H #define MAME_BUS_PCI_OPTI82C861_H
#pragma once #pragma once

View File

@ -5,19 +5,21 @@
#include "emu.h" #include "emu.h"
#include "pci_slot.h" #include "pci_slot.h"
#include "virge_pci.h"
#include "riva128.h" #include "ds2416.h"
#include "rivatnt.h"
#include "geforce.h" #include "geforce.h"
#include "mga2064w.h" #include "mga2064w.h"
#include "opti82c861.h"
#include "promotion.h" #include "promotion.h"
#include "ds2416.h" #include "riva128.h"
#include "sonicvibes.h" #include "rivatnt.h"
#include "sw1000xg.h"
#include "zr36057.h"
#include "rtl8029as_pci.h" #include "rtl8029as_pci.h"
#include "rtl8139_pci.h" #include "rtl8139_pci.h"
#include "opti82c861.h" #include "sonicvibes.h"
#include "sw1000xg.h"
#include "virge_pci.h"
#include "zr36057.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")
@ -47,18 +49,10 @@ pci_card_device *pci_slot_device::get_card() const
pci_card_interface::pci_card_interface(const machine_config &mconfig, device_t &device) : pci_card_interface::pci_card_interface(const machine_config &mconfig, device_t &device) :
device_interface(device, "pci_card"), device_interface(device, "pci_card"),
m_pci_slot(nullptr) m_pci_slot(dynamic_cast<pci_slot_device *>(device.owner())) // Beware, the owner may not be a pci_slot_device, in which case the cast returns nullptr
{ {
} }
void pci_card_interface::interface_pre_start()
{
// Beware, the owner may not be a pci_slot_device, in which case
// the cast is expected to return nullptr.
m_pci_slot = dynamic_cast<pci_slot_device *>(device().owner());
}
pci_card_device::pci_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : pci_card_device::pci_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
pci_device(mconfig, type, tag, owner, clock), pci_device(mconfig, type, tag, owner, clock),
pci_card_interface(mconfig, *this) pci_card_interface(mconfig, *this)

View File

@ -8,6 +8,9 @@
#include "machine/pci.h" #include "machine/pci.h"
#include <array>
class pci_card_interface; class pci_card_interface;
class pci_slot_device: public device_t, public device_single_card_slot_interface<pci_card_interface> class pci_slot_device: public device_t, public device_single_card_slot_interface<pci_card_interface>
@ -47,21 +50,19 @@ private:
u8 m_slot; u8 m_slot;
}; };
class pci_card_interface : public device_interface class pci_card_interface : public device_interface
{ {
public:
protected: protected:
pci_slot_device *m_pci_slot; pci_slot_device *const m_pci_slot;
pci_card_interface(const machine_config &mconfig, device_t &device); pci_card_interface(const machine_config &mconfig, device_t &device);
virtual void interface_pre_start() override;
}; };
class pci_card_device : public pci_device, public pci_card_interface class pci_card_device : public pci_device, public pci_card_interface
{ {
public: public:
pci_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
virtual ~pci_card_device(); virtual ~pci_card_device();
void set_irq_map(u8 irqa, u8 irqb = 0xff, u8 irqc = 0xff, u8 irqd = 0xff) { void set_irq_map(u8 irqa, u8 irqb = 0xff, u8 irqc = 0xff, u8 irqd = 0xff) {
@ -78,6 +79,8 @@ protected:
virtual void device_start() override; virtual void device_start() override;
virtual void device_reset() override; virtual void device_reset() override;
pci_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
void irq_pin_w(offs_t line, int state); void irq_pin_w(offs_t line, int state);
}; };

View File

@ -1,14 +1,16 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders: // copyright-holders:
#ifndef MAME_VIDEO_PROMOTION_H #ifndef MAME_BUS_PCI_PROMOTION_H
#define MAME_VIDEO_PROMOTION_H #define MAME_BUS_PCI_PROMOTION_H
#pragma once #pragma once
#include "pci_slot.h" #include "pci_slot.h"
#include "video/pc_vga.h" #include "video/pc_vga.h"
class promotion3210_device : public pci_card_device class promotion3210_device : public pci_card_device
{ {
public: public:
@ -44,4 +46,4 @@ private:
DECLARE_DEVICE_TYPE(PROMOTION3210, promotion3210_device) DECLARE_DEVICE_TYPE(PROMOTION3210, promotion3210_device)
#endif // MAME_VIDEO_PROMOTION_H #endif // MAME_BUS_PCI_PROMOTION_H

View File

@ -1,14 +1,15 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders: Angelo Salese // copyright-holders: Angelo Salese
#ifndef MAME_VIDEO_RIVA128_H #ifndef MAME_BUS_PCI_RIVA128_H
#define MAME_VIDEO_RIVA128_H #define MAME_BUS_PCI_RIVA128_H
#pragma once #pragma once
#include "pci_slot.h" #include "pci_slot.h"
#include "video/pc_vga_nvidia.h" #include "video/pc_vga_nvidia.h"
class riva128_device : public pci_card_device class riva128_device : public pci_card_device
{ {
public: public:
@ -61,4 +62,4 @@ protected:
DECLARE_DEVICE_TYPE(RIVA128, riva128_device) DECLARE_DEVICE_TYPE(RIVA128, riva128_device)
DECLARE_DEVICE_TYPE(RIVA128ZX, riva128zx_device) DECLARE_DEVICE_TYPE(RIVA128ZX, riva128zx_device)
#endif // MAME_VIDEO_RIVA128_H #endif // MAME_BUS_PCI_RIVA128_H

View File

@ -1,14 +1,16 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders: Angelo Salese // copyright-holders: Angelo Salese
#ifndef MAME_VIDEO_RIVATNT_H #ifndef MAME_BUS_VIDEO_RIVATNT_H
#define MAME_VIDEO_RIVATNT_H #define MAME_BUS_VIDEO_RIVATNT_H
#pragma once #pragma once
#include "riva128.h"
#include "machine/pci.h" #include "machine/pci.h"
#include "video/pc_vga_nvidia.h" #include "video/pc_vga_nvidia.h"
#include "riva128.h"
class rivatnt_device : public riva128_device class rivatnt_device : public riva128_device
{ {

View File

@ -1,8 +1,8 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders: // copyright-holders:
#ifndef MAME_NETWORK_RTL8029AS_PCI_H #ifndef MAME_BUS_PCI_RTL8029AS_PCI_H
#define MAME_NETWORK_RTL8029AS_PCI_H #define MAME_BUS_PCI_RTL8029AS_PCI_H
#pragma once #pragma once

View File

@ -1,8 +1,8 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders: // copyright-holders:
#ifndef MAME_NETWORK_RTL8129_PCI_H #ifndef MAME_BUS_PCI_RTL8129_PCI_H
#define MAME_NETWORK_RTL8129_PCI_H #define MAME_BUS_PCI_RTL8129_PCI_H
#pragma once #pragma once

View File

@ -1,15 +1,17 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:Angelo Salese // copyright-holders:Angelo Salese
#ifndef MAME__SONICVIBES_H #ifndef MAME_BUS_PCI_SONICVIBES_H
#define MAME__SONICVIBES_H #define MAME_BUS_PCI_SONICVIBES_H
#pragma once #pragma once
#include "pci_slot.h" #include "pci_slot.h"
#include "bus/pc_joy/pc_joy.h" #include "bus/pc_joy/pc_joy.h"
#include "sound/ymopl.h" #include "sound/ymopl.h"
class sonicvibes_device : public pci_card_device class sonicvibes_device : public pci_card_device
{ {
public: public:
@ -39,4 +41,4 @@ private:
DECLARE_DEVICE_TYPE(SONICVIBES, sonicvibes_device) DECLARE_DEVICE_TYPE(SONICVIBES, sonicvibes_device)
#endif // MAME__SONICVIBES_H #endif // MAME_BUS_PCI_SONICVIBES_H

View File

@ -1,8 +1,8 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:Olivier Galibert // copyright-holders:Olivier Galibert
#ifndef MAME_SOUND_SW1000XG_H #ifndef MAME_BUS_PCI_SW1000XG_H
#define MAME_SOUND_SW1000XG_H #define MAME_BUS_PCI_SW1000XG_H
#pragma once #pragma once
@ -11,6 +11,7 @@
#include "cpu/h8/h83002.h" #include "cpu/h8/h83002.h"
#include "sound/swp30.h" #include "sound/swp30.h"
class sw1000xg_device : public ymp21_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);

View File

@ -5,8 +5,8 @@
* S3 ViRGE 3D accelerator card * S3 ViRGE 3D accelerator card
*/ */
#ifndef MAME_VIDEO_VIRGE_PCI_H #ifndef MAME_BUS_PCI_VIRGE_PCI_H
#define MAME_VIDEO_VIRGE_PCI_H #define MAME_BUS_PCI_VIRGE_PCI_H
#pragma once #pragma once

View File

@ -3,13 +3,16 @@
// PCI interfacing gate array common to the sw1000xg and the ds2416 // PCI interfacing gate array common to the sw1000xg and the ds2416
#ifndef MAME_SOUND_YMP21_H #ifndef MAME_BUS_PCI_YMP21_H
#define MAME_SOUND_YMP21_H #define MAME_BUS_PCI_YMP21_H
#pragma once #pragma once
#include "pci_slot.h" #include "pci_slot.h"
#include <array>
class ymp21_device : public pci_card_device { class ymp21_device : public pci_card_device {
protected: protected:
devcb_write_line::array<2> m_tx_cb; devcb_write_line::array<2> m_tx_cb;