bus/bbc/exp, bus/bbc/rom, ds1315, upd7002: Simplify read/write handlers (nw)

This commit is contained in:
AJR 2019-03-14 21:57:44 -04:00
parent 1a14eeaa7d
commit 307c442eb5
26 changed files with 154 additions and 149 deletions

View File

@ -97,26 +97,26 @@ void bbc_exp_slot_device::device_reset()
// read
//-------------------------------------------------
READ8_MEMBER(bbc_exp_slot_device::fred_r)
uint8_t bbc_exp_slot_device::fred_r(offs_t offset)
{
if (m_card)
return m_card->fred_r(space, offset);
return m_card->fred_r(offset);
else
return 0xff;
}
READ8_MEMBER(bbc_exp_slot_device::jim_r)
uint8_t bbc_exp_slot_device::jim_r(offs_t offset)
{
if (m_card)
return m_card->jim_r(space, offset);
return m_card->jim_r(offset);
else
return 0xff;
}
READ8_MEMBER(bbc_exp_slot_device::sheila_r)
uint8_t bbc_exp_slot_device::sheila_r(offs_t offset)
{
if (m_card)
return m_card->sheila_r(space, offset);
return m_card->sheila_r(offset);
else
return 0xfe;
}
@ -125,32 +125,32 @@ READ8_MEMBER(bbc_exp_slot_device::sheila_r)
// write
//-------------------------------------------------
WRITE8_MEMBER(bbc_exp_slot_device::fred_w)
void bbc_exp_slot_device::fred_w(offs_t offset, uint8_t data)
{
if (m_card)
m_card->fred_w(space, offset, data);
m_card->fred_w(offset, data);
}
WRITE8_MEMBER(bbc_exp_slot_device::jim_w)
void bbc_exp_slot_device::jim_w(offs_t offset, uint8_t data)
{
if (m_card)
m_card->jim_w(space, offset, data);
m_card->jim_w(offset, data);
}
WRITE8_MEMBER(bbc_exp_slot_device::sheila_w)
void bbc_exp_slot_device::sheila_w(offs_t offset, uint8_t data)
{
if (m_card)
m_card->sheila_w(space, offset, data);
m_card->sheila_w(offset, data);
}
//-------------------------------------------------
// pb_r
//-------------------------------------------------
READ8_MEMBER(bbc_exp_slot_device::pb_r)
uint8_t bbc_exp_slot_device::pb_r()
{
if (m_card)
return 0x1f | m_card->pb_r(space, 0);
return 0x1f | m_card->pb_r();
else
return 0xff;
}
@ -160,10 +160,10 @@ READ8_MEMBER(bbc_exp_slot_device::pb_r)
// pb_w
//-------------------------------------------------
WRITE8_MEMBER(bbc_exp_slot_device::pb_w)
void bbc_exp_slot_device::pb_w(uint8_t data)
{
if (m_card)
m_card->pb_w(space, 0, data);
m_card->pb_w(data);
}
//-------------------------------------------------

View File

