trunk/src/mame/drivers/route16.c
| r248490 | r248491 | |
| 572 | 572 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) /* frames per second, vblank duration */ |
| 573 | 573 | MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_route16) |
| 574 | 574 | |
| 575 | MCFG_PALETTE_ADD_3BIT_RGB("palette") |
| 576 | |
| 575 | 577 | /* sound hardware */ |
| 576 | 578 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 577 | 579 | MCFG_SOUND_ADD("ay8910", AY8910, 10000000/8) |
| r248490 | r248491 | |
| 599 | 601 | |
| 600 | 602 | /* video hardware */ |
| 601 | 603 | MCFG_SCREEN_MODIFY("screen") |
| 602 | | MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_stratvox) |
| 604 | MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_ttmahjng) |
| 603 | 605 | |
| 604 | 606 | /* sound hardware */ |
| 605 | 607 | MCFG_SOUND_MODIFY("ay8910") |
| r248490 | r248491 | |
| 654 | 656 | /* video hardware */ |
| 655 | 657 | MCFG_SCREEN_MODIFY("screen") |
| 656 | 658 | MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_ttmahjng) |
| 659 | |
| 660 | MCFG_DEVICE_REMOVE("palette") |
| 661 | MCFG_PALETTE_ADD_3BIT_BGR("palette") |
| 657 | 662 | MACHINE_CONFIG_END |
| 658 | 663 | |
| 659 | 664 | |
trunk/src/mame/includes/route16.h
| r248490 | r248491 | |
| 10 | 10 | m_sn(*this, "snsnd"), |
| 11 | 11 | m_sharedram(*this, "sharedram"), |
| 12 | 12 | m_videoram1(*this, "videoram1"), |
| 13 | | m_videoram2(*this, "videoram2"){ } |
| 13 | m_videoram2(*this, "videoram2"), |
| 14 | m_palette(*this, "palette") {} |
| 14 | 15 | |
| 15 | 16 | optional_device<sn76477_device> m_sn; |
| 16 | 17 | |
| 17 | 18 | required_shared_ptr<UINT8> m_sharedram; |
| 18 | 19 | required_shared_ptr<UINT8> m_videoram1; |
| 19 | 20 | required_shared_ptr<UINT8> m_videoram2; |
| 21 | required_device<palette_device> m_palette; |
| 20 | 22 | |
| 21 | 23 | UINT8 m_ttmahjng_port_select; |
| 22 | 24 | int m_speakres_vrx; |
| r248490 | r248491 | |
| 41 | 43 | virtual void video_start(); |
| 42 | 44 | |
| 43 | 45 | 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); |
| 45 | 46 | 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)); |
| 49 | 47 | }; |
trunk/src/mame/video/route16.c
| r248490 | r248491 | |
| 47 | 47 | * |
| 48 | 48 | *************************************/ |
| 49 | 49 | |
| 50 | | pen_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 | | |
| 59 | | pen_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 | | |
| 68 | 50 | /* |
| 69 | 51 | * Game observation shows that Route 16 can blank each |
| 70 | 52 | * bitmap by setting bit 1 of the palette register. |
| r248490 | r248491 | |
| 106 | 88 | ((data2 >> 0) & 0x01)]; |
| 107 | 89 | |
| 108 | 90 | /* the final color is the OR of the two colors (verified) */ |
| 109 | | UINT8 final_color = color1 | color2; |
| 91 | UINT8 final_color = (color1 | color2) & 0x07; |
| 110 | 92 | |
| 111 | | pen_t pen = route16_make_pen(final_color); |
| 112 | | |
| 113 | 93 | if (m_flipscreen) |
| 114 | | bitmap.pix32(255 - y, 255 - x) = pen; |
| 94 | bitmap.pix32(255 - y, 255 - x) = m_palette->pen_color(final_color); |
| 115 | 95 | else |
| 116 | | bitmap.pix32(y, x) = pen; |
| 96 | bitmap.pix32(y, x) = m_palette->pen_color(final_color); |
| 117 | 97 | |
| 118 | 98 | x = x + 1; |
| 119 | 99 | data1 = data1 >> 1; |
| r248490 | r248491 | |
| 129 | 109 | * The Stratovox video connections have been verified from the schematics |
| 130 | 110 | */ |
| 131 | 111 | |
| 132 | | int route16_state::video_update_stratvox_ttmahjng(bitmap_rgb32 &bitmap, |
| 133 | | const rectangle &cliprect, |
| 134 | | pen_t (route16_state::*make_pen)(UINT8)) |
| 112 | UINT32 route16_state::screen_update_ttmahjng(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 135 | 113 | { |
| 136 | 114 | offs_t offs; |
| 137 | 115 | |
| r248490 | r248491 | |
| 161 | 139 | ((data2 >> 0) & 0x01)]; |
| 162 | 140 | |
| 163 | 141 | /* the final color is the OR of the two colors */ |
| 164 | | UINT8 final_color = color1 | color2; |
| 142 | UINT8 final_color = (color1 | color2) & 0x07; |
| 165 | 143 | |
| 166 | | pen_t pen = (this->*make_pen)(final_color); |
| 167 | | |
| 168 | 144 | if (m_flipscreen) |
| 169 | | bitmap.pix32(255 - y, 255 - x) = pen; |
| 145 | bitmap.pix32(255 - y, 255 - x) = m_palette->pen_color(final_color); |
| 170 | 146 | else |
| 171 | | bitmap.pix32(y, x) = pen; |
| 147 | bitmap.pix32(y, x) = m_palette->pen_color(final_color); |
| 172 | 148 | |
| 173 | 149 | x = x + 1; |
| 174 | 150 | data1 = data1 >> 1; |
| r248490 | r248491 | |
| 178 | 154 | |
| 179 | 155 | return 0; |
| 180 | 156 | } |
| 181 | | |
| 182 | | |
| 183 | | UINT32 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 | | |
| 189 | | UINT32 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 | | } |