From 102a0e4baf4985785a59372755ab208a3d91c7e1 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Mon, 26 Dec 2016 15:08:29 +0000 Subject: fix 06422 --- src/mame/drivers/rohga.cpp | 4 ++-- src/mame/video/deco16ic.cpp | 39 ++++++++++++++++++++++++--------------- src/mame/video/deco16ic.h | 4 ++-- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/mame/drivers/rohga.cpp b/src/mame/drivers/rohga.cpp index a310456c385..8b3d103078b 100644 --- a/src/mame/drivers/rohga.cpp +++ b/src/mame/drivers/rohga.cpp @@ -153,7 +153,7 @@ static ADDRESS_MAP_START( rohga_map, AS_PROGRAM, 16, rohga_state ) AM_RANGE(0x3c4000, 0x3c4fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w) AM_RANGE(0x3c6000, 0x3c6fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w) - AM_RANGE(0x3c8000, 0x3c8fff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf1_rowscroll") + AM_RANGE(0x3c8000, 0x3c9fff) AM_RAM AM_SHARE("pf1_rowscroll") AM_RANGE(0x3ca000, 0x3cafff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf2_rowscroll") AM_RANGE(0x3cc000, 0x3ccfff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf3_rowscroll") AM_RANGE(0x3ce000, 0x3cefff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf4_rowscroll") @@ -823,7 +823,7 @@ static MACHINE_CONFIG_START( rohga, rohga_state ) MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_WIDTH12(1) + MCFG_DECO16IC_WIDTH12(1|4) MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) MCFG_DECO16IC_PF1_COL_BANK(0x00) diff --git a/src/mame/video/deco16ic.cpp b/src/mame/video/deco16ic.cpp index 03677b75e8a..5549b11e137 100644 --- a/src/mame/video/deco16ic.cpp +++ b/src/mame/video/deco16ic.cpp @@ -192,7 +192,7 @@ deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, m_pf12_last_big(0), m_pf1_8bpp_mode(0), m_split(0), - m_full_width12(1), + m_tilemapsizes(1), m_pf1_trans_mask(0xf), m_pf2_trans_mask(0xf), m_pf1_colour_bank(0), @@ -229,22 +229,23 @@ void deco16ic_device::device_start() int fullheight = 0; int fullwidth = 0; + int fullheight_8x8 = 0; - if (m_full_width12&2) + + if (m_tilemapsizes&4) + fullheight_8x8 = 1; + + if (m_tilemapsizes&2) fullheight = 1; - if (m_full_width12&1) + if (m_tilemapsizes&1) fullwidth = 1; m_pf1_tilemap_16x16 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ?64 : 32); -// m_pf1_tilemap_8x8 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, m_full_width12 ? 64 : 32, 32); - m_pf1_tilemap_8x8 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, 64 , 32); // nitroball - - if (m_split) - m_pf2_tilemap_16x16 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32); - else - m_pf2_tilemap_16x16 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32); +// m_pf1_tilemap_8x8 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, m_tilemapsizes ? 64 : 32, 32); + m_pf1_tilemap_8x8 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, 64 , fullheight_8x8 ? 64 : 32); // nitroball + m_pf2_tilemap_16x16 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32); m_pf2_tilemap_8x8 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, fullwidth ? 64 : 32, fullheight ? 64 : 32); m_pf1_tilemap_8x8->set_transparent_pen(0); @@ -678,7 +679,9 @@ static int deco16_pf_update( const uint16_t scrollx, const uint16_t scrolly, const uint16_t control0, - const uint16_t control1) + const uint16_t control1, + const int tilemapsizes + ) { int rows, cols, offs, use_custom = 0; @@ -731,11 +734,17 @@ static int deco16_pf_update( if (tilemap_8x8) { + int numrows = rows; + + // wolffang uses a larger 8x8 tilemap for the Japanese intro text, everything else seems to need this logic tho? + if (!(tilemapsizes & 4)) + numrows = rows >> 1; + tilemap_8x8->set_scroll_cols(1); - tilemap_8x8->set_scroll_rows(rows / 2); + tilemap_8x8->set_scroll_rows(numrows); tilemap_8x8->set_scrolly(0, scrolly); - for (offs = 0; offs < rows / 2; offs++) + for (offs = 0; offs < numrows; offs++) tilemap_8x8->set_scrollx(offs, scrollx + rowscroll_ptr[offs]); } } @@ -826,8 +835,8 @@ void deco16ic_device::pf_update( const uint16_t *rowscroll_1_ptr, const uint16_t /* Update scrolling and tilemap enable */ m_pf1_rowscroll_ptr = rowscroll_1_ptr; m_pf2_rowscroll_ptr = rowscroll_2_ptr; - m_use_custom_pf2 = deco16_pf_update(m_pf2_tilemap_8x8, m_pf2_tilemap_16x16, rowscroll_2_ptr, m_pf12_control[3], m_pf12_control[4], m_pf12_control[5] >> 8, m_pf12_control[6] >> 8); - m_use_custom_pf1 = deco16_pf_update(m_pf1_tilemap_8x8, m_pf1_tilemap_16x16, rowscroll_1_ptr, m_pf12_control[1], m_pf12_control[2], m_pf12_control[5] & 0xff, m_pf12_control[6] & 0xff); + m_use_custom_pf2 = deco16_pf_update(m_pf2_tilemap_8x8, m_pf2_tilemap_16x16, rowscroll_2_ptr, m_pf12_control[3], m_pf12_control[4], m_pf12_control[5] >> 8, m_pf12_control[6] >> 8, m_tilemapsizes); + m_use_custom_pf1 = deco16_pf_update(m_pf1_tilemap_8x8, m_pf1_tilemap_16x16, rowscroll_1_ptr, m_pf12_control[1], m_pf12_control[2], m_pf12_control[5] & 0xff, m_pf12_control[6] & 0xff, m_tilemapsizes); /* Update banking and global flip state */ if (!m_bank1_cb.isnull()) diff --git a/src/mame/video/deco16ic.h b/src/mame/video/deco16ic.h index 8af152bc96b..1483c62c24c 100644 --- a/src/mame/video/deco16ic.h +++ b/src/mame/video/deco16ic.h @@ -34,7 +34,7 @@ public: static void set_bank1_callback(device_t &device, deco16_bank_cb_delegate callback) { downcast(device).m_bank1_cb = callback; } static void set_bank2_callback(device_t &device, deco16_bank_cb_delegate callback) { downcast(device).m_bank2_cb = callback; } static void set_split(device_t &device, int split) { downcast(device).m_split = split; } - static void set_full_width(device_t &device, int width) { downcast(device).m_full_width12 = width; } + static void set_full_width(device_t &device, int width) { downcast(device).m_tilemapsizes = width; } static void set_pf1_trans_mask(device_t &device, int mask) { downcast(device).m_pf1_trans_mask = mask; } static void set_pf2_trans_mask(device_t &device, int mask) { downcast(device).m_pf2_trans_mask = mask; } static void set_pf1_col_mask(device_t &device, int mask) { downcast(device).m_pf1_colourmask = mask; } @@ -142,7 +142,7 @@ private: int m_pf1_8bpp_mode; int m_split; - int m_full_width12; + int m_tilemapsizes; int m_pf1_trans_mask, m_pf2_trans_mask; int m_pf1_colour_bank, m_pf2_colour_bank; int m_pf1_colourmask, m_pf2_colourmask; -- cgit v1.2.3