@ -75,12 +75,12 @@ public:
auto cb1_handler() { return m_cb1_handler.bind(); }
auto cb2_handler() { return m_cb2_handler.bind(); }
virtual DECLARE_READ8_MEMBER(fred_r);
virtual DECLARE_WRITE8_MEMBER(fred_w);
virtual DECLARE_READ8_MEMBER(jim_r);
virtual DECLARE_WRITE8_MEMBER(jim_w);
virtual DECLARE_READ8_MEMBER(sheila_r);
virtual DECLARE_WRITE8_MEMBER(sheila_w);
uint8_t fred_r(offs_t offset);
void fred_w(offs_t offset, uint8_t data);
uint8_t jim_r(offs_t offset);
void jim_w(offs_t offset, uint8_t data);
uint8_t sheila_r(offs_t offset);
void sheila_w(offs_t offset, uint8_t data);
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq_handler(state); }
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_handler(state); }
@ -89,8 +89,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(cb1_w) { m_cb1_handler(state); }
DECLARE_WRITE_LINE_MEMBER(cb2_w) { m_cb2_handler(state); }
DECLARE_READ8_MEMBER(pb_r);
DECLARE_WRITE8_MEMBER(pb_w);
uint8_t pb_r();
void pb_w(uint8_t data);
protected:
// device-level overrides
@ -114,15 +114,15 @@ private:
class device_bbc_exp_interface : public device_slot_card_interface
{
public:
virtual DECLARE_READ8_MEMBER(fred_r) { return 0xff; }
virtual DECLARE_WRITE8_MEMBER(fred_w) { }
virtual DECLARE_READ8_MEMBER(jim_r) { return 0xff; }
virtual DECLARE_WRITE8_MEMBER(jim_w) { }
virtual DECLARE_READ8_MEMBER(sheila_r) { return 0xfe; }
virtual DECLARE_WRITE8_MEMBER(sheila_w) { }
virtual uint8_t fred_r(offs_t offset) { return 0xff; }
virtual void fred_w(offs_t offset, uint8_t data) { }
virtual uint8_t jim_r(offs_t offset) { return 0xff; }
virtual void jim_w(offs_t offset, uint8_t data) { }
virtual uint8_t sheila_r(offs_t offset) { return 0xfe; }
virtual void sheila_w(offs_t offset, uint8_t data) { }
virtual DECLARE_READ8_MEMBER(pb_r) { return 0xff; }
virtual DECLARE_WRITE8_MEMBER(pb_w) { }
virtual uint8_t pb_r() { return 0xff; }
virtual void pb_w(uint8_t data) { }
protected:
device_bbc_exp_interface(const machine_config &mconfig, device_t &device);

View File

@ -114,52 +114,52 @@ void bbc_mertec_device::upd7002_eoc(int data)
//m_via6522_0->write_cb1(data);
}
READ8_MEMBER(bbc_mertec_device::fred_r)
uint8_t bbc_mertec_device::fred_r(offs_t offset)
{
return m_2mhzbus->fred_r(offset);
}
WRITE8_MEMBER(bbc_mertec_device::fred_w)
void bbc_mertec_device::fred_w(offs_t offset, uint8_t data)
{
m_2mhzbus->fred_w(offset, data);
}
READ8_MEMBER(bbc_mertec_device::jim_r)
uint8_t bbc_mertec_device::jim_r(offs_t offset)
{
return m_2mhzbus->jim_r(offset);
}
WRITE8_MEMBER(bbc_mertec_device::jim_w)
void bbc_mertec_device::jim_w(offs_t offset, uint8_t data)
{
m_2mhzbus->jim_w(offset, data);
}
READ8_MEMBER(bbc_mertec_device::sheila_r)
uint8_t bbc_mertec_device::sheila_r(offs_t offset)
{
uint8_t data = 0xfe;
if (offset >= 0x18 && offset < 0x20)
{
data = m_upd7002->read(space, offset & 0x03);
data = m_upd7002->read(offset & 0x03);
}
return data;
}
WRITE8_MEMBER(bbc_mertec_device::sheila_w)
void bbc_mertec_device::sheila_w(offs_t offset, uint8_t data)
{
if (offset >= 0x18 && offset < 0x20)
{
m_upd7002->write(space, offset & 0x03, data);
m_upd7002->write(offset & 0x03, data);
}
}
READ8_MEMBER(bbc_mertec_device::pb_r)
uint8_t bbc_mertec_device::pb_r()
{
return m_userport->pb_r();
}
WRITE8_MEMBER(bbc_mertec_device::pb_w)
void bbc_mertec_device::pb_w(uint8_t data)
{
m_userport->pb_w(data);
}

View File

@ -40,15 +40,15 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
virtual DECLARE_READ8_MEMBER(fred_r) override;
virtual DECLARE_WRITE8_MEMBER(fred_w) override;
virtual DECLARE_READ8_MEMBER(jim_r) override;
virtual DECLARE_WRITE8_MEMBER(jim_w) override;
virtual DECLARE_READ8_MEMBER(sheila_r) override;
virtual DECLARE_WRITE8_MEMBER(sheila_w) override;
virtual uint8_t fred_r(offs_t offset) override;
virtual void fred_w(offs_t offset, uint8_t data) override;
virtual uint8_t jim_r(offs_t offset) override;
virtual void jim_w(offs_t offset, uint8_t data) override;
virtual uint8_t sheila_r(offs_t offset) override;
virtual void sheila_w(offs_t offset, uint8_t data) override;
virtual DECLARE_READ8_MEMBER(pb_r) override;
virtual DECLARE_WRITE8_MEMBER(pb_w) override;
virtual uint8_t pb_r() override;
virtual void pb_w(uint8_t data) override;
private:
int get_analogue_input(int channel_number);

