Previous 199869 Revisions Next

r33030 Tuesday 28th October, 2014 at 07:19:12 UTC by Osso
konamigx: a few more global variables to the driver state (nw)
[src/mame/includes]konamigx.h
[src/mame/video]konamigx.c

trunk/src/mame/includes/konamigx.h
r241541r241542
199199   
200200   UINT16 m_prot_data[0x20];
201201   
202   UINT16 *m_gx_spriteram;
203   
204   // mirrored K054338 settings
205   int *m_K054338_shdRGB;
206   
202207   // 1st-Tier GX/MW Variables
203208   // frequently used registers
204209   int m_k053247_vrcbk[4];
r241541r241542
236241       unsupported flipping modes (probably due to the way it's hooked up to the
237242       rest of the chips) which is causing entirely the wrong output.
238243
239    -- furthermore video/konamigx.c contains it's own implementation of
240       the K053936_zoom_draw named K053936GP_zoom_draw ...
244    -- furthermore video\k053936.c contains an implementation of
245       the K053936_zoom_draw named K053936GP_zoom_draw that's only used in konamigx ...
241246
242247
243248    */
244249   bitmap_ind16 *m_gxtype1_roz_dstbitmap;
245250   bitmap_ind16 *m_gxtype1_roz_dstbitmap2;
246251   rectangle m_gxtype1_roz_dstbitmapclip;
252   
253   int m_konamigx_type3_psac2_actual_bank;
254   //int m_konamigx_type3_psac2_actual_last_bank = 0;
247255};
248256
249257// Sprite Callbacks
trunk/src/mame/video/konamigx.c
r241541r241542
276276#define GX_MAX_OBJECTS (GX_MAX_SPRITES + GX_MAX_LAYERS)
277277
278278static struct GX_OBJ { int order, offs, code, color; } *gx_objpool;
279static UINT16 *gx_spriteram;
280279
281// mirrored K054338 settings
282static int *K054338_shdRGB;
283
284
285280void konamigx_state::konamigx_mixer_init(screen_device &screen, int objdma)
286281{
287282   m_gx_objdma = 0;
r241541r241542
291286   m_gx_shdzbuf = auto_alloc_array(machine(), UINT8, GX_ZBUFSIZE);
292287   gx_objpool = auto_alloc_array(machine(), struct GX_OBJ, GX_MAX_OBJECTS);
293288
294   m_k054338->export_config(&K054338_shdRGB);
289   m_k054338->export_config(&m_K054338_shdRGB);
295290
296291   if (objdma)
297292   {
298      gx_spriteram = auto_alloc_array(machine(), UINT16, 0x1000/2);
293      m_gx_spriteram = auto_alloc_array(machine(), UINT16, 0x1000/2);
299294      m_gx_objdma = 1;
300295   }
301296   else
302      m_k055673->k053247_get_ram(&gx_spriteram);
297      m_k055673->k053247_get_ram(&m_gx_spriteram);
303298
304299   m_palette->set_shadow_dRGB32(3,-80,-80,-80, 0);
305300   m_k054338->invert_alpha(1);
r241541r241542
315310   UINT16* k053247_ram;
316311   m_k055673->k053247_get_ram(&k053247_ram);
317312
318   if (m_gx_objdma && gx_spriteram && k053247_ram) memcpy(gx_spriteram, k053247_ram, 0x1000);
313   if (m_gx_objdma && m_gx_spriteram && k053247_ram) memcpy(m_gx_spriteram, k053247_ram, 0x1000);
319314}
320315
321316void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect,
r241541r241542
416411      // only enable shadows beyond a +/-7 RGB threshold
417412      for (j=0,i=0; i<3; j+=3,i++)
418413      {
419         k = K054338_shdRGB[j  ]; if (k < -7 || k > 7) { shadowon[i] = 1; continue; }
420         k = K054338_shdRGB[j+1]; if (k < -7 || k > 7) { shadowon[i] = 1; continue; }
421         k = K054338_shdRGB[j+2]; if (k < -7 || k > 7) { shadowon[i] = 1; }
414         k = m_K054338_shdRGB[j  ]; if (k < -7 || k > 7) { shadowon[i] = 1; continue; }
415         k = m_K054338_shdRGB[j+1]; if (k < -7 || k > 7) { shadowon[i] = 1; continue; }
416         k = m_K054338_shdRGB[j+2]; if (k < -7 || k > 7) { shadowon[i] = 1; }
422417      }
423418
424419      // SHDON specifies layers on which shadows can be projected (see detail on p.65 7.2.8)
r241541r241542
496491   {
497492      int pri = 0;
498493
499      if (!(gx_spriteram[offs] & 0x8000)) continue;
494      if (!(m_gx_spriteram[offs] & 0x8000)) continue;
500495
501      int zcode = gx_spriteram[offs] & 0xff;
496      int zcode = m_gx_spriteram[offs] & 0xff;
502497
503498      // invert z-order when opset_pri is set (see p.51 OPSET PRI)
504499      if (m_k053247_opset & 0x10) zcode = 0xff - zcode;
505500
506      int code  = gx_spriteram[offs+1];
507      int color = k = gx_spriteram[offs+6];
508      l     = gx_spriteram[offs+7];
501      int code  = m_gx_spriteram[offs+1];
502      int color = k = m_gx_spriteram[offs+6];
503      l     = m_gx_spriteram[offs+7];
509504
510505      m_k055673->m_k053247_cb(&code, &color, &pri);
511506
r241541r241542
869864
870865
871866         m_k055673->k053247_draw_single_sprite_gxcore(bitmap, cliprect,
872            m_gx_objzbuf, m_gx_shdzbuf, code, gx_spriteram, offs,
867            m_gx_objzbuf, m_gx_shdzbuf, code, m_gx_spriteram, offs,
873868            color, alpha, drawmode, zcode, pri,
874869            /* non-gx only */
875870            0,0,NULL,NULL,0
r241541r241542
927922   SET_TILE_INFO_MEMBER(0, tileno, colour, TILE_FLIPYX(flip));
928923}
929924
930static int konamigx_type3_psac2_actual_bank;
931//int konamigx_type3_psac2_actual_last_bank = 0;
932925
933926WRITE32_MEMBER(konamigx_state::konamigx_type3_psac2_bank_w)
934927{
935928   // other bits are used for something...
936929
937930   COMBINE_DATA(&m_konamigx_type3_psac2_bank[offset]);
938   konamigx_type3_psac2_actual_bank = (m_konamigx_type3_psac2_bank[0] & 0x10000000) >> 28;
931   m_konamigx_type3_psac2_actual_bank = (m_konamigx_type3_psac2_bank[0] & 0x10000000) >> 28;
939932
940933   /* handle this by creating 2 roz tilemaps instead, otherwise performance dies completely on dual screen mode
941   if (konamigx_type3_psac2_actual_bank!=konamigx_type3_psac2_actual_last_bank)
934   if (m_konamigx_type3_psac2_actual_bank!=m_konamigx_type3_psac2_actual_last_bank)
942935   {
943936       m_gx_psac_tilemap->mark_all_dirty();
944       konamigx_type3_psac2_actual_last_bank = konamigx_type3_psac2_actual_bank;
937       m_konamigx_type3_psac2_actual_last_bank = m_konamigx_type3_psac2_actual_bank;
945938   }
946939   */
947940}
r241541r241542
956949
957950   int base_index = tile_index;
958951
959//  if (konamigx_type3_psac2_actual_bank)
952//  if (m_konamigx_type3_psac2_actual_bank)
960953//      base_index+=0x20000/2;
961954
962955
r241541r241542
977970
978971   int base_index = tile_index;
979972
980//  if (konamigx_type3_psac2_actual_bank)
973//  if (m_konamigx_type3_psac2_actual_bank)
981974//      base_index+=0x20000/2;
982975
983976
r241541r241542
14321425      temprect = cliprect;
14331426      temprect.max_x = cliprect.min_x+320;
14341427
1435      if (konamigx_type3_psac2_actual_bank == 1) K053936_0_zoom_draw(screen, *m_type3_roz_temp_bitmap, temprect,m_gx_psac_tilemap_alt, 0,0,0); // soccerss playfield
1428      if (m_konamigx_type3_psac2_actual_bank == 1) K053936_0_zoom_draw(screen, *m_type3_roz_temp_bitmap, temprect,m_gx_psac_tilemap_alt, 0,0,0); // soccerss playfield
14361429      else K053936_0_zoom_draw(screen, *m_type3_roz_temp_bitmap, temprect,m_gx_psac_tilemap, 0,0,0); // soccerss playfield
14371430
14381431


Previous 199869 Revisions Next


© 1997-2024 The MAME Team