summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/m72.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/includes/m72.h')
-rw-r--r--src/mame/includes/m72.h121
1 files changed, 59 insertions, 62 deletions
diff --git a/src/mame/includes/m72.h b/src/mame/includes/m72.h
index 50dc9fbbdf7..f49eb4f74f4 100644
--- a/src/mame/includes/m72.h
+++ b/src/mame/includes/m72.h
@@ -15,6 +15,7 @@
#include "machine/mb8421.h"
#include "machine/pic8259.h"
#include "machine/upd4701.h"
+#include "video/bufsprite.h"
#include "sound/dac.h"
#include "emupal.h"
#include "screen.h"
@@ -46,15 +47,15 @@ public:
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_spriteram(*this, "spriteram"),
- m_videoram1(*this, "videoram1"),
- m_videoram2(*this, "videoram2"),
+ m_videoram(*this, "videoram%u", 1U),
m_m82_rowscrollram(*this, "majtitle_rowscr"),
m_spriteram2(*this, "spriteram2"),
m_soundram(*this, "soundram"),
- m_generic_paletteram_16(*this, "paletteram"),
- m_generic_paletteram2_16(*this, "paletteram2"),
+ m_paletteram(*this, "paletteram%u", 1U),
m_upd71059c(*this, "upd71059c"),
m_upd4701(*this, {"upd4701l", "upd4701h"}),
+ m_samples_region(*this, "samples"),
+ m_io_dsw(*this, "DSW"),
m_fg_source(0),
m_bg_source(0),
m_m81_b_b_j3(*this, "JumperJ3"),
@@ -100,32 +101,32 @@ private:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ required_device<buffered_spriteram16_device> m_spriteram;
+
+ required_shared_ptr_array<u16, 2> m_videoram;
+ optional_shared_ptr<u16> m_m82_rowscrollram;
+ optional_shared_ptr<u16> m_spriteram2;
+ optional_shared_ptr<u8> m_soundram;
+ required_shared_ptr_array<u16, 2> m_paletteram;
- required_shared_ptr<uint16_t> m_spriteram;
- required_shared_ptr<uint16_t> m_videoram1;
- required_shared_ptr<uint16_t> m_videoram2;
- optional_shared_ptr<uint16_t> m_m82_rowscrollram;
- optional_shared_ptr<uint16_t> m_spriteram2;
- optional_shared_ptr<uint8_t> m_soundram;
- required_shared_ptr<uint16_t> m_generic_paletteram_16;
- required_shared_ptr<uint16_t> m_generic_paletteram2_16;
optional_device<pic8259_device> m_upd71059c;
optional_device_array<upd4701_device, 2> m_upd4701;
- std::unique_ptr<uint16_t[]> m_protection_ram;
+ optional_region_ptr<u8> m_samples_region;
+
+ optional_ioport m_io_dsw;
+
+ std::unique_ptr<u16[]> m_protection_ram;
emu_timer *m_scanline_timer;
- const uint8_t *m_protection_code;
- const uint8_t *m_protection_crc;
- uint32_t m_raster_irq_position;
- std::unique_ptr<uint16_t[]> m_buffered_spriteram;
+ const u8 *m_protection_code;
+ const u8 *m_protection_crc;
+ u32 m_raster_irq_position;
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap;
tilemap_t *m_bg_tilemap_large;
- int32_t m_scrollx1;
- int32_t m_scrolly1;
- int32_t m_scrollx2;
- int32_t m_scrolly2;
- int32_t m_video_off;
+ s32 m_scrollx[2];
+ s32 m_scrolly[2];
+ s32 m_video_off;
int m_fg_source;
int m_bg_source;
@@ -133,39 +134,36 @@ private:
// majtitle specific
int m_m82_rowscroll;
- uint16_t m_m82_tmcontrol;
+ u16 m_m82_tmcontrol;
// m72_i8751 specific
- uint8_t m_mcu_sample_latch;
- uint32_t m_mcu_sample_addr;
+ u8 m_mcu_sample_latch;
+ u32 m_mcu_sample_addr;
// common
- DECLARE_READ16_MEMBER(palette1_r);
- DECLARE_READ16_MEMBER(palette2_r);
- DECLARE_WRITE16_MEMBER(palette1_w);
- DECLARE_WRITE16_MEMBER(palette2_w);
- DECLARE_WRITE16_MEMBER(videoram1_w);
- DECLARE_WRITE16_MEMBER(videoram2_w);
- DECLARE_READ16_MEMBER(soundram_r);
- DECLARE_WRITE16_MEMBER(soundram_w);
+ template<unsigned N> u16 palette_r(offs_t offset);
+ template<unsigned N> void palette_w(offs_t offset, u16 data, u16 mem_mask);
+ void videoram1_w(offs_t offset, u16 data, u16 mem_mask);
+ void videoram2_w(offs_t offset, u16 data, u16 mem_mask);
+ void irq_line_w(u16 data);
+ template<unsigned N> void scrollx_w(offs_t offset, u16 data, u16 mem_mask);
+ template<unsigned N> void scrolly_w(offs_t offset, u16 data, u16 mem_mask);
+ void dmaon_w(u8 data);
+ void port02_w(u8 data);
+ u8 soundram_r(offs_t offset);
+ void soundram_w(offs_t offset, u8 data);
// m72_i8751 specific
DECLARE_WRITE16_MEMBER(main_mcu_sound_w);
- DECLARE_WRITE16_MEMBER(main_mcu_w);
- DECLARE_WRITE8_MEMBER(mcu_data_w);
- DECLARE_READ8_MEMBER(mcu_data_r);
- DECLARE_READ8_MEMBER(mcu_sample_r);
- DECLARE_WRITE8_MEMBER(mcu_port1_w);
- DECLARE_WRITE8_MEMBER(mcu_low_w);
- DECLARE_WRITE8_MEMBER(mcu_high_w);
- DECLARE_READ8_MEMBER(snd_cpu_sample_r);
- DECLARE_WRITE16_MEMBER(irq_line_w);
- DECLARE_WRITE16_MEMBER(scrollx1_w);
- DECLARE_WRITE16_MEMBER(scrollx2_w);
- DECLARE_WRITE16_MEMBER(scrolly1_w);
- DECLARE_WRITE16_MEMBER(scrolly2_w);
- DECLARE_WRITE16_MEMBER(dmaon_w);
- DECLARE_WRITE8_MEMBER(port02_w);
+ void main_mcu_w(offs_t offset, u16 data, u16 mem_mask);
+ void mcu_data_w(offs_t offset, u8 data);
+ u8 mcu_data_r(offs_t offset);
+ u8 mcu_sample_r();
+ void mcu_port1_w(u8 data);
+ void mcu_low_w(u8 data);
+ void mcu_high_w(u8 data);
+ u8 snd_cpu_sample_r();
+
DECLARE_READ16_MEMBER(protection_r);
DECLARE_WRITE16_MEMBER(protection_w);
@@ -178,16 +176,15 @@ private:
DECLARE_WRITE16_MEMBER(airduelm72_sample_trigger_w);
DECLARE_WRITE16_MEMBER(dkgenm72_sample_trigger_w);
DECLARE_WRITE16_MEMBER(gallop_sample_trigger_w);
- DECLARE_WRITE8_MEMBER(rtype2_port02_w);
- DECLARE_WRITE8_MEMBER(poundfor_port02_w);
- DECLARE_WRITE16_MEMBER(m82_gfx_ctrl_w);
- DECLARE_WRITE16_MEMBER(m82_tm_ctrl_w);
+ void rtype2_port02_w(u8 data);
+ void poundfor_port02_w(u8 data);
+ void m82_gfx_ctrl_w(offs_t offset, u16 data, u16 mem_mask);
+ void m82_tm_ctrl_w(offs_t offset, u16 data, u16 mem_mask);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
- TILE_GET_INFO_MEMBER(rtype2_get_bg_tile_info);
- TILE_GET_INFO_MEMBER(rtype2_get_fg_tile_info);
+ template<unsigned N> TILE_GET_INFO_MEMBER(rtype2_get_tile_info);
TILEMAP_MAPPER_MEMBER(m82_scan_rows);
@@ -210,17 +207,16 @@ private:
TIMER_CALLBACK_MEMBER(delayed_ram16_w);
TIMER_CALLBACK_MEMBER(delayed_ram8_w);
- uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_m81(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_m82(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- inline void m72_m81_get_tile_info(tile_data &tileinfo,int tile_index,const uint16_t *vram,int gfxnum);
- inline void m82_m84_get_tile_info(tile_data &tileinfo,int tile_index,const uint16_t *vram,int gfxnum);
+ u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ u32 screen_update_m81(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ u32 screen_update_m82(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ inline void m72_m81_get_tile_info(tile_data &tileinfo,int tile_index,const u16 *vram,int gfxnum);
void register_savestate();
- inline void changecolor(int color,int r,int g,int b);
+ inline void changecolor(offs_t color, u8 r, u8 g, u8 b);
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
void majtitle_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
- void copy_le(uint16_t *dest, const uint8_t *src, uint8_t bytes);
- void install_protection_handler(const uint8_t *code,const uint8_t *crc);
+ void copy_le(u16 *dest, const u8 *src, u8 bytes);
+ void install_protection_handler(const u8 *code,const u8 *crc);
void dbreed_map(address_map &map);
void dbreedm72_map(address_map &map);
@@ -248,6 +244,7 @@ private:
void rtype_map(address_map &map);
void rtype_sound_portmap(address_map &map);
void sound_portmap(address_map &map);
+ void sound_protected_portmap(address_map &map);
void sound_ram_map(address_map &map);
void sound_rom_map(address_map &map);
void xmultipl_map(address_map &map);