View File

@ -45,7 +45,7 @@ void bbc_mrme00_device::device_start()
// read
//-------------------------------------------------
READ8_MEMBER(bbc_mrme00_device::read)
uint8_t bbc_mrme00_device::read(offs_t offset)
{
if (offset < get_rom_size())
return get_rom_base()[offset & (get_rom_size() - 1)];
@ -57,7 +57,7 @@ READ8_MEMBER(bbc_mrme00_device::read)
// write
//-------------------------------------------------
WRITE8_MEMBER(bbc_mrme00_device::write)
void bbc_mrme00_device::write(offs_t offset, uint8_t data)
{
get_ram_base()[offset & (get_ram_size() - 1)] = data;
}

View File

@ -31,8 +31,8 @@ protected:
virtual void device_start() override;
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual DECLARE_WRITE8_MEMBER(write) override;
virtual uint8_t read(offs_t offset) override;
virtual void write(offs_t offset, uint8_t data) override;
};
// device type definition

View File

@ -129,7 +129,7 @@ void bbc_pal_device::device_start()
// read
//-------------------------------------------------
READ8_MEMBER(bbc_cciword_device::read)
uint8_t bbc_cciword_device::read(offs_t offset)
{
if (!machine().side_effects_disabled())
{
@ -147,7 +147,7 @@ READ8_MEMBER(bbc_cciword_device::read)
return get_rom_base()[(offset & 0x3fff) | (m_bank << 14)];
}
READ8_MEMBER(bbc_ccibase_device::read)
uint8_t bbc_ccibase_device::read(offs_t offset)
{
if (!machine().side_effects_disabled())
{
@ -164,7 +164,7 @@ READ8_MEMBER(bbc_ccibase_device::read)
return get_rom_base()[(offset & 0x3fff) | (m_bank << 14)];
}
READ8_MEMBER(bbc_ccispell_device::read)
uint8_t bbc_ccispell_device::read(offs_t offset)
{
if (!machine().side_effects_disabled())
{
@ -191,7 +191,7 @@ READ8_MEMBER(bbc_ccispell_device::read)
return get_rom_base()[(offset & 0x3fff) | (m_bank << 14)];
}
READ8_MEMBER(bbc_palqst_device::read)
uint8_t bbc_palqst_device::read(offs_t offset)
{
if (!machine().side_effects_disabled())
{
@ -215,7 +215,7 @@ READ8_MEMBER(bbc_palqst_device::read)
}
}
READ8_MEMBER(bbc_palwap_device::read)
uint8_t bbc_palwap_device::read(offs_t offset)
{
if (!machine().side_effects_disabled())
{
@ -243,7 +243,7 @@ READ8_MEMBER(bbc_palwap_device::read)
}
}
READ8_MEMBER(bbc_palted_device::read)
uint8_t bbc_palted_device::read(offs_t offset)
{
if (!machine().side_effects_disabled())
{
@ -267,7 +267,7 @@ READ8_MEMBER(bbc_palted_device::read)
}
}
READ8_MEMBER(bbc_palabep_device::read)
uint8_t bbc_palabep_device::read(offs_t offset)
{
if (!machine().side_effects_disabled())
{
@ -282,7 +282,7 @@ READ8_MEMBER(bbc_palabep_device::read)
return get_rom_base()[(offset & 0x3fff) | (m_bank << 14)];
}
READ8_MEMBER(bbc_palabe_device::read)
uint8_t bbc_palabe_device::read(offs_t offset)
{
if (!machine().side_effects_disabled())
{
@ -297,7 +297,7 @@ READ8_MEMBER(bbc_palabe_device::read)
return get_rom_base()[(offset & 0x3fff) | (m_bank << 14)];
}
READ8_MEMBER(bbc_palmo2_device::read)
uint8_t bbc_palmo2_device::read(offs_t offset)
{
if (!machine().side_effects_disabled())
{

View File

@ -46,7 +46,7 @@ public:
protected:
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual uint8_t read(offs_t offset) override;
};
// ======================> bbc_ccibase_device
@ -59,7 +59,7 @@ public:
protected:
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual uint8_t read(offs_t offset) override;
};
// ======================> bbc_ccispell_device
@ -72,7 +72,7 @@ public:
protected:
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual uint8_t read(offs_t offset) override;
};
// ======================> bbc_palqst_device
@ -84,7 +84,7 @@ public:
protected:
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual uint8_t read(offs_t offset) override;
};
// ======================> bbc_palwap_device
@ -96,7 +96,7 @@ public:
protected:
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual uint8_t read(offs_t offset) override;
};
// ======================> bbc_palted_device
@ -109,7 +109,7 @@ public:
protected:
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual uint8_t read(offs_t offset) override;
};
// ======================> bbc_palabep_device
@ -122,7 +122,7 @@ public:
protected:
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual uint8_t read(offs_t offset) override;
};
// ======================> bbc_palabe_device
@ -135,7 +135,7 @@ public:
protected:
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual uint8_t read(offs_t offset) override;
};
// ======================> bbc_palmo2_device
@ -148,7 +148,7 @@ public:
protected:
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual uint8_t read(offs_t offset) override;
};

