summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/ddragon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/ddragon.cpp')
-rw-r--r--src/mame/video/ddragon.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/mame/video/ddragon.cpp b/src/mame/video/ddragon.cpp
index 6c4f33f454b..b79ab7f911b 100644
--- a/src/mame/video/ddragon.cpp
+++ b/src/mame/video/ddragon.cpp
@@ -55,32 +55,35 @@ Sprite layout.
TILEMAP_MAPPER_MEMBER(ddragon_state::background_scan)
{
/* logical (col,row) -> memory offset */
- return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x10) << 4) + ((row & 0x10) << 5);
+ return (col & 0x0f) | ((row & 0x0f) << 4) | ((col & 0x10) << 4) | ((row & 0x10) << 5);
}
TILE_GET_INFO_MEMBER(ddragon_state::get_bg_tile_info)
{
- uint8_t attr = m_bgvideoram[2 * tile_index];
+ tile_index <<= 1;
+ uint8_t attr = m_bgvideoram[tile_index];
SET_TILE_INFO_MEMBER(2,
- m_bgvideoram[2 * tile_index+1] + ((attr & 0x07) << 8),
+ m_bgvideoram[tile_index | 1] | ((attr & 0x07) << 8),
(attr >> 3) & 0x07,
TILE_FLIPYX((attr & 0xc0) >> 6));
}
TILE_GET_INFO_MEMBER(ddragon_state::get_fg_tile_info)
{
- uint8_t attr = m_fgvideoram[2 * tile_index];
+ tile_index <<= 1;
+ uint8_t attr = m_fgvideoram[tile_index];
SET_TILE_INFO_MEMBER(0,
- m_fgvideoram[2 * tile_index + 1] + ((attr & 0x07) << 8),
+ m_fgvideoram[tile_index | 1] | ((attr & 0x07) << 8),
attr >> 5,
0);
}
TILE_GET_INFO_MEMBER(ddragon_state::get_fg_16color_tile_info)
{
- uint8_t attr = m_fgvideoram[2 * tile_index];
+ tile_index <<= 1;
+ uint8_t attr = m_fgvideoram[tile_index];
SET_TILE_INFO_MEMBER(0,
- m_fgvideoram[2 * tile_index+1] + ((attr & 0x0f) << 8),
+ m_fgvideoram[tile_index | 1] | ((attr & 0x0f) << 8),
attr >> 4,
0);
}
@@ -114,13 +117,13 @@ VIDEO_START_MEMBER(ddragon_state,ddragon)
WRITE8_MEMBER(ddragon_state::ddragon_bgvideoram_w)
{
m_bgvideoram[offset] = data;
- m_bg_tilemap->mark_tile_dirty(offset / 2);
+ m_bg_tilemap->mark_tile_dirty(offset >> 1);
}
WRITE8_MEMBER(ddragon_state::ddragon_fgvideoram_w)
{
m_fgvideoram[offset] = data;
- m_fg_tilemap->mark_tile_dirty(offset / 2);
+ m_fg_tilemap->mark_tile_dirty(offset >> 1);
}
@@ -145,8 +148,8 @@ void ddragon_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
int attr = src[i + 1];
if (attr & 0x80) /* visible */
{
- int sx = 240 - src[i + 4] + ((attr & 2) << 7);
- int sy = 232 - src[i + 0] + ((attr & 1) << 8);
+ int sx = 240 - (src[i + 4] | ((attr & 2) << 7));
+ int sy = 232 - (src[i + 0] | ((attr & 1) << 8));
int size = (attr & 0x30) >> 4;
int flipx = attr & 8;
int flipy = attr & 4;
@@ -158,7 +161,7 @@ void ddragon_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
if (m_technos_video_hw == 2) /* Double Dragon 2 */
{
color = src[i + 2] >> 5;
- which = src[i + 3] + ((src[i + 2] & 0x1f) << 8);
+ which = src[i + 3] | ((src[i + 2] & 0x1f) << 8);
}
else
{
@@ -168,7 +171,7 @@ void ddragon_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
if ((sy < -7) && (sy > -16)) sy += 256; /* fix sprite clip */
}
color = src[i + 2] >> 4;
- which = src[i + 3] + ((src[i + 2] & 0x0f) << 8);
+ which = src[i + 3] | ((src[i + 2] & 0x0f) << 8);
}
if (flip_screen())