trunk/src/mame/drivers/silvmil.c
| r243335 | r243336 | |
| 261 | 261 | PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW2:8" ) /* Verified */ |
| 262 | 262 | INPUT_PORTS_END |
| 263 | 263 | |
| 264 | | |
| 265 | | static INPUT_PORTS_START( puzzlove ) |
| 266 | | PORT_START("P1_P2") |
| 267 | | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) |
| 268 | | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) |
| 269 | | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) |
| 270 | | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) |
| 271 | | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 272 | | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 273 | | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 274 | | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) |
| 275 | | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) |
| 276 | | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) |
| 277 | | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) |
| 278 | | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) |
| 279 | | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 280 | | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 281 | | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 282 | | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 ) |
| 283 | | |
| 284 | | PORT_START("COIN") |
| 285 | | PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 286 | | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 287 | | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 288 | | PORT_BIT( 0xfc00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 289 | | |
| 290 | | PORT_START("DSW") |
| 291 | | PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) |
| 292 | | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) |
| 293 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 294 | | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) |
| 295 | | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) |
| 296 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 297 | | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) |
| 298 | | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) |
| 299 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 300 | | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) |
| 301 | | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) |
| 302 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 303 | | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) |
| 304 | | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 305 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 306 | | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) |
| 307 | | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) |
| 308 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 309 | | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) |
| 310 | | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 311 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 312 | | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) |
| 313 | | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 314 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 315 | | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) |
| 316 | | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 317 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 318 | | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) |
| 319 | | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 320 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 321 | | PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) |
| 322 | | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) |
| 323 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 324 | | PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) |
| 325 | | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) |
| 326 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 327 | | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) |
| 328 | | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) |
| 329 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 330 | | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) |
| 331 | | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 332 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 333 | | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) |
| 334 | | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 335 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 336 | | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) |
| 337 | | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 338 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 339 | | INPUT_PORTS_END |
| 340 | | |
| 341 | | |
| 342 | | |
| 343 | 264 | static const gfx_layout tlayout = |
| 344 | 265 | { |
| 345 | 266 | 16,16, |
| r243335 | r243336 | |
| 431 | 352 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.2) |
| 432 | 353 | MACHINE_CONFIG_END |
| 433 | 354 | |
| 434 | | static MACHINE_CONFIG_DERIVED( puzzlove, silvmil ) |
| 435 | | MCFG_DEVICE_MODIFY("spritegen") |
| 436 | | MCFG_DECO_SPRITE_BOOTLEG_TYPE(1) |
| 437 | | MACHINE_CONFIG_END |
| 438 | 355 | |
| 439 | 356 | ROM_START( silvmil ) |
| 440 | 357 | ROM_REGION( 0x100000, "maincpu", 0 ) /* 68k */ |
| r243335 | r243336 | |
| 488 | 405 | ROM_LOAD16_BYTE( "d-20_u56.bin", 0x100001, 0x80000, CRC(e67c2c7d) SHA1(cddfd6a3d934e71853af62e3d2bf312618c9b4ff) ) |
| 489 | 406 | ROM_END |
| 490 | 407 | |
| 491 | | ROM_START( puzzlove ) |
| 492 | | ROM_REGION( 0x100000, "maincpu", 0 ) /* 68k */ |
| 493 | | ROM_LOAD16_BYTE( "3.u3", 0x00000, 0x40000, CRC(826c8472) SHA1(54f1a9fa0431de840d6fce466e09098a8d601660) ) |
| 494 | | ROM_LOAD16_BYTE( "4.u2", 0x00001, 0x40000, CRC(64ddc708) SHA1(60b29f8cd5dd654be34452fd197a77abc872e63d) ) |
| 495 | 408 | |
| 496 | | ROM_REGION( 0x20000, "audiocpu", 0 ) /* z80 */ |
| 497 | | ROM_LOAD( "1.uz02", 0x00000, 0x20000, CRC(3077e7f3) SHA1(e2bf634a2166e1851486a801e74a7ec0d4599c28) ) |
| 498 | | |
| 499 | | ROM_REGION( 0x40000, "oki", 0 ) /* samples */ |
| 500 | | ROM_LOAD( "2.uz11", 0x00000, 0x40000, CRC(4c06ec68) SHA1(3cfca1c98e73c65a45b65d43e012c5529572c057) ) |
| 501 | | |
| 502 | | ROM_REGION( 0x100000, "gfx1", 0 ) |
| 503 | | ROM_LOAD16_BYTE( "10.u41", 0x000000, 0x20000, CRC(7200f878) SHA1(27c6389f802f6e0af0210e2b01788914c0eb1d04) ) |
| 504 | | ROM_CONTINUE ( 0x080000,0x20000 ) |
| 505 | | ROM_CONTINUE ( 0x040000,0x20000 ) |
| 506 | | ROM_CONTINUE ( 0x0c0000,0x20000 ) |
| 507 | | ROM_LOAD16_BYTE( "9.u42", 0x000001, 0x20000, CRC(21b1b297) SHA1(0f589d1c62d0f79b1379e4444b119bdc4cc70cfb) ) |
| 508 | | ROM_CONTINUE ( 0x080001,0x20000 ) |
| 509 | | ROM_CONTINUE ( 0x040001,0x20000 ) |
| 510 | | ROM_CONTINUE ( 0x0c0001,0x20000 ) |
| 511 | | |
| 512 | | ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */ |
| 513 | | ROM_LOAD16_BYTE( "5.u53", 0x000000, 0x80000, CRC(8707d5a0) SHA1(05480ac34982a4e4768b7f3fccd2e557ca4b2545) ) |
| 514 | | ROM_LOAD16_BYTE( "6.u54", 0x000001, 0x80000, CRC(60a6d614) SHA1(0693c08c51d6b3a05373c9999f01b0b8d23a1c89) ) |
| 515 | | ROM_LOAD16_BYTE( "7.u55", 0x100000, 0x80000, CRC(0f2ea5c4) SHA1(4cb46fc6272e3cc14dfdcd7831157433ee7cf247) ) |
| 516 | | ROM_LOAD16_BYTE( "8.u56", 0x100001, 0x80000, CRC(037dcd3d) SHA1(fcdf604710518982e0b4acc81a56fa703d0c9407) ) |
| 517 | | ROM_END |
| 518 | | |
| 519 | 409 | void silvmil_state::tumblepb_gfx1_rearrange() |
| 520 | 410 | { |
| 521 | 411 | UINT8 *rom = memregion("gfx1")->base(); |
| r243335 | r243336 | |
| 542 | 432 | tumblepb_gfx1_rearrange(); |
| 543 | 433 | } |
| 544 | 434 | |
| 545 | | GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", GAME_SUPPORTS_SAVE ) |
| 546 | | GAME( 1994, puzzlove, 0, puzzlove,puzzlove,silvmil_state, silvmil, ROT0, "Para", "PuzzLove", GAME_SUPPORTS_SAVE ) |
| 435 | GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/wink.c
| r243335 | r243336 | |
| 22 | 22 | public: |
| 23 | 23 | wink_state(const machine_config &mconfig, device_type type, const char *tag) |
| 24 | 24 | : driver_device(mconfig, type, tag), |
| 25 | m_videoram(*this, "videoram"), |
| 25 | 26 | m_maincpu(*this, "maincpu"), |
| 26 | 27 | m_audiocpu(*this, "audiocpu"), |
| 27 | | m_gfxdecode(*this, "gfxdecode"), |
| 28 | | m_videoram(*this, "videoram") { } |
| 28 | m_gfxdecode(*this, "gfxdecode") { } |
| 29 | 29 | |
| 30 | | required_device<cpu_device> m_maincpu; |
| 31 | | required_device<cpu_device> m_audiocpu; |
| 32 | | required_device<gfxdecode_device> m_gfxdecode; |
| 33 | | |
| 34 | 30 | required_shared_ptr<UINT8> m_videoram; |
| 35 | | |
| 36 | 31 | tilemap_t *m_bg_tilemap; |
| 37 | 32 | UINT8 m_sound_flag; |
| 38 | 33 | UINT8 m_tile_bank; |
| 39 | | |
| 40 | 34 | DECLARE_WRITE8_MEMBER(bgram_w); |
| 41 | 35 | DECLARE_WRITE8_MEMBER(player_mux_w); |
| 42 | 36 | DECLARE_WRITE8_MEMBER(tile_banking_w); |
| r243335 | r243336 | |
| 47 | 41 | DECLARE_READ8_MEMBER(prot_r); |
| 48 | 42 | DECLARE_WRITE8_MEMBER(prot_w); |
| 49 | 43 | DECLARE_READ8_MEMBER(sound_r); |
| 50 | | |
| 51 | | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 52 | | |
| 53 | 44 | DECLARE_DRIVER_INIT(wink); |
| 54 | | virtual void machine_start(); |
| 45 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 55 | 46 | virtual void machine_reset(); |
| 56 | 47 | virtual void video_start(); |
| 57 | | |
| 58 | 48 | UINT32 screen_update_wink(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 59 | | |
| 60 | 49 | INTERRUPT_GEN_MEMBER(wink_sound); |
| 50 | required_device<cpu_device> m_maincpu; |
| 51 | required_device<cpu_device> m_audiocpu; |
| 52 | required_device<gfxdecode_device> m_gfxdecode; |
| 61 | 53 | }; |
| 62 | 54 | |
| 63 | 55 | |
| r243335 | r243336 | |
| 339 | 331 | m_sound_flag ^= 0x80; |
| 340 | 332 | } |
| 341 | 333 | |
| 342 | | void wink_state::machine_start() |
| 343 | | { |
| 344 | | save_item(NAME(m_sound_flag)); |
| 345 | | save_item(NAME(m_tile_bank)); |
| 346 | | } |
| 347 | | |
| 348 | 334 | void wink_state::machine_reset() |
| 349 | 335 | { |
| 350 | 336 | m_sound_flag = 0; |
| r243335 | r243336 | |
| 445 | 431 | ROM[i] += BITSWAP8(i & 0xff, 7,5,3,1,6,4,2,0); |
| 446 | 432 | } |
| 447 | 433 | |
| 448 | | GAME( 1985, wink, 0, wink, wink, wink_state, wink, ROT0, "Midcoin", "Wink (set 1)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) |
| 449 | | GAME( 1985, winka, wink, wink, wink, wink_state, wink, ROT0, "Midcoin", "Wink (set 2)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) |
| 434 | GAME( 1985, wink, 0, wink, wink, wink_state, wink, ROT0, "Midcoin", "Wink (set 1)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) |
| 435 | GAME( 1985, winka, wink, wink, wink, wink_state, wink, ROT0, "Midcoin", "Wink (set 2)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) |
trunk/src/mess/layout/wildfire.lay
| r243335 | r243336 | |
| 8 | 8 | <element name="digit" defstate="0"> |
| 9 | 9 | <led7seg><color red="1.0" green="0.20" blue="0.22" /></led7seg> |
| 10 | 10 | </element> |
| 11 | | <element name="led" defstate="0"> |
| 12 | | <disk state="0"><color red="0.2" green="0.04" blue="0.05" /></disk> |
| 13 | | <disk state="1"><color red="1.0" green="0.20" blue="0.22" /></disk> |
| 14 | | </element> |
| 15 | 11 | |
| 16 | 12 | |
| 17 | 13 | <!-- build screen --> |
| r243335 | r243336 | |
| 26 | 22 | <bezel name="digit1" element="digit"><bounds x="10" y="0" width="10" height="15" /></bezel> |
| 27 | 23 | <bezel name="digit2" element="digit"><bounds x="20" y="0" width="10" height="15" /></bezel> |
| 28 | 24 | |
| 29 | | <bezel name="lamp30" element="led"><bounds x="0" y="20" width="1" height="1" /></bezel> |
| 30 | | <bezel name="lamp31" element="led"><bounds x="2" y="20" width="1" height="1" /></bezel> |
| 31 | | <bezel name="lamp32" element="led"><bounds x="4" y="20" width="1" height="1" /></bezel> |
| 32 | | <bezel name="lamp33" element="led"><bounds x="6" y="20" width="1" height="1" /></bezel> |
| 33 | | <bezel name="lamp34" element="led"><bounds x="8" y="20" width="1" height="1" /></bezel> |
| 34 | | <bezel name="lamp35" element="led"><bounds x="10" y="20" width="1" height="1" /></bezel> |
| 35 | | <bezel name="lamp36" element="led"><bounds x="12" y="20" width="1" height="1" /></bezel> |
| 36 | | <bezel name="lamp37" element="led"><bounds x="14" y="20" width="1" height="1" /></bezel> |
| 37 | | |
| 38 | | <bezel name="lamp40" element="led"><bounds x="0" y="22" width="1" height="1" /></bezel> |
| 39 | | <bezel name="lamp41" element="led"><bounds x="2" y="22" width="1" height="1" /></bezel> |
| 40 | | <bezel name="lamp42" element="led"><bounds x="4" y="22" width="1" height="1" /></bezel> |
| 41 | | <bezel name="lamp43" element="led"><bounds x="6" y="22" width="1" height="1" /></bezel> |
| 42 | | <bezel name="lamp44" element="led"><bounds x="8" y="22" width="1" height="1" /></bezel> |
| 43 | | <bezel name="lamp45" element="led"><bounds x="10" y="22" width="1" height="1" /></bezel> |
| 44 | | <bezel name="lamp46" element="led"><bounds x="12" y="22" width="1" height="1" /></bezel> |
| 45 | | <bezel name="lamp47" element="led"><bounds x="14" y="22" width="1" height="1" /></bezel> |
| 46 | | |
| 47 | | <bezel name="lamp50" element="led"><bounds x="0" y="24" width="1" height="1" /></bezel> |
| 48 | | <bezel name="lamp51" element="led"><bounds x="2" y="24" width="1" height="1" /></bezel> |
| 49 | | <bezel name="lamp52" element="led"><bounds x="4" y="24" width="1" height="1" /></bezel> |
| 50 | | <bezel name="lamp53" element="led"><bounds x="6" y="24" width="1" height="1" /></bezel> |
| 51 | | <bezel name="lamp54" element="led"><bounds x="8" y="24" width="1" height="1" /></bezel> |
| 52 | | <bezel name="lamp55" element="led"><bounds x="10" y="24" width="1" height="1" /></bezel> |
| 53 | | <bezel name="lamp56" element="led"><bounds x="12" y="24" width="1" height="1" /></bezel> |
| 54 | | <bezel name="lamp57" element="led"><bounds x="14" y="24" width="1" height="1" /></bezel> |
| 55 | | |
| 56 | | <bezel name="lamp60" element="led"><bounds x="0" y="26" width="1" height="1" /></bezel> |
| 57 | | <bezel name="lamp61" element="led"><bounds x="2" y="26" width="1" height="1" /></bezel> |
| 58 | | <bezel name="lamp62" element="led"><bounds x="4" y="26" width="1" height="1" /></bezel> |
| 59 | | <bezel name="lamp63" element="led"><bounds x="6" y="26" width="1" height="1" /></bezel> |
| 60 | | <bezel name="lamp64" element="led"><bounds x="8" y="26" width="1" height="1" /></bezel> |
| 61 | | <bezel name="lamp65" element="led"><bounds x="10" y="26" width="1" height="1" /></bezel> |
| 62 | | <bezel name="lamp66" element="led"><bounds x="12" y="26" width="1" height="1" /></bezel> |
| 63 | | <bezel name="lamp67" element="led"><bounds x="14" y="26" width="1" height="1" /></bezel> |
| 64 | | |
| 65 | | <bezel name="lamp70" element="led"><bounds x="0" y="28" width="1" height="1" /></bezel> |
| 66 | | <bezel name="lamp71" element="led"><bounds x="2" y="28" width="1" height="1" /></bezel> |
| 67 | | <bezel name="lamp72" element="led"><bounds x="4" y="28" width="1" height="1" /></bezel> |
| 68 | | <bezel name="lamp73" element="led"><bounds x="6" y="28" width="1" height="1" /></bezel> |
| 69 | | <bezel name="lamp74" element="led"><bounds x="8" y="28" width="1" height="1" /></bezel> |
| 70 | | <bezel name="lamp75" element="led"><bounds x="10" y="28" width="1" height="1" /></bezel> |
| 71 | | <bezel name="lamp76" element="led"><bounds x="12" y="28" width="1" height="1" /></bezel> |
| 72 | | <bezel name="lamp77" element="led"><bounds x="14" y="28" width="1" height="1" /></bezel> |
| 73 | | |
| 74 | | <bezel name="lamp80" element="led"><bounds x="0" y="30" width="1" height="1" /></bezel> |
| 75 | | <bezel name="lamp81" element="led"><bounds x="2" y="30" width="1" height="1" /></bezel> |
| 76 | | <bezel name="lamp82" element="led"><bounds x="4" y="30" width="1" height="1" /></bezel> |
| 77 | | <bezel name="lamp83" element="led"><bounds x="6" y="30" width="1" height="1" /></bezel> |
| 78 | | <bezel name="lamp84" element="led"><bounds x="8" y="30" width="1" height="1" /></bezel> |
| 79 | | <bezel name="lamp85" element="led"><bounds x="10" y="30" width="1" height="1" /></bezel> |
| 80 | | <bezel name="lamp86" element="led"><bounds x="12" y="30" width="1" height="1" /></bezel> |
| 81 | | <bezel name="lamp87" element="led"><bounds x="14" y="30" width="1" height="1" /></bezel> |
| 82 | | |
| 83 | | <bezel name="lamp90" element="led"><bounds x="0" y="32" width="1" height="1" /></bezel> |
| 84 | | <bezel name="lamp91" element="led"><bounds x="2" y="32" width="1" height="1" /></bezel> |
| 85 | | <bezel name="lamp92" element="led"><bounds x="4" y="32" width="1" height="1" /></bezel> |
| 86 | | <bezel name="lamp93" element="led"><bounds x="6" y="32" width="1" height="1" /></bezel> |
| 87 | | <bezel name="lamp94" element="led"><bounds x="8" y="32" width="1" height="1" /></bezel> |
| 88 | | <bezel name="lamp95" element="led"><bounds x="10" y="32" width="1" height="1" /></bezel> |
| 89 | | <bezel name="lamp96" element="led"><bounds x="12" y="32" width="1" height="1" /></bezel> |
| 90 | | <bezel name="lamp97" element="led"><bounds x="14" y="32" width="1" height="1" /></bezel> |
| 91 | | |
| 92 | | <bezel name="lamp100" element="led"><bounds x="0" y="34" width="1" height="1" /></bezel> |
| 93 | | <bezel name="lamp101" element="led"><bounds x="2" y="34" width="1" height="1" /></bezel> |
| 94 | | <bezel name="lamp102" element="led"><bounds x="4" y="34" width="1" height="1" /></bezel> |
| 95 | | <bezel name="lamp103" element="led"><bounds x="6" y="34" width="1" height="1" /></bezel> |
| 96 | | <bezel name="lamp104" element="led"><bounds x="8" y="34" width="1" height="1" /></bezel> |
| 97 | | <bezel name="lamp105" element="led"><bounds x="10" y="34" width="1" height="1" /></bezel> |
| 98 | | <bezel name="lamp106" element="led"><bounds x="12" y="34" width="1" height="1" /></bezel> |
| 99 | | <bezel name="lamp107" element="led"><bounds x="14" y="34" width="1" height="1" /></bezel> |
| 100 | | |
| 101 | | <bezel name="lamp110" element="led"><bounds x="0" y="36" width="1" height="1" /></bezel> |
| 102 | | <bezel name="lamp111" element="led"><bounds x="2" y="36" width="1" height="1" /></bezel> |
| 103 | | <bezel name="lamp112" element="led"><bounds x="4" y="36" width="1" height="1" /></bezel> |
| 104 | | <bezel name="lamp113" element="led"><bounds x="6" y="36" width="1" height="1" /></bezel> |
| 105 | | <bezel name="lamp114" element="led"><bounds x="8" y="36" width="1" height="1" /></bezel> |
| 106 | | <bezel name="lamp115" element="led"><bounds x="10" y="36" width="1" height="1" /></bezel> |
| 107 | | <bezel name="lamp116" element="led"><bounds x="12" y="36" width="1" height="1" /></bezel> |
| 108 | | <bezel name="lamp117" element="led"><bounds x="14" y="36" width="1" height="1" /></bezel> |
| 109 | | |
| 110 | | <bezel name="lamp120" element="led"><bounds x="0" y="40" width="1" height="1" /></bezel> |
| 111 | | <bezel name="lamp121" element="led"><bounds x="2" y="40" width="1" height="1" /></bezel> |
| 112 | | <bezel name="lamp122" element="led"><bounds x="4" y="40" width="1" height="1" /></bezel> |
| 113 | | <bezel name="lamp123" element="led"><bounds x="6" y="40" width="1" height="1" /></bezel> |
| 114 | | <bezel name="lamp124" element="led"><bounds x="8" y="40" width="1" height="1" /></bezel> |
| 115 | | <bezel name="lamp125" element="led"><bounds x="10" y="40" width="1" height="1" /></bezel> |
| 116 | | <bezel name="lamp126" element="led"><bounds x="12" y="40" width="1" height="1" /></bezel> |
| 117 | | <bezel name="lamp127" element="led"><bounds x="14" y="40" width="1" height="1" /></bezel> |
| 118 | | |
| 119 | | <bezel name="lamp7" element="led"><bounds x="0" y="42" width="1" height="1" /></bezel> |
| 120 | | <bezel name="lamp17" element="led"><bounds x="2" y="42" width="1" height="1" /></bezel> |
| 121 | | <bezel name="lamp27" element="led"><bounds x="4" y="42" width="1" height="1" /></bezel> |
| 122 | | |
| 123 | 25 | </view> |
| 124 | 26 | </mamelayout> |
trunk/src/osd/sdl/drawsdl.c
| r243335 | r243336 | |
| 64 | 64 | #endif |
| 65 | 65 | m_yuv_lookup(NULL), |
| 66 | 66 | m_yuv_bitmap(NULL), |
| 67 | | //m_hw_scale_width(0), |
| 68 | | //m_hw_scale_height(0), |
| 67 | m_hw_scale_width(0), |
| 68 | m_hw_scale_height(0), |
| 69 | 69 | m_last_hofs(0), |
| 70 | 70 | m_last_vofs(0), |
| 71 | 71 | m_old_blitwidth(0), |
| r243335 | r243336 | |
| 114 | 114 | // if we leave scaling to SDL and the underlying driver, this |
| 115 | 115 | // is the render_target_width/height to use |
| 116 | 116 | |
| 117 | int m_hw_scale_width; |
| 118 | int m_hw_scale_height; |
| 117 | 119 | int m_last_hofs; |
| 118 | 120 | int m_last_vofs; |
| 119 | 121 | int m_old_blitwidth; |
| r243335 | r243336 | |
| 133 | 135 | const char *sdl_scale_mode; /* what to use as a hint ? */ |
| 134 | 136 | #endif |
| 135 | 137 | int pixel_format; /* Pixel/Overlay format */ |
| 136 | | void (*yuv_blit)(const UINT16 *bitmap, UINT8 *ptr, const int pitch, const UINT32 *lookup, const int width, const int height); |
| 138 | void (*yuv_blit)(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch); |
| 137 | 139 | }; |
| 138 | 140 | |
| 139 | 141 | //============================================================ |
| r243335 | r243336 | |
| 149 | 151 | |
| 150 | 152 | // YUV overlays |
| 151 | 153 | |
| 152 | | static void yuv_RGB_to_YV12(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ |
| 153 | | const UINT32 *lookup, const int width, const int height); |
| 154 | | static void yuv_RGB_to_YV12X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ |
| 155 | | const UINT32 *lookup, const int width, const int height); |
| 156 | | static void yuv_RGB_to_YUY2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ |
| 157 | | const UINT32 *lookup, const int width, const int height); |
| 158 | | static void yuv_RGB_to_YUY2X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ |
| 159 | | const UINT32 *lookup, const int width, const int height); |
| 154 | static void yuv_RGB_to_YV12(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch); |
| 155 | static void yuv_RGB_to_YV12X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch); |
| 156 | static void yuv_RGB_to_YUY2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch); |
| 157 | static void yuv_RGB_to_YUY2X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch); |
| 160 | 158 | |
| 161 | 159 | // Static declarations |
| 162 | 160 | |
| r243335 | r243336 | |
| 165 | 163 | |
| 166 | 164 | static const sdl_scale_mode scale_modes[] = |
| 167 | 165 | { |
| 168 | | { "none", 0, 0, 1, 1, SDL_DOUBLEBUF, 0, 0 }, |
| 169 | | { "async", 0, 0, 1, 1, SDL_DOUBLEBUF | SDL_ASYNCBLIT, 0, 0 }, |
| 166 | { "none", 0, 0, 0, 0, SDL_DOUBLEBUF, 0, 0 }, |
| 167 | { "async", 0, 0, 0, 0, SDL_DOUBLEBUF | SDL_ASYNCBLIT, 0, 0 }, |
| 170 | 168 | { "yv12", 1, 1, 1, 1, 0, SDL_YV12_OVERLAY, yuv_RGB_to_YV12 }, |
| 171 | 169 | { "yv12x2", 1, 1, 2, 2, 0, SDL_YV12_OVERLAY, yuv_RGB_to_YV12X2 }, |
| 172 | 170 | { "yuy2", 1, 1, 1, 1, 0, SDL_YUY2_OVERLAY, yuv_RGB_to_YUY2 }, |
| r243335 | r243336 | |
| 176 | 174 | #else |
| 177 | 175 | static const sdl_scale_mode scale_modes[] = |
| 178 | 176 | { |
| 179 | | { "none", 0, 0, 1, 1, DRAW2_SCALEMODE_NEAREST, 0, 0 }, |
| 177 | { "none", 0, 0, 0, 0, DRAW2_SCALEMODE_NEAREST, 0, 0 }, |
| 180 | 178 | { "hwblit", 1, 0, 1, 1, DRAW2_SCALEMODE_LINEAR, 0, 0 }, |
| 181 | 179 | { "hwbest", 1, 0, 1, 1, DRAW2_SCALEMODE_BEST, 0, 0 }, |
| 182 | 180 | { "yv12", 1, 1, 1, 1, DRAW2_SCALEMODE_NEAREST, SDL_PIXELFORMAT_YV12, yuv_RGB_to_YV12 }, |
| r243335 | r243336 | |
| 282 | 280 | m_yuv_bitmap = NULL; |
| 283 | 281 | } |
| 284 | 282 | |
| 285 | | fmt = (sdl_sm->pixel_format ? sdl_sm->pixel_format : mode.format); |
| 286 | | |
| 287 | 283 | if (sdl_sm->is_scale) |
| 288 | 284 | { |
| 289 | | int m_hw_scale_width =0; |
| 290 | | int m_hw_scale_height = 0; |
| 291 | | |
| 292 | 285 | window().m_target->compute_minimum_size(m_hw_scale_width, m_hw_scale_height); |
| 293 | 286 | if (video_config.prescale) |
| 294 | 287 | { |
| r243335 | r243336 | |
| 298 | 291 | /* This must be a multiple of 2 */ |
| 299 | 292 | m_hw_scale_width = (m_hw_scale_width + 1) & ~1; |
| 300 | 293 | } |
| 301 | | if (sdl_sm->is_yuv) |
| 302 | | m_yuv_bitmap = global_alloc_array(UINT16, m_hw_scale_width * m_hw_scale_height); |
| 294 | } |
| 303 | 295 | |
| 296 | if (sdl_sm->is_yuv) |
| 297 | m_yuv_bitmap = global_alloc_array(UINT16, m_hw_scale_width * m_hw_scale_height); |
| 298 | |
| 299 | fmt = (sdl_sm->pixel_format ? sdl_sm->pixel_format : mode.format); |
| 300 | |
| 301 | if (sdl_sm->is_scale) |
| 302 | { |
| 304 | 303 | int w = m_hw_scale_width * sdl_sm->mult_w; |
| 305 | 304 | int h = m_hw_scale_height * sdl_sm->mult_h; |
| 306 | 305 | |
| r243335 | r243336 | |
| 356 | 355 | //return 1; |
| 357 | 356 | } |
| 358 | 357 | |
| 358 | m_hw_scale_width = minimum_width; |
| 359 | m_hw_scale_height = minimum_height; |
| 360 | |
| 359 | 361 | if (!shown_video_info) |
| 360 | 362 | { |
| 361 | 363 | osd_printf_verbose("YUV Mode : %s\n", sdl_sm->name); |
| r243335 | r243336 | |
| 544 | 546 | |
| 545 | 547 | if (!m_sdlsurf) |
| 546 | 548 | return 1; |
| 549 | |
| 547 | 550 | window().m_width = m_sdlsurf->w; |
| 548 | 551 | window().m_height = m_sdlsurf->h; |
| 552 | |
| 549 | 553 | if (sm->is_yuv) |
| 550 | 554 | yuv_overlay_init(); |
| 551 | 555 | |
| r243335 | r243336 | |
| 585 | 589 | |
| 586 | 590 | m_sdlsurf = SDL_SetVideoMode(width, height, 0, |
| 587 | 591 | SDL_SWSURFACE | SDL_ANYFORMAT | m_extra_flags); |
| 588 | | |
| 589 | 592 | window().m_width = m_sdlsurf->w; |
| 590 | 593 | window().m_height = m_sdlsurf->h; |
| 591 | 594 | |
| 592 | | if (sdl_sm->is_yuv) |
| 595 | if (sdl_sm->is_yuv) |
| 593 | 596 | { |
| 594 | 597 | yuv_overlay_init(); |
| 595 | 598 | } |
| r243335 | r243336 | |
| 667 | 670 | return 0; |
| 668 | 671 | if (*yt<0 || *xt >= window().m_blitheight) |
| 669 | 672 | return 0; |
| 673 | if (!sm->is_scale) |
| 674 | { |
| 675 | return 1; |
| 676 | } |
| 677 | /* Rescale */ |
| 678 | *xt = (*xt * m_hw_scale_width) / window().m_blitwidth; |
| 679 | *yt = (*yt * m_hw_scale_height) / window().m_blitheight; |
| 670 | 680 | return 1; |
| 671 | 681 | } |
| 672 | 682 | |
| r243335 | r243336 | |
| 676 | 686 | |
| 677 | 687 | void sdl_info::set_target_bounds() |
| 678 | 688 | { |
| 679 | | window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect()); |
| 689 | const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode]; |
| 690 | |
| 691 | if (!sm->is_scale) |
| 692 | window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect()); |
| 693 | else |
| 694 | window().m_target->set_bounds(m_hw_scale_width, m_hw_scale_height); |
| 680 | 695 | } |
| 681 | 696 | |
| 682 | 697 | //============================================================ |
| r243335 | r243336 | |
| 688 | 703 | const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode]; |
| 689 | 704 | UINT8 *surfptr; |
| 690 | 705 | INT32 pitch; |
| 706 | int bpp; |
| 691 | 707 | Uint32 rmask, gmask, bmask; |
| 692 | 708 | #if (SDLMAME_SDL2) |
| 693 | 709 | Uint32 amask; |
| 694 | 710 | #endif |
| 695 | 711 | INT32 vofs, hofs, blitwidth, blitheight, ch, cw; |
| 696 | | int bpp; |
| 697 | 712 | |
| 698 | 713 | if (video_config.novideo) |
| 699 | 714 | { |
| r243335 | r243336 | |
| 735 | 750 | SDL_LockYUVOverlay(m_yuvsurf); |
| 736 | 751 | surfptr = m_yuvsurf->pixels[0]; // (UINT8 *) m_yuv_bitmap; |
| 737 | 752 | pitch = m_yuvsurf->pitches[0]; // (UINT8 *) m_yuv_bitmap; |
| 738 | | #if 0 |
| 739 | | printf("abcd %d\n", m_yuvsurf->h); |
| 740 | | printf("abcd %d %d %d\n", m_yuvsurf->pitches[0], m_yuvsurf->pitches[1], m_yuvsurf->pitches[2]); |
| 741 | | printf("abcd %p %p %p\n", m_yuvsurf->pixels[0], m_yuvsurf->pixels[1], m_yuvsurf->pixels[2]); |
| 742 | | printf("abcd %ld %ld\n", m_yuvsurf->pixels[1] - m_yuvsurf->pixels[0], m_yuvsurf->pixels[2] - m_yuvsurf->pixels[1]); |
| 743 | | #endif |
| 744 | 753 | } |
| 745 | 754 | else |
| 746 | 755 | surfptr = (UINT8 *)m_sdlsurf->pixels; |
| r243335 | r243336 | |
| 823 | 832 | |
| 824 | 833 | window().m_primlist->acquire_lock(); |
| 825 | 834 | |
| 826 | | int mamewidth, mameheight; |
| 835 | // render to it |
| 836 | if (!sm->is_yuv) |
| 837 | { |
| 838 | int mamewidth, mameheight; |
| 827 | 839 | |
| 828 | | #if !SDLMAME_SDL2 |
| 829 | | if (!sm->is_yuv) |
| 840 | if (!sm->is_scale) |
| 830 | 841 | { |
| 842 | mamewidth = blitwidth; |
| 843 | mameheight = blitheight; |
| 844 | #if !SDLMAME_SDL2 |
| 831 | 845 | surfptr += ((vofs * pitch) + (hofs * bpp)); |
| 832 | | mamewidth = blitwidth; //m_sdlsurf->w; |
| 833 | | mameheight = blitheight; //m_sdlsurf->h; |
| 846 | #endif |
| 834 | 847 | } |
| 835 | 848 | else |
| 836 | 849 | { |
| 837 | | mamewidth = m_yuvsurf->w / sm->mult_w; |
| 838 | | mameheight = m_yuvsurf->h / sm->mult_h; |
| 850 | mamewidth = m_hw_scale_width; |
| 851 | mameheight = m_hw_scale_height; |
| 839 | 852 | } |
| 840 | | #else |
| 841 | | Uint32 fmt = 0; |
| 842 | | int access = 0; |
| 843 | | SDL_QueryTexture(m_texture_id, &fmt, &access, &mamewidth, &mameheight); |
| 844 | | mamewidth /= sm->mult_w; |
| 845 | | mameheight /= sm->mult_h; |
| 846 | | #endif |
| 847 | | //printf("w h %d %d %d %d\n", mamewidth, mameheight, blitwidth, blitheight); |
| 848 | | |
| 849 | | // rescale bounds |
| 850 | | float fw = (float) mamewidth / (float) blitwidth; |
| 851 | | float fh = (float) mameheight / (float) blitheight; |
| 852 | | |
| 853 | | // FIXME: this could be a lot easier if we get the primlist here! |
| 854 | | // Bounds would be set fit for purpose and done! |
| 855 | | |
| 856 | | for (render_primitive *prim = window().m_primlist->first(); prim != NULL; prim = prim->next()) |
| 857 | | { |
| 858 | | prim->bounds.x0 *= fw; |
| 859 | | prim->bounds.x1 *= fw; |
| 860 | | prim->bounds.y0 *= fh; |
| 861 | | prim->bounds.y1 *= fh; |
| 862 | | } |
| 863 | | |
| 864 | | // render to it |
| 865 | | if (!sm->is_yuv) |
| 866 | | { |
| 867 | 853 | switch (rmask) |
| 868 | 854 | { |
| 869 | 855 | case 0x0000ff00: |
| r243335 | r243336 | |
| 895 | 881 | { |
| 896 | 882 | assert (m_yuv_bitmap != NULL); |
| 897 | 883 | assert (surfptr != NULL); |
| 898 | | software_renderer<UINT16, 3,3,3, 10,5,0>::draw_primitives(*window().m_primlist, m_yuv_bitmap, mamewidth, mameheight, mamewidth); |
| 899 | | sm->yuv_blit((UINT16 *)m_yuv_bitmap, surfptr, pitch, m_yuv_lookup, mamewidth, mameheight); |
| 884 | software_renderer<UINT16, 3,3,3, 10,5,0>::draw_primitives(*window().m_primlist, m_yuv_bitmap, m_hw_scale_width, m_hw_scale_height, m_hw_scale_width); |
| 885 | sm->yuv_blit((UINT16 *)m_yuv_bitmap, this, surfptr, pitch); |
| 900 | 886 | } |
| 901 | 887 | |
| 902 | 888 | window().m_primlist->release_lock(); |
| r243335 | r243336 | |
| 1006 | 992 | } |
| 1007 | 993 | } |
| 1008 | 994 | |
| 1009 | | //UINT32 *lookup = sdl->m_yuv_lookup; |
| 1010 | | |
| 1011 | | static void yuv_RGB_to_YV12(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ |
| 1012 | | const UINT32 *lookup, const int width, const int height) |
| 995 | static void yuv_RGB_to_YV12(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch) |
| 1013 | 996 | { |
| 1014 | 997 | int x, y; |
| 998 | UINT8 *dest_y; |
| 999 | UINT8 *dest_u; |
| 1000 | UINT8 *dest_v; |
| 1001 | UINT16 *src; |
| 1002 | UINT16 *src2; |
| 1003 | UINT32 *lookup = sdl->m_yuv_lookup; |
| 1015 | 1004 | UINT8 *pixels[3]; |
| 1016 | 1005 | int u1,v1,y1,u2,v2,y2,u3,v3,y3,u4,v4,y4; /* 12 */ |
| 1017 | 1006 | |
| 1018 | 1007 | pixels[0] = ptr; |
| 1019 | | pixels[1] = ptr + pitch * height; |
| 1020 | | pixels[2] = pixels[1] + pitch * height / 4; |
| 1008 | pixels[1] = ptr + pitch * sdl->m_hw_scale_height; |
| 1009 | pixels[2] = pixels[1] + pitch * sdl->m_hw_scale_height / 4; |
| 1021 | 1010 | |
| 1022 | | for(y=0;y<height;y+=2) |
| 1011 | for(y=0;y<sdl->m_hw_scale_height;y+=2) |
| 1023 | 1012 | { |
| 1024 | | const UINT16 *src=bitmap + (y * width) ; |
| 1025 | | const UINT16 *src2=src + width; |
| 1013 | src=bitmap + (y * sdl->m_hw_scale_width) ; |
| 1014 | src2=src + sdl->m_hw_scale_width; |
| 1026 | 1015 | |
| 1027 | | UINT8 *dest_y = pixels[0] + y * pitch; |
| 1028 | | UINT8 *dest_v = pixels[1] + (y>>1) * pitch / 2; |
| 1029 | | UINT8 *dest_u = pixels[2] + (y>>1) * pitch / 2; |
| 1016 | dest_y = pixels[0] + y * pitch; |
| 1017 | dest_v = pixels[1] + (y>>1) * pitch / 2; |
| 1018 | dest_u = pixels[2] + (y>>1) * pitch / 2; |
| 1030 | 1019 | |
| 1031 | | for(x=0;x<width;x+=2) |
| 1020 | for(x=0;x<sdl->m_hw_scale_width;x+=2) |
| 1032 | 1021 | { |
| 1033 | 1022 | v1 = lookup[src[x]]; |
| 1034 | 1023 | y1 = (v1>>Y1SHIFT) & 0xff; |
| r243335 | r243336 | |
| 1062 | 1051 | } |
| 1063 | 1052 | } |
| 1064 | 1053 | |
| 1065 | | static void yuv_RGB_to_YV12X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ |
| 1066 | | const UINT32 *lookup, const int width, const int height) |
| 1054 | static void yuv_RGB_to_YV12X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch) |
| 1067 | 1055 | { |
| 1068 | 1056 | /* this one is used when scale==2 */ |
| 1069 | 1057 | unsigned int x,y; |
| 1058 | UINT16 *dest_y; |
| 1059 | UINT8 *dest_u; |
| 1060 | UINT8 *dest_v; |
| 1061 | UINT16 *src; |
| 1070 | 1062 | int u1,v1,y1; |
| 1071 | 1063 | UINT8 *pixels[3]; |
| 1072 | 1064 | |
| 1073 | 1065 | pixels[0] = ptr; |
| 1074 | | pixels[1] = ptr + pitch * height * 2; |
| 1075 | | #if (SDLMAME_SDL2) |
| 1076 | | int p2 = (pitch >> 1); |
| 1077 | | #else |
| 1078 | | int p2 = (pitch + 7) & ~ 7;; |
| 1079 | | p2 = (p2 >> 1); |
| 1080 | | #endif |
| 1081 | | pixels[2] = pixels[1] + p2 * height; |
| 1066 | pixels[1] = ptr + pitch * sdl->m_hw_scale_height * 2; |
| 1067 | pixels[2] = pixels[1] + pitch * sdl->m_hw_scale_height / 2; |
| 1082 | 1068 | |
| 1083 | | for(y=0;y<height;y++) |
| 1069 | for(y=0;y<sdl->m_hw_scale_height;y++) |
| 1084 | 1070 | { |
| 1085 | | const UINT16 *src = bitmap + (y * width) ; |
| 1071 | src = bitmap + (y * sdl->m_hw_scale_width) ; |
| 1086 | 1072 | |
| 1087 | | UINT16 *dest_y = (UINT16 *)(pixels[0] + 2 * y * pitch); |
| 1088 | | UINT8 *dest_v = pixels[1] + y * p2; |
| 1089 | | UINT8 *dest_u = pixels[2] + y * p2; |
| 1090 | | for(x=0;x<width;x++) |
| 1073 | dest_y = (UINT16 *)(pixels[0] + 2 * y * pitch); |
| 1074 | dest_v = pixels[1] + y * pitch / 2; |
| 1075 | dest_u = pixels[2] + y * pitch / 2; |
| 1076 | for(x=0;x<sdl->m_hw_scale_width;x++) |
| 1091 | 1077 | { |
| 1092 | | v1 = lookup[src[x]]; |
| 1078 | v1 = sdl->m_yuv_lookup[src[x]]; |
| 1093 | 1079 | y1 = (v1 >> Y1SHIFT) & 0xff; |
| 1094 | 1080 | u1 = (v1 >> USHIFT) & 0xff; |
| 1095 | 1081 | v1 = (v1 >> VSHIFT) & 0xff; |
| r243335 | r243336 | |
| 1102 | 1088 | } |
| 1103 | 1089 | } |
| 1104 | 1090 | |
| 1105 | | static void yuv_RGB_to_YUY2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ |
| 1106 | | const UINT32 *lookup, const int width, const int height) |
| 1091 | static void yuv_RGB_to_YUY2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch) |
| 1107 | 1092 | { |
| 1108 | 1093 | /* this one is used when scale==2 */ |
| 1109 | 1094 | unsigned int y; |
| 1095 | UINT32 *dest; |
| 1096 | UINT16 *src; |
| 1097 | UINT16 *end; |
| 1110 | 1098 | UINT32 p1,p2,uv; |
| 1111 | | const int yuv_pitch = pitch/4; |
| 1099 | UINT32 *lookup = sdl->m_yuv_lookup; |
| 1100 | int yuv_pitch = pitch/4; |
| 1112 | 1101 | |
| 1113 | | for(y=0;y<height;y++) |
| 1102 | for(y=0;y<sdl->m_hw_scale_height;y++) |
| 1114 | 1103 | { |
| 1115 | | const UINT16 *src=bitmap + (y * width) ; |
| 1116 | | const UINT16 *end=src+width; |
| 1104 | src=bitmap + (y * sdl->m_hw_scale_width) ; |
| 1105 | end=src+sdl->m_hw_scale_width; |
| 1117 | 1106 | |
| 1118 | | UINT32 *dest = (UINT32 *) ptr; |
| 1107 | dest = (UINT32 *) ptr; |
| 1119 | 1108 | dest += y * yuv_pitch; |
| 1120 | 1109 | for(; src<end; src+=2) |
| 1121 | 1110 | { |
| r243335 | r243336 | |
| 1128 | 1117 | } |
| 1129 | 1118 | } |
| 1130 | 1119 | |
| 1131 | | static void yuv_RGB_to_YUY2X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ |
| 1132 | | const UINT32 *lookup, const int width, const int height) |
| 1120 | static void yuv_RGB_to_YUY2X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch) |
| 1133 | 1121 | { |
| 1134 | 1122 | /* this one is used when scale==2 */ |
| 1135 | 1123 | unsigned int y; |
| 1124 | UINT32 *dest; |
| 1125 | UINT16 *src; |
| 1126 | UINT16 *end; |
| 1127 | UINT32 *lookup = sdl->m_yuv_lookup; |
| 1136 | 1128 | int yuv_pitch = pitch / 4; |
| 1137 | 1129 | |
| 1138 | | for(y=0;y<height;y++) |
| 1130 | for(y=0;y<sdl->m_hw_scale_height;y++) |
| 1139 | 1131 | { |
| 1140 | | const UINT16 *src=bitmap + (y * width) ; |
| 1141 | | const UINT16 *end=src+width; |
| 1132 | src=bitmap + (y * sdl->m_hw_scale_width) ; |
| 1133 | end=src+sdl->m_hw_scale_width; |
| 1142 | 1134 | |
| 1143 | | UINT32 *dest = (UINT32 *) ptr; |
| 1135 | dest = (UINT32 *) ptr; |
| 1144 | 1136 | dest += (y * yuv_pitch); |
| 1145 | 1137 | for(; src<end; src++) |
| 1146 | 1138 | { |
trunk/src/osd/sdl/window.c
| r243335 | r243336 | |
| 55 | 55 | #define ASSERT_WINDOW_THREAD() ASSERT_USE(window_threadid) |
| 56 | 56 | #define ASSERT_MAIN_THREAD() ASSERT_USE(main_threadid) |
| 57 | 57 | |
| 58 | #define OSDWORK_CALLBACK(name) void *name(void *param, ATTR_UNUSED int threadid) |
| 59 | |
| 58 | 60 | // minimum window dimension |
| 59 | 61 | #define MIN_WINDOW_DIM 200 |
| 60 | 62 | |
| r243335 | r243336 | |
| 139 | 141 | // PROTOTYPES |
| 140 | 142 | //============================================================ |
| 141 | 143 | |
| 144 | static OSDWORK_CALLBACK( draw_video_contents_wt ); |
| 145 | static OSDWORK_CALLBACK( sdlwindow_video_window_destroy_wt ); |
| 146 | static OSDWORK_CALLBACK( sdlwindow_resize_wt ); |
| 147 | static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt ); |
| 142 | 148 | static void sdlwindow_update_cursor_state(running_machine &machine, sdl_window_info *window); |
| 143 | 149 | static void sdlwindow_sync(void); |
| 144 | 150 | |
| 151 | static void *complete_create_wt(void *param, int threadid); |
| 145 | 152 | static void set_starting_view(running_machine &machine, int index, sdl_window_info *window, const char *defview, const char *view); |
| 146 | 153 | |
| 147 | 154 | //============================================================ |
| r243335 | r243336 | |
| 476 | 483 | // (main thread) |
| 477 | 484 | //============================================================ |
| 478 | 485 | |
| 479 | | OSDWORK_CALLBACK( sdl_window_info::sdlwindow_resize_wt ) |
| 486 | static OSDWORK_CALLBACK( sdlwindow_resize_wt ) |
| 480 | 487 | { |
| 481 | 488 | worker_param * wp = (worker_param *) param; |
| 482 | 489 | sdl_window_info * window = wp->window(); |
| r243335 | r243336 | |
| 510 | 517 | // (window thread) |
| 511 | 518 | //============================================================ |
| 512 | 519 | |
| 513 | | OSDWORK_CALLBACK( sdl_window_info::sdlwindow_clear_surface_wt ) |
| 520 | static OSDWORK_CALLBACK( sdlwindow_clear_surface_wt ) |
| 514 | 521 | { |
| 515 | 522 | worker_param *wp = (worker_param *) param; |
| 516 | 523 | sdl_window_info *window = wp->window(); |
| r243335 | r243336 | |
| 540 | 547 | // (main thread) |
| 541 | 548 | //============================================================ |
| 542 | 549 | |
| 543 | | OSDWORK_CALLBACK( sdl_window_info::sdlwindow_toggle_full_screen_wt ) |
| 550 | static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt ) |
| 544 | 551 | { |
| 545 | 552 | worker_param *wp = (worker_param *) param; |
| 546 | 553 | sdl_window_info *window = wp->window(); |
| r243335 | r243336 | |
| 576 | 583 | execute_async_wait(&sdlwindow_toggle_full_screen_wt, worker_param(machine, this)); |
| 577 | 584 | } |
| 578 | 585 | |
| 579 | | OSDWORK_CALLBACK( sdl_window_info::destroy_all_textures_wt ) |
| 586 | static OSDWORK_CALLBACK( destroy_all_textures_wt ) |
| 580 | 587 | { |
| 581 | 588 | worker_param *wp = (worker_param *) param; |
| 582 | 589 | |
| r243335 | r243336 | |
| 696 | 703 | return NULL; |
| 697 | 704 | } |
| 698 | 705 | |
| 699 | | int sdl_window_info::xy_to_render_target(int x, int y, int *xt, int *yt) |
| 700 | | { |
| 701 | | return renderer().xy_to_render_target(x, y, xt, yt); |
| 702 | | } |
| 703 | 706 | |
| 704 | 707 | //============================================================ |
| 705 | 708 | // sdlwindow_video_window_create |
| r243335 | r243336 | |
| 750 | 753 | { |
| 751 | 754 | osd_work_item *wi; |
| 752 | 755 | |
| 753 | | wi = osd_work_item_queue(work_queue, &sdl_window_info::complete_create_wt, (void *) wp, 0); |
| 756 | wi = osd_work_item_queue(work_queue, &complete_create_wt, (void *) wp, 0); |
| 754 | 757 | sdlwindow_sync(); |
| 755 | 758 | result = *((int *) (osd_work_item_result)(wi)); |
| 756 | 759 | osd_work_item_release(wi); |
| 757 | 760 | } |
| 758 | 761 | else |
| 759 | | result = *((int *) sdl_window_info::complete_create_wt((void *) wp, 0)); |
| 762 | result = *((int *) complete_create_wt((void *) wp, 0)); |
| 760 | 763 | |
| 761 | 764 | // handle error conditions |
| 762 | 765 | if (result == 1) |
| r243335 | r243336 | |
| 777 | 780 | // (main thread) |
| 778 | 781 | //============================================================ |
| 779 | 782 | |
| 780 | | OSDWORK_CALLBACK( sdl_window_info::sdlwindow_video_window_destroy_wt ) |
| 783 | static OSDWORK_CALLBACK( sdlwindow_video_window_destroy_wt ) |
| 781 | 784 | { |
| 782 | 785 | worker_param * wp = (worker_param *) param; |
| 783 | 786 | sdl_window_info * window = wp->window(); |
| r243335 | r243336 | |
| 1072 | 1075 | // (window thread) |
| 1073 | 1076 | //============================================================ |
| 1074 | 1077 | |
| 1075 | | OSDWORK_CALLBACK( sdl_window_info::complete_create_wt ) |
| 1078 | static OSDWORK_CALLBACK( complete_create_wt ) |
| 1076 | 1079 | { |
| 1077 | 1080 | worker_param * wp = (worker_param *) param; |
| 1078 | 1081 | sdl_window_info * window = wp->window(); |
| r243335 | r243336 | |
| 1136 | 1139 | // (window thread) |
| 1137 | 1140 | //============================================================ |
| 1138 | 1141 | |
| 1139 | | void sdl_window_info::measure_fps(UINT32 dc, int update) |
| 1142 | static void measure_fps(sdl_window_info *window, UINT32 dc, int update) |
| 1140 | 1143 | { |
| 1141 | 1144 | const unsigned long frames_skip4fps = 100; |
| 1142 | 1145 | static int64_t lastTime=0, sumdt=0, startTime=0; |
| r243335 | r243336 | |
| 1151 | 1154 | |
| 1152 | 1155 | t0 = osd_ticks(); |
| 1153 | 1156 | |
| 1154 | | renderer().draw(dc, update); |
| 1157 | window->renderer().draw(dc, update); |
| 1155 | 1158 | |
| 1156 | 1159 | frames++; |
| 1157 | 1160 | currentTime = osd_ticks(); |
| r243335 | r243336 | |
| 1178 | 1181 | } |
| 1179 | 1182 | } |
| 1180 | 1183 | |
| 1181 | | OSDWORK_CALLBACK( sdl_window_info::draw_video_contents_wt ) |
| 1184 | static OSDWORK_CALLBACK( draw_video_contents_wt ) |
| 1182 | 1185 | { |
| 1183 | 1186 | UINT32 dc = 0; |
| 1184 | 1187 | int update = 1; |
| r243335 | r243336 | |
| 1200 | 1203 | else |
| 1201 | 1204 | { |
| 1202 | 1205 | if( video_config.perftest ) |
| 1203 | | window->measure_fps(dc, update); |
| 1206 | measure_fps(window, dc, update); |
| 1204 | 1207 | else |
| 1205 | 1208 | window->renderer().draw(dc, update); |
| 1206 | 1209 | } |