View File

@ -42,7 +42,7 @@ void bbc_ram_device::device_start()
// read
//-------------------------------------------------
READ8_MEMBER(bbc_ram_device::read)
uint8_t bbc_ram_device::read(offs_t offset)
{
return get_ram_base()[offset & (get_ram_size() - 1)];
}
@ -51,7 +51,7 @@ READ8_MEMBER(bbc_ram_device::read)
// write
//-------------------------------------------------
WRITE8_MEMBER(bbc_ram_device::write)
void bbc_ram_device::write(offs_t offset, uint8_t data)
{
get_ram_base()[offset & (get_ram_size() - 1)] = data;
}

View File

@ -31,8 +31,8 @@ protected:
virtual void device_start() override;
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual DECLARE_WRITE8_MEMBER(write) override;
virtual uint8_t read(offs_t offset) override;
virtual void write(offs_t offset, uint8_t data) override;
};

View File

@ -42,7 +42,7 @@ void bbc_rom_device::device_start()
// read
//-------------------------------------------------
READ8_MEMBER(bbc_rom_device::read)
uint8_t bbc_rom_device::read(offs_t offset)
{
uint32_t size = std::min((int32_t)get_rom_size(), 0x4000);

View File

@ -31,7 +31,7 @@ protected:
virtual void device_start() override;
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual uint8_t read(offs_t offset) override;
};
// device type definition

View File

