From 5b959d28aac598c9312e30af1a80417944725232 Mon Sep 17 00:00:00 2001 From: davidhay Date: Sat, 9 May 2009 11:43:03 +0000 Subject: [PATCH] put bilinear enable as a debug feature for now, it's pretty, but a little slow to be developing with :-) --- src/mame/drivers/naomi.c | 11 +++++++++++ src/mame/video/dc.c | 21 +++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c index ff9db9c6239..2d53e180730 100644 --- a/src/mame/drivers/naomi.c +++ b/src/mame/drivers/naomi.c @@ -976,6 +976,13 @@ ADDRESS_MAP_END * Input ports */ +#define NAOMI_MAME_DEBUG_DIP \ + PORT_START("MAMEDEBUG") \ + PORT_DIPNAME( 0x01, 0x00, "Bilinear Filtering" ) \ + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) \ + + /* for now we hardwire a joystick + 6 buttons for every game.*/ static INPUT_PORTS_START( naomi ) PORT_START("IN0") @@ -1011,6 +1018,8 @@ static INPUT_PORTS_START( naomi ) PORT_START("COINS") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[0]) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[1]) + + NAOMI_MAME_DEBUG_DIP INPUT_PORTS_END /* JVS mahjong panel */ @@ -1122,6 +1131,8 @@ static INPUT_PORTS_START( naomi_mp ) PORT_START("COINS") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[0]) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[1]) + + NAOMI_MAME_DEBUG_DIP INPUT_PORTS_END static MACHINE_RESET( naomi ) diff --git a/src/mame/video/dc.c b/src/mame/video/dc.c index f324695f260..38202a8f825 100644 --- a/src/mame/video/dc.c +++ b/src/mame/video/dc.c @@ -34,6 +34,7 @@ static UINT32 dilated0[15][1024]; static UINT32 dilated1[15][1024]; static int dilatechose[64]; static float wbuffer[480][640]; +static UINT32 debug_dip_status; UINT64 *dc_texture_ram; static UINT32 tafifo_buff[32]; @@ -1600,12 +1601,17 @@ void render_hline(bitmap_t *bitmap, texinfo *ti, int y, float xl, float xr, floa }*/ c = ti->r(ti, u, v); - if(ti->filter_mode == TEX_FILTER_BILINEAR) - { - UINT32 c1 = ti->r(ti, u+1.0, v); - UINT32 c2 = ti->r(ti, u+1.0, v+1.0); - UINT32 c3 = ti->r(ti, u, v+1.0); - c = bilinear_filter(c, c1, c2, c3, u, v); + + // debug dip to turn on/off bilinear filtering, it's slooooow + if (debug_dip_status&0x1) + { + if(ti->filter_mode == TEX_FILTER_BILINEAR) + { + UINT32 c1 = ti->r(ti, u+1.0, v); + UINT32 c2 = ti->r(ti, u+1.0, v+1.0); + UINT32 c3 = ti->r(ti, u, v+1.0); + c = bilinear_filter(c, c1, c2, c3, u, v); + } } if(c & 0xff000000) { @@ -2107,6 +2113,9 @@ VIDEO_UPDATE(dc) } } + // update this here so we only do string lookup once per frame + debug_dip_status = input_port_read(screen->machine, "MAMEDEBUG"); + return 0; }