summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/irobot.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/includes/irobot.h')
-rw-r--r--src/mame/includes/irobot.h115
1 files changed, 64 insertions, 51 deletions
diff --git a/src/mame/includes/irobot.h b/src/mame/includes/irobot.h
index ffda13271ff..a4560f42dc7 100644
--- a/src/mame/includes/irobot.h
+++ b/src/mame/includes/irobot.h
@@ -5,39 +5,81 @@
Atari I, Robot hardware
*************************************************************************/
+#ifndef MAME_INCLUDES_IROBOT_H
+#define MAME_INCLUDES_IROBOT_H
+
+#pragma once
#include "machine/timer.h"
#include "screen.h"
#define IR_TIMING 1 /* try to emulate MB and VG running time */
-struct irmb_ops
-{
- const struct irmb_ops *nxtop;
- uint32_t func;
- uint32_t diradd;
- uint32_t latchmask;
- uint32_t *areg;
- uint32_t *breg;
- uint8_t cycles;
- uint8_t diren;
- uint8_t flags;
- uint8_t ramsel;
-};
-
-
class irobot_state : public driver_device
{
public:
- irobot_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_nvram(*this, "nvram") ,
+ struct irmb_ops
+ {
+ const struct irmb_ops *nxtop;
+ uint32_t func;
+ uint32_t diradd;
+ uint32_t latchmask;
+ uint32_t *areg;
+ uint32_t *breg;
+ uint8_t cycles;
+ uint8_t diren;
+ uint8_t flags;
+ uint8_t ramsel;
+ };
+
+ irobot_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
+ m_nvram(*this, "nvram") ,
m_videoram(*this, "videoram"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette")
+ { }
+
+ DECLARE_DRIVER_INIT(irobot);
+
+ void irobot(machine_config &config);
+
+protected:
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+ void irobot_map(address_map &map);
+
+ DECLARE_WRITE8_MEMBER(irobot_nvram_w);
+ DECLARE_WRITE8_MEMBER(irobot_clearirq_w);
+ DECLARE_WRITE8_MEMBER(irobot_clearfirq_w);
+ DECLARE_READ8_MEMBER(irobot_sharedmem_r);
+ DECLARE_WRITE8_MEMBER(irobot_sharedmem_w);
+ DECLARE_WRITE8_MEMBER(irobot_statwr_w);
+ DECLARE_WRITE8_MEMBER(irobot_out0_w);
+ DECLARE_WRITE8_MEMBER(irobot_rom_banksel_w);
+ DECLARE_WRITE8_MEMBER(irobot_control_w);
+ DECLARE_READ8_MEMBER(irobot_control_r);
+ DECLARE_READ8_MEMBER(irobot_status_r);
+ DECLARE_WRITE8_MEMBER(irobot_paletteram_w);
+ DECLARE_READ8_MEMBER(quad_pokeyn_r);
+ DECLARE_WRITE8_MEMBER(quad_pokeyn_w);
+ DECLARE_PALETTE_INIT(irobot);
+ uint32_t screen_update_irobot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_CALLBACK_MEMBER(scanline_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(irobot_irvg_done_callback);
+ TIMER_DEVICE_CALLBACK_MEMBER(irobot_irmb_done_callback);
+ void irobot_poly_clear(uint8_t *bitmap_base);
+ void irobot_poly_clear();
+ void draw_line(uint8_t *polybitmap, int x1, int y1, int x2, int y2, int col);
+ void irobot_run_video();
+ uint32_t irmb_din(const irmb_ops *curop);
+ void irmb_dout(const irmb_ops *curop, uint32_t d);
+ void load_oproms();
+ void irmb_run();
+private:
required_shared_ptr<uint8_t> m_nvram;
required_shared_ptr<uint8_t> m_videoram;
uint8_t m_vg_clear;
@@ -70,40 +112,11 @@ public:
int m_ir_ymin;
int m_ir_xmax;
int m_ir_ymax;
- DECLARE_WRITE8_MEMBER(irobot_nvram_w);
- DECLARE_WRITE8_MEMBER(irobot_clearirq_w);
- DECLARE_WRITE8_MEMBER(irobot_clearfirq_w);
- DECLARE_READ8_MEMBER(irobot_sharedmem_r);
- DECLARE_WRITE8_MEMBER(irobot_sharedmem_w);
- DECLARE_WRITE8_MEMBER(irobot_statwr_w);
- DECLARE_WRITE8_MEMBER(irobot_out0_w);
- DECLARE_WRITE8_MEMBER(irobot_rom_banksel_w);
- DECLARE_WRITE8_MEMBER(irobot_control_w);
- DECLARE_READ8_MEMBER(irobot_control_r);
- DECLARE_READ8_MEMBER(irobot_status_r);
- DECLARE_WRITE8_MEMBER(irobot_paletteram_w);
- DECLARE_READ8_MEMBER(quad_pokeyn_r);
- DECLARE_WRITE8_MEMBER(quad_pokeyn_w);
- DECLARE_DRIVER_INIT(irobot);
- virtual void machine_reset() override;
- virtual void video_start() override;
- DECLARE_PALETTE_INIT(irobot);
- uint32_t screen_update_irobot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_CALLBACK_MEMBER(scanline_callback);
- TIMER_DEVICE_CALLBACK_MEMBER(irobot_irvg_done_callback);
- TIMER_DEVICE_CALLBACK_MEMBER(irobot_irmb_done_callback);
- void _irobot_poly_clear(uint8_t *bitmap_base);
- void irobot_poly_clear();
- void draw_line(uint8_t *polybitmap, int x1, int y1, int x2, int y2, int col);
- void irobot_run_video();
- uint32_t irmb_din(const irmb_ops *curop);
- void irmb_dout(const irmb_ops *curop, uint32_t d);
- void load_oproms();
- void irmb_run();
+
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
- void irobot(machine_config &config);
- void irobot_map(address_map &map);
};
+
+#endif // MAME_INCLUDES_IROBOT_H