Previous 199869 Revisions Next

r33316 Monday 10th November, 2014 at 07:34:30 UTC by Alex W. Jackson
Taito device tilemap assert fixes, and clean up of obsolete stuff (nw)
[src/mame/drivers]darius.c opwolf.c rainbow.c rastan.c slapshot.c taito_f2.c topspeed.c
[src/mame/includes]darius.h ninjaw.h warriorb.h
[src/mame/video]darius.c ninjaw.c tc0080vco.c tc0100scn.c tc0100scn.h tc0480scp.c warriorb.c

trunk/src/mame/drivers/darius.c
r241827r241828
676676};
677677
678678static GFXDECODE_START( darius )
679   GFXDECODE_ENTRY( "gfx2", 0, tilelayout,   0, 256 )  /* sprites */
680   GFXDECODE_ENTRY( "gfx1", 0, charlayout,   0, 256 )  /* scr tiles */
681   GFXDECODE_ENTRY( "gfx3", 0, char2layout,  0, 256 )  /* top layer scr tiles */
679   GFXDECODE_ENTRY( "gfx2", 0, tilelayout,   0, 128 )  /* sprites */
680   GFXDECODE_ENTRY( "gfx1", 0, charlayout,   0, 128 )  /* scr tiles */
681   GFXDECODE_ENTRY( "gfx3", 0, char2layout,  0, 128 )  /* top layer scr tiles */
682682GFXDECODE_END
683683
684684
r241827r241828
764764
765765   /* video hardware */
766766   MCFG_GFXDECODE_ADD("gfxdecode", "palette", darius)
767   MCFG_PALETTE_ADD("palette", 4096*2)
767   MCFG_PALETTE_ADD("palette", 2048)
768768   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
769769   MCFG_DEFAULT_LAYOUT(layout_darius)
770770
trunk/src/mame/drivers/opwolf.c
r241827r241828
666666};
667667
668668static GFXDECODE_START( opwolf )
669   GFXDECODE_ENTRY( "gfx2", 0, tilelayout,  0, 256 )   /* sprites */
670   GFXDECODE_ENTRY( "gfx1", 0, charlayout,  0, 256 )   /* scr tiles */
669   GFXDECODE_ENTRY( "gfx2", 0, tilelayout,  0, 128 )   /* sprites */
670   GFXDECODE_ENTRY( "gfx1", 0, charlayout,  0, 128 )   /* scr tiles */
671671GFXDECODE_END
672672
673673static GFXDECODE_START( opwolfb )
674   GFXDECODE_ENTRY( "gfx2", 0, tilelayout_b,  0, 256 ) /* sprites */
675   GFXDECODE_ENTRY( "gfx1", 0, charlayout_b,  0, 256 ) /* scr tiles */
674   GFXDECODE_ENTRY( "gfx2", 0, tilelayout_b,  0, 128 ) /* sprites */
675   GFXDECODE_ENTRY( "gfx1", 0, charlayout_b,  0, 128 ) /* scr tiles */
676676GFXDECODE_END
677677
678678
r241827r241828
704704   MCFG_SCREEN_PALETTE("palette")
705705
706706   MCFG_GFXDECODE_ADD("gfxdecode", "palette", opwolf)
707   MCFG_PALETTE_ADD("palette", 8192)
707   MCFG_PALETTE_ADD("palette", 2048)
708708   MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB)
709709
710710   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
r241827r241828
770770   MCFG_SCREEN_PALETTE("palette")
771771
772772   MCFG_GFXDECODE_ADD("gfxdecode", "palette", opwolfb)
773   MCFG_PALETTE_ADD("palette", 8192)
773   MCFG_PALETTE_ADD("palette", 2048)
774774   MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB)
775775
776776   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
trunk/src/mame/drivers/rainbow.c
r241827r241828
646646   MCFG_SCREEN_PALETTE("palette")
647647
648648   MCFG_GFXDECODE_ADD("gfxdecode", "palette", rbisland)
649   MCFG_PALETTE_ADD("palette", 8192)
649   MCFG_PALETTE_ADD("palette", 2048)
650650   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
651651
652652   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
r241827r241828
697697   MCFG_SCREEN_PALETTE("palette")
698698
699699   MCFG_GFXDECODE_ADD("gfxdecode", "palette", jumping)
700   MCFG_PALETTE_ADD("palette", 8192)
700   MCFG_PALETTE_ADD("palette", 2048)
701701   MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
702702
703703   MCFG_VIDEO_START_OVERRIDE(rbisland_state,jumping)
trunk/src/mame/drivers/rastan.c
r241827r241828
376376   MCFG_SCREEN_PALETTE("palette")
377377
378378   MCFG_GFXDECODE_ADD("gfxdecode", "palette", rastan)
379   MCFG_PALETTE_ADD("palette", 8192)
379   MCFG_PALETTE_ADD("palette", 2048)
380380   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
381381
382382   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
trunk/src/mame/drivers/slapshot.c
r241827r241828
446446
447447static GFXDECODE_START( slapshot )
448448   GFXDECODE_ENTRY( "gfx2", 0x0, tilelayout,  0, 256 ) /* sprite parts */
449   GFXDECODE_ENTRY( "gfx1", 0x0, slapshot_charlayout, 0, 256 )    /* sprites & playfield */
449   GFXDECODE_ENTRY( "gfx1", 0x0, slapshot_charlayout, 4096, 256 )    /* sprites & playfield */
450450GFXDECODE_END
451451
452452
r241827r241828
514514   MCFG_TC0480SCP_OFFSETS(30 + 3, 9)
515515   MCFG_TC0480SCP_OFFSETS_TX(-1, -1)
516516   MCFG_TC0480SCP_OFFSETS_FLIP(0, 2)
517   MCFG_TC0480SCP_COL_BASE(256)
517   MCFG_TC0480SCP_COL_BASE(4096)
518518   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
519519   MCFG_TC0480SCP_PALETTE("palette")
520520
r241827r241828
575575   MCFG_TC0480SCP_OFFSETS(30 + 3, 9)
576576   MCFG_TC0480SCP_OFFSETS_TX(-1, -1)
577577   MCFG_TC0480SCP_OFFSETS_FLIP(0, 2)
578   MCFG_TC0480SCP_COL_BASE(256)
578   MCFG_TC0480SCP_COL_BASE(4096)
579579   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
580580   MCFG_TC0480SCP_PALETTE("palette")
581581
trunk/src/mame/drivers/taito_f2.c
r241827r241828
27922792   RGN_FRAC(1,4),
27932793   4,  /* 4 bits per pixel */
27942794   { RGN_FRAC(0,4), RGN_FRAC(1,4),RGN_FRAC(2,4),RGN_FRAC(3,4) },
2795   { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 },
2796   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
2795   { STEP16(0,1) },
2796   { STEP16(0,16) },
27972797   16*16   /* every sprite takes 128 consecutive bytes */
27982798};
27992799
2800static const gfx_layout footchmpbl_charlayout =
2801{
2802   8,8,  /* 16*16 sprites */
2803   256,  /* the ROMs are mostly empty */
2804   4,  /* 4 bits per pixel */
2805   { RGN_FRAC(0,4), RGN_FRAC(1,4),RGN_FRAC(2,4),RGN_FRAC(3,4) },
2806   { STEP8(0,1) },
2807   { STEP8(0,8) },
2808   8*8   /* every sprite takes 128 consecutive bytes */
2809};
28002810
28012811static GFXDECODE_START( footchmpbl )
28022812   GFXDECODE_ENTRY( "gfx2", 0, footchmpbl_tilelayout,  0, 256 )    /* sprites & playfield */
28032813   GFXDECODE_ENTRY( "gfx1", 0, footchmpbl_tilelayout,  0, 256 )    /* sprites & playfield */
2804   GFXDECODE_ENTRY( "gfx3", 0, footchmpbl_tilelayout,  0, 256 )    // gets wiped out by the dynamic decode atm
2805   GFXDECODE_ENTRY( "gfx3", 0, footchmpbl_tilelayout,  0, 256 )    // bootleg should clearly use this instead of the uploaded tiles
2814   GFXDECODE_ENTRY( "gfx3", 0, footchmpbl_charlayout,  0, 256 )    // gets wiped out by the dynamic decode atm
2815   GFXDECODE_ENTRY( "gfx3", 0, footchmpbl_charlayout,  0, 256 )    // bootleg should clearly use this instead of the uploaded tiles
28062816GFXDECODE_END
28072817
28082818
r241827r241828
34173427   MCFG_TC0480SCP_OFFSETS(0x32 + 3, -0x04)
34183428   MCFG_TC0480SCP_OFFSETS_TX(1, 0)
34193429   MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0)
3420   MCFG_TC0480SCP_COL_BASE(256)
3430   MCFG_TC0480SCP_COL_BASE(4096)
34213431   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
34223432   MCFG_TC0480SCP_PALETTE("palette")
34233433
trunk/src/mame/drivers/topspeed.c
r241827r241828
516516
517517static GFXDECODE_START( topspeed )
518518   GFXDECODE_ENTRY( "gfx2", 0x0, tile16x8_layout,  0, 256 )    // Sprite parts
519   GFXDECODE_ENTRY( "gfx1", 0x0, charlayout,  0, 256 )         // Sprites & playfield
519   GFXDECODE_ENTRY( "gfx1", 0x0, charlayout,  0, 512 )         // Sprites & playfield
520520   // Road Lines gfxdecodable ?
521521GFXDECODE_END
522522
trunk/src/mame/includes/darius.h
r241827r241828
124124   UINT32 screen_update_darius_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
125125   UINT32 screen_update_darius_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
126126   void darius_postload();
127   inline void actual_get_fg_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum );
128127   void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int primask, int x_offs, int y_offs );
129128   UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffs);
130129   void parse_control(  )   /* assumes Z80 sandwiched between 68Ks */;
trunk/src/mame/includes/ninjaw.h
r241827r241828
7070   DECLARE_WRITE16_MEMBER(tc0100scn_triple_screen_w);
7171   virtual void machine_start();
7272   virtual void machine_reset();
73   virtual void video_start();
7473   UINT32 screen_update_ninjaw_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7574   UINT32 screen_update_ninjaw_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7675   UINT32 screen_update_ninjaw_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
trunk/src/mame/includes/warriorb.h
r241827r241828
6464   DECLARE_WRITE16_MEMBER(tc0100scn_dual_screen_w);
6565   virtual void machine_start();
6666   virtual void machine_reset();
67   virtual void video_start();
6867   UINT32 screen_update_warriorb_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6968   UINT32 screen_update_warriorb_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7069   void reset_sound_region();
trunk/src/mame/video/darius.c
r241827r241828
33
44/***************************************************************************/
55
6inline void darius_state::actual_get_fg_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum )
6TILE_GET_INFO_MEMBER(darius_state::get_fg_tile_info)
77{
8   UINT16 code = (ram[tile_index + 0x2000] & 0x7ff);
9   UINT16 attr = ram[tile_index];
8   UINT16 code = (m_fg_ram[tile_index + 0x2000] & 0x7ff);
9   UINT16 attr = m_fg_ram[tile_index];
1010
11   SET_TILE_INFO_MEMBER(gfxnum,
11   SET_TILE_INFO_MEMBER(2,
1212         code,
13         ((attr & 0xff) << 2),
13         (attr & 0x7f),
1414         TILE_FLIPYX((attr & 0xc000) >> 14));
1515}
1616
17TILE_GET_INFO_MEMBER(darius_state::get_fg_tile_info)
18{
19   actual_get_fg_tile_info(tileinfo, tile_index, m_fg_ram, 2);
20}
21
2217/***************************************************************************/
2318
2419void darius_state::video_start()
2520{
21   m_gfxdecode->gfx(2)->set_granularity(16);
2622   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(darius_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,64);
2723
2824   m_fg_tilemap->set_transparent_pen(0);
trunk/src/mame/video/ninjaw.c
r241827r241828
11#include "emu.h"
22#include "includes/ninjaw.h"
33
4/**********************************************************/
5
6void ninjaw_state::video_start()
7{
8   /* Ensure palette from correct TC0110PCR used for each screen */
9   m_tc0100scn_1->set_colbanks(0x0, 0x100, 0x200);
10}
11
124/************************************************************
135            SPRITE DRAW ROUTINE
146************************************************************/
trunk/src/mame/video/tc0080vco.c
r241827r241828
191191   m_scroll_ram    = m_ram + 0x20800 / 2;
192192
193193   /* create the char set (gfx will then be updated dynamically from RAM) */
194   m_gfxdecode->set_gfx(m_txnum, global_alloc(gfx_element(m_palette, charlayout, (UINT8 *)m_char_ram, 0, 64, 0)));
194   m_gfxdecode->set_gfx(m_txnum, global_alloc(gfx_element(m_palette, charlayout, (UINT8 *)m_char_ram, 0, 1, 512)));
195195
196196   save_pointer(NAME(m_ram), TC0080VCO_RAM_SIZE / 2);
197197   machine().save().register_postload(save_prepost_delegate(FUNC(tc0080vco_device::postload), this));
r241827r241828
273273
274274   SET_TILE_INFO_MEMBER(m_txnum,
275275         tile,
276         0x40,
277         0);     /* 0x20<<1 as 3bpp */
276         0,
277         0);
278278}
279279
280280
trunk/src/mame/video/tc0100scn.c
r241827r241828
132132   m_bgscrolly(0),
133133   m_fgscrollx(0),
134134   m_fgscrolly(0),
135   m_bg_col_mult(0),
136135   m_bg_tilemask(0),
137   m_tx_col_mult(0),
138136   m_gfxbank(0),
139   m_colbank(0),
140137   m_bg0_colbank(0),
141138   m_bg1_colbank(0),
142139   m_tx_colbank(0),
r241827r241828
257254
258255   m_bg_tilemask = 0xffff;    /* Mjnquest has 0x7fff tilemask */
259256
260   m_bg_col_mult = 1; /* multiplier for when bg gfx != 4bpp */
261   m_tx_col_mult = 1; /* multiplier needed when bg gfx is 6bpp */
257   m_ram = auto_alloc_array_clear(machine(), UINT16, TC0100SCN_RAM_SIZE / 2);
262258
263   if (m_gfxdecode->gfx(m_gfxnum)->granularity() == 2)    /* Yuyugogo, Yesnoj */
264      m_bg_col_mult = 8;
259   set_layer_ptrs();
265260
266   if (m_gfxdecode->gfx(m_gfxnum)->granularity() == 0x40) /* Undrfire */
267      m_tx_col_mult = 4;
261   /* create the char set (gfx will then be updated dynamically from RAM) */
262   m_gfxdecode->set_gfx(m_txnum, global_alloc(gfx_element(m_palette, tc0100scn_charlayout, (UINT8 *)m_char_ram, NATIVE_ENDIAN_VALUE_LE_BE(8,0), 256, 0)));
268263
269//logerror("TC0100SCN bg gfx granularity %04x: multiplier %04x\n", m_gfxdecode->gfx(m_gfxnum)->granularity(), m_tx_col_mult);
264   gfx_element *gfx = m_gfxdecode->gfx(m_gfxnum);
265   gfx_element *txt = m_gfxdecode->gfx(m_txnum);
270266
271   m_ram = auto_alloc_array_clear(machine(), UINT16, TC0100SCN_RAM_SIZE / 2);
267   if (gfx->granularity() == 2)    /* Yuyugogo, Yesnoj */
268      gfx->set_granularity(16);
272269
273   set_layer_ptrs();
270   txt->set_granularity(gfx->granularity());
274271
275272   set_colbanks(0, 0, 0);  /* standard values, only Wgp & multiscreen games change them */
276273                           /* we call this here, so that they can be modified at video_start*/
277274
278   /* create the char set (gfx will then be updated dynamically from RAM) */
279   m_gfxdecode->set_gfx(m_txnum, global_alloc(gfx_element(m_palette, tc0100scn_charlayout, (UINT8 *)m_char_ram, NATIVE_ENDIAN_VALUE_LE_BE(8,0), 64, 0)));
280
281275   save_pointer(NAME(m_ram), TC0100SCN_RAM_SIZE / 2);
282276   save_item(NAME(m_ctrl));
283277   save_item(NAME(m_dblwidth));
r241827r241828
292286void tc0100scn_device::device_reset()
293287{
294288   m_dblwidth = 0;
295   m_colbank = 0;
296289   m_gfxbank = 0; /* Mjnquest uniquely banks tiles */
297290
298291   for (int i = 0; i < 8; i++)
r241827r241828
304297    DEVICE HANDLERS
305298*****************************************************************************/
306299
307void tc0100scn_device::common_get_bg0_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth )
300void tc0100scn_device::common_get_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int colbank )
308301{
309302   int code, attr;
310303
311   if (!dblwidth)
304   if (!m_dblwidth)
312305   {
313306      /* Mahjong Quest (F2 system) inexplicably has a banking feature */
314307      code = (ram[2 * tile_index + 1] & m_bg_tilemask) + (m_gfxbank << 15);
r241827r241828
320313      attr = ram[2 * tile_index];
321314   }
322315
323   SET_TILE_INFO_MEMBER(gfxnum,
316   SET_TILE_INFO_MEMBER(m_gfxnum,
324317         code,
325         (((attr * m_bg_col_mult) + m_bg0_colbank) & 0xff) + colbank,
318         ((attr + colbank) & 0xff),
326319         TILE_FLIPYX((attr & 0xc000) >> 14));
327320}
328321
329void tc0100scn_device::common_get_bg1_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth )
330{
331   int code, attr;
332
333   if (!dblwidth)
334   {
335      /* Mahjong Quest (F2 system) inexplicably has a banking feature */
336      code = (ram[2 * tile_index + 1] & m_bg_tilemask) + (m_gfxbank << 15);
337      attr = ram[2 * tile_index];
338   }
339   else
340   {
341      code = ram[2 * tile_index + 1] & m_bg_tilemask;
342      attr = ram[2 * tile_index];
343   }
344
345   SET_TILE_INFO_MEMBER(gfxnum,
346         code,
347         (((attr * m_bg_col_mult) + m_bg1_colbank) & 0xff) + colbank,
348         TILE_FLIPYX((attr & 0xc000) >> 14));
349}
350
351void tc0100scn_device::common_get_tx_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth )
352{
353   int attr = ram[tile_index];
354
355   SET_TILE_INFO_MEMBER(gfxnum,
356         attr & 0xff,
357         ((((attr >> 6) & 0xfc) * m_tx_col_mult + (m_tx_colbank << 2)) & 0x3ff) + colbank * 4,
358         TILE_FLIPYX((attr & 0xc000) >> 14));
359}
360
361322TILE_GET_INFO_MEMBER(tc0100scn_device::get_bg_tile_info)
362323{
363   common_get_bg0_tile_info(tileinfo, tile_index, m_bg_ram, m_gfxnum, m_colbank, m_dblwidth);
324   common_get_tile_info(tileinfo, tile_index, m_bg_ram, m_bg0_colbank);
364325}
365326
366327TILE_GET_INFO_MEMBER(tc0100scn_device::get_fg_tile_info)
367328{
368   common_get_bg1_tile_info(tileinfo, tile_index, m_fg_ram, m_gfxnum, m_colbank, m_dblwidth);
329   common_get_tile_info(tileinfo, tile_index, m_fg_ram, m_bg1_colbank);
369330}
370331
371332TILE_GET_INFO_MEMBER(tc0100scn_device::get_tx_tile_info)
372333{
373   common_get_tx_tile_info(tileinfo, tile_index, m_tx_ram, m_txnum, m_colbank, m_dblwidth);
374}
334   int attr = m_tx_ram[tile_index];
375335
376void tc0100scn_device::set_colbank( int col )
377{
378   m_colbank = col;
336   SET_TILE_INFO_MEMBER(m_txnum,
337         attr & 0x00ff,
338         ((attr & 0x3f00) >> 8) + m_tx_colbank,
339         TILE_FLIPYX((attr & 0xc000) >> 14));
379340}
380341
381342void tc0100scn_device::set_colbanks( int bg0, int bg1, int tx )
trunk/src/mame/video/tc0100scn.h
r241827r241828
3939   To change from the default (0,0,0) use after calling TC0100SCN_vh_start */
4040   void set_colbanks(int bg0, int bg1, int tx);
4141
42   /* Function to set separate color banks for each TC0100SCN.
43   To change from the default (0,0,0) use after calling TC0100SCN_vh_start */
44   void set_colbank(int colbank);
45
4642   /* Function to set bg tilemask < 0xffff */
4743   void set_bg_tilemask(int mask);
4844
r241827r241828
9288   /* We keep two tilemaps for each of the 3 actual tilemaps: one at standard width, one double */
9389   tilemap_t      *m_tilemap[3][2];
9490
95   int          m_bg_col_mult, m_bg_tilemask, m_tx_col_mult;
96   INT32        m_gfxbank, m_colbank;
91   int          m_bg_tilemask;
92   INT32        m_gfxbank;
9793   INT32        m_bg0_colbank, m_bg1_colbank, m_tx_colbank;
9894   int          m_dblwidth;
9995
r241827r241828
112108   TILE_GET_INFO_MEMBER(get_fg_tile_info);
113109   TILE_GET_INFO_MEMBER(get_tx_tile_info);
114110
115   void common_get_bg0_tile_info(tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth);
116   void common_get_bg1_tile_info(tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth);
117   void common_get_tx_tile_info(tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth);
111   void common_get_tile_info(tile_data &tileinfo, int tile_index, UINT16 *ram, int colbank);
118112
119113   void tilemap_draw_fg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t* tmap, int flags, UINT32 priority);
120114   void set_layer_ptrs();
trunk/src/mame/video/tc0480scp.c
r241827r241828
282282   set_layer_ptrs();
283283
284284   /* create the char set (gfx will then be updated dynamically from RAM) */
285   m_gfxdecode->set_gfx(m_txnum, global_alloc(gfx_element(m_palette, tc0480scp_charlayout, (UINT8 *)m_char_ram, NATIVE_ENDIAN_VALUE_LE_BE(8,0), 64, 0)));
285   m_gfxdecode->set_gfx(m_txnum, global_alloc(gfx_element(m_palette, tc0480scp_charlayout, (UINT8 *)m_char_ram, NATIVE_ENDIAN_VALUE_LE_BE(8,0), 64, m_col_base)));
286   m_gfxdecode->gfx(m_gfxnum)->set_colorbase(m_col_base);
286287
287288   save_item(NAME(m_ram));
288289   save_item(NAME(m_ctrl));
r241827r241828
317318   int attr = ram[2 * tile_index];
318319   SET_TILE_INFO_MEMBER(gfxnum,
319320         code,
320         (attr & 0xff) + m_col_base,
321         (attr & 0xff),
321322         TILE_FLIPYX((attr & 0xc000) >> 14));
322323}
323324
r241827r241828
326327   int attr = ram[tile_index];
327328   SET_TILE_INFO_MEMBER(gfxnum,
328329         attr & 0xff,
329         ((attr & 0x3f00) >> 8) + m_col_base,
330         ((attr & 0x3f00) >> 8),
330331         TILE_FLIPYX((attr & 0xc000) >> 14));
331332}
332333
r241827r241828
654655TODO
655656----
656657
657Broken for any rotation except ROT0. ROT180 support could probably
658be added without too much difficulty: machine_flip is there as a
659place-holder for this purpose.
660
661658Wouldn't work if y needs to be > 255 (i.e. if some game uses a
662659bigger than usual vertical visible area). Refer to tc0080vco
663660custom draw routine for an example of dealing with this.
r241827r241828
709706      int flip = m_pri_reg & 0x40;
710707      int i, y, y_index, src_y_index, row_index;
711708      int x_index, x_step;
712      int machine_flip = 0;   /* for  ROT 180 ? */
713709
714710      UINT16 screen_width = 512; //cliprect.width();
715711      UINT16 min_y = cliprect.min_y;
r241827r241828
736732         y_index -= (m_y_offset - min_y) * zoomy;
737733      }
738734
739      if (!machine_flip)
740         y = min_y;
741      else
742         y = max_y;
735      y = min_y;
743736
744737      do
745738      {
r241827r241828
781774         taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority);
782775
783776         y_index += zoomy;
784         if (!machine_flip)
785            y++;
786         else
787            y--;
777         y++;
788778      }
789      while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y));
779      while (y <= max_y);
790780
791781   }
792782}
r241827r241828
798788TODO
799789----
800790
801Broken for any rotation except ROT0. ROT180 support could probably
802be added without too much difficulty: machine_flip is there as a
803place-holder for this purpose.
804
805791Wouldn't work if y needs to be > 255 (i.e. if some game uses a
806792bigger than usual vertical visible area). Refer to tc0080vco
807793custom draw routine for an example of dealing with this.
r241827r241828
844830   UINT32 zoomx, zoomy;
845831   UINT16 scanline[512];
846832   int flipscreen = m_pri_reg & 0x40;
847   int machine_flip = 0;   /* for  ROT 180 ? */
848833
849834   UINT16 screen_width = 512; //cliprect.width();
850835   UINT16 min_y = cliprect.min_y;
r241827r241828
878863      y_index -= (m_y_offset - min_y) * zoomy;
879864   }
880865
881
882   if (!machine_flip)
883866      y = min_y;
884   else
885      y = max_y;
886867
887868   do
888869   {
r241827r241828
944925      taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority);
945926
946927      y_index += zoomy;
947      if (!machine_flip)
948         y++;
949      else
950         y--;
928      y++;
951929   }
952   while ((!machine_flip && y<=max_y) || (machine_flip && y>=min_y));
930   while (y<=max_y);
953931}
954932
955933
trunk/src/mame/video/warriorb.c
r241827r241828
11#include "emu.h"
22#include "includes/warriorb.h"
33
4/**********************************************************/
5
6void warriorb_state::video_start()
7{
8   /* Ensure palette from correct TC0110PCR used for each screen */
9   m_tc0100scn_1->set_colbanks(0x0, 0x100, 0x0);
10}
11
12
134/************************************************************
145            SPRITE DRAW ROUTINE
156************************************************************/


Previous 199869 Revisions Next


© 1997-2024 The MAME Team