trunk/src/mame/video/mcatadv.cpp
r250342 | r250343 | |
21 | 21 | int colour = (m_videoram1[tile_index * 2] & 0x3f00) >> 8; |
22 | 22 | int pri = (m_videoram1[tile_index * 2] & 0xc000) >> 14; |
23 | 23 | |
| 24 | pri |= 0x8; |
| 25 | |
24 | 26 | SET_TILE_INFO_MEMBER(0,tileno,colour + m_palette_bank1 * 0x40, 0); |
25 | 27 | tileinfo.category = pri; |
26 | 28 | } |
r250342 | r250343 | |
37 | 39 | int colour = (m_videoram2[tile_index * 2] & 0x3f00) >> 8; |
38 | 40 | int pri = (m_videoram2[tile_index * 2] & 0xc000) >> 14; |
39 | 41 | |
| 42 | pri |= 0x8; |
| 43 | |
40 | 44 | SET_TILE_INFO_MEMBER(1, tileno, colour + m_palette_bank2 * 0x40, 0); |
41 | 45 | tileinfo.category = pri; |
42 | 46 | } |
r250342 | r250343 | |
50 | 54 | |
51 | 55 | void mcatadv_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
52 | 56 | { |
53 | | UINT16 *source = m_spriteram_old; |
54 | | UINT16 *finish = source + (m_spriteram.bytes() / 2) /2; |
| 57 | UINT16 *source = (m_spriteram_old + (m_spriteram.bytes() / 2) /2); |
| 58 | source -= 4; |
| 59 | UINT16 *finish = m_spriteram_old; |
55 | 60 | int global_x = m_vidregs[0] - 0x184; |
56 | 61 | int global_y = m_vidregs[1] - 0x1f1; |
57 | 62 | |
r250342 | r250343 | |
73 | 78 | logerror("Spritebank != 0/1\n"); |
74 | 79 | } |
75 | 80 | |
76 | | while (source < finish) |
| 81 | while (source >= finish) |
77 | 82 | { |
78 | 83 | int pen = (source[0] & 0x3f00) >> 8; |
79 | 84 | int tileno = source[1] & 0xffff; |
80 | 85 | int pri = (source[0] & 0xc000) >> 14; |
| 86 | |
| 87 | pri |= 0x8; |
| 88 | |
81 | 89 | int x = source[2] & 0x3ff; |
82 | 90 | int y = source[3] & 0x3ff; |
83 | 91 | int flipy = source[0] & 0x0040; |
r250342 | r250343 | |
127 | 135 | |
128 | 136 | if ((drawxpos >= cliprect.min_x) && (drawxpos <= cliprect.max_x)) |
129 | 137 | { |
130 | | if((priline[drawxpos] < pri)) |
131 | | { |
| 138 | int pridata = priline[drawxpos]; |
| 139 | |
| 140 | |
| 141 | if (!(pridata & 0x10)) // if we haven't already drawn a sprite pixel here (sprite masking) |
| 142 | { |
132 | 143 | pix = sprdata[(offset / 2)&sprmask]; |
133 | 144 | |
134 | 145 | if (offset & 1) |
r250342 | r250343 | |
136 | 147 | pix &= 0x0f; |
137 | 148 | |
138 | 149 | if (pix) |
139 | | destline[drawxpos] = (pix + (pen << 4)); |
| 150 | { |
| 151 | if ((priline[drawxpos] < pri)) |
| 152 | destline[drawxpos] = (pix + (pen << 4)); |
| 153 | |
| 154 | priline[drawxpos] |= 0x10; |
| 155 | } |
| 156 | |
140 | 157 | } |
141 | 158 | } |
142 | 159 | |
r250342 | r250343 | |
149 | 166 | } |
150 | 167 | } |
151 | 168 | } |
152 | | source += 4; |
| 169 | source -= 4; |
153 | 170 | } |
154 | 171 | } |
155 | 172 | |
r250342 | r250343 | |
229 | 246 | #ifdef MAME_DEBUG |
230 | 247 | if (!machine().input().code_pressed(KEYCODE_Q)) |
231 | 248 | #endif |
232 | | mcatadv_draw_tilemap_part(screen, m_scroll1, m_videoram1, i, m_tilemap1, bitmap, cliprect); |
| 249 | mcatadv_draw_tilemap_part(screen, m_scroll1, m_videoram1, i|0x8, m_tilemap1, bitmap, cliprect); |
233 | 250 | |
234 | 251 | #ifdef MAME_DEBUG |
235 | 252 | if (!machine().input().code_pressed(KEYCODE_W)) |
236 | 253 | #endif |
237 | | mcatadv_draw_tilemap_part(screen, m_scroll2, m_videoram2, i, m_tilemap2, bitmap, cliprect); |
| 254 | mcatadv_draw_tilemap_part(screen, m_scroll2, m_videoram2, i|0x8, m_tilemap2, bitmap, cliprect); |
238 | 255 | } |
239 | 256 | |
240 | 257 | g_profiler.start(PROFILER_USER1); |