Previous 199869 Revisions Next

r39979 Monday 27th July, 2015 at 16:20:27 UTC by Dirk Best
route16: use standard 3-bit palettes, clean it up a bit
[src/mame/drivers]route16.c
[src/mame/includes]route16.h
[src/mame/video]route16.c

trunk/src/mame/drivers/route16.c
r248490r248491
572572   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)   /* frames per second, vblank duration */
573573   MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_route16)
574574
575   MCFG_PALETTE_ADD_3BIT_RGB("palette")
576
575577   /* sound hardware */
576578   MCFG_SPEAKER_STANDARD_MONO("mono")
577579   MCFG_SOUND_ADD("ay8910", AY8910, 10000000/8)
r248490r248491
599601
600602   /* video hardware */
601603   MCFG_SCREEN_MODIFY("screen")
602   MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_stratvox)
604   MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_ttmahjng)
603605
604606   /* sound hardware */
605607   MCFG_SOUND_MODIFY("ay8910")
r248490r248491
654656   /* video hardware */
655657   MCFG_SCREEN_MODIFY("screen")
656658   MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_ttmahjng)
659
660   MCFG_DEVICE_REMOVE("palette")
661   MCFG_PALETTE_ADD_3BIT_BGR("palette")
657662MACHINE_CONFIG_END
658663
659664
trunk/src/mame/includes/route16.h
r248490r248491
1010      m_sn(*this, "snsnd"),
1111      m_sharedram(*this, "sharedram"),
1212      m_videoram1(*this, "videoram1"),
13      m_videoram2(*this, "videoram2"){ }
13      m_videoram2(*this, "videoram2"),
14      m_palette(*this, "palette") {}
1415
1516   optional_device<sn76477_device> m_sn;
1617
1718   required_shared_ptr<UINT8> m_sharedram;
1819   required_shared_ptr<UINT8> m_videoram1;
1920   required_shared_ptr<UINT8> m_videoram2;
21   required_device<palette_device> m_palette;
2022
2123   UINT8 m_ttmahjng_port_select;
2224   int m_speakres_vrx;
r248490r248491
4143   virtual void video_start();
4244
4345   UINT32 screen_update_route16(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
44   UINT32 screen_update_stratvox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
4546   UINT32 screen_update_ttmahjng(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
46   pen_t route16_make_pen(UINT8 color);
47   pen_t ttmajng_make_pen(UINT8 color);
48   int video_update_stratvox_ttmahjng(bitmap_rgb32 &bitmap,const rectangle &cliprect,pen_t (route16_state::*make_pen)(UINT8));
4947};
trunk/src/mame/video/route16.c
r248490r248491
4747 *
4848 *************************************/
4949
50pen_t route16_state::route16_make_pen(UINT8 color)
51{
52   return rgb_t(pal1bit((color >> 0) & 0x01),
53               pal1bit((color >> 1) & 0x01),
54               pal1bit((color >> 2) & 0x01));
55
56}
57
58
59pen_t route16_state::ttmajng_make_pen(UINT8 color)
60{
61   return rgb_t(pal1bit((color >> 2) & 0x01),
62               pal1bit((color >> 1) & 0x01),
63               pal1bit((color >> 0) & 0x01));
64
65}
66
67
6850/*
6951 *  Game observation shows that Route 16 can blank each
7052 *  bitmap by setting bit 1 of the palette register.
r248490r248491
10688                              ((data2 >> 0) & 0x01)];
10789
10890         /* the final color is the OR of the two colors (verified) */
109         UINT8 final_color = color1 | color2;
91         UINT8 final_color = (color1 | color2) & 0x07;
11092
111         pen_t pen = route16_make_pen(final_color);
112
11393         if (m_flipscreen)
114            bitmap.pix32(255 - y, 255 - x) = pen;
94            bitmap.pix32(255 - y, 255 - x) = m_palette->pen_color(final_color);
11595         else
116            bitmap.pix32(y, x) = pen;
96            bitmap.pix32(y, x) = m_palette->pen_color(final_color);
11797
11898         x = x + 1;
11999         data1 = data1 >> 1;
r248490r248491
129109 *  The Stratovox video connections have been verified from the schematics
130110 */
131111
132int route16_state::video_update_stratvox_ttmahjng(bitmap_rgb32 &bitmap,
133                                 const rectangle &cliprect,
134                                 pen_t (route16_state::*make_pen)(UINT8))
112UINT32 route16_state::screen_update_ttmahjng(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
135113{
136114   offs_t offs;
137115
r248490r248491
161139                              ((data2 >> 0) & 0x01)];
162140
163141         /* the final color is the OR of the two colors */
164         UINT8 final_color = color1 | color2;
142         UINT8 final_color = (color1 | color2) & 0x07;
165143
166         pen_t pen = (this->*make_pen)(final_color);
167
168144         if (m_flipscreen)
169            bitmap.pix32(255 - y, 255 - x) = pen;
145            bitmap.pix32(255 - y, 255 - x) = m_palette->pen_color(final_color);
170146         else
171            bitmap.pix32(y, x) = pen;
147            bitmap.pix32(y, x) = m_palette->pen_color(final_color);
172148
173149         x = x + 1;
174150         data1 = data1 >> 1;
r248490r248491
178154
179155   return 0;
180156}
181
182
183UINT32 route16_state::screen_update_stratvox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
184{
185   return video_update_stratvox_ttmahjng(bitmap, cliprect, &route16_state::route16_make_pen);
186}
187
188
189UINT32 route16_state::screen_update_ttmahjng(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
190{
191   return video_update_stratvox_ttmahjng(bitmap, cliprect, &route16_state::ttmajng_make_pen);
192}


Previous 199869 Revisions Next


© 1997-2024 The MAME Team