Previous 199869 Revisions Next

r21187 Tuesday 19th February, 2013 at 18:12:34 UTC by David Haywood
play with some of the blitter values a bit (nw)
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21186r21187
294294   int m_vPosition;
295295   int m_hPosition;
296296
297   UINT16 m_vOrigin;
298   UINT16 m_hOrigin;
299   UINT16 m_vZoom;
300   UINT16 m_hZoom;
301
297302   required_device<cpu_device> m_maincpu;
298303   required_device<cpu_device> m_subcpu;
299304   required_device<cpu_device> m_soundcpu;
r21186r21187
569574               m_vCellCount = (data & 0xffff0000) >> 16;
570575               m_hCellCount = (data & 0x0000ffff);
571576            }
577            else if (m_blitterSerialCount == 7)
578            {     
579               m_vOrigin = (data & 0xffff0000) >> 16;
580               m_hOrigin = (data & 0x0000ffff);
581               //printf("%04x %04x\n", m_vOrigin, m_hOrigin);
582            }
583            else if (m_blitterSerialCount == 8)
584            {
585               m_vZoom = (data & 0xffff0000) >> 16;
586               m_hZoom = (data & 0x0000ffff);
587            }
572588            else if (m_blitterSerialCount == 9)
573589            {
574590               m_vPosition = (data & 0xffff0000) >> 16;
r21186r21187
588604               else // 0x90, 0xa0, 0xb0, 0xc0
589605                  drawbitmap = &m_temp_bitmap_sprites2;
590606
607               int sizex = m_hCellCount * 16 * m_hZoom;
608               int sizey = m_vCellCount * 16 * m_vZoom;
609               m_hPosition *= 0x40;
610               m_vPosition *= 0x40;
611
612               switch (m_vOrigin & 3)
613               {
614               case 0:
615                  // top
616                  break;
617               case 1:
618                  m_vPosition -= sizey / 2 ;
619                  // middle?
620                  break;
621               case 2:
622                  m_vPosition -= sizey;
623                  // bottom?
624                  break;
625               case 3:
626                  // invalid?
627                  break;
628               }
629               
630               switch (m_hOrigin & 3)
631               {
632               case 0:
633                  // left
634                  break;
635               case 1:
636                  m_hPosition -= sizex / 2;
637                  // middle?
638                  break;
639               case 2:
640                  m_hPosition -= sizex;
641                  // right?
642                  break;
643               case 3:
644                  // invalid?
645                  break;
646               }
647
591648               // Splat some sprites
592649               for (int h = 0; h < m_hCellCount; h++)
593650               {
594651                  for (int v = 0; v < m_vCellCount; v++)
595652                  {
596                     const int pixelOffsetX = (m_hPosition) + (h*16);
597                     const int pixelOffsetY = (m_vPosition) + (v*16);
653                     const int pixelOffsetX = ((m_hPosition) + (h* 16 * m_hZoom)) / 0x40;
654                     const int pixelOffsetY = ((m_vPosition) + (v* 16 * m_vZoom)) / 0x40;
598655
599656                     // It's unknown if it's row-major or column-major
600657                     // TODO: Study the CRT test and "Cool Riders" logo for clues.
601658                     UINT8 spriteNumber = space.read_byte(memOffset + h + (v*h));
602659
603660                     // DEBUG: For demo purposes, skip &spaces and NULL characters
604                     if (spriteNumber == 0x20 || spriteNumber == 0x00)
605                        continue;
661                     if (m_blitterMode == 0x30 || m_blitterMode == 0x90)
662                        if (spriteNumber == 0x20 || spriteNumber == 0x00)
663                           continue;
606664
665                     
666                     int blockwide = ((16*m_hZoom)/0x40)-1;
667                     int blockhigh = ((16*m_vZoom)/0x40)-1;
668                     // hack
669                     if (blockwide<=0) blockwide = 1;
670                     if (blockhigh<=0) blockhigh = 1;
671
607672                     // DEBUG: Draw 16x16 block
608                     for (int x = 1; x < 15; x++)
673                     for (int x = 0; x < blockwide; x++)
609674                     {
610                        for (int y = 1; y < 15; y++)
675                        for (int y = 0; y < blockhigh; y++)
611676                        {
612677
613678                           UINT32 color = 0xffffffff;
r21186r21187
636701                              color = 0xff000000 | ((((m_colorNumber & 0xff) | 0x80)-0x40) << 16);
637702                           }
638703
704
639705                           if (drawbitmap->cliprect().contains(pixelOffsetX+x, pixelOffsetY+y))
640706                              if (drawbitmap->pix32(pixelOffsetY+y, pixelOffsetX+x)==0) drawbitmap->pix32(pixelOffsetY+y, pixelOffsetX+x) = color;
641707                        }
r21186r21187
13511417   MCFG_SCREEN_ADD("lscreen", RASTER)
13521418   MCFG_SCREEN_REFRESH_RATE(60)
13531419   MCFG_SCREEN_SIZE(640, 512)
1354   //MCFG_SCREEN_VISIBLE_AREA(0,495, 0, 383) // this resolution is right for test mode, but too low for the game, it can probably change
1355   MCFG_SCREEN_VISIBLE_AREA(0,639, 0, 479)
1420   MCFG_SCREEN_VISIBLE_AREA(0,495, 0, 383) // the game uses this resolution
1421   //MCFG_SCREEN_VISIBLE_AREA(0,639, 0, 479) // the 'for use in Japan screen uses this resolution' (Outrunners also uses the higher res for this screen on system 32..)
13561422   MCFG_SCREEN_UPDATE_DRIVER(coolridr_state, screen_update_coolridr1)
13571423
13581424   MCFG_SCREEN_ADD("rscreen", RASTER)
13591425   MCFG_SCREEN_REFRESH_RATE(60)
13601426   MCFG_SCREEN_SIZE(640, 512)
1361   //MCFG_SCREEN_VISIBLE_AREA(0,495, 0, 383)
1362   MCFG_SCREEN_VISIBLE_AREA(0,639, 0, 479)
1427   MCFG_SCREEN_VISIBLE_AREA(0,495, 0, 383) // the game uses this resolution
1428   //MCFG_SCREEN_VISIBLE_AREA(0,639, 0, 479) // the 'for use in ... screen uses this resolution'
13631429   MCFG_SCREEN_UPDATE_DRIVER(coolridr_state, screen_update_coolridr2)
13641430
13651431
r21186r21187
14521518   machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60d8894, 0x060d8897, read32_delegate(FUNC(coolridr_state::coolridr_hack2_r), this));
14531519}
14541520
1455GAME( 1995, coolridr,    0, coolridr,    coolridr, coolridr_state,    coolridr, ROT0,  "Sega", "Cool Riders (US)",GAME_NOT_WORKING|GAME_NO_SOUND )
1521GAME( 1995, coolridr,    0, coolridr,    coolridr, coolridr_state,    coolridr, ROT0,  "Sega", "Cool Riders",GAME_NOT_WORKING|GAME_NO_SOUND ) // was marked 'US' but clearly uploads a Japan warning, might be a jumper select

Previous 199869 Revisions Next


© 1997-2024 The MAME Team