@ -75,7 +75,7 @@ void bbc_pmsrtc_device::device_start()
// read
//-------------------------------------------------
READ8_MEMBER(bbc_stlrtc_device::read)
uint8_t bbc_stlrtc_device::read(offs_t offset)
{
uint8_t data = get_rom_base()[offset & 0x3fff];
@ -85,7 +85,8 @@ READ8_MEMBER(bbc_stlrtc_device::read)
data = m_rtc->read(1);
break;
case 0x3e40:
m_rtc->write(0, data);
if (!machine().side_effects_disabled())
m_rtc->write(0, data);
break;
case 0x3e80:
case 0x3ec0:
@ -95,27 +96,28 @@ READ8_MEMBER(bbc_stlrtc_device::read)
case 0x3f40:
case 0x3f80:
case 0x3fc0:
m_rtc->write(1, data);
if (!machine().side_effects_disabled())
m_rtc->write(1, data);
break;
}
return data;
}
READ8_MEMBER(bbc_pmsrtc_device::read)
uint8_t bbc_pmsrtc_device::read(offs_t offset)
{
uint8_t data = get_rom_base()[offset & 0x1fff];
switch (offset)
{
case 0x00:
data |= m_rtc->read_0(space, 0);
data |= m_rtc->read_0();
break;
case 0x01:
data |= m_rtc->read_1(space, 0);
data |= m_rtc->read_1();
break;
case 0x04:
if (m_rtc->chip_enable())
data = m_rtc->read_data(space, 0) & 0x01;
data = m_rtc->read_data() & 0x01;
break;
}
return data;

View File

@ -37,7 +37,7 @@ protected:
virtual void device_start() override;
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual uint8_t read(offs_t offset) override;
private:
required_device<mc146818_device> m_rtc;
@ -59,7 +59,7 @@ protected:
virtual void device_start() override;
// device_bbc_rom_interface overrides
virtual DECLARE_READ8_MEMBER(read) override;
virtual uint8_t read(offs_t offset) override;
private:
required_device<ds1315_device> m_rtc;

View File

@ -180,10 +180,10 @@ uint32_t bbc_romslot_device::get_rom_size()
// read - rom read
//-------------------------------------------------
READ8_MEMBER(bbc_romslot_device::read)
uint8_t bbc_romslot_device::read(offs_t offset)
{
if (m_cart)
return m_cart->read(space, offset);
return m_cart->read(offset);
else
return 0xff;
}
@ -193,10 +193,10 @@ READ8_MEMBER(bbc_romslot_device::read)
// write - rom write
//-------------------------------------------------
WRITE8_MEMBER(bbc_romslot_device::write)
void bbc_romslot_device::write(offs_t offset, uint8_t data)
{
if (m_cart)
m_cart->write(space, offset, data);
m_cart->write(offset, data);
}

View File

@ -47,8 +47,8 @@ public:
virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override;
// reading and writing
virtual DECLARE_READ8_MEMBER(read);
virtual DECLARE_WRITE8_MEMBER(write);
uint8_t read(offs_t offset);
void write(offs_t offset, uint8_t data);
uint32_t get_rom_size();
uint32_t get_slot_size() const { return m_slot_size; }
@ -116,8 +116,8 @@ public:
virtual ~device_bbc_rom_interface();
// reading and writing
virtual DECLARE_READ8_MEMBER(read) { return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write) { m_device.logerror("unhandled ROM write to %04X = %02X\n", offset | 0x8000, data); }
virtual uint8_t read(offs_t offset) { return 0xff; }
virtual void write(offs_t offset, uint8_t data) { m_device.logerror("unhandled ROM write to %04X = %02X\n", offset | 0x8000, data); }
void rom_alloc(uint32_t size, const char *tag);
void ram_alloc(uint32_t size);

View File

@ -343,17 +343,17 @@ READ8_MEMBER(coco_fdc_device_base::scs_read)
case 0x38: /* FF78 */
if (real_time_clock() == rtc_type::CLOUD9)
m_ds1315->read_0(space, offset);
m_ds1315->read_0();
break;
case 0x39: /* FF79 */
if (real_time_clock() == rtc_type::CLOUD9)
m_ds1315->read_1(space, offset);
m_ds1315->read_1();
break;
case 0x3C: /* FF7C */
if (real_time_clock() == rtc_type::CLOUD9)
result = m_ds1315->read_data(space, offset);
result = m_ds1315->read_data();
break;
}
return result;

View File

@ -71,15 +71,18 @@ void cpc_smartwatch_device::device_reset()
READ8_MEMBER(cpc_smartwatch_device::rtc_w)
{
uint8_t* bank = (uint8_t*)m_bank->base();
if(offset & 1)
m_rtc->read_1(space,0);
else
m_rtc->read_0(space,0);
if (!machine().side_effects_disabled())
{
if(offset & 1)
m_rtc->read_1();
else
m_rtc->read_0();
}
return bank[offset & 1];
}
READ8_MEMBER(cpc_smartwatch_device::rtc_r)
{
uint8_t* bank = (uint8_t*)m_bank->base();
return ((bank[(offset & 1)+4]) & 0xfe) | (m_rtc->read_data(space,0) & 0x01);
return ((bank[(offset & 1)+4]) & 0xfe) | (m_rtc->read_data() & 0x01);
}

View File

