summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/ym3802.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/ym3802.h')
-rw-r--r--src/devices/machine/ym3802.h28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/devices/machine/ym3802.h b/src/devices/machine/ym3802.h
index 31301fab4f1..3d6334f2d4c 100644
--- a/src/devices/machine/ym3802.h
+++ b/src/devices/machine/ym3802.h
@@ -3,7 +3,10 @@
/*
* ym3802.h - Yamaha YM3802/YM3523 MCS MIDI Communication and Service Controller
*
- * * Registers:
+ * CLK input - anywhere from 1MHz up to 4MHz
+ * CLKM input - usually either 1MHz or 0.5MHz, or CLKF input - usually 614.4kHz
+ *
+ * Registers:
* reg0 : IVR (read-only)
* reg1 : RGR (bit 8 = reset, bits 0-3 = register bank select)
* reg2 : ISR (read-only)
@@ -26,22 +29,21 @@
class ym3802_device : public device_t, public device_serial_interface
{
public:
- // construction/destruction
+ // construction/destruction
ym3802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration helpers
auto irq_handler() { return m_irq_handler.bind(); }
auto txd_handler() { return m_txd_handler.bind(); }
- DECLARE_READ8_MEMBER(read);
- DECLARE_WRITE8_MEMBER(write);
+ uint8_t read(offs_t offset);
+ void write(offs_t offset, uint8_t data);
uint8_t vector() { return m_vector; }
protected:
- virtual void device_start() override;
- virtual void device_reset() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+ virtual void device_start() override ATTR_COLD;
+ virtual void device_reset() override ATTR_COLD;
private:
enum
@@ -118,15 +120,8 @@ private:
IRQ_GENERAL_TIMER = 0x80
};
- enum
- {
- TIMER_SYSTEM_CLOCK = 0x200, // CLK input - anywhere from 1MHz up to 4MHz
- TIMER_TX_CLOCK,
- TIMER_MIDI_CLOCK // CLKM input - usually either 1MHz or 0.5MHz, or CLKF input - usually 614.4kHz
- };
-
- void transmit_clk();
- void midi_clk();
+ TIMER_CALLBACK_MEMBER(transmit_clk);
+ TIMER_CALLBACK_MEMBER(midi_clk);
void reset_midi_timer();
void set_comms_mode();
void set_irq(uint8_t irq);
@@ -135,7 +130,6 @@ private:
devcb_write_line m_irq_handler;
devcb_write_line m_txd_handler;
devcb_read_line m_rxd_handler;
- emu_timer* m_clock_timer;
emu_timer* m_midi_timer;
emu_timer* m_midi_counter_timer;