Previous 199869 Revisions Next

r44388 Saturday 23rd January, 2016 at 21:36:20 UTC by hap
m58: small cleanup
[src/mame/drivers]m58.cpp
[src/mame/includes]m58.h
[src/mame/video]m58.cpp

trunk/src/mame/drivers/m58.cpp
r252899r252900
211211
212212   /* sound hardware */
213213   MCFG_DEVICE_ADD("irem_audio", IREM_M52_LARGE_AUDIO, 0)
214
215214MACHINE_CONFIG_END
216215
217216
r252899r252900
222221 *
223222 *************************************/
224223
225ROM_START( 10yard )
226// Dumped from an original Irem M52 board. Serial no. 307761/License Seal 09461.
224ROM_START( 10yard ) // Dumped from an original Irem M52 board. Serial no. 307761/License Seal 09461.
227225   ROM_REGION( 0x10000, "maincpu", 0 )
228226   ROM_LOAD( "yf-a-3p-b",    0x0000, 0x2000, CRC(2e205ec2) SHA1(fcfa08f45423b35f2c99d4e6b5474ab1b3a84fec) )
229227   ROM_LOAD( "yf-a-3n-b",    0x2000, 0x2000, CRC(82fcd980) SHA1(7846705b29961cb95ee1571ee7e16baceea522d4) )
r252899r252900
384382   ROM_LOAD( "yf-b-5j.5j",      0x08000, 0x2000, CRC(713ef31f) SHA1(b48df9ed4f26fded3c7eaac3a52b580b2dd60477) )
385383   ROM_LOAD( "yf-b-5k.5k",      0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
386384
387   ROM_REGION( 0x0520, "proms", 0 )
385   ROM_REGION( 0x0520, "proms", 0 ) // on these sets the content of the sprite color PROM needs reversing - are the proms on the other sets from bootleg boards, or hand modified?
388386   ROM_LOAD( "yf-a-5c.5c",      0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
389387   ROM_LOAD( "yf-a-5d.5d",      0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
390   ROM_LOAD( "yf-b-2b.2b",      0x0200, 0x0020, CRC(fcd283ea) SHA1(6ebc3e966bb920685250f38edab5fe1f8a27c316) ) /* sprites palette */
388   ROMX_LOAD( "yf-b-2b.2b",     0x0200, 0x0020, CRC(fcd283ea) SHA1(6ebc3e966bb920685250f38edab5fe1f8a27c316), ROM_GROUPSIZE(16) | ROM_REVERSE ) /* sprites palette */
391389   ROM_LOAD( "yf-b-3l.3l",      0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
392390   ROM_LOAD( "yf-b-2r.2r",      0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
393391   ROM_LOAD( "yf-b-2p.2p",      0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
r252899r252900
418416   ROM_LOAD( "yf-b-5j.5j",      0x08000, 0x2000, CRC(713ef31f) SHA1(b48df9ed4f26fded3c7eaac3a52b580b2dd60477) )
419417   ROM_LOAD( "yf-b-5k.5k",      0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
420418
421   ROM_REGION( 0x0520, "proms", 0 )
419   ROM_REGION( 0x0520, "proms", 0 ) // on these sets the content of the sprite color PROM needs reversing - are the proms on the other sets from bootleg boards, or hand modified?
422420   ROM_LOAD( "yf-a-5c.5c",      0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
423421   ROM_LOAD( "yf-a-5d.5d",      0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
424   ROM_LOAD( "yf-b-2b.2b",      0x0200, 0x0020, CRC(fcd283ea) SHA1(6ebc3e966bb920685250f38edab5fe1f8a27c316) ) /* sprites palette */
422   ROMX_LOAD( "yf-b-2b.2b",     0x0200, 0x0020, CRC(fcd283ea) SHA1(6ebc3e966bb920685250f38edab5fe1f8a27c316), ROM_GROUPSIZE(16) | ROM_REVERSE ) /* sprites palette */
425423   ROM_LOAD( "yf-b-3l.3l",      0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
426424   ROM_LOAD( "yf-b-2r.2r",      0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
427425   ROM_LOAD( "yf-b-2p.2p",      0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
428426ROM_END
429427
430/*************************************
431 *
432 *  Game drivers
433 *
434 *************************************/
435428
436DRIVER_INIT_MEMBER(m58_state,yard85)
437{
438   // on these sets the content of the sprite color PROM needs reversing
439   //  are the proms on the other sets from bootleg boards, or hand modified?
440   std::unique_ptr<UINT8[]> buffer = std::make_unique<UINT8[]>(0x10);
441   UINT8* region = memregion("proms")->base();
442   int i;
443
444   for (i=0;i<0x10;i++)
445   {
446      buffer[i] = region[0x20f-i];
447   }
448   memcpy(region+0x200, buffer.get(), 0x10);
449   m_palette->update();
450}
451
452GAME( 1983, 10yard,   0,        yard,     yard, driver_device,     0, ROT0, "Irem", "10-Yard Fight (World, set 1)", MACHINE_SUPPORTS_SAVE ) // no copyright
453GAME( 1983, 10yardj,  10yard,   yard,     yard, driver_device,     0, ROT0, "Irem", "10-Yard Fight (Japan)", MACHINE_SUPPORTS_SAVE )
454GAME( 1984, vs10yard, 10yard,   yard,     vs10yard, driver_device, 0, ROT0, "Irem", "Vs 10-Yard Fight (World, 11/05/84)", MACHINE_SUPPORTS_SAVE )
455GAME( 1984, vs10yardj,10yard,   yard,     vs10yarj, driver_device, 0, ROT0, "Irem", "Vs 10-Yard Fight (Japan)", MACHINE_SUPPORTS_SAVE )
456GAME( 1984, vs10yardu,10yard,   yard,     vs10yard, m58_state, yard85, ROT0, "Irem (Taito license)", "Vs 10-Yard Fight (US, Taito license)", MACHINE_SUPPORTS_SAVE ) // had '85 stickers, but doesn't have '85 on the title screen like the set below
457GAME( 1985, 10yard85, 10yard,   yard,     yard, m58_state,     yard85, ROT0, "Irem (Taito license)", "10-Yard Fight '85 (US, Taito license)", MACHINE_SUPPORTS_SAVE )
429/*    YEAR  NAME       PARENT    MACHINE  INPUT     INIT              MONITOR, COMPANY, FULLNAME, FLAGS */
430GAME( 1983, 10yard,    0,        yard,    yard,     driver_device, 0, ROT0, "Irem", "10-Yard Fight (World, set 1)", MACHINE_SUPPORTS_SAVE ) // no copyright
431GAME( 1983, 10yardj,   10yard,   yard,    yard,     driver_device, 0, ROT0, "Irem", "10-Yard Fight (Japan)", MACHINE_SUPPORTS_SAVE )
432GAME( 1984, vs10yard,  10yard,   yard,    vs10yard, driver_device, 0, ROT0, "Irem", "Vs 10-Yard Fight (World, 11/05/84)", MACHINE_SUPPORTS_SAVE )
433GAME( 1984, vs10yardj, 10yard,   yard,    vs10yarj, driver_device, 0, ROT0, "Irem", "Vs 10-Yard Fight (Japan)", MACHINE_SUPPORTS_SAVE )
434GAME( 1984, vs10yardu, 10yard,   yard,    vs10yard, driver_device, 0, ROT0, "Irem (Taito license)", "Vs 10-Yard Fight (US, Taito license)", MACHINE_SUPPORTS_SAVE ) // had '85 stickers, but doesn't have '85 on the title screen like the set below
435GAME( 1985, 10yard85,  10yard,   yard,    yard,     driver_device, 0, ROT0, "Irem (Taito license)", "10-Yard Fight '85 (US, Taito license)", MACHINE_SUPPORTS_SAVE )
trunk/src/mame/includes/m58.h
r252899r252900
11// license:BSD-3-Clause
22// copyright-holders:Lee Taylor
33// thanks-to:John Clegg
4/****************************************************************************
5
6    Irem M58 hardware
7
8****************************************************************************/
9
410class m58_state : public driver_device
511{
612public:
r252899r252900
1521      m_scroll_x_low(*this, "scroll_x_low"),
1622      m_scroll_x_high(*this, "scroll_x_high"),
1723      m_scroll_y_low(*this, "scroll_y_low"),
18      m_score_panel_disabled(*this, "score_disable") { }
24      m_score_panel_disabled(*this, "score_disable")
25   { }
1926
2027   /* devices */
2128   required_device<cpu_device> m_maincpu;
r252899r252900
3239   required_shared_ptr<UINT8> m_score_panel_disabled;
3340
3441   /* video-related */
35   tilemap_t*             m_bg_tilemap;
36   bitmap_ind16             m_scroll_panel_bitmap;
42   tilemap_t* m_bg_tilemap;
43   bitmap_ind16 m_scroll_panel_bitmap;
3744
3845   DECLARE_WRITE8_MEMBER(videoram_w);
3946   DECLARE_WRITE8_MEMBER(scroll_panel_w);
4047   DECLARE_WRITE8_MEMBER(flipscreen_w);
4148
42   DECLARE_DRIVER_INIT(yard85);
4349   virtual void video_start() override;
4450   DECLARE_PALETTE_INIT(m58);
4551
trunk/src/mame/video/m58.cpp
r252899r252900
1111#include "video/resnet.h"
1212#include "includes/m58.h"
1313
14#define SCROLL_PANEL_WIDTH  (14*4)
15#define RADAR_PALETTE_BASE  (256)
1614
1715
18
1916/*************************************
2017 *
2118 *  Palette configuration
r252899r252900
114111
115112WRITE8_MEMBER(m58_state::scroll_panel_w)
116113{
117   int sx,sy,i;
114   int sx = ( offset % 16 );
115   int sy = ( offset / 16 );
118116
119   sx = ( offset % 16 );
120   sy = ( offset / 16 );
121
122117   if (sx < 1 || sx > 14)
123118      return;
124119
125120   sx = 4 * (sx - 1);
126121
127   for (i = 0;i < 4;i++)
122   for (int i = 0;i < 4;i++)
128123   {
129124      int col;
130125
131126      col = (data >> i) & 0x11;
132127      col = ((col >> 3) | col) & 3;
133128
134      m_scroll_panel_bitmap.pix16(sy, sx + i) = RADAR_PALETTE_BASE + (sy & 0xfc) + col;
129      m_scroll_panel_bitmap.pix16(sy, sx + i) = 0x100 + (sy & 0xfc) + col;
135130   }
136131}
137132
r252899r252900
178173   int height = m_screen->height();
179174   const rectangle &visarea = m_screen->visible_area();
180175
181   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m58_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(m58_state::tilemap_scan_rows),this), 8, 8, 64, 32);
176   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m58_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(m58_state::tilemap_scan_rows),this), 8, 8, 64, 32);
182177   m_bg_tilemap->set_scrolldx(visarea.min_x, width - (visarea.max_x + 1));
183178   m_bg_tilemap->set_scrolldy(visarea.min_y - 8, height + 16 - (visarea.max_y + 1));
184179
185   //m_scroll_panel_bitmap = std::make_unique<bitmap_ind16>(SCROLL_PANEL_WIDTH, height);
186180   m_screen->register_screen_bitmap(m_scroll_panel_bitmap);
187181   save_item(NAME(m_scroll_panel_bitmap));
188182}
r252899r252900
212206 *
213207 *************************************/
214208
215#define DRAW_SPRITE(code, sy)  m_gfxdecode->gfx(1)->transmask(bitmap,cliprect, code, color, flipx, flipy, sx, sy, m_palette->transpen_mask(*m_gfxdecode->gfx(1), color, 512));
216
217209void m58_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
218210{
219   int offs;
220211   const rectangle &visarea = m_screen->visible_area();
221212
222   for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
213   for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
223214   {
224215      int attr = m_spriteram[offs + 1];
225216      int bank = (attr & 0x20) >> 5;
r252899r252900
254245      {
255246         sy2 = sy1 + 0x10;
256247      }
257
258      DRAW_SPRITE(code1 + 256 * bank, visarea.min_y + sy1)
259      DRAW_SPRITE(code2 + 256 * bank, visarea.min_y + sy2)
248     
249      m_gfxdecode->gfx(1)->transmask(bitmap, cliprect,
250         code1 + 256 * bank, color,
251         flipx, flipy, sx, visarea.min_y + sy1,
252         m_palette->transpen_mask(*m_gfxdecode->gfx(1), color, 512)
253      );
254      m_gfxdecode->gfx(1)->transmask(bitmap, cliprect,
255         code2 + 256 * bank, color,
256         flipx, flipy, sx, visarea.min_y + sy2,
257         m_palette->transpen_mask(*m_gfxdecode->gfx(1), color, 512)
258      );
260259   }
261260}
262261
r252899r252900
276275      const rectangle clippanelflip(0*8, 6*8-1, 1*8, 31*8-1);
277276      rectangle clip = flip_screen() ? clippanelflip : clippanel;
278277      const rectangle &visarea = m_screen->visible_area();
279      int sx = flip_screen() ? cliprect.min_x - 8 : cliprect.max_x + 1 - SCROLL_PANEL_WIDTH;
278      int sx = flip_screen() ? cliprect.min_x - 8 : cliprect.max_x + 1 - 14*4;
280279      int yoffs = flip_screen() ? -40 : -16;
281280
282281      clip.min_y += visarea.min_y + yoffs;
283282      clip.max_y += visarea.max_y + yoffs;
284283      clip &= cliprect;
285284
286      copybitmap(bitmap, m_scroll_panel_bitmap, flip_screen(), flip_screen(),
287               sx, visarea.min_y + yoffs, clip);
285      copybitmap(bitmap, m_scroll_panel_bitmap, flip_screen(), flip_screen(), sx, visarea.min_y + yoffs, clip);
288286   }
289287}
290288


Previous 199869 Revisions Next


© 1997-2024 The MAME Team