Previous 15994 Revisions Next

r12454 Tuesday 2nd August, 2011 at 16:09:16 UTC by Angelo Salese
Implemented Line Colour screen and added colour offset for back screen, former is used in Bio Hazard Options Menu
[src/mame/video]stvvdp2.c

src/mame/video/stvvdp2.c
r12453r12454
11/* Sega Saturn VDP2 */
22
3/*Debug features,remember to zero it if you publish this file.*/
43#define DEBUG_MODE 0
54
65/*
r12453r12454
380379
381380/*180024 - Special Function Code Select
382381
383180026 - Special Function Code
382*/
384383
384   #define STV_VDP2_SFSEL ((state->m_vdp2_regs[0x024/4] >> 16)&0x0000ffff)
385
386/*180026 - Special Function Code
387
388*/
389
390   #define STV_VDP2_SFCODE ((state->m_vdp2_regs[0x024/4] >> 0)&0x0000ffff)
391
392
393/*
385394180028 - CHCTLA - Character Control (NBG0, NBG1)
386395 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
387396       |    --    |    --    | N1CHCN1  | N1CHCN0  | N1BMSZ1  | N1BMSZ0  | N1BMEN   | N1CHSZ   |
r12453r12454
674683/*  Supplementary Character Bits (in 1 byte mode) */
675684   #define STV_VDP2_R0SPCN ((STV_VDP2_PNCR & 0x001f) >> 0)
676685
677/* 18003A - PLSZ - Plane Size (incomplete)
686/* 18003A - PLSZ - Plane Size
678687 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
679688       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
680689       |----07----|----06----|----05----|----04----|----03----|----02----|----01----|----00----|
r12453r12454
689698    10 invalid
690699    11 2H Pages x 2V Pages  */
691700   #define STV_VDP2_RBOVR   ((STV_VDP2_PLSZ & 0xc000) >> 14)
701   #define STV_VDP2_RBPLSZ ((STV_VDP2_PLSZ & 0x3000) >> 12)
692702   #define STV_VDP2_RAOVR   ((STV_VDP2_PLSZ & 0x0c00) >> 10)
703   #define STV_VDP2_RAPLSZ ((STV_VDP2_PLSZ & 0x0300) >> 8)
704   #define STV_VDP2_N3PLSZ ((STV_VDP2_PLSZ & 0x00c0) >> 6)
705   #define STV_VDP2_N2PLSZ ((STV_VDP2_PLSZ & 0x0030) >> 4)
706   #define STV_VDP2_N1PLSZ ((STV_VDP2_PLSZ & 0x000c) >> 2)
693707   #define STV_VDP2_N0PLSZ ((STV_VDP2_PLSZ & 0x0003) >> 0)
694   #define STV_VDP2_N1PLSZ ((STV_VDP2_PLSZ & 0x000c) >> 2)
695   #define STV_VDP2_N2PLSZ ((STV_VDP2_PLSZ & 0x0030) >> 4)
696   #define STV_VDP2_N3PLSZ ((STV_VDP2_PLSZ & 0x00c0) >> 6)
697   #define STV_VDP2_RAPLSZ ((STV_VDP2_PLSZ & 0x0300) >> 8)
698   #define STV_VDP2_RBPLSZ ((STV_VDP2_PLSZ & 0x3000) >> 12)
699708
700709/* 18003C - MPOFN - Map Offset (NBG0, NBG1, NBG2, NBG3)
701710 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
r12453r12454
707716   #define STV_VDP2_MPOFN_ ((state->m_vdp2_regs[0x03c/4] >> 16)&0x0000ffff)
708717
709718   /* Higher 3 bits of the map offset for each layer */
719   #define STV_VDP2_N3MP_ ((STV_VDP2_MPOFN_ & 0x7000) >> 12)
720   #define STV_VDP2_N2MP_ ((STV_VDP2_MPOFN_ & 0x0700) >> 8)
721   #define STV_VDP2_N1MP_ ((STV_VDP2_MPOFN_ & 0x0070) >> 4)
710722   #define STV_VDP2_N0MP_ ((STV_VDP2_MPOFN_ & 0x0007) >> 0)
711   #define STV_VDP2_N1MP_ ((STV_VDP2_MPOFN_ & 0x0070) >> 4)
712   #define STV_VDP2_N2MP_ ((STV_VDP2_MPOFN_ & 0x0700) >> 8)
713   #define STV_VDP2_N3MP_ ((STV_VDP2_MPOFN_ & 0x7000) >> 12)
714723
715724
716725
r12453r12454
13211330       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
13221331       \----------|----------|----------|----------|----------|----------|----------|---------*/
13231332
1333   #define STV_VDP2_VCSTAU ((state->m_vdp2_regs[0x09c/4] >> 16)&0x00000007)
1334
1335
13241336/* 18009e - Vertical Cell Table Address (NBG0, NBG1)
13251337 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
13261338       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
r12453r12454
13281340       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
13291341       \----------|----------|----------|----------|----------|----------|----------|---------*/
13301342
1343   #define STV_VDP2_VCSTAL ((state->m_vdp2_regs[0x09c/4] >> 0)&0x0000fffe)
1344
1345
13311346/* 1800a0 - LSTA0U - Line Scroll Table Address (NBG0)
13321347 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
13331348       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
r12453r12454
13361351       \----------|----------|----------|----------|----------|----------|----------|---------*/
13371352
13381353   /*bit 2 unused when VRAM = 4 Mbits*/
1339   #define STV_VDP2_LSTA0U ((state->m_vdp2_regs[0x0a0/4] >> 16)&0x00000003)
1354   #define STV_VDP2_LSTA0U ((state->m_vdp2_regs[0x0a0/4] >> 16)&0x00000007)
13401355
13411356/* 1800a2 - LSTA0L - Line Scroll Table Address (NBG0)
13421357 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
r12453r12454
13551370       \----------|----------|----------|----------|----------|----------|----------|---------*/
13561371
13571372   /*bit 2 unused when VRAM = 4 Mbits*/
1358   #define STV_VDP2_LSTA1U ((state->m_vdp2_regs[0x0a4/4] >> 16)&0x00000003)
1373   #define STV_VDP2_LSTA1U ((state->m_vdp2_regs[0x0a4/4] >> 16)&0x00000007)
13591374
13601375/* 1800a6 - LSTA1L - Line Scroll Table Address (NBG1)
13611376 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
r12453r12454
13841399       \----------|----------|----------|----------|----------|----------|----------|---------*/
13851400   #define STV_VDP2_LCTAL   ((state->m_vdp2_regs[0x0a8/4] >> 0) & 0xffff)
13861401
1387   #define STV_VDP2_LCTA   (state->m_vdp2_regs[0x0a8/4] & 0x0003ffff)
1402   #define STV_VDP2_LCTA   (((STV_VDP2_LCTAU & 0x0007) << 16) | (STV_VDP2_LCTAL & 0xfffe))
13881403
13891404/* 1800ac - Back Screen Table Address
13901405 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
r12453r12454
13931408       |    --    |    --    |    --    |    --    |    --    |  BKTA18  |  BKTA17  |  BKTA16  |
13941409       \----------|----------|----------|----------|----------|----------|----------|---------*/
13951410
1411   #define STV_VDP2_BKTAU   ((state->m_vdp2_regs[0x0ac/4] >> 16) & 0xffff)
1412
1413   #define STV_VDP2_BKCLMD ((STV_VDP2_BKTAU & 0x8000) >> 15)
1414
1415
13961416/* 1800ae - Back Screen Table Address
13971417 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
13981418       |  BKTA15  |  BKTA14  |  BKTA13  |  BKTA12  |  BKTA11  |  BKTA10  |  BKTA9   |  BKTA8   |
r12453r12454
14001420       |  BKTA7   |  BKTA7   |  BKTA6   |  BKTA5   |  BKTA4   |  BKTA3   |  BKTA2   |  BKTA0   |
14011421       \----------|----------|----------|----------|----------|----------|----------|---------*/
14021422
1403   #define STV_VDP2_BKTA_UL (state->m_vdp2_regs[0x0ac/4])
1423   #define STV_VDP2_BKTAL   ((state->m_vdp2_regs[0x0ac/4] >> 0) & 0xffff)
14041424
1405   #define STV_VDP2_BKCLMD ((STV_VDP2_BKTA_UL & 0x80000000) >> 31)
1406   #define STV_VDP2_BKTA   ((STV_VDP2_BKTA_UL & 0x0007ffff) >> 0)
1425   #define STV_VDP2_BKTA   (((STV_VDP2_BKTAU & 0x0007) << 16) | (STV_VDP2_BKTAL & 0xfffe))
14071426
14081427/* 1800b0 - RPMD - Rotation Parameter Mode
14091428 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
r12453r12454
16561675       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
16571676       \----------|----------|----------|----------|----------|----------|----------|---------*/
16581677
1678   #define STV_VDP2_WCTLD ((state->m_vdp2_regs[0x0d4/4] >> 0)&0x0000ffff)
1679   #define STV_VDP2_CCLOG ((STV_VDP2_WCTLD & 0x8000) >> 15)
1680   #define STV_VDP2_CCSWE ((STV_VDP2_WCTLD & 0x2000) >> 13)
1681   #define STV_VDP2_CCSWA ((STV_VDP2_WCTLD & 0x1000) >> 12)
1682   #define STV_VDP2_CCW1E ((STV_VDP2_WCTLD & 0x0800) >> 11)
1683   #define STV_VDP2_CCW1A ((STV_VDP2_WCTLD & 0x0400) >> 10)
1684   #define STV_VDP2_CCW0E ((STV_VDP2_WCTLD & 0x0200) >> 9)
1685   #define STV_VDP2_CCW0A ((STV_VDP2_WCTLD & 0x0100) >> 8)
1686   #define STV_VDP2_RPLOG ((STV_VDP2_WCTLD & 0x0080) >> 7)
1687   #define STV_VDP2_RPW1E ((STV_VDP2_WCTLD & 0x0008) >> 3)
1688   #define STV_VDP2_RPW1A ((STV_VDP2_WCTLD & 0x0004) >> 2)
1689   #define STV_VDP2_RPW0E ((STV_VDP2_WCTLD & 0x0002) >> 1)
1690   #define STV_VDP2_RPW0A ((STV_VDP2_WCTLD & 0x0001) >> 0)
1691
16591692/* 1800d8 - Line Window Table Address (W0)
16601693 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
16611694       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
r12453r12454
16631696       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
16641697       \----------|----------|----------|----------|----------|----------|----------|---------*/
16651698
1699   #define STV_VDP2_LWTA0U ((state->m_vdp2_regs[0x0d8/4] >> 16)&0x0000ffff)
1700
1701   #define STV_VDP2_W0LWE  ((STV_VDP2_LWTA0U & 0x8000) >> 15)
1702
16661703/* 1800da - Line Window Table Address (W0)
16671704 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
16681705       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
r12453r12454
16701707       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
16711708       \----------|----------|----------|----------|----------|----------|----------|---------*/
16721709
1710   #define STV_VDP2_LWTA0L ((state->m_vdp2_regs[0x0d8/4] >> 0)&0x0000ffff)
1711
1712   /* bit 19 isn't used when VRAM = 4 Mbit */
1713   #define STV_VDP2_W0LWTA   (((STV_VDP2_LWTA0U & 0x0007) << 16) | (STV_VDP2_LWTA0L & 0xfffe))
1714
1715
16731716/* 1800dc - Line Window Table Address (W1)
16741717 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
16751718       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
r12453r12454
16771720       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
16781721       \----------|----------|----------|----------|----------|----------|----------|---------*/
16791722
1723   #define STV_VDP2_LWTA1U ((state->m_vdp2_regs[0x0dc/4] >> 16)&0x0000ffff)
1724
1725   #define STV_VDP2_W1LWE  ((STV_VDP2_LWTA0U & 0x8000) >> 15)
1726
1727
16801728/* 1800de - Line Window Table Address (W1)
16811729 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
16821730       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
r12453r12454
16841732       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
16851733       \----------|----------|----------|----------|----------|----------|----------|---------*/
16861734
1735   #define STV_VDP2_LWTA1L ((state->m_vdp2_regs[0x0dc/4] >> 0)&0x0000ffff)
1736
1737   /* bit 19 isn't used when VRAM = 4 Mbit */
1738   #define STV_VDP2_W1LWTA   (((STV_VDP2_LWTA1U & 0x0007) << 16) | (STV_VDP2_LWTA1L & 0xfffe))
1739
1740
16871741/* 1800e0 - Sprite Control
16881742 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
16891743       |    --    |    --    | SPCCCS1  | SPCCCS0  |    --    |  SPCCN2  |  SPCCN1  |  SPCCN0  |
r12453r12454
17551809       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
17561810       \----------|----------|----------|----------|----------|----------|----------|---------*/
17571811
1812   #define STV_VDP2_SFPRMD   ((state->m_vdp2_regs[0x0e8/4] >> 0)&0x0000ffff)
1813
1814
17581815/* 1800ec - Colour Calculation Control
17591816 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
17601817       |  BOKEN   |  BOKN2   |  BOKN1   |   BOKN0  |    --    |  EXCCEN  |  CCRTMD  |  CCMD    |
r12453r12454
17801837       |    --    |    --    |    --    |    --    |    --    |    --    |    --    |    --    |
17811838       \----------|----------|----------|----------|----------|----------|----------|---------*/
17821839
1840   #define STV_VDP2_SFCCMD     ((state->m_vdp2_regs[0xec/4]>>0)&0x0000ffff)
1841
17831842/* 1800f0 - Priority Number (Sprite 0,1)
17841843 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
17851844       |    --    |    --    |    --    |    --    |    --    |  S1PRIN2 |  S1PRIN1 |  S1PRIN0 |
r12453r12454
20402099   UINT8 roz;   /*Debug roz on screen*/
20412100} debug;
20422101
2043/*
2044Errors are currently mapped as follows:
2045x--- ---- ---- ---- ---- ---- ---- ---- VRAM Size = 8 Mbit
2046-x-- ---- ---- ---- ---- ---- ---- ---- CRKTE used
2047---- ---- ---- ---- ---- ---- ---- --x- Mosaic Control
2048---- ---- ---- ---- ---- ---- ---- ---x Window on tilemap
2049*/
2050#define VDP2_ERR(_bit_) (debug.error & _bit_)
2051#define VDP2_CHK(_bit_) (debug.error^=_bit_)
2052
20532102/* Not sure if to use this for the rotating tilemaps as well or just use different draw functions, might add too much bloat */
20542103static struct stv_vdp2_tilemap_capabilities
20552104{
r12453r12454
20882137   UINT8  fade_control;
20892138   UINT8  window_control;
20902139
2140   UINT8  line_screen_enabled;
2141
20912142//  UINT8  real_map_offset[16];
20922143
20932144   int layer_name; /* just to keep track */
r12453r12454
41494200   }
41504201}
41514202
4203static void stv_vdp2_draw_line(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
4204{
4205   saturn_state *state = machine.driver_data<saturn_state>();
4206   int x,y;
4207   UINT8* gfxdata = state->m_vdp2.gfx_decode;
4208   UINT32 base_offs,base_mask;
4209   UINT16 pix;
4210   UINT8 interlace;
4211
4212   interlace = (STV_VDP2_LSMD == 3)+1;
4213
4214   {
4215      base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff;
4216
4217      for(y=cliprect->min_y;y<=cliprect->max_y;y++)
4218      {
4219         base_offs = (STV_VDP2_LCTA & base_mask) << 1;
4220
4221         if(STV_VDP2_LCCLMD)
4222            base_offs += (y / interlace) << 1;
4223
4224         for(x=cliprect->min_x;x<=cliprect->max_x;x++)
4225         {
4226            UINT16 pen;
4227
4228            pen = (gfxdata[base_offs+0]<<8)|gfxdata[base_offs+1];
4229            pix = *BITMAP_ADDR16(bitmap, y,x);
4230
4231            *BITMAP_ADDR16(bitmap, y, x) = stv_add_blend(machine.pens[pen & 0x7ff],pix);
4232         }
4233      }
4234   }
4235}
4236
41524237static void stv_vdp2_check_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
41534238{
41544239   /* the idea is here we check the tilemap capabilities / whats enabled and call an appropriate tilemap drawing routine, or
r12453r12454
41844269   else
41854270   {
41864271      stv_vdp2_draw_basic_tilemap(machine, bitmap, &mycliprect);
4187
4188      if((stv2_current_tilemap.window_control & 6) != 0 && VDP2_ERR(1))
4189      {
4190         VDP2_CHK(1);
4191         mame_printf_debug("Window control enabled on a tilemap plane = %02x\n",stv2_current_tilemap.window_control);
4192      }
41934272   }
41944273
4195   if(STV_VDP2_MZCTL & 0x1f)
4274   if(stv2_current_tilemap.line_screen_enabled)
4275      stv_vdp2_draw_line(machine,bitmap,cliprect);
4276
4277
41964278   {
4197      printf("Mosaic control enabled = %04x\n",STV_VDP2_MZCTL);
4279      /* Capcom Collection Dai 2 - Choh Makaimura (Duh!) */
4280      if(STV_VDP2_MZCTL & 0x1f && 0)
4281         popmessage("Mosaic control enabled = %04x\n",STV_VDP2_MZCTL);
4282
4283      /* Bio Hazard bit 1 */
4284      if(STV_VDP2_LNCLEN & ~2)
4285         popmessage("Line Colour screen enabled %04x %08x, contact MAMEdev",STV_VDP2_LNCLEN,STV_VDP2_LCTAU<<16|STV_VDP2_LCTAL);
4286
4287      /* Bio Hazard 0x400 = extended color calculation enabled */
4288      //if(STV_VDP2_CCCR & 0xf600)
4289      if(STV_VDP2_CCCR & 0xf200)
4290         popmessage("Gradation enabled %04x, contact MAMEdev",STV_VDP2_CCCR);
4291
4292      /* Advanced VG, Shining Force 3 */
4293      if(STV_VDP2_SFCCMD && 0)
4294         popmessage("Special Color Calculation enable %04x, contact MAMEdev",STV_VDP2_SFCCMD);
4295
4296      if(STV_VDP2_SDCTL & 0x0120)
4297         popmessage("%s shadow select bit enabled, contact MAMEdev",STV_VDP2_SDCTL & 0x100 ? "Transparent" : "Back");
4298
4299      if(STV_VDP2_SFSEL)
4300         popmessage("Special Function Code Select enable %04x %04x, contact MAMEdev",STV_VDP2_SFSEL,STV_VDP2_SFCODE);
4301
4302      if(STV_VDP2_ZMCTL)
4303         popmessage("Reduction enable %04x, contact MAMEdev",STV_VDP2_ZMCTL);
4304
4305      if(STV_VDP2_SCRCTL & 0x0101)
4306         popmessage("Vertical cell scroll enable %04x, contact MAMEdev",STV_VDP2_SCRCTL);
4307
4308      if(STV_VDP2_WCTLD & 0x2606)
4309         popmessage("Special window enabled %04x, contact MAMEdev",STV_VDP2_WCTLD);
4310
4311      if(STV_VDP2_W0LWE || STV_VDP2_W1LWE)
4312         popmessage("Line Window %s enabled, contact MAMEdev",STV_VDP2_W0LWE ? "0" : "1");
4313
4314      if(STV_VDP2_SFPRMD)
4315         popmessage("Special Priority Mode enabled %04x, contact MAMEdev",STV_VDP2_SFPRMD);
41984316   }
41994317}
42004318
r12453r12454
45924710static void stv_vdp2_draw_NBG0(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
45934711{
45944712   saturn_state *state = machine.driver_data<saturn_state>();
4713   UINT32 base_mask;
45954714
4715   base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff;
4716
45964717   /*
45974718       Colours           : 16, 256, 2048, 32768, 16770000
45984719       Char Size         : 1x1 cells, 2x2 cells
r12453r12454
46564777
46574778   stv2_current_tilemap.linescroll_enable = STV_VDP2_N0LSCX;
46584779   stv2_current_tilemap.linescroll_interval = (((STV_VDP2_LSMD & 3) == 2) ? (2) : (1)) << (STV_VDP2_N0LSS);
4659   stv2_current_tilemap.linescroll_table_address = ((STV_VDP2_LSTA0U << 16) | STV_VDP2_LSTA0L) * 2;
4780   stv2_current_tilemap.linescroll_table_address = (((STV_VDP2_LSTA0U << 16) | STV_VDP2_LSTA0L) & base_mask) * 2;
46604781   stv2_current_tilemap.vertical_linescroll_enable = STV_VDP2_N0LSCY;
46614782   stv2_current_tilemap.linezoom_enable = STV_VDP2_N0LZMX;
46624783
r12453r12454
46724793                                (STV_VDP2_N0W1A << 5) |
46734794                                (STV_VDP2_N0SWA << 6);
46744795
4796   stv2_current_tilemap.line_screen_enabled = STV_VDP2_N0LCEN;
4797
46754798   stv2_current_tilemap.layer_name=0;
46764799
46774800   if ( stv2_current_tilemap.enabled && (!(STV_VDP2_R1ON))) /* TODO: check cycle pattern for RBG1 */
r12453r12454
46884811static void stv_vdp2_draw_NBG1(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
46894812{
46904813   saturn_state *state = machine.driver_data<saturn_state>();
4814   UINT32 base_mask;
46914815
4816   base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff;
4817
46924818   /*
46934819       Colours           : 16, 256, 2048, 32768
46944820       Char Size         : 1x1 cells, 2x2 cells
r12453r12454
47514877
47524878   stv2_current_tilemap.linescroll_enable = STV_VDP2_N1LSCX;
47534879   stv2_current_tilemap.linescroll_interval = (((STV_VDP2_LSMD & 3) == 2) ? (2) : (1)) << (STV_VDP2_N1LSS);
4754   stv2_current_tilemap.linescroll_table_address = ((STV_VDP2_LSTA1U << 16) | STV_VDP2_LSTA1L) * 2;
4880   stv2_current_tilemap.linescroll_table_address = (((STV_VDP2_LSTA1U << 16) | STV_VDP2_LSTA1L) & base_mask) * 2;
47554881   stv2_current_tilemap.vertical_linescroll_enable = STV_VDP2_N1LSCY;
47564882   stv2_current_tilemap.linezoom_enable = STV_VDP2_N1LZMX;
47574883
r12453r12454
47674893                                (STV_VDP2_N1W1A << 5) |
47684894                                (STV_VDP2_N1SWA << 6);
47694895
4896   stv2_current_tilemap.line_screen_enabled = STV_VDP2_N1LCEN;
4897
47704898   stv2_current_tilemap.layer_name=1;
47714899
47724900   if ( stv2_current_tilemap.enabled )
r12453r12454
48674995                                (STV_VDP2_N2W1A << 5) |
48684996                                (STV_VDP2_N2SWA << 6);
48694997
4998   stv2_current_tilemap.line_screen_enabled = STV_VDP2_N2LCEN;
4999
48705000   stv2_current_tilemap.layer_name=2;
48715001
48725002   stv2_current_tilemap.plane_size = STV_VDP2_N2PLSZ;
r12453r12454
49685098                                (STV_VDP2_N3W1A << 5) |
49695099                                (STV_VDP2_N3SWA << 6);
49705100
5101   stv2_current_tilemap.line_screen_enabled = STV_VDP2_N3LCEN;
5102
49715103   stv2_current_tilemap.layer_name=3;
49725104
49735105   stv2_current_tilemap.plane_size = STV_VDP2_N3PLSZ;
r12453r12454
52405372   stv2_current_tilemap.vertical_linescroll_enable = 0;
52415373   stv2_current_tilemap.linezoom_enable = 0;
52425374
5375   stv2_current_tilemap.line_screen_enabled = STV_VDP2_R0LCEN;
5376
52435377   /*Use 0x80 as a normal/rotate switch*/
52445378   stv2_current_tilemap.layer_name=0x80;
52455379
r12453r12454
52965430            b = (dot & 0x7c00) >> 10;
52975431            g = (dot & 0x03e0) >> 5;
52985432            r = (dot & 0x001f) >> 0;
5433            if(STV_VDP2_BKCOEN)
5434               stv_vdp2_compute_color_offset_RGB555( machine, &r, &g, &b, STV_VDP2_BKCOSL );
52995435
53005436            *BITMAP_ADDR16(bitmap, y,x) = b | g << 5 | r << 10;
53015437         }
r12453r12454
66236759   }
66246760
66256761#if DEBUG_MODE
6626   if(STV_VDP2_VRAMSZ && VDP2_ERR(0x80000000))
6627   {
6628      VDP2_CHK(0x80000000);
6629      mame_printf_debug("Warning: VRAM Size = 8 MBit!\n");
6630   }
6631   if(STV_VDP2_CRKTE && VDP2_ERR(0x40000000))
6632   {
6633      VDP2_CHK(0x40000000);
6634      mame_printf_debug("Warning: Color RAM Coefficient Table Ctrl used\n");
6635   }
6636
66376762   /*popmessage("N0 %02x %04x %02x %04x N1 %02x %04x %02x %04x"
66386763    ,STV_VDP2_N0ZMXI,STV_VDP2_N0ZMXD
66396764    ,STV_VDP2_N0ZMYI,STV_VDP2_N0ZMYD

Previous 15994 Revisions Next


© 1998-2018 The MESS Team