Previous 199869 Revisions Next

r41831 Monday 23rd November, 2015 at 02:26:19 UTC by David Haywood
this may or may not improve priorities in nost (level 6 boss effect / final boss works, but haven't yet established if anything broken)
[src/mame/video]mcatadv.cpp

trunk/src/mame/video/mcatadv.cpp
r250342r250343
2121   int colour = (m_videoram1[tile_index * 2] & 0x3f00) >> 8;
2222   int pri = (m_videoram1[tile_index * 2] & 0xc000) >> 14;
2323
24   pri |= 0x8;
25
2426   SET_TILE_INFO_MEMBER(0,tileno,colour + m_palette_bank1 * 0x40, 0);
2527   tileinfo.category = pri;
2628}
r250342r250343
3739   int colour = (m_videoram2[tile_index * 2] & 0x3f00) >> 8;
3840   int pri = (m_videoram2[tile_index * 2] & 0xc000) >> 14;
3941
42   pri |= 0x8;
43
4044   SET_TILE_INFO_MEMBER(1, tileno, colour + m_palette_bank2 * 0x40, 0);
4145   tileinfo.category = pri;
4246}
r250342r250343
5054
5155void mcatadv_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
5256{
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;
5560   int global_x = m_vidregs[0] - 0x184;
5661   int global_y = m_vidregs[1] - 0x1f1;
5762
r250342r250343
7378      logerror("Spritebank != 0/1\n");
7479   }
7580
76   while (source < finish)
81   while (source >= finish)
7782   {
7883      int pen = (source[0] & 0x3f00) >> 8;
7984      int tileno = source[1] & 0xffff;
8085      int pri = (source[0] & 0xc000) >> 14;
86
87      pri |= 0x8;
88
8189      int x = source[2] & 0x3ff;
8290      int y = source[3] & 0x3ff;
8391      int flipy = source[0] & 0x0040;
r250342r250343
127135
128136                  if ((drawxpos >= cliprect.min_x) && (drawxpos <= cliprect.max_x))
129137                  {
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                     {           
132143                        pix = sprdata[(offset / 2)&sprmask];
133144
134145                        if (offset & 1)
r250342r250343
136147                        pix &= 0x0f;
137148
138149                        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                       
140157                     }
141158                  }
142159
r250342r250343
149166            }
150167         }
151168      }
152      source += 4;
169      source -= 4;
153170   }
154171}
155172
r250342r250343
229246   #ifdef MAME_DEBUG
230247         if (!machine().input().code_pressed(KEYCODE_Q))
231248   #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);
233250
234251   #ifdef MAME_DEBUG
235252         if (!machine().input().code_pressed(KEYCODE_W))
236253   #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);
238255   }
239256
240257   g_profiler.start(PROFILER_USER1);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team