trunk/src/mame/drivers/kangaroo.c
| r248489 | r248490 | |
| 443 | 443 | MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK, 320*2, 0*2, 256*2, 260, 8, 248) |
| 444 | 444 | MCFG_SCREEN_UPDATE_DRIVER(kangaroo_state, screen_update_kangaroo) |
| 445 | 445 | |
| 446 | MCFG_PALETTE_ADD_3BIT_BGR("palette") |
| 447 | |
| 446 | 448 | /* sound hardware */ |
| 447 | 449 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 448 | 450 | MCFG_SOUND_ADD("aysnd", AY8910, MASTER_CLOCK/8) |
trunk/src/mame/includes/kangaroo.h
| r248489 | r248490 | |
| 14 | 14 | kangaroo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 15 | 15 | : driver_device(mconfig, type, tag), |
| 16 | 16 | m_video_control(*this, "video_control"), |
| 17 | | m_maincpu(*this, "maincpu") { } |
| 17 | m_maincpu(*this, "maincpu"), |
| 18 | m_palette(*this, "palette") { } |
| 18 | 19 | |
| 19 | 20 | /* memory pointers */ |
| 20 | 21 | required_shared_ptr<UINT8> m_video_control; |
| r248489 | r248490 | |
| 37 | 38 | void videoram_write( UINT16 offset, UINT8 data, UINT8 mask ); |
| 38 | 39 | void blitter_execute( ); |
| 39 | 40 | required_device<cpu_device> m_maincpu; |
| 41 | required_device<palette_device> m_palette; |
| 40 | 42 | }; |
trunk/src/mame/video/kangaroo.c
| r248489 | r248490 | |
| 141 | 141 | UINT8 enab = (m_video_control[9] & 0x04); |
| 142 | 142 | UINT8 pria = (~m_video_control[9] & 0x02); |
| 143 | 143 | UINT8 prib = (~m_video_control[9] & 0x01); |
| 144 | | rgb_t pens[8]; |
| 145 | 144 | int x, y; |
| 146 | 145 | |
| 147 | | /* build up the pens arrays */ |
| 148 | | for (x = 0; x < 8; x++) |
| 149 | | pens[x] = rgb_t(pal1bit(x >> 2), pal1bit(x >> 1), pal1bit(x >> 0)); |
| 150 | | |
| 151 | 146 | /* iterate over pixels */ |
| 152 | 147 | for (y = cliprect.min_y; y <= cliprect.max_y; y++) |
| 153 | 148 | { |
| r248489 | r248490 | |
| 171 | 166 | finalpens |= pixb; |
| 172 | 167 | |
| 173 | 168 | /* store the first of two pixels, which is always full brightness */ |
| 174 | | dest[x + 0] = pens[finalpens & 7]; |
| 169 | dest[x + 0] = m_palette->pen_color(finalpens & 7); |
| 175 | 170 | |
| 176 | 171 | /* KOS1 alternates at 5MHz, offset from the pixel clock by 1/2 clock */ |
| 177 | 172 | /* when 0, it enables the color mask for pixels with Z = 0 */ |
| r248489 | r248490 | |
| 188 | 183 | } |
| 189 | 184 | |
| 190 | 185 | /* store the second of two pixels, which is affected by KOS1 and the A/B masks */ |
| 191 | | dest[x + 1] = pens[finalpens & 7]; |
| 186 | dest[x + 1] = m_palette->pen_color(finalpens & 7); |
| 192 | 187 | } |
| 193 | 188 | } |
| 194 | 189 | |