mirror of
https://github.com/holub/mame
synced 2025-04-25 09:50:04 +03:00
-mac: MACHINE_CONFIG removal, nw
This commit is contained in:
parent
782466772f
commit
0f028a8bd2
@ -19,15 +19,6 @@
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
||||
#define MCFG_MACPDS_BUS_ADD(_tag, _cputag) \
|
||||
MCFG_DEVICE_ADD(_tag, MACPDS, 0) \
|
||||
downcast<macpds_device &>(*device).set_cputag(_cputag);
|
||||
|
||||
#define MCFG_MACPDS_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot) \
|
||||
MCFG_DEVICE_ADD(_tag, MACPDS_SLOT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
|
||||
downcast<macpds_slot_device &>(*device).set_macpds_slot(_nbtag, _tag);
|
||||
|
||||
#define MCFG_MACPDS_SLOT_REMOVE(_tag) \
|
||||
MCFG_DEVICE_REMOVE(_tag)
|
||||
|
||||
@ -50,6 +41,16 @@ class macpds_slot_device : public device_t,
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
template <typename T>
|
||||
macpds_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *nbtag, T &&opts, const char *dflt)
|
||||
: macpds_slot_device(mconfig, tag, owner, (uint32_t)0)
|
||||
{
|
||||
option_reset();
|
||||
opts(*this);
|
||||
set_default_option(dflt);
|
||||
set_macpds_slot(nbtag, tag);
|
||||
}
|
||||
|
||||
macpds_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// inline configuration
|
||||
@ -76,7 +77,14 @@ class macpds_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
macpds_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *cputag)
|
||||
: macpds_device(mconfig, tag, owner, (uint32_t)0)
|
||||
{
|
||||
set_cputag(cputag);
|
||||
}
|
||||
|
||||
macpds_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
~macpds_device() { m_device_list.detach_all(); }
|
||||
// inline configuration
|
||||
void set_cputag(const char *tag) { m_cputag = tag; }
|
||||
|
@ -62,6 +62,16 @@ class nubus_slot_device : public device_t, public device_slot_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
template <typename T>
|
||||
nubus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *nbtag, T &&opts, const char *dflt)
|
||||
: nubus_slot_device(mconfig, tag, owner, (uint32_t)0)
|
||||
{
|
||||
option_reset();
|
||||
opts(*this);
|
||||
set_default_option(dflt);
|
||||
set_nubus_slot(nbtag, tag);
|
||||
}
|
||||
|
||||
nubus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// inline configuration
|
||||
@ -97,6 +107,12 @@ public:
|
||||
template <class Object> devcb_base &set_out_irqc_callback(Object &&cb) { return m_out_irqc_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_out_irqd_callback(Object &&cb) { return m_out_irqd_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_out_irqe_callback(Object &&cb) { return m_out_irqe_cb.set_callback(std::forward<Object>(cb)); }
|
||||
auto out_irq9_callback() { return m_out_irq9_cb.bind(); }
|
||||
auto out_irqa_callback() { return m_out_irqa_cb.bind(); }
|
||||
auto out_irqb_callback() { return m_out_irqb_cb.bind(); }
|
||||
auto out_irqc_callback() { return m_out_irqc_cb.bind(); }
|
||||
auto out_irqd_callback() { return m_out_irqd_cb.bind(); }
|
||||
auto out_irqe_callback() { return m_out_irqe_cb.bind(); }
|
||||
|
||||
void add_nubus_card(device_nubus_card_interface *card);
|
||||
void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, uint32_t mask=0xffffffff);
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
scc8530_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
template <class Object> devcb_base &set_intrq_wr_callback(Object &&cb) { return intrq_cb.set_callback(std::forward<Object>(cb)); }
|
||||
auto intrq_callback() { return intrq_cb.bind(); }
|
||||
|
||||
uint8_t get_reg_a(int reg);
|
||||
uint8_t get_reg_b(int reg);
|
||||
|
@ -136,6 +136,12 @@ public:
|
||||
class iwm_device : public applefdc_base_device
|
||||
{
|
||||
public:
|
||||
iwm_device(const machine_config &mconfig, const char *tag, device_t *owner, const applefdc_interface *intrf)
|
||||
: iwm_device(mconfig, tag, owner, (uint32_t)0)
|
||||
{
|
||||
set_config(intrf);
|
||||
}
|
||||
|
||||
iwm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
};
|
||||
|
||||
|
@ -28,6 +28,8 @@ public:
|
||||
|
||||
template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_out_drq_callback(Object &&cb) { return m_out_drq_cb.set_callback(std::forward<Object>(cb)); }
|
||||
auto irq_callback() { return m_out_irq_cb.bind(); }
|
||||
auto drq_callback() { return m_out_drq_cb.bind(); }
|
||||
|
||||
// our API
|
||||
DECLARE_READ8_MEMBER(read);
|
||||
|
@ -59,18 +59,20 @@ public:
|
||||
ARDBEG = 7 // Subset of ASC included in the Ardbeg ASIC (LC520)
|
||||
};
|
||||
|
||||
asc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, asc_type type)
|
||||
: asc_device(mconfig, tag, owner, clock)
|
||||
{
|
||||
set_type(type);
|
||||
}
|
||||
|
||||
// construction/destruction
|
||||
asc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// inline configuration helpers
|
||||
void set_type(asc_type type) { m_chip_type = type; }
|
||||
|
||||
|
||||
template <class Write> devcb_base &set_irqf(Write &&wr)
|
||||
{
|
||||
return write_irq.set_callback(std::forward<Write>(wr));
|
||||
}
|
||||
auto irqf_callback() { return write_irq.bind(); }
|
||||
|
||||
DECLARE_READ8_MEMBER(read);
|
||||
DECLARE_WRITE8_MEMBER(write);
|
||||
|
@ -39,6 +39,12 @@ public:
|
||||
|
||||
// Override
|
||||
template <typename Obj> void set_dasm_override(Obj &&cb) { m_dasm_override = std::forward<Obj>(cb); }
|
||||
void set_dasm_override(dasm_override_delegate callback) { m_dasm_override = callback; }
|
||||
template <class FunctionClass> void set_dasm_override(offs_t (FunctionClass::*callback)(std::ostream &, offs_t,
|
||||
const util::disasm_interface::data_buffer &, const util::disasm_interface::data_buffer &), const char *name)
|
||||
{
|
||||
set_dasm_override(dasm_override_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
|
||||
}
|
||||
|
||||
// disassembler request
|
||||
util::disasm_interface &get_disassembler();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1363,9 +1363,9 @@ void mac128_state::mac512ke(machine_config &config)
|
||||
IWM(config, m_iwm, 0).set_config(&mac_iwm_interface);
|
||||
sonydriv_floppy_image_device::legacy_2_drives_add(config, &mac_floppy_interface);
|
||||
|
||||
scc85c30_device &scc(SCC85C30(config, "scc", C7M));
|
||||
scc.configure_channels(C3_7M, 0, C3_7M, 0);
|
||||
scc.out_int_callback().set(FUNC(mac128_state::set_scc_interrupt));
|
||||
SCC85C30(config, m_scc, C7M);
|
||||
m_scc->configure_channels(C3_7M, 0, C3_7M, 0);
|
||||
m_scc->out_int_callback().set(FUNC(mac128_state::set_scc_interrupt));
|
||||
|
||||
VIA6522(config, m_via, 1000000);
|
||||
m_via->readpa_handler().set(FUNC(mac128_state::mac_via_in_a));
|
||||
|
@ -99,19 +99,34 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void add_mackbd(machine_config &config);
|
||||
void add_scsi(machine_config &config, bool cdrom = false);
|
||||
void add_base_devices(machine_config &config, bool rtc = true, bool super_woz = false);
|
||||
void add_asc(machine_config &config, asc_device::asc_type type = asc_device::asc_type::ASC);
|
||||
void add_macplus_additions(machine_config &config);
|
||||
void add_nubus(machine_config &config, bool bank1 = true, bool bank2 = true);
|
||||
template <typename T> void add_nubus_pds(machine_config &config, const char *slot_tag, T &&opts);
|
||||
void add_via1_adb(machine_config &config, bool macii);
|
||||
void add_via2(machine_config &config);
|
||||
void add_pb1xx_vias(machine_config &config);
|
||||
void add_pb1xx_screen(machine_config &config);
|
||||
void add_egret(machine_config &config, int type);
|
||||
void add_cuda(machine_config &config, int type);
|
||||
|
||||
void mac512ke_base(machine_config &config);
|
||||
void mac512ke(machine_config &config);
|
||||
void macplus(machine_config &config);
|
||||
void maclc(machine_config &config);
|
||||
void maclc(machine_config &config, bool cpu = true, bool egret = true, asc_device::asc_type asc_type = asc_device::asc_type::V8);
|
||||
void macpb170(machine_config &config);
|
||||
void macclasc(machine_config &config);
|
||||
void maciisi(machine_config &config);
|
||||
void maclc2(machine_config &config);
|
||||
void maclc2(machine_config &config, bool egret = true);
|
||||
void macse(machine_config &config);
|
||||
void maclc3(machine_config &config);
|
||||
void maclc3(machine_config &config, bool egret = true);
|
||||
void macpd210(machine_config &config);
|
||||
void maciici(machine_config &config);
|
||||
void macprtb(machine_config &config);
|
||||
void maciix(machine_config &config);
|
||||
void maciix(machine_config &config, bool nubus_bank1 = true, bool nubus_bank2 = true);
|
||||
void maclc520(machine_config &config);
|
||||
void pwrmac(machine_config &config);
|
||||
void maciivx(machine_config &config);
|
||||
@ -127,7 +142,8 @@ public:
|
||||
void maciifx(machine_config &config);
|
||||
void macpb140(machine_config &config);
|
||||
void macclas2(machine_config &config);
|
||||
void macii(machine_config &config);
|
||||
void macii(machine_config &config, bool cpu = true, asc_device::asc_type asc_type = asc_device::asc_type::ASC,
|
||||
bool nubus = true, bool nubus_bank1 = true, bool nubus_bank2 = true);
|
||||
void maciihmu(machine_config &config);
|
||||
|
||||
void init_maclc2();
|
||||
@ -287,7 +303,6 @@ private:
|
||||
TIMER_CALLBACK_MEMBER(overlay_timeout_func);
|
||||
DECLARE_READ32_MEMBER(rom_switch_r);
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(mac_scanline);
|
||||
bool m_snd_enable;
|
||||
bool m_main_buffer;
|
||||
int m_snd_vol;
|
||||
@ -514,10 +529,11 @@ private:
|
||||
emu_timer *m_scanline_timer;
|
||||
emu_timer *m_adb_timer;
|
||||
|
||||
void palette_init_mac(palette_device &palette);
|
||||
void palette_init_macgsc(palette_device &palette);
|
||||
|
||||
DECLARE_VIDEO_START(mac);
|
||||
DECLARE_PALETTE_INIT(mac);
|
||||
DECLARE_VIDEO_START(macprtb);
|
||||
DECLARE_PALETTE_INIT(macgsc);
|
||||
DECLARE_VIDEO_START(macsonora);
|
||||
DECLARE_VIDEO_RESET(macrbv);
|
||||
DECLARE_VIDEO_START(macdafb);
|
||||
|
@ -59,6 +59,12 @@ class cuda_device : public device_t, public device_nvram_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
cuda_device(const machine_config &mconfig, const char *tag, device_t *owner, int type)
|
||||
: cuda_device(mconfig, tag, owner, (uint32_t)0)
|
||||
{
|
||||
set_type(type);
|
||||
}
|
||||
|
||||
cuda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// inline configuration helpers
|
||||
|
@ -57,6 +57,12 @@ class egret_device : public device_t, public device_nvram_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
egret_device(const machine_config &mconfig, const char *tag, device_t *owner, int type)
|
||||
: egret_device(mconfig, tag, owner, (uint32_t)0)
|
||||
{
|
||||
set_type(type);
|
||||
}
|
||||
|
||||
egret_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// inline configuration helpers
|
||||
@ -98,6 +104,10 @@ public:
|
||||
template <class Object> devcb_base &set_linechange_cb(Object &&wr) { return write_linechange.set_callback(std::forward<Object>(wr)); }
|
||||
template <class Object> devcb_base &set_via_clock_cb(Object &&wr) { return write_via_clock.set_callback(std::forward<Object>(wr)); }
|
||||
template <class Object> devcb_base &set_via_data_cb(Object &&wr) { return write_via_data.set_callback(std::forward<Object>(wr)); }
|
||||
auto reset_callback() { return write_reset.bind(); }
|
||||
auto linechange_callback() { return write_linechange.bind(); }
|
||||
auto via_clock_callback() { return write_via_clock.bind(); }
|
||||
auto via_data_callback() { return write_via_data.bind(); }
|
||||
|
||||
devcb_write_line write_reset, write_linechange, write_via_clock, write_via_data;
|
||||
|
||||
|
@ -99,6 +99,9 @@
|
||||
|
||||
#define INTS_RBV ((m_model >= MODEL_MAC_IICI) && (m_model <= MODEL_MAC_IIVI)) || ((m_model >= MODEL_MAC_LC) && (m_model <= MODEL_MAC_LC_580))
|
||||
|
||||
#define MAC_MAIN_SND_BUF_OFFSET 0x0300
|
||||
#define MAC_ALT_SND_BUF_OFFSET 0x5F00
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
#define LOG_ADB 0
|
||||
#define LOG_VIA 0
|
||||
@ -2354,7 +2357,23 @@ TIMER_CALLBACK_MEMBER(mac_state::mac_scanline_tick)
|
||||
mouse_callback();
|
||||
}
|
||||
|
||||
m_scanline_timer->adjust(m_screen->time_until_pos((scanline+1) % MAC_V_TOTAL, 0));
|
||||
if (m_dac)
|
||||
{
|
||||
uint16_t *snd_buf_ptr;
|
||||
if (m_main_buffer)
|
||||
{
|
||||
snd_buf_ptr = (uint16_t *)(m_ram->pointer() + m_ram->size() - MAC_MAIN_SND_BUF_OFFSET);
|
||||
}
|
||||
else
|
||||
{
|
||||
snd_buf_ptr = (uint16_t *)(m_ram->pointer() + m_ram->size() - MAC_ALT_SND_BUF_OFFSET);
|
||||
}
|
||||
|
||||
m_dac->write(snd_buf_ptr[scanline] >> 8);
|
||||
}
|
||||
|
||||
int next_scanline = (scanline+1) % MAC_V_TOTAL;
|
||||
m_scanline_timer->adjust(m_screen->time_until_pos(next_scanline), next_scanline);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(mac_state::nubus_irq_9_w)
|
||||
|
@ -24,6 +24,12 @@ DECLARE_DEVICE_TYPE(SWIM, swim_device)
|
||||
class swim_device : public applefdc_base_device
|
||||
{
|
||||
public:
|
||||
swim_device(const machine_config &mconfig, const char *tag, device_t *owner, const applefdc_interface *intrf)
|
||||
: swim_device(mconfig, tag, owner, (uint32_t)0)
|
||||
{
|
||||
set_config(intrf);
|
||||
}
|
||||
|
||||
swim_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// read/write
|
||||
|
@ -59,14 +59,14 @@ Apple color FPD 01 11 10 (FPD = Full Page Display)
|
||||
#include "machine/ram.h"
|
||||
#include "render.h"
|
||||
|
||||
PALETTE_INIT_MEMBER(mac_state,mac)
|
||||
void mac_state::palette_init_mac(palette_device &palette)
|
||||
{
|
||||
palette.set_pen_color(0, 0xff, 0xff, 0xff);
|
||||
palette.set_pen_color(1, 0x00, 0x00, 0x00);
|
||||
}
|
||||
|
||||
// 4-level grayscale
|
||||
PALETTE_INIT_MEMBER(mac_state,macgsc)
|
||||
void mac_state::palette_init_macgsc(palette_device &palette)
|
||||
{
|
||||
palette.set_pen_color(0, 0xff, 0xff, 0xff);
|
||||
palette.set_pen_color(1, 0x7f, 0x7f, 0x7f);
|
||||
|
Loading…
Reference in New Issue
Block a user