Previous 199869 Revisions Next

r45187 Wednesday 24th February, 2016 at 02:41:18 UTC by Roberto Fresca
Space Rocks: Marked the bipolar PROM as bad dump...
[src/mame/drivers]asteroid.cpp system16.cpp
[src/mame/includes]system16.h
[src/mame/video]system16.cpp
[src/osd/windows]window.cpp

trunk/src/mame/drivers/asteroid.cpp
r253698r253699
786786
787787   /* DVG PROM */
788788   ROM_REGION( 0x100, "user1", 0 )
789   ROM_LOAD( "034602-01.c8",  0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
789   ROM_LOAD( "034602-01.c8",  0x0000, 0x0100, BAD_DUMP CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) ) // still undumped.
790790ROM_END
791791
792792ROM_START( aerolitos )
r253698r253699
10111011ROM_END
10121012
10131013
1014
10151014/*************************************
10161015 *
10171016 *  Driver initialization
r253698r253699
10301029   m_maincpu->space(AS_PROGRAM).install_read_handler(0x2000, 0x2007, read8_delegate(FUNC(asteroid_state::asterock_IN0_r),this));
10311030}
10321031
1032
10331033/*************************************
10341034 *
10351035 *  Game drivers
trunk/src/mame/drivers/system16.cpp
r253698r253699
13541354   return 0xffff;//rand();
13551355}
13561356
1357WRITE16_MEMBER(segas1x_bootleg_state::ddcrewbl_spritebank_w)
1358{
1359//   printf("banking write %08x: %04x (%04x %04x)\n", space.device().safe_pc(), offset*2, data&mem_mask, mem_mask);
1360
1361   data &= mem_mask;
1362//   offset &= 0x7;
1363   offset += 4;
1364
1365   int maxbanks = memregion("sprites")->bytes() / 0x40000;
1366   if (data >= maxbanks)
1367      data = 255;
1368   m_sprites->set_bank((offset) * 2 + 0, data * 2 + 0);
1369   m_sprites->set_bank((offset) * 2 + 1, data * 2 + 1);
1370}
1371
1372
13731357// todo: this
1374static ADDRESS_MAP_START(ddcrewbl_map, AS_PROGRAM, 16, segas1x_bootleg_state)
1375   AM_RANGE(0x000000, 0x07ffff) AM_ROM // ok
1376   AM_RANGE(0x200000, 0x27ffff) AM_ROM // ok
1358static ADDRESS_MAP_START( ddcrewbl_map, AS_PROGRAM, 16, segas1x_bootleg_state )
1359   AM_RANGE(0x000000, 0x07ffff) AM_ROM
1360   AM_RANGE(0x200000, 0x27ffff) AM_ROM
13771361
13781362   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_SHARE("tileram")
13791363   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram")
1380   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites") // ok
1364   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
1365//   AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("COINAGE")
1366//   AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("DSW1")
13811367
1382   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") // ok
1368//   AM_RANGE(0xa0000e, 0xa0000f) AM_WRITE(sys18_tilebank_w)
1369//   AM_RANGE(0xa01000, 0xa01001) AM_READ_PORT("SERVICE")
1370//   AM_RANGE(0xa01002, 0xa01003) AM_READ_PORT("P1")
1371//   AM_RANGE(0xa01004, 0xa01005) AM_READ_PORT("P2")
1372//   AM_RANGE(0xa01006, 0xa01007) AM_READ_PORT("P3")
13831373
1384   AM_RANGE(0xC00000, 0xC00001) AM_WRITENOP // vdp leftovers maybe?
1385   AM_RANGE(0xC00004, 0xC00005) AM_WRITENOP
1386   AM_RANGE(0xC00006, 0xC00007) AM_WRITENOP
1387   
1374   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
13881375
1376   AM_RANGE(0xC00000, 0xC00001) AM_WRITENOP
1377
13891378   AM_RANGE(0xC40000, 0xC40001) AM_READ(ddcrew_c41006_r)
13901379   AM_RANGE(0xC40002, 0xC40003) AM_READ(ddcrew_c41006_r)
1380
1381
13911382   AM_RANGE(0xC41000, 0xC41001) AM_READ(ddcrew_c41006_r)
1392   AM_RANGE(0xC41002, 0xC41003) AM_READ(ddcrew_c41006_r)
1393   AM_RANGE(0xC41004, 0xC41005) AM_READ(ddcrew_c41006_r)
13941383   AM_RANGE(0xC41006, 0xC41007) AM_READ(ddcrew_c41006_r)
13951384
1396
1397   
1398   AM_RANGE(0xC44000, 0xC44001) AM_WRITENOP
1399
14001385   AM_RANGE(0xc46600, 0xc46601) AM_WRITE(sys18_refreshenable_w)
1401
1402   AM_RANGE(0xC46038, 0xC4603f) AM_WRITE(ddcrewbl_spritebank_w) // ok
1403
1404   AM_RANGE(0xC46000, 0xC46001) AM_WRITENOP
1405   AM_RANGE(0xC46010, 0xC46011) AM_WRITENOP
1406   AM_RANGE(0xC46020, 0xC46021) AM_WRITENOP
1407
1408   AM_RANGE(0xC46040, 0xC46041) AM_WRITENOP
1409   AM_RANGE(0xC46050, 0xC46051) AM_WRITENOP
1410
1411   AM_RANGE(0xC46060, 0xC46061) AM_WRITENOP
1412   AM_RANGE(0xC46062, 0xC46063) AM_WRITENOP
1413   AM_RANGE(0xC46064, 0xC46065) AM_WRITENOP
1414
1415   AM_RANGE(0xC46070, 0xC46071) AM_WRITENOP
1416   
1417   AM_RANGE(0xffc000, 0xffffff) AM_RAM // ok
1386   AM_RANGE(0xffc000, 0xffffff) AM_RAM
14181387ADDRESS_MAP_END
14191388
14201389/*************************************
r253698r253699
25032472MACHINE_CONFIG_END
25042473
25052474
2506MACHINE_RESET_MEMBER(segas1x_bootleg_state,ddcrewbl)
2507{
2508   // set up the initial banks for this game
2509   // because it doesn't appear to actually program banks 0-3.
2510   for (int i = 0; i < 4; i++)
2511   {
2512      m_sprites->set_bank((i)* 2 + 0, i * 2 + 0);
2513      m_sprites->set_bank((i)* 2 + 1, i * 2 + 1);
2514   }
2515}
2516
2517
25182475static MACHINE_CONFIG_START( ddcrewbl, segas1x_bootleg_state )
25192476
25202477   /* basic machine hardware */
r253698r253699
25372494   MCFG_VIDEO_START_OVERRIDE(segas1x_bootleg_state,system18old)
25382495
25392496   MCFG_BOOTLEG_SYS16B_SPRITES_ADD("sprites")
2540   MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-124)
2497   MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-107)
25412498
2542   MCFG_MACHINE_RESET_OVERRIDE(segas1x_bootleg_state,ddcrewbl)
2543
25442499MACHINE_CONFIG_END
25452500
25462501
r253698r253699
37853740DRIVER_INIT_MEMBER(segas1x_bootleg_state,ddcrewbl)
37863741{
37873742   DRIVER_INIT_CALL(common);
3743   m_spritebank_type = 0;
37883744}
37893745
37903746
trunk/src/mame/includes/system16.h
r253698r253699
131131   DECLARE_READ16_MEMBER(passht4b_io3_r);
132132   DECLARE_READ16_MEMBER(ddcrew_c41006_r);
133133   DECLARE_WRITE16_MEMBER(sys16_tilebank_w);
134   DECLARE_WRITE16_MEMBER(ddcrewbl_spritebank_w);
135134   DECLARE_WRITE8_MEMBER(tturfbl_msm5205_data_w);
136135   DECLARE_READ8_MEMBER(tturfbl_soundbank_r);
137136   DECLARE_WRITE8_MEMBER(tturfbl_soundbank_w);
r253698r253699
188187   DECLARE_DRIVER_INIT(goldnaxeb1);
189188   DECLARE_DRIVER_INIT(ddcrewbl);
190189   DECLARE_DRIVER_INIT(common);
191   DECLARE_MACHINE_RESET(ddcrewbl);
192190   TILEMAP_MAPPER_MEMBER(sys16_bg_map);
193191   TILEMAP_MAPPER_MEMBER(sys16_text_map);
194192   TILE_GET_INFO_MEMBER(get_bg_tile_info);
trunk/src/mame/video/system16.cpp
r253698r253699
3434
3535void segas1x_bootleg_state::setup_system16_bootleg_spritebanking(  )
3636{
37   if (m_spritebank_type == 0)
37   if (m_spritebank_type == 1)
3838   {
39      static const UINT8 default_banklist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
40      int i;
41      for (i = 0; i < 16; i++)
42         m_sprites->set_bank(i, default_banklist[i]);
43   }
44   else
45   {
3946      static const UINT8 alternate_banklist[] = { 0,255,255,255, 255,255,255,3, 255,255,255,2, 255,1,0,255 };
4047      int i;
4148      for (i = 0; i < 16; i++)
trunk/src/osd/windows/window.cpp
r253698r253699
16131613}
16141614
16151615
1616static inline int better_mode(int width0, int height0, int width1, int height1, float desired_aspect)
1617{
1618   float aspect0 = (float)width0 / (float)height0;
1619   float aspect1 = (float)width1 / (float)height1;
1620   return (fabs(desired_aspect - aspect0) < fabs(desired_aspect - aspect1)) ? 0 : 1;
1621}
16161622
16171623//============================================================
16181624//  constrain_to_aspect_ratio
r253698r253699
16261632   INT32 propwidth, propheight;
16271633   INT32 minwidth, minheight;
16281634   INT32 maxwidth, maxheight;
1629   INT32 viswidth, visheight;
16301635   INT32 adjwidth, adjheight;
1631   float pixel_aspect;
1636   float desired_aspect = 1.0f;
1637   osd_dim window_dim = get_size();
1638   INT32 target_width = window_dim.width();
1639   INT32 target_height = window_dim.height();
1640   INT32 xscale = 1, yscale = 1;
1641   int newwidth, newheight;
16321642   osd_monitor_info *monitor = winwindow_video_window_monitor(&rect);
16331643
16341644   assert(GetCurrentThreadId() == window_threadid);
16351645
16361646   // get the pixel aspect ratio for the target monitor
1637   pixel_aspect = monitor->aspect();
1647   float pixel_aspect = monitor->aspect();
16381648
16391649   // determine the proposed width/height
16401650   propwidth = rect.width() - extrawidth;
r253698r253699
16621672   // get the minimum width/height for the current layout
16631673   m_target->compute_minimum_size(minwidth, minheight);
16641674
1675   // compute the appropriate visible area if we're trying to keepaspect
1676   if (video_config.keepaspect)
1677   {
1678      // make sure the monitor is up-to-date
1679      m_target->compute_visible_area(target_width, target_height, m_monitor->aspect(), m_target->orientation(), target_width, target_height);
1680      desired_aspect = (float)target_width / (float)target_height;
1681   }
1682
1683   // non-integer scaling - often gives more pleasing results in full screen
1684   if (!video_config.fullstretch)
1685   {
1686      // compute maximum integral scaling to fit the window
1687      xscale = (target_width + 2) / newwidth;
1688      yscale = (target_height + 2) / newheight;
1689
1690      // try a little harder to keep the aspect ratio if desired
1691      if (video_config.keepaspect)
1692      {
1693         // if we could stretch more in the X direction, and that makes a better fit, bump the xscale
1694         while (newwidth * (xscale + 1) <= window_dim.width() &&
1695            better_mode(newwidth * xscale, newheight * yscale, newwidth * (xscale + 1), newheight * yscale, desired_aspect))
1696            xscale++;
1697
1698         // if we could stretch more in the Y direction, and that makes a better fit, bump the yscale
1699         while (newheight * (yscale + 1) <= window_dim.height() &&
1700            better_mode(newwidth * xscale, newheight * yscale, newwidth * xscale, newheight * (yscale + 1), desired_aspect))
1701            yscale++;
1702
1703         // now that we've maxed out, see if backing off the maximally stretched one makes a better fit
1704         if (window_dim.width() - newwidth * xscale < window_dim.height() - newheight * yscale)
1705         {
1706            while (better_mode(newwidth * xscale, newheight * yscale, newwidth * (xscale - 1), newheight * yscale, desired_aspect) && (xscale >= 0))
1707               xscale--;
1708         }
1709         else
1710         {
1711            while (better_mode(newwidth * xscale, newheight * yscale, newwidth * xscale, newheight * (yscale - 1), desired_aspect) && (yscale >= 0))
1712               yscale--;
1713         }
1714      }
1715
1716      // ensure at least a scale factor of 1
1717      if (xscale <= 0) xscale = 1;
1718      if (yscale <= 0) yscale = 1;
1719
1720      // apply the final scale
1721      newwidth *= xscale;
1722      newheight *= yscale;
1723   }
1724   else
1725   {
1726      newwidth = target_width;
1727      newheight = target_height;
1728   }
1729
16651730   // clamp against the absolute minimum
16661731   propwidth = MAX(propwidth, MIN_WINDOW_DIM);
16671732   propheight = MAX(propheight, MIN_WINDOW_DIM);
r253698r253699
16921757   propwidth = MIN(propwidth, maxwidth);
16931758   propheight = MIN(propheight, maxheight);
16941759
1695   // compute the visible area based on the proposed rectangle
1696   m_target->compute_visible_area(propwidth, propheight, pixel_aspect, m_target->orientation(), viswidth, visheight);
1697
16981760   // compute the adjustments we need to make
1699   adjwidth = (viswidth + extrawidth) - rect.width();
1700   adjheight = (visheight + extraheight) - rect.height();
1761   adjwidth = (propwidth + extrawidth) - rect.width();
1762   adjheight = (propheight + extraheight) - rect.height();
17011763
17021764   // based on which corner we're adjusting, constrain in different ways
17031765   osd_rect ret(rect);
r253698r253699
17241786         ret = rect.move_by(0, -adjheight).resize(rect.width() + adjwidth, rect.height() + adjheight);
17251787         break;
17261788   }
1789
17271790   return ret;
17281791}
17291792


Previous 199869 Revisions Next


© 1997-2024 The MAME Team