Previous 199869 Revisions Next

r33544 Wednesday 26th November, 2014 at 02:38:05 UTC by David Haywood
fixed colours, it's xRGBRRRRGGGGBBBB but with the highest bits separated, not the lowest like the MAME format (nw)
[src/mame/drivers]supduck.c

trunk/src/mame/drivers/supduck.c
r242055r242056
237237
238238}
239239
240WRITE16_MEMBER(supduck_state::supduck_paletteram_w)  // wrong
240WRITE16_MEMBER(supduck_state::supduck_paletteram_w)
241241{
242242   int r, g, b;
243243   data = COMBINE_DATA(&m_paletteram[offset]);
244244
245245   r = ((data >> 8) & 0x0f);
246   if (data & 0x4000) r |= 0x10;
247
246248   g = ((data >> 4 ) & 0x0f);
249   if (data & 0x2000) g |= 0x10;
250
247251   b = ((data >> 0 ) & 0x0f);
252   if (data & 0x1000) b |= 0x10;
248253
249   int bright = (data & 0x7000) >> 12;
250
251   bright += 1;
252
253   r = r * bright * 2;
254   g = g * bright * 2;
255   b = b * bright * 2;
256
257
258   m_palette->set_pen_color (offset, rgb_t(r, g, b));
254   m_palette->set_pen_color (offset, rgb_t(r<<3, g<<3, b<<3));
259255}
260256
261257WRITE16_MEMBER(supduck_state::supduck_4002_w)
r242055r242056
275271   {
276272   case 0:
277273      m_back_tilemap->set_scrollx(0, data);
278//      printf("fore x scroll %04x\n", data);
279     
280274      break;
281275   case 1:
282276      m_back_tilemap->set_scrolly(0, -data - 32 * 8);
283//      printf("fore y scroll %04x\n", data);
284
285277      break;
286278   case 2:
287279      m_fore_tilemap->set_scrollx(0, data);
288//      printf("back x scroll %04x\n", data);
289
290280      break;
291281   case 3:
292282      m_fore_tilemap->set_scrolly(0, -data - 32 * 8);
293//      printf("back y scroll %04x\n", data);
294
295283      break;
296284   }
297285}
r242055r242056
312300   AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE(text_videoram_w) AM_SHARE("textvideoram")
313301   AM_RANGE(0xff0000, 0xff3fff) AM_RAM_WRITE(back_videoram_w) AM_SHARE("backvideoram")
314302   AM_RANGE(0xff4000, 0xff7fff) AM_RAM_WRITE(fore_videoram_w) AM_SHARE("forevideoram")
315   AM_RANGE(0xff8000, 0xff87ff) AM_RAM_WRITE(supduck_paletteram_w) AM_SHARE("paletteram")
303   AM_RANGE(0xff8000, 0xff87ff) AM_RAM_WRITE(supduck_paletteram_w) AM_SHARE("paletteram") // AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
316304   AM_RANGE(0xffc000, 0xffffff) AM_RAM /* working RAM */
317305ADDRESS_MAP_END
318306
r242055r242056
527515   MCFG_GFXDECODE_ADD("gfxdecode", "palette", supduck)
528516
529517   MCFG_PALETTE_ADD("palette", 0x800/2)
530//   MCFG_PALETTE_FORMAT(IIIIRRRRGGGGBBBB)
518//   MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB) // can't use this, the RGB bits are the lowest bits with this format, for this game they're the highest bits
531519
532520   /* sound hardware */
533521   MCFG_SPEAKER_STANDARD_MONO("mono")
r242055r242056
582570   ROM_LOAD( "1.su13",   0x00000, 0x80000, CRC(7fb1ed42) SHA1(77ec86a6454398e329066aa060e9b6a39085ce71) ) // banked sample data
583571ROM_END
584572
585GAME( 1992, supduck, 0, supduck, supduck, driver_device, 0, ROT0, "Comad", "Super Duck", GAME_IMPERFECT_COLORS )
573GAME( 1992, supduck, 0, supduck, supduck, driver_device, 0, ROT0, "Comad", "Super Duck", 0 )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team