summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/m72.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/m72.cpp')
-rw-r--r--src/mame/video/m72.cpp303
1 files changed, 99 insertions, 204 deletions
diff --git a/src/mame/video/m72.cpp b/src/mame/video/m72.cpp
index 6cc92c031c6..888144f09cc 100644
--- a/src/mame/video/m72.cpp
+++ b/src/mame/video/m72.cpp
@@ -10,9 +10,9 @@
***************************************************************************/
-inline void m72_state::m72_m81_get_tile_info(tile_data &tileinfo,int tile_index,const uint16_t *vram,int gfxnum)
+inline void m72_state::m72_m81_get_tile_info(tile_data &tileinfo,int tile_index,const u16 *vram,int gfxnum)
{
- int code,attr,color,pri;
+ int pri;
// word 0 word 1
// fftt tttt tttt tttt ---- ---- zz-? pppp
@@ -22,76 +22,62 @@ inline void m72_state::m72_m81_get_tile_info(tile_data &tileinfo,int tile_index,
tile_index *= 2;
- code = vram[tile_index] & 0xff;
- attr = vram[tile_index] >> 8;
- color = vram[tile_index+1] & 0xff;
+ const u16 code = vram[tile_index];
+ const u16 attr = vram[tile_index+1];
- if (color & 0x80) pri = 2;
- else if (color & 0x40) pri = 1;
+ if (attr & 0x0080) pri = 2;
+ else if (attr & 0x0040) pri = 1;
else pri = 0;
-/* color & 0x10 is used in bchopper and hharry, more priority? */
+/* attr & 0x0010 is used in bchopper and hharry, more priority? */
SET_TILE_INFO_MEMBER(gfxnum,
- code + ((attr & 0x3f) << 8),
- color & 0x0f,
- TILE_FLIPYX((attr & 0xc0) >> 6));
+ code & 0x3fff,
+ attr & 0x000f,
+ TILE_FLIPYX((code & 0xc000) >> 14));
tileinfo.group = pri;
}
-inline void m72_state::m82_m84_get_tile_info(tile_data &tileinfo,int tile_index,const uint16_t *vram,int gfxnum)
+
+TILE_GET_INFO_MEMBER(m72_state::get_bg_tile_info)
+{
+ m72_m81_get_tile_info(tileinfo,tile_index,m_videoram[1],m_bg_source);
+}
+
+TILE_GET_INFO_MEMBER(m72_state::get_fg_tile_info)
+{
+ m72_m81_get_tile_info(tileinfo,tile_index,m_videoram[0],m_fg_source);
+}
+
+template<unsigned N>
+TILE_GET_INFO_MEMBER(m72_state::rtype2_get_tile_info)
{
- int code,attr,color,pri;
+ int pri;
// word 0 word 1
// tttt tttt tttt tttt ---- ---z zff- pppp
// f = flips, t = tilenum, z = pri, p = palette
-
tile_index *= 2;
- code = vram[tile_index];
- color = vram[tile_index+1] & 0xff;
- attr = vram[tile_index+1] >> 8;
+ const u16 code = m_videoram[N][tile_index];
+ const u16 attr = m_videoram[N][tile_index+1];
- if (attr & 0x01) pri = 2;
- else if (color & 0x80) pri = 1;
+ if (attr & 0x0100) pri = 2;
+ else if (attr & 0x0080) pri = 1;
else pri = 0;
-/* (vram[tile_index+2] & 0x10) is used by majtitle on the green, but it's not clear for what */
-/* (vram[tile_index+3] & 0xfe) are used as well */
+/* (m_videoram[N][tile_index+2] & 0x10) is used by majtitle on the green, but it's not clear for what */
+/* (m_videoram[N][tile_index+3] & 0xfe) are used as well */
- SET_TILE_INFO_MEMBER(gfxnum,
+ SET_TILE_INFO_MEMBER(1,
code,
- color & 0x0f,
- TILE_FLIPYX((color & 0x60) >> 5));
+ attr & 0x000f,
+ TILE_FLIPYX((attr & 0x0060) >> 5));
tileinfo.group = pri;
}
-TILE_GET_INFO_MEMBER(m72_state::get_bg_tile_info)
-{
- m72_m81_get_tile_info(tileinfo,tile_index,m_videoram2,m_bg_source);
-}
-
-TILE_GET_INFO_MEMBER(m72_state::get_fg_tile_info)
-{
- m72_m81_get_tile_info(tileinfo,tile_index,m_videoram1,m_fg_source);
-}
-
-TILE_GET_INFO_MEMBER(m72_state::rtype2_get_bg_tile_info)
-{
- m82_m84_get_tile_info(tileinfo,tile_index,m_videoram2,1);
-}
-
-TILE_GET_INFO_MEMBER(m72_state::rtype2_get_fg_tile_info)
-{
- m82_m84_get_tile_info(tileinfo,tile_index,m_videoram1,1);
-}
-
-
-
-
/***************************************************************************
Start the video hardware emulation.
@@ -102,11 +88,8 @@ void m72_state::register_savestate()
{
save_item(NAME(m_raster_irq_position));
save_item(NAME(m_video_off));
- save_item(NAME(m_scrollx1));
- save_item(NAME(m_scrolly1));
- save_item(NAME(m_scrollx2));
- save_item(NAME(m_scrolly2));
- save_pointer(NAME(m_buffered_spriteram), m_spriteram.bytes()/2);
+ save_item(NAME(m_scrollx));
+ save_item(NAME(m_scrolly));
}
@@ -115,8 +98,6 @@ VIDEO_START_MEMBER(m72_state,m72)
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
- m_buffered_spriteram = std::make_unique<uint16_t[]>(m_spriteram.bytes()/2);
-
m_fg_tilemap->set_transmask(0,0xffff,0x0001);
m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
m_fg_tilemap->set_transmask(2,0x0001,0xffff);
@@ -129,7 +110,7 @@ VIDEO_START_MEMBER(m72_state,m72)
//m_bg_tilemap->set_transmask(2,0x001f,0xffe0); // needed for nspiritj japan warning to look correct
// not sure what is needed to be able to see the imgfghto warning message
- memset(m_buffered_spriteram.get(),0,m_spriteram.bytes());
+ memset(m_spriteram->buffer(),0,m_spriteram->bytes());
m_fg_tilemap->set_scrolldx(0,0);
m_fg_tilemap->set_scrolldy(-128,-128);
@@ -183,11 +164,11 @@ TILEMAP_MAPPER_MEMBER(m72_state::m82_scan_rows)
VIDEO_START_MEMBER(m72_state,m82)
{
- m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
- m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_tile_info<0>),this),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_tile_info<1>),this),TILEMAP_SCAN_ROWS,8,8,64,64);
// The tilemap can be 256x64, but seems to be used at 128x64 (scroll wraparound).
// The layout ramains 256x64, the right half is just not displayed.
- m_bg_tilemap_large = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_bg_tile_info),this),tilemap_mapper_delegate(FUNC(m72_state::m82_scan_rows),this),8,8,128,64);
+ m_bg_tilemap_large = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_tile_info<1>),this),tilemap_mapper_delegate(FUNC(m72_state::m82_scan_rows),this),8,8,128,64);
m_fg_tilemap->set_transmask(0,0xffff,0x0001);
m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
@@ -210,8 +191,7 @@ VIDEO_START_MEMBER(m72_state,m82)
m_bg_tilemap_large->set_scrolldx(4,0);
m_bg_tilemap_large->set_scrolldy(-128,-128);
- m_buffered_spriteram = std::make_unique<uint16_t[]>(m_spriteram.bytes()/2);
- memset(m_buffered_spriteram.get(),0,m_spriteram.bytes());
+ memset(m_spriteram->buffer(),0,m_spriteram->bytes());
register_savestate();
save_item(NAME(m_m82_rowscroll));
@@ -222,10 +202,8 @@ VIDEO_START_MEMBER(m72_state,m82)
// M84
VIDEO_START_MEMBER(m72_state,rtype2)
{
- m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
- m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
-
- m_buffered_spriteram = std::make_unique<uint16_t[]>(m_spriteram.bytes()/2);
+ m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_tile_info<1>),this),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_tile_info<0>),this),TILEMAP_SCAN_ROWS,8,8,64,64);
m_fg_tilemap->set_transmask(0,0xffff,0x0001);
m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
@@ -235,7 +213,7 @@ VIDEO_START_MEMBER(m72_state,rtype2)
m_bg_tilemap->set_transmask(1,0x00ff,0xff00);
m_bg_tilemap->set_transmask(2,0x0001,0xfffe);
- memset(m_buffered_spriteram.get(),0,m_spriteram.bytes());
+ memset(m_spriteram->buffer(),0,m_spriteram->bytes());
m_fg_tilemap->set_scrolldx(4,0);
m_fg_tilemap->set_scrolldy(-128,16);
@@ -276,62 +254,15 @@ VIDEO_START_MEMBER(m72_state,poundfor)
***************************************************************************/
-READ16_MEMBER(m72_state::palette1_r)
-{
- /* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */
- offset &= ~0x100;
-
- return m_generic_paletteram_16[offset] | 0xffe0; /* only D0-D4 are connected */
-}
-
-READ16_MEMBER(m72_state::palette2_r)
+void m72_state::videoram1_w(offs_t offset, u16 data, u16 mem_mask)
{
- /* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */
- offset &= ~0x100;
-
- return m_generic_paletteram2_16[offset] | 0xffe0; /* only D0-D4 are connected */
-}
-
-inline void m72_state::changecolor(int color,int r,int g,int b)
-{
- m_palette->set_pen_color(color,pal5bit(r),pal5bit(g),pal5bit(b));
-}
-
-WRITE16_MEMBER(m72_state::palette1_w)
-{
- /* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */
- offset &= ~0x100;
-
- COMBINE_DATA(&m_generic_paletteram_16[offset]);
- offset &= 0x0ff;
- changecolor(offset,
- m_generic_paletteram_16[offset + 0x000],
- m_generic_paletteram_16[offset + 0x200],
- m_generic_paletteram_16[offset + 0x400]);
-}
-
-WRITE16_MEMBER(m72_state::palette2_w)
-{
- /* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */
- offset &= ~0x100;
-
- COMBINE_DATA(&m_generic_paletteram2_16[offset]);
- offset &= 0x0ff;
- changecolor(offset + 256,
- m_generic_paletteram2_16[offset + 0x000],
- m_generic_paletteram2_16[offset + 0x200],
- m_generic_paletteram2_16[offset + 0x400]);
-}
-
-WRITE16_MEMBER(m72_state::videoram1_w)
-{
- COMBINE_DATA(&m_videoram1[offset]);
+ COMBINE_DATA(&m_videoram[0][offset]);
m_fg_tilemap->mark_tile_dirty(offset/2);
}
-WRITE16_MEMBER(m72_state::videoram2_w)
+void m72_state::videoram2_w(offs_t offset, u16 data, u16 mem_mask)
{
- COMBINE_DATA(&m_videoram2[offset]);
+ COMBINE_DATA(&m_videoram[1][offset]);
m_bg_tilemap->mark_tile_dirty(offset/2);
// m82 has selectable tilemap size
@@ -340,7 +271,7 @@ WRITE16_MEMBER(m72_state::videoram2_w)
}
-WRITE16_MEMBER(m72_state::irq_line_w)
+void m72_state::irq_line_w(u16 data)
{
// KNA70H015(11): ISET
m_raster_irq_position = data & 0x1ff;
@@ -353,38 +284,13 @@ WRITE16_MEMBER(m72_state::irq_line_w)
m_maincpu->set_input_line(NEC_INPUT_LINE_INTP2, CLEAR_LINE);
}
-WRITE16_MEMBER(m72_state::scrollx1_w)
+void m72_state::dmaon_w(u8 data)
{
- m_screen->update_partial(m_screen->vpos());
- COMBINE_DATA(&m_scrollx1);
+ m_spriteram->copy();
}
-WRITE16_MEMBER(m72_state::scrollx2_w)
-{
- m_screen->update_partial(m_screen->vpos());
- COMBINE_DATA(&m_scrollx2);
-}
-WRITE16_MEMBER(m72_state::scrolly1_w)
-{
- m_screen->update_partial(m_screen->vpos());
- COMBINE_DATA(&m_scrolly1);
-}
-
-WRITE16_MEMBER(m72_state::scrolly2_w)
-{
- m_screen->update_partial(m_screen->vpos());
- COMBINE_DATA(&m_scrolly2);
-}
-
-WRITE16_MEMBER(m72_state::dmaon_w)
-{
- if (ACCESSING_BITS_0_7)
- memcpy(m_buffered_spriteram.get(), m_spriteram, m_spriteram.bytes());
-}
-
-
-WRITE8_MEMBER(m72_state::port02_w)
+void m72_state::port02_w(u8 data)
{
if (data & 0xe0) logerror("write %02x to port 02\n",data);
@@ -393,7 +299,7 @@ WRITE8_MEMBER(m72_state::port02_w)
machine().bookkeeping().coin_counter_w(1,data & 0x02);
/* bit 2 is flip screen (handled both by software and hardware) */
- flip_screen_set(((data & 0x04) >> 2) ^ ((~ioport("DSW")->read() >> 8) & 1));
+ flip_screen_set(((data & 0x04) >> 2) ^ ((~m_io_dsw->read() >> 8) & 1));
/* bit 3 is display disable */
m_video_off = data & 0x08;
@@ -407,7 +313,7 @@ WRITE8_MEMBER(m72_state::port02_w)
/* bit 5 = "bank"? */
}
-WRITE8_MEMBER(m72_state::rtype2_port02_w)
+void m72_state::rtype2_port02_w(u8 data)
{
if (data & 0xe0) logerror("write %02x to port 02\n",data);
@@ -416,7 +322,7 @@ WRITE8_MEMBER(m72_state::rtype2_port02_w)
machine().bookkeeping().coin_counter_w(1,data & 0x02);
/* bit 2 is flip screen (handled both by software and hardware) */
- flip_screen_set(((data & 0x04) >> 2) ^ ((~ioport("DSW")->read() >> 8) & 1));
+ flip_screen_set(((data & 0x04) >> 2) ^ ((~m_io_dsw->read() >> 8) & 1));
/* bit 3 is display disable */
m_video_off = data & 0x08;
@@ -424,7 +330,7 @@ WRITE8_MEMBER(m72_state::rtype2_port02_w)
/* other bits unknown */
}
-WRITE8_MEMBER(m72_state::poundfor_port02_w)
+void m72_state::poundfor_port02_w(u8 data)
{
// bit 5 resets both uPD4701A?
m_upd4701[0]->resetx_w(BIT(data, 5));
@@ -432,13 +338,13 @@ WRITE8_MEMBER(m72_state::poundfor_port02_w)
m_upd4701[1]->resetx_w(BIT(data, 5));
m_upd4701[1]->resety_w(BIT(data, 5));
- rtype2_port02_w(space, 0, data & 0xbf);
+ rtype2_port02_w(data & 0xbf);
}
/* the following is mostly a kludge. This register seems to be used for something else */
-WRITE16_MEMBER(m72_state::m82_gfx_ctrl_w)
+void m72_state::m82_gfx_ctrl_w(offs_t offset, u16 data, u16 mem_mask)
{
if (ACCESSING_BITS_8_15)
{
@@ -449,7 +355,7 @@ WRITE16_MEMBER(m72_state::m82_gfx_ctrl_w)
}
-WRITE16_MEMBER(m72_state::m82_tm_ctrl_w)
+void m72_state::m82_tm_ctrl_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_m82_tmcontrol);
// printf("tmcontrol %04x\n", m_m82_tmcontrol);
@@ -464,24 +370,20 @@ WRITE16_MEMBER(m72_state::m82_tm_ctrl_w)
void m72_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- uint16_t *spriteram = m_buffered_spriteram.get();
- int offs;
+ u16 *spriteram = m_spriteram->buffer();
+ int offs = 0;
- offs = 0;
- while (offs < m_spriteram.bytes()/2)
+ while (offs < m_spriteram->bytes()/2)
{
- int code,color,sx,sy,flipx,flipy,w,h,x,y;
-
-
- code = spriteram[offs+1];
- color = spriteram[offs+2] & 0x0f;
- sx = -256+(spriteram[offs+3] & 0x3ff);
- sy = 384-(spriteram[offs+0] & 0x1ff);
- flipx = spriteram[offs+2] & 0x0800;
- flipy = spriteram[offs+2] & 0x0400;
-
- w = 1 << ((spriteram[offs+2] & 0xc000) >> 14);
- h = 1 << ((spriteram[offs+2] & 0x3000) >> 12);
+ const int code = spriteram[offs+1];
+ const u32 color = spriteram[offs+2] & 0x0f;
+ int sx = -256+(spriteram[offs+3] & 0x3ff);
+ int sy = 384-(spriteram[offs+0] & 0x1ff);
+ int flipx = spriteram[offs+2] & 0x0800;
+ int flipy = spriteram[offs+2] & 0x0400;
+
+ const int w = 1 << ((spriteram[offs+2] & 0xc000) >> 14);
+ const int h = 1 << ((spriteram[offs+2] & 0x3000) >> 12);
sy -= 16 * h;
if (flip_screen())
@@ -492,9 +394,9 @@ void m72_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
flipy = !flipy;
}
- for (x = 0;x < w;x++)
+ for (int x = 0; x < w; x++)
{
- for (y = 0;y < h;y++)
+ for (int y = 0; y < h; y++)
{
int c = code;
@@ -517,23 +419,19 @@ void m72_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
void m72_state::majtitle_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- uint16_t *spriteram16_2 = m_spriteram2;
- int offs;
+ u16 *spriteram16_2 = m_spriteram2;
- for (offs = 0;offs < m_spriteram.bytes();offs += 4)
+ for (int offs = 0; offs < m_spriteram2.bytes(); offs += 4)
{
- int code,color,sx,sy,flipx,flipy,w,h,x,y;
-
-
- code = spriteram16_2[offs+1];
- color = spriteram16_2[offs+2] & 0x0f;
- sx = -256+(spriteram16_2[offs+3] & 0x3ff);
- sy = 384-(spriteram16_2[offs+0] & 0x1ff);
- flipx = spriteram16_2[offs+2] & 0x0800;
- flipy = spriteram16_2[offs+2] & 0x0400;
-
- w = 1;// << ((spriteram16_2[offs+2] & 0xc000) >> 14);
- h = 1 << ((spriteram16_2[offs+2] & 0x3000) >> 12);
+ const int code = spriteram16_2[offs+1];
+ const u32 color = spriteram16_2[offs+2] & 0x0f;
+ int sx = -256+(spriteram16_2[offs+3] & 0x3ff);
+ int sy = 384-(spriteram16_2[offs+0] & 0x1ff);
+ int flipx = spriteram16_2[offs+2] & 0x0800;
+ int flipy = spriteram16_2[offs+2] & 0x0400;
+
+ const int w = 1;// << ((spriteram16_2[offs+2] & 0xc000) >> 14);
+ const int h = 1 << ((spriteram16_2[offs+2] & 0x3000) >> 12);
sy -= 16 * h;
if (flip_screen())
@@ -544,9 +442,9 @@ void m72_state::majtitle_draw_sprites(bitmap_ind16 &bitmap,const rectangle &clip
flipy = !flipy;
}
- for (x = 0;x < w;x++)
+ for (int x = 0; x < w; x++)
{
- for (y = 0;y < h;y++)
+ for (int y = 0; y < h; y++)
{
int c = code;
@@ -565,7 +463,7 @@ void m72_state::majtitle_draw_sprites(bitmap_ind16 &bitmap,const rectangle &clip
}
}
-uint32_t m72_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 m72_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
if (m_video_off)
{
@@ -573,11 +471,11 @@ uint32_t m72_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
return 0;
}
- m_fg_tilemap->set_scrollx(0,m_scrollx1);
- m_fg_tilemap->set_scrolly(0,m_scrolly1);
+ m_fg_tilemap->set_scrollx(0,m_scrollx[0]);
+ m_fg_tilemap->set_scrolly(0,m_scrolly[0]);
- m_bg_tilemap->set_scrollx(0,m_scrollx2);
- m_bg_tilemap->set_scrolly(0,m_scrolly2);
+ m_bg_tilemap->set_scrollx(0,m_scrollx[1]);
+ m_bg_tilemap->set_scrolly(0,m_scrolly[1]);
m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
@@ -587,11 +485,11 @@ uint32_t m72_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
return 0;
}
-uint32_t m72_state::screen_update_m81(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 m72_state::screen_update_m81(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// on M81 the FG data always comes from the Ax roms
// the source of the BG data however depends on Jumper J3
- int J3 = m_m81_b_b_j3->read();
+ const int J3 = m_m81_b_b_j3->read();
if (J3 == 0) m_bg_source = 1;
else m_bg_source = 2;
@@ -599,39 +497,36 @@ uint32_t m72_state::screen_update_m81(screen_device &screen, bitmap_ind16 &bitma
}
-uint32_t m72_state::screen_update_m82(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 m72_state::screen_update_m82(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- int i;
-
tilemap_t* tm;
if (m_m82_tmcontrol & 0x40) tm = m_bg_tilemap_large;
else tm = m_bg_tilemap;
-
if (m_video_off)
{
bitmap.fill(m_palette->black_pen(), cliprect);
return 0;
}
- m_fg_tilemap->set_scrollx(0,m_scrollx1);
- m_fg_tilemap->set_scrolly(0,m_scrolly1);
+ m_fg_tilemap->set_scrollx(0,m_scrollx[0]);
+ m_fg_tilemap->set_scrolly(0,m_scrolly[0]);
if (m_m82_rowscroll)
{
tm->set_scroll_rows(512);
- for (i = 0;i < 512;i++)
- tm->set_scrollx((i+m_scrolly2)&0x1ff,
+ for (int i = 0; i < 512; i++)
+ tm->set_scrollx((i+m_scrolly[1])&0x1ff,
256 + m_m82_rowscrollram[i]);
}
else
{
tm->set_scroll_rows(1);
- tm->set_scrollx(0,256 + m_scrollx2);
+ tm->set_scrollx(0,256 + m_scrollx[1]);
}
- tm->set_scrolly(0,m_scrolly2);
+ tm->set_scrolly(0,m_scrolly[1]);
tm->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
majtitle_draw_sprites(bitmap,cliprect);