summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nubus/bootbug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/nubus/bootbug.cpp')
-rw-r--r--src/devices/bus/nubus/bootbug.cpp98
1 files changed, 37 insertions, 61 deletions
diff --git a/src/devices/bus/nubus/bootbug.cpp b/src/devices/bus/nubus/bootbug.cpp
index 24763b64dc2..4d7b568b19c 100644
--- a/src/devices/bus/nubus/bootbug.cpp
+++ b/src/devices/bus/nubus/bootbug.cpp
@@ -5,18 +5,42 @@
Brigent BootBug card
Debugger support card for creators of NuBus slot firmware and other
- early-boot/low-level software.
+ early-boot/low-level software. Actually has many of the features
+ of MacsBug including A6 stack tracing. Absolutely not PowerMac compatible
+ though, unlike MacsBug.
- Basically a serial card with an overachieving declaration ROM.
+ Basically an 8250 serial card with an overachieving declaration ROM.
***************************************************************************/
#include "emu.h"
#include "bootbug.h"
+
#include "bus/rs232/rs232.h"
#include "bus/rs232/terminal.h"
#include "bus/rs232/null_modem.h"
-#include "screen.h"
+#include "machine/ins8250.h"
+
+namespace {
+class nubus_bootbug_device : public device_t,
+ public device_nubus_card_interface
+{
+public:
+ nubus_bootbug_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+protected:
+ required_device<ns16450_device> m_uart;
+
+ // device-level overrides
+ virtual void device_start() override ATTR_COLD;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
+ virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
+
+private:
+ void card_map(address_map &map);
+};
static void isa_com(device_slot_interface &device)
{
@@ -24,10 +48,8 @@ static void isa_com(device_slot_interface &device)
device.option_add("null_modem", NULL_MODEM);
}
-#define BOOTBUG_ROM_REGION "btbug_rom"
-
ROM_START( bootbug )
- ROM_REGION(0x10000, BOOTBUG_ROM_REGION, 0)
+ ROM_REGION(0x10000, "declrom", 0)
ROM_DEFAULT_BIOS("bb15")
ROM_SYSTEM_BIOS(0, "bb15", "BootBug v1.5")
ROMX_LOAD( "bootbug1.5.bin", 0x000000, 0x010000, CRC(432badf0) SHA1(914ad4bb28946cac732cf8b178508b69e4c1aae2), ROM_BIOS(0))
@@ -35,17 +57,6 @@ ROM_START( bootbug )
ROMX_LOAD( "bootbug1.3.bin", 0x000000, 0x010000, CRC(2902a234) SHA1(c783d19a5e4c536e58e1e7e201ec47e8fb78d435), ROM_BIOS(1))
ROM_END
-//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-DEFINE_DEVICE_TYPE(NUBUS_BOOTBUG, nubus_bootbug_device, "nb_btbug", "Brigent BootBug debugger card")
-
-
-//-------------------------------------------------
-// device_add_mconfig - add device configuration
-//-------------------------------------------------
-
void nubus_bootbug_device::device_add_mconfig(machine_config &config)
{
NS16450(config, m_uart, XTAL(1'843'200));
@@ -61,64 +72,29 @@ void nubus_bootbug_device::device_add_mconfig(machine_config &config)
serport0.cts_handler().set(m_uart, FUNC(ins8250_uart_device::cts_w));
}
-//-------------------------------------------------
-// rom_region - device-specific ROM region
-//-------------------------------------------------
-
const tiny_rom_entry *nubus_bootbug_device::device_rom_region() const
{
return ROM_NAME( bootbug );
}
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// nubus_bootbug_device - constructor
-//-------------------------------------------------
-
-nubus_bootbug_device::nubus_bootbug_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- nubus_bootbug_device(mconfig, NUBUS_BOOTBUG, tag, owner, clock)
-{
-}
-
-nubus_bootbug_device::nubus_bootbug_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, type, tag, owner, clock),
+nubus_bootbug_device::nubus_bootbug_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
+ device_t(mconfig, NUBUS_BOOTBUG, tag, owner, clock),
device_nubus_card_interface(mconfig, *this),
m_uart(*this, "uart_0")
{
}
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void nubus_bootbug_device::device_start()
+void nubus_bootbug_device::card_map(address_map &map)
{
- uint32_t slotspace;
-
- install_declaration_rom(this, BOOTBUG_ROM_REGION);
-
- slotspace = get_slotspace();
-
- nubus().install_device(slotspace, slotspace+0xff, read32_delegate(FUNC(nubus_bootbug_device::dev_r), this), write32_delegate(FUNC(nubus_bootbug_device::dev_w), this));
+ map(0x00'0000, 0x00'00ff).rw(m_uart, FUNC(ns16450_device::ins8250_r), FUNC(ns16450_device::ins8250_w)).umask32(0x000000ff);
}
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void nubus_bootbug_device::device_reset()
+void nubus_bootbug_device::device_start()
{
+ install_declaration_rom("declrom");
+ nubus().install_map(*this, &nubus_bootbug_device::card_map);
}
-WRITE32_MEMBER( nubus_bootbug_device::dev_w )
-{
- m_uart->ins8250_w(offset, data & 0xff);
-}
+} // anonymous namespace
-READ32_MEMBER( nubus_bootbug_device::dev_r )
-{
- return m_uart->ins8250_r(offset);
-}
+DEFINE_DEVICE_TYPE_PRIVATE(NUBUS_BOOTBUG, device_nubus_card_interface, nubus_bootbug_device, "nb_btbug", "Brigent BootBug debugger card")