Previous 15994 Revisions Next

r6264 Monday 2nd November, 2009 at 23:38:18 UTC by Harmony
[CDI] Added a few debug DIP switches to selectively enable and disable video planes [Harmony]
[src/mess/drivers]cdi.c

src/mess/drivers/cdi.c
r6263r6264
38273827static void mcd212_mix_lines(running_machine *machine, UINT8 *plane_a_r, UINT8 *plane_a_g, UINT8 *plane_a_b, UINT8 *plane_b_r, UINT8 *plane_b_g, UINT8 *plane_b_b, UINT32 *out)
38283828{
38293829   int x = 0;
3830   UINT32 backdrop = mcd212_4bpp_color[mcd212_regs.channel[0].backdrop_color];
3830   UINT8 debug_mode = input_port_read(machine, "DEBUG");
3831   UINT8 global_plane_a_disable = debug_mode & 1;
3832   UINT8 global_plane_b_disable = debug_mode & 2;
3833   UINT8 debug_backdrop_enable = debug_mode & 4;
3834   UINT8 debug_backdrop_index = debug_mode >> 4;
3835   UINT32 backdrop = debug_backdrop_enable ? mcd212_4bpp_color[debug_backdrop_index] : mcd212_4bpp_color[mcd212_regs.channel[0].backdrop_color];
38313836   UINT8 transparency_mode_a = (mcd212_regs.channel[0].transparency_control >> 0) & 0x0f;
38323837   UINT8 transparency_mode_b = (mcd212_regs.channel[0].transparency_control >> 8) & 0x0f;
38333838   UINT8 transparent_color_a_r = (UINT8)(mcd212_regs.channel[0].transparent_color_a >> 16);
r6263r6264
39503955               plane_enable_b = 1;
39513956               break;
39523957         }
3958         if(global_plane_a_disable)
3959         {
3960            plane_enable_a = 0;
3961         }
3962         if(global_plane_b_disable)
3963         {
3964            plane_enable_b = 0;
3965         }
39533966         plane_a_r_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_a_r_cur - 16) * mcd212_regs.channel[0].weight_factor_a[x]) >> 6) + 16);
39543967         plane_a_g_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_a_g_cur - 16) * mcd212_regs.channel[0].weight_factor_a[x]) >> 6) + 16);
39553968         plane_a_b_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_a_b_cur - 16) * mcd212_regs.channel[0].weight_factor_a[x]) >> 6) + 16);
r6263r6264
39914004   UINT32 out[768];
39924005   UINT32 *scanline = BITMAP_ADDR32(bitmap, y, 0);
39934006   int x;
4007
39944008   mcd212_process_vsr(machine, 0, plane_a_r, plane_a_g, plane_a_b);
39954009   mcd212_process_vsr(machine, 1, plane_b_r, plane_b_g, plane_b_b);
4010
39964011   mcd212_mix_lines(machine, plane_a_r, plane_a_g, plane_a_b, plane_b_r, plane_b_g, plane_b_b, out);
4012
39974013   for(x = 0; x < 384; x++)
39984014   {
39994015      scanline[x] = out[x*2];
4000      //scanline[x] = (plane_a_r[x*2] << 16) | (plane_a_g[x*2] << 8) | plane_a_b[x*2];
4001      //scanline[x+384] = (plane_b_r[x*2] << 16) | (plane_b_g[x*2] << 8) | plane_b_b[x*2];
40024016   }
4017
40034018   mcd212_draw_cursor(machine, scanline, y);
40044019}
40054020
r6263r6264
42214236   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_NAME("Mouse Button 1") PORT_CHANGED(mouse_update, 0)
42224237   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_NAME("Mouse Button 2") PORT_CHANGED(mouse_update, 0)
42234238   PORT_BIT(0xfc, IP_ACTIVE_HIGH, IPT_UNUSED)
4239
4240   PORT_START("DEBUG")
4241   PORT_DIPNAME( 0x01, 0x00, "Plane A Disable")
4242   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
4243   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
4244   PORT_DIPNAME( 0x02, 0x00, "Plane B Disable")
4245   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
4246   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
4247   PORT_DIPNAME( 0x04, 0x00, "Force Backdrop Color")
4248   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
4249   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
4250   PORT_DIPNAME( 0xf0, 0x00, "Backdrop Color")
4251   PORT_DIPSETTING(    0x00, "Black" )
4252   PORT_DIPSETTING(    0x10, "Half-Bright Blue" )
4253   PORT_DIPSETTING(    0x20, "Half-Bright Green" )
4254   PORT_DIPSETTING(    0x30, "Half-Bright Cyan" )
4255   PORT_DIPSETTING(    0x40, "Half-Bright Red" )
4256   PORT_DIPSETTING(    0x50, "Half-Bright Magenta" )
4257   PORT_DIPSETTING(    0x60, "Half-Bright Yellow" )
4258   PORT_DIPSETTING(    0x70, "Half-Bright White" )
4259   PORT_DIPSETTING(    0x80, "Black (Alternate)" )
4260   PORT_DIPSETTING(    0x90, "Blue" )
4261   PORT_DIPSETTING(    0xa0, "Green" )
4262   PORT_DIPSETTING(    0xb0, "Cyan" )
4263   PORT_DIPSETTING(    0xc0, "Red" )
4264   PORT_DIPSETTING(    0xd0, "Magenta" )
4265   PORT_DIPSETTING(    0xe0, "Yellow" )
4266   PORT_DIPSETTING(    0xf0, "White" )
42244267INPUT_PORTS_END
42254268
42264269static MACHINE_RESET( cdi )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team