@ -87,17 +87,17 @@ static const uint8_t ds1315_pattern[] =
***************************************************************************/
// automated read, does all the work the real Dallas chip does
READ8_MEMBER( ds1315_device::read )
uint8_t ds1315_device::read(offs_t offset)
{
if (m_mode == DS_SEEK_MATCHING)
{
if (offset & 1)
{
read_1(space, 0);
read_1();
}
else
{
read_0(space, 0);
read_0();
}
if (offset & 4)
@ -110,7 +110,7 @@ READ8_MEMBER( ds1315_device::read )
}
else if (m_mode == DS_CALENDAR_IO)
{
return read_data(space, offset);
return read_data();
}
return 0xff; // shouldn't happen, but compilers don't know that
@ -121,7 +121,7 @@ READ8_MEMBER( ds1315_device::read )
read_0 (actual data)
-------------------------------------------------*/
READ8_MEMBER( ds1315_device::read_0 )
uint8_t ds1315_device::read_0()
{
if (ds1315_pattern[m_count++] == 0)
{
@ -145,7 +145,7 @@ READ8_MEMBER( ds1315_device::read_0 )
read_1 (actual data)
-------------------------------------------------*/
READ8_MEMBER( ds1315_device::read_1 )
uint8_t ds1315_device::read_1()
{
if (ds1315_pattern[m_count++] == 1)
{
@ -163,7 +163,7 @@ READ8_MEMBER( ds1315_device::read_1 )
read_data
-------------------------------------------------*/
READ8_MEMBER( ds1315_device::read_data )
uint8_t ds1315_device::read_data()
{
uint8_t result;
@ -228,7 +228,7 @@ void ds1315_device::fill_raw_data()
write_data
-------------------------------------------------*/
READ8_MEMBER(ds1315_device::write_data)
uint8_t ds1315_device::write_data(offs_t offset)
{
static int write_count;
if (write_count >= 64)

View File

@ -24,12 +24,12 @@ public:
auto read_backing() { return m_backing_read.bind(); }
// this handler automates the bits 0/2 stuff
DECLARE_READ8_MEMBER(read);
uint8_t read(offs_t offset);
DECLARE_READ8_MEMBER(read_0);
DECLARE_READ8_MEMBER(read_1);
DECLARE_READ8_MEMBER(read_data);
DECLARE_READ8_MEMBER(write_data);
uint8_t read_0();
uint8_t read_1();
uint8_t read_data();
uint8_t write_data(offs_t offset);
bool chip_enable();
void chip_reset();

View File

@ -59,7 +59,7 @@ void upd7002_device::device_reset()
*****************************************************************************/
READ8_MEMBER( upd7002_device::eoc_r )
READ_LINE_MEMBER( upd7002_device::eoc_r )
{
return (m_status>>7)&0x01;
}
@ -94,7 +94,7 @@ void upd7002_device::device_timer(emu_timer &timer, device_timer_id id, int para
}
READ8_MEMBER( upd7002_device::read )
uint8_t upd7002_device::read(offs_t offset)
{
switch(offset&0x03)
{
@ -112,7 +112,7 @@ READ8_MEMBER( upd7002_device::read )
WRITE8_MEMBER( upd7002_device::write )
void upd7002_device::write(offs_t offset, uint8_t data)
{
/* logerror("write to uPD7002 $%02X = $%02X\n",offset,data); */

View File

@ -30,9 +30,9 @@ public:
template <typename... T> void set_get_analogue_callback(T &&... args) { m_get_analogue_cb = get_analogue_delegate(std::forward<T>(args)...); }
template <typename... T> void set_eoc_callback(T &&... args) { m_eoc_cb = eoc_delegate(std::forward<T>(args)...); }
DECLARE_READ8_MEMBER(eoc_r);
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
DECLARE_READ_LINE_MEMBER(eoc_r);
uint8_t read(offs_t offset);
void write(offs_t offset, uint8_t data);
protected:
// device-level overrides

View File

@ -467,7 +467,7 @@ private:
uint8_t *m_exp_ram;
int m_exp_wptr, m_exp_liveptr;
void do_io(address_space &space, int offset, bool is_iic);
void do_io(int offset, bool is_iic);
uint8_t read_floatingbus();
void update_slotrom_banks();
void lc_update(int offset, bool writing);
@ -1397,7 +1397,7 @@ void apple2e_state::cec_lcrom_update()
}
// most softswitches don't care about read vs write, so handle them here
void apple2e_state::do_io(address_space &space, int offset, bool is_iic)
void apple2e_state::do_io(int offset, bool is_iic)
{
if(machine().side_effects_disabled()) return;
@ -1724,7 +1724,7 @@ READ8_MEMBER(apple2e_state::c000_r)
return (m_video->m_dhires ? 0x00 : 0x80) | uFloatingBus7;
default:
do_io(space, offset, false);
do_io(offset, false);
break;
}
@ -1844,7 +1844,7 @@ WRITE8_MEMBER(apple2e_state::c000_w)
// card may have banked auxram; get a new bank pointer
m_aux_bank_ptr = m_auxslotdevice->get_auxbank_ptr();
}
do_io(space, offset, false); // make sure it also side-effect resets the paddles as documented
do_io(offset, false); // make sure it also side-effect resets the paddles as documented
break;
case 0x7e: // SETIOUDIS
@ -1854,7 +1854,7 @@ WRITE8_MEMBER(apple2e_state::c000_w)
m_ioudis = false; break;
default:
do_io(space, offset, false);
do_io(offset, false);
break;
}
}
@ -1977,7 +1977,7 @@ READ8_MEMBER(apple2e_state::c000_iic_r)
return (m_video->m_dhires ? 0x00 : 0x80) | uFloatingBus7;
default:
do_io(space, offset, true);
do_io(offset, true);
break;
}
@ -2115,7 +2115,7 @@ WRITE8_MEMBER(apple2e_state::c000_iic_w)
break;
default:
do_io(space, offset, true);
do_io(offset, true);
break;
}
}
@ -2333,7 +2333,7 @@ void apple2e_state::write_slot_rom(int slotbias, int offset, uint8_t data)
uint8_t apple2e_state::read_int_rom(int slotbias, int offset)
{
//return m_rom_ptr[slotbias + offset];
return m_ds1315->read(machine().dummy_space(), slotbias + offset);
return m_ds1315->read(slotbias + offset);
}
READ8_MEMBER(apple2e_state::nsc_backing_r) { return m_rom_ptr[offset]; }

View File

@ -1548,16 +1548,16 @@ WRITE8_MEMBER(rainbow_state::rtc_w)
{
case 0x00: // Write to 0xED0FE
if (m_rtc->chip_enable())
m_rtc->write_data(space, offset & 0x01); // Transfer data to DS1315 (data = offset):
m_rtc->write_data(offset & 0x01); // Transfer data to DS1315 (data = offset):
else
m_rtc->read_0(space, 0); // (RTC ACTIVATION) read magic pattern 0
m_rtc->read_0(); // (RTC ACTIVATION) read magic pattern 0
break;
case 0x01: // Write to 0xED0FF
if (m_rtc->chip_enable())
m_rtc->write_data(space, offset & 0x01); // Transfer data to DS1315 (data = offset):
m_rtc->write_data(offset & 0x01); // Transfer data to DS1315 (data = offset):
else
m_rtc->read_1(space, 0); // (RTC ACTIVATION) read magic pattern 1
m_rtc->read_1(); // (RTC ACTIVATION) read magic pattern 1
break;
}
}
@ -1576,7 +1576,7 @@ READ8_MEMBER(rainbow_state::rtc_r)
#ifdef ASSUME_RAINBOW_A_HARDWARE
case 0x00: // read time/date from 0xED000 (ClikClok for 100-A)
if (m_rtc->chip_enable())
return m_rtc->read_data(space, 0) & 0x01;
return m_rtc->read_data() & 0x01;
else
m_rtc->chip_reset();
#else
@ -1586,25 +1586,25 @@ READ8_MEMBER(rainbow_state::rtc_r)
case 0x0001: // RTC_WRITE_DATA_1 0xFC001
case 0x2001: // RTC_WRITE_DATA_1 0xFE001 (MIRROR)
m_rtc->write_data(space, offset & 0x01);
m_rtc->write_data(offset & 0x01);
break;
// Read actual time/date from ClikClok:
case 0x0004: // 0xFC004
case 0x2004: // 0xFE004 (MIRROR)
if (m_rtc->chip_enable())
return (m_rtc->read_data(space, 0) & 0x01);
return (m_rtc->read_data() & 0x01);
// (RTC ACTIVATION) read magic pattern 0
case 0x0100: // 0xFC100
case 0x2100: // 0xFE100 (MIRROR)
m_rtc->read_0(space, 0);
m_rtc->read_0();
break;
// (RTC ACTIVATION) read magic pattern 1
case 0x0101: // 0xFC101
case 0x2101: // 0xFE101 (MIRROR)
m_rtc->read_1(space, 0);
m_rtc->read_1();
break;
// RESET

View File

@ -300,7 +300,7 @@ protected:
int m_acccon_e;
int m_acccon_d;
void mc146818_set(address_space &space);
void mc146818_set();
int m_mc146818_as; // 6522 port b bit 7
int m_mc146818_ce; // 6522 port b bit 6

View File

@ -52,7 +52,7 @@ READ8_MEMBER(bbc_state::bbc_paged_r)
if (m_rom[m_swrbank] && memregion(region_tag.assign(m_rom[m_swrbank]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
{
data = m_rom[m_swrbank]->read(space, offset);
data = m_rom[m_swrbank]->read(offset);
}
else
{
@ -75,7 +75,7 @@ WRITE8_MEMBER(bbc_state::bbc_paged_w)
if (m_rom[m_swrbank] && memregion(region_tag.assign(m_rom[m_swrbank]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
{
m_rom[m_swrbank]->write(space, offset, data);
m_rom[m_swrbank]->write(offset, data);
}
else if (swramtype[m_swramtype][m_swrbank])
{
@ -156,7 +156,7 @@ READ8_MEMBER(bbc_state::bbcbp_paged_r)
{
if (m_rom[m_swrbank] && memregion(region_tag.assign(m_rom[m_swrbank]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
{
data = m_rom[m_swrbank]->read(space, offset);
data = m_rom[m_swrbank]->read(offset);
}
else
{
@ -181,7 +181,7 @@ WRITE8_MEMBER(bbc_state::bbcbp_paged_w)
{
if (m_rom[m_swrbank] && memregion(region_tag.assign(m_rom[m_swrbank]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
{
m_rom[m_swrbank]->write(space, offset, data);
m_rom[m_swrbank]->write(offset, data);
}
else if (m_ram->size() == 128 * 1024 && swram_banks[m_swrbank])
{
@ -297,7 +297,7 @@ READ8_MEMBER(bbc_state::bbcm_paged_r)
{
if (m_rom[m_swrbank] && memregion(region_tag.assign(m_rom[m_swrbank]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
{
data = m_rom[m_swrbank]->read(space, offset);
data = m_rom[m_swrbank]->read(offset);
}
else
{
@ -320,7 +320,7 @@ WRITE8_MEMBER(bbc_state::bbcm_paged_w)
{
if (m_rom[m_swrbank] && memregion(region_tag.assign(m_rom[m_swrbank]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
{
m_rom[m_swrbank]->write(space, offset, data);
m_rom[m_swrbank]->write(offset, data);
}
else if ((!m_lk19_ic37_paged_rom && (m_swrbank == 4 || m_swrbank == 5)) || (!m_lk18_ic41_paged_rom && (m_swrbank == 6 || m_swrbank == 7)))
{
@ -613,7 +613,7 @@ WRITE_LINE_MEMBER(bbc_state::shiftlock_led_w)
}
void bbc_state::mc146818_set(address_space &space)
void bbc_state::mc146818_set()
{
/* if chip enabled */
if (m_mc146818_ce)
@ -662,7 +662,7 @@ WRITE8_MEMBER(bbc_state::via_system_porta_w)
if (m_rtc)
{
mc146818_set(space);
mc146818_set();
}
}
@ -707,7 +707,7 @@ WRITE8_MEMBER(bbc_state::via_system_portb_w)
/* set Chip Enable and Address Strobe lines */
m_mc146818_ce = BIT(data, 6);
m_mc146818_as = BIT(data, 7);
mc146818_set(space);
mc146818_set();
}
/* Master Compact only */