本文整理汇总了C++中RGN_FRAC函数的典型用法代码示例。如果您正苦于以下问题:C++ RGN_FRAC函数的具体用法?C++ RGN_FRAC怎么用?C++ RGN_FRAC使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RGN_FRAC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: STEP8
static const UINT32 pts_4bits_layout_xoffset[64] =
{
STEP8( 0*256, 4 ), STEP8( 1*256, 4 ), STEP8( 4*256, 4 ), STEP8( 5*256, 4 ),
STEP8( 16*256, 4 ), STEP8( 17*256, 4 ), STEP8( 20*256, 4 ), STEP8( 21*256, 4 )
};
static const UINT32 pts_4bits_layout_yoffset[64] =
{
STEP8( 0*256, 8*4 ), STEP8( 2*256, 8*4 ), STEP8( 8*256, 8*4 ), STEP8( 10*256, 8*4 ),
STEP8( 32*256, 8*4 ), STEP8( 34*256, 8*4 ), STEP8( 40*256, 8*4 ), STEP8( 42*256, 8*4 )
};
static const gfx_layout pts_8x8_4bits_layout =
{
8,8, /* 8*8 pixels */
RGN_FRAC(1,1), /* 65536 patterns */
4, /* 4 bits per pixel */
{ 0, 1, 2, 3 },
EXTENDED_XOFFS,
EXTENDED_YOFFS,
8*8*4,
pts_4bits_layout_xoffset,
pts_4bits_layout_yoffset
};
static const gfx_layout pts_16x16_4bits_layout =
{
16,16, /* 16*16 pixels */
RGN_FRAC(1,1), /* 16384 patterns */
4, /* 4 bits per pixel */
{ 0, 1, 2, 3 },
示例2: PORT_BIT
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
INPUT_PORTS_END
/*************************************
*
* Graphics layouts
*
*************************************/
static const gfx_layout charlayout =
{
8,8,
RGN_FRAC(1,2),
4,
{ RGN_FRAC(1,2),RGN_FRAC(1,2)+4, 0,4 },
{ STEP4(0,1), STEP4(8,1) },
{ STEP8(0,16) },
8*8*2
};
static const gfx_layout spritelayout =
{
16,16,
RGN_FRAC(1,3),
3,
{ RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
{ STEP8(0,1), STEP8(8*8,1) },
示例3: PORT_DIPSETTING
PORT_DIPSETTING( 0x00, "5" )
PORT_DIPSETTING( 0x20, "7" )
PORT_DIPSETTING( 0x30, "9" )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, "Stereo Sound" ) PORT_DIPLOCATION("SW2:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
static const gfx_layout tile_layout =
{
16,16,
RGN_FRAC(1,1),
4,
{ 0, 1, 2, 3 },
{
0*4,1*4,2*4,3*4,4*4,5*4,6*4,7*4,
8*32+0*4,8*32+1*4,8*32+2*4,8*32+3*4,8*32+4*4,8*32+5*4,8*32+6*4,8*32+7*4
},
{
0*32,1*32,2*32,3*32,4*32,5*32,6*32,7*32,
16*32+0*32,16*32+1*32,16*32+2*32,16*32+3*32,16*32+4*32,16*32+5*32,16*32+6*32,16*32+7*32
},
4*8*32
};
static GFXDECODE_START( djboy )
GFXDECODE_ENTRY( "gfx1", 0, tile_layout, 0x100, 16 ) /* sprite bank */
示例4: PORT_DIPSETTING
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, "Coin Mode" )
PORT_DIPSETTING( 0x08, "1" )
PORT_DIPSETTING( 0x00, "2" )
/* Coin Mode 1 */
IREM_COIN_MODE_1_NEW
/* Coin Mode 2, not supported yet */
// IREM_COIN_MODE_2
INPUT_PORTS_END
/*****************************************************************************/
static struct GfxLayout charlayout =
{
8,8,
RGN_FRAC(1,4),
4,
{ RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
8*8
};
static struct GfxLayout spritelayout =
{
16,16,
RGN_FRAC(1,4),
4,
{ RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) },
{ 0, 1, 2, 3, 4, 5, 6, 7,
16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 },
示例5: PORT_DIPSETTING
PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x08, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x04, DEF_STR( Hard ) )
// PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
PORT_DIPNAME( 0x02, 0x02, "Bonus Time" )
PORT_DIPSETTING( 0x00, "*2 +30" )
PORT_DIPSETTING( 0x02, "*2 +50" )
PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
INPUT_PORTS_END
static const gfx_layout charlayout =
{
8,8,
RGN_FRAC(1,4),
8,
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ RGN_FRAC(3,4)+0, RGN_FRAC(2,4)+0, RGN_FRAC(1,4)+0, RGN_FRAC(0,4)+0,
RGN_FRAC(3,4)+8, RGN_FRAC(2,4)+8, RGN_FRAC(1,4)+8, RGN_FRAC(0,4)+8 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
16*8
};
static GFXDECODE_START( mosaic )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 1 )
GFXDECODE_ENTRY( "gfx2", 0, charlayout, 0, 1 )
GFXDECODE_END
示例6: RGN_FRAC
{
8, 8, /* 8 x 8 characters */
512, /* 512 characters */
1, /* 1 bits per pixel */
{ 0 }, /* no bitplanes */
/* x offsets */
{ 0, 1, 2, 3, 4, 5, 6, 7 },
/* y offsets */
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
8*8 /* every char takes 8 bytes */
};
static const gfx_layout kanji_layout =
{
16, 16, /* 8 x 8 characters */
RGN_FRAC(1,1), /* 512 characters */
1, /* 1 bits per pixel */
{ 0 }, /* no bitplanes */
/* x offsets */
{ STEP16(0,1) },
/* y offsets */
{ STEP16(0,16) },
16*16 /* every char takes 8 bytes */
};
static GFXDECODE_START( pcjr )
GFXDECODE_ENTRY( "gfx1", 0x0000, pc_8_charlayout, 3, 1 )
GFXDECODE_END
static ADDRESS_MAP_START(ibmpcjr_map, AS_PROGRAM, 8, pcjr_state)
示例7: PORT_BIT
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
INPUT_PORTS_END
static const gfx_layout tile_8x8_layout =
{
8,8,
RGN_FRAC(1,2),
4,
{ RGN_FRAC(1,2)+8,RGN_FRAC(1,2)+0,RGN_FRAC(0,2)+8,RGN_FRAC(0,2)+0 },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
8*16
};
static const gfx_layout tile_16x16_layout =
{
16,16,
RGN_FRAC(1,2),
4,
{ RGN_FRAC(1,2)+8,RGN_FRAC(1,2)+0,RGN_FRAC(0,2)+8,RGN_FRAC(0,2)+0 },
{ 256,257,258,259,260,261,262,263,0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,8*16,9*16,10*16,11*16,12*16,13*16,14*16,15*16 },
示例8: PORT_BIT
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_COCKTAIL /* OUT:coin lockout */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* OUT:coin counter 1 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) /* OUT:coin counter 2 */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Jump")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Left")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Right")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL PORT_NAME("P2 Jump")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL PORT_NAME("P2 Left")
INPUT_PORTS_END
static const gfx_layout spritelayout =
{
16,16,
RGN_FRAC(1,2),
4,
{ 0, 4, RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+4 },
{ STEP4(0*8,1), STEP4(8*8,1), STEP4(16*8,1), STEP4(24*8,1) },
{ STEP8(0*8,8), STEP8(32*8,8) },
64*8
};
static const gfx_layout charlayout =
{
8,8,
RGN_FRAC(1,1),
2,
{ 0, 4 },
{ STEP4(8*8,1), STEP4(0*8,1) },
{ STEP8(0*8,8) },
示例9: PORT_MODIFY
PORT_MODIFY("LIGHT0_Y")
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, -1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_REVERSE
PORT_MODIFY("LIGHT1_X")
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_REVERSE
PORT_MODIFY("LIGHT1_Y")
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, -1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_REVERSE
INPUT_PORTS_END
static const gfx_layout lethal_6bpp =
{
16,16,
RGN_FRAC(1,2),
6,
{ RGN_FRAC(1,2)+8,RGN_FRAC(1,2)+0, 8, 0, 24, 16 },
{ 0, 1, 2, 3, 4, 5, 6, 7,
8*32+0, 8*32+1, 8*32+2, 8*32+3, 8*32+4, 8*32+5, 8*32+6, 8*32+7 },
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 },
128*8
};
/* we use this decode instead of the one done by the sprite video start due to it being 6bpp */
static GFXDECODE_START( lethal )
GFXDECODE_ENTRY( "gfx2", 0, lethal_6bpp, 0x000/*0x400*/, 256 ) /* sprites tiles */
GFXDECODE_END
示例10: PORT_DIPSETTING
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, "Demo Music" ) /* code at 0x6226 - when is it called ? */
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x20, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
INPUT_PORTS_END
static const gfx_layout charlayout =
{
8,8,
RGN_FRAC(1,1),
2,
{ 4, 0 },
{ 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
16*8
};
static const gfx_layout spritelayout =
{
16,16,
RGN_FRAC(1,2),
4,
{ RGN_FRAC(1,2)+4, RGN_FRAC(1,2)+0, 4, 0 },
{ 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3,
32*8+0, 32*8+1, 32*8+2, 32*8+3, 33*8+0, 33*8+1, 33*8+2, 33*8+3 },
示例11: PORT_START
PORT_START("DIAL1") // player 2 8-way rotary control - converted in jackalr_rotary_r()
PORT_BIT( 0xff, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(8) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_FULL_TURN_COUNT(8)
INPUT_PORTS_END
/*************************************
*
* Graphics definitions
*
*************************************/
static const gfx_layout charlayout =
{
8, 8,
RGN_FRAC(1,4),
8, /* 8 bits per pixel (!) */
{ 0, 1, 2, 3, RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+1, RGN_FRAC(1,2)+2, RGN_FRAC(1,2)+3 },
{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
32*8
};
static const gfx_layout spritelayout =
{
16, 16,
RGN_FRAC(1,4),
4,
{ 0, 1, 2, 3 },
{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
32*8+0*4, 32*8+1*4, 32*8+2*4, 32*8+3*4, 32*8+4*4, 32*8+5*4, 32*8+6*4, 32*8+7*4 },
示例12: PORT_INCLUDE
PORT_INCLUDE( firetrapj )
PORT_MODIFY("IN2")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_MODIFY("COIN")
PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
static const gfx_layout charlayout =
{
8,8,
RGN_FRAC(1,2),
2,
{ 0, 4 },
{ 3, 2, 1, 0, RGN_FRAC(1,2)+3, RGN_FRAC(1,2)+2, RGN_FRAC(1,2)+1, RGN_FRAC(1,2)+0 },
{ 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
8*8
};
static const gfx_layout tilelayout =
{
16,16,
RGN_FRAC(1,4),
4,
{ 0, 4, RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+4 },
{ 3, 2, 1, 0, RGN_FRAC(1,4)+3, RGN_FRAC(1,4)+2, RGN_FRAC(1,4)+1, RGN_FRAC(1,4)+0,
16*8+3, 16*8+2, 16*8+1, 16*8+0, RGN_FRAC(1,4)+16*8+3, RGN_FRAC(1,4)+16*8+2, RGN_FRAC(1,4)+16*8+1, RGN_FRAC(1,4)+16*8+0 },
{ 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8,
示例13: PORT_START
PORT_START("P2")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
INPUT_PORTS_END
static const gfx_layout oneshot16x16_layout =
{
16,16,
RGN_FRAC(1,8),
8,
{ RGN_FRAC(0,8),RGN_FRAC(1,8),RGN_FRAC(2,8),RGN_FRAC(3,8),RGN_FRAC(4,8),RGN_FRAC(5,8),RGN_FRAC(6,8),RGN_FRAC(7,8) },
{ 0,1,2,3,4,5,6,7,
64+0,64+1,64+2,64+3,64+4,64+5,64+6,64+7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
128+0*8, 128+1*8, 128+2*8, 128+3*8, 128+4*8, 128+5*8, 128+6*8, 128+7*8 },
16*16
};
static const gfx_layout oneshot8x8_layout =
{
8,8,
RGN_FRAC(1,8),
8,
{ RGN_FRAC(0,8),RGN_FRAC(1,8),RGN_FRAC(2,8),RGN_FRAC(3,8),RGN_FRAC(4,8),RGN_FRAC(5,8),RGN_FRAC(6,8),RGN_FRAC(7,8) },
示例14: ADDRESS_MAP_START
return 0;
}
static ADDRESS_MAP_START( tcl_map, AS_PROGRAM, 8, tcl_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM /* bfff ? */
ADDRESS_MAP_END
static INPUT_PORTS_START( tcl )
PORT_START("IN0")
INPUT_PORTS_END
static const gfx_layout charlayout =
{
8,8,
RGN_FRAC(1,3),
3,
{ 0, RGN_FRAC(1,3), RGN_FRAC(2,3) },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
8*8
};
static const gfx_layout charlayout2 =
{
8,8,
RGN_FRAC(1,4),
4,
{ 0, RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4)},
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
示例15: PORT_DIPSETTING
PORT_DIPSETTING( 0xe0000000, DEF_STR(1C_1C))
PORT_DIPSETTING( 0xc0000000, DEF_STR(1C_2C))
PORT_DIPSETTING( 0xa0000000, DEF_STR(1C_3C))
PORT_DIPSETTING( 0x80000000, DEF_STR(1C_4C))
// PORT_START("MISC") /* Misc inputs */
// PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* VBLANK ? */
// PORT_BIT( 0xff7f, IP_ACTIVE_LOW, IPT_UNUSED ) /* unknown / unused */
INPUT_PORTS_END
/* BACKGROUNDS */
static const gfx_layout tiles16x16x6_layout =
{
16,16,
RGN_FRAC(1,3),
6,
{ 0x0000000*8+8,0x0000000*8+0, 0x0800000*8+8, 0x0800000*8+0, 0x1000000*8+8,0x1000000*8+0 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23 },
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
16*32
};
static GFXDECODE_START( silkroad )
GFXDECODE_ENTRY( "gfx1", 0, tiles16x16x6_layout, 0x0000, 256 )
GFXDECODE_END
static MACHINE_CONFIG_START( silkroad, silkroad_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68EC020, XTAL_32MHz/2) /* 16MHz */