mirror of
https://github.com/holub/mame
synced 2025-06-28 15:14:21 +03:00
Merge branch 'master' of https://github.com/mamedev/mame
This commit is contained in:
commit
1fb84ad0e3
@ -382,6 +382,7 @@ media_auditor::summary media_auditor::summarize(const char *name, astring *strin
|
||||
else
|
||||
string->catprintf("NOT FOUND (%s)\n", shared_device->shortname());
|
||||
}
|
||||
best_new_status = NOTFOUND;
|
||||
break;
|
||||
|
||||
case audit_record::SUBSTATUS_NOT_FOUND_NODUMP:
|
||||
|
@ -261,6 +261,85 @@ static INPUT_PORTS_START( silvmil )
|
||||
PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW2:8" ) /* Verified */
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
static INPUT_PORTS_START( puzzlove )
|
||||
PORT_START("P1_P2")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
|
||||
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_PLAYER(2)
|
||||
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) 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 )
|
||||
|
||||
PORT_START("COIN")
|
||||
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
PORT_BIT( 0xfc00, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("DSW")
|
||||
PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0004, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0010, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0020, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0080, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0200, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0400, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x4000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
|
||||
static const gfx_layout tlayout =
|
||||
{
|
||||
16,16,
|
||||
@ -352,6 +431,10 @@ static MACHINE_CONFIG_START( silvmil, silvmil_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.2)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( puzzlove, silvmil )
|
||||
MCFG_DEVICE_MODIFY("spritegen")
|
||||
MCFG_DECO_SPRITE_BOOTLEG_TYPE(1)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
ROM_START( silvmil )
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68k */
|
||||
@ -405,6 +488,33 @@ ROM_START( silvmil )
|
||||
ROM_LOAD16_BYTE( "d-20_u56.bin", 0x100001, 0x80000, CRC(e67c2c7d) SHA1(cddfd6a3d934e71853af62e3d2bf312618c9b4ff) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( puzzlove )
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68k */
|
||||
ROM_LOAD16_BYTE( "3.u3", 0x00000, 0x40000, CRC(826c8472) SHA1(54f1a9fa0431de840d6fce466e09098a8d601660) )
|
||||
ROM_LOAD16_BYTE( "4.u2", 0x00001, 0x40000, CRC(64ddc708) SHA1(60b29f8cd5dd654be34452fd197a77abc872e63d) )
|
||||
|
||||
ROM_REGION( 0x20000, "audiocpu", 0 ) /* z80 */
|
||||
ROM_LOAD( "1.uz02", 0x00000, 0x20000, CRC(3077e7f3) SHA1(e2bf634a2166e1851486a801e74a7ec0d4599c28) )
|
||||
|
||||
ROM_REGION( 0x40000, "oki", 0 ) /* samples */
|
||||
ROM_LOAD( "2.uz11", 0x00000, 0x40000, CRC(4c06ec68) SHA1(3cfca1c98e73c65a45b65d43e012c5529572c057) )
|
||||
|
||||
ROM_REGION( 0x100000, "gfx1", 0 )
|
||||
ROM_LOAD16_BYTE( "10.u41", 0x000000, 0x20000, CRC(7200f878) SHA1(27c6389f802f6e0af0210e2b01788914c0eb1d04) )
|
||||
ROM_CONTINUE ( 0x080000,0x20000 )
|
||||
ROM_CONTINUE ( 0x040000,0x20000 )
|
||||
ROM_CONTINUE ( 0x0c0000,0x20000 )
|
||||
ROM_LOAD16_BYTE( "9.u42", 0x000001, 0x20000, CRC(21b1b297) SHA1(0f589d1c62d0f79b1379e4444b119bdc4cc70cfb) )
|
||||
ROM_CONTINUE ( 0x080001,0x20000 )
|
||||
ROM_CONTINUE ( 0x040001,0x20000 )
|
||||
ROM_CONTINUE ( 0x0c0001,0x20000 )
|
||||
|
||||
ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */
|
||||
ROM_LOAD16_BYTE( "5.u53", 0x000000, 0x80000, CRC(8707d5a0) SHA1(05480ac34982a4e4768b7f3fccd2e557ca4b2545) )
|
||||
ROM_LOAD16_BYTE( "6.u54", 0x000001, 0x80000, CRC(60a6d614) SHA1(0693c08c51d6b3a05373c9999f01b0b8d23a1c89) )
|
||||
ROM_LOAD16_BYTE( "7.u55", 0x100000, 0x80000, CRC(0f2ea5c4) SHA1(4cb46fc6272e3cc14dfdcd7831157433ee7cf247) )
|
||||
ROM_LOAD16_BYTE( "8.u56", 0x100001, 0x80000, CRC(037dcd3d) SHA1(fcdf604710518982e0b4acc81a56fa703d0c9407) )
|
||||
ROM_END
|
||||
|
||||
void silvmil_state::tumblepb_gfx1_rearrange()
|
||||
{
|
||||
@ -432,4 +542,5 @@ DRIVER_INIT_MEMBER(silvmil_state,silvmil)
|
||||
tumblepb_gfx1_rearrange();
|
||||
}
|
||||
|
||||
GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1994, puzzlove, 0, puzzlove,puzzlove,silvmil_state, silvmil, ROT0, "Para", "PuzzLove", GAME_SUPPORTS_SAVE )
|
||||
|
@ -22,15 +22,21 @@ class wink_state : public driver_device
|
||||
public:
|
||||
wink_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_gfxdecode(*this, "gfxdecode") { }
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_videoram(*this, "videoram") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
|
||||
required_shared_ptr<UINT8> m_videoram;
|
||||
|
||||
tilemap_t *m_bg_tilemap;
|
||||
UINT8 m_sound_flag;
|
||||
UINT8 m_tile_bank;
|
||||
|
||||
DECLARE_WRITE8_MEMBER(bgram_w);
|
||||
DECLARE_WRITE8_MEMBER(player_mux_w);
|
||||
DECLARE_WRITE8_MEMBER(tile_banking_w);
|
||||
@ -41,15 +47,17 @@ public:
|
||||
DECLARE_READ8_MEMBER(prot_r);
|
||||
DECLARE_WRITE8_MEMBER(prot_w);
|
||||
DECLARE_READ8_MEMBER(sound_r);
|
||||
DECLARE_DRIVER_INIT(wink);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
|
||||
DECLARE_DRIVER_INIT(wink);
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
|
||||
UINT32 screen_update_wink(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
INTERRUPT_GEN_MEMBER(wink_sound);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
};
|
||||
|
||||
|
||||
@ -331,6 +339,12 @@ INTERRUPT_GEN_MEMBER(wink_state::wink_sound)
|
||||
m_sound_flag ^= 0x80;
|
||||
}
|
||||
|
||||
void wink_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_sound_flag));
|
||||
save_item(NAME(m_tile_bank));
|
||||
}
|
||||
|
||||
void wink_state::machine_reset()
|
||||
{
|
||||
m_sound_flag = 0;
|
||||
@ -431,5 +445,5 @@ DRIVER_INIT_MEMBER(wink_state,wink)
|
||||
ROM[i] += BITSWAP8(i & 0xff, 7,5,3,1,6,4,2,0);
|
||||
}
|
||||
|
||||
GAME( 1985, wink, 0, wink, wink, wink_state, wink, ROT0, "Midcoin", "Wink (set 1)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
|
||||
GAME( 1985, winka, wink, wink, wink, wink_state, wink, ROT0, "Midcoin", "Wink (set 2)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
|
||||
GAME( 1985, wink, 0, wink, wink, wink_state, wink, ROT0, "Midcoin", "Wink (set 1)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
|
||||
GAME( 1985, winka, wink, wink, wink, wink_state, wink, ROT0, "Midcoin", "Wink (set 2)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
|
||||
|
@ -10479,6 +10479,7 @@ crospang // (c) 1998 F2 System
|
||||
heuksun // (c) 1998 Oksan / F2 System
|
||||
bestri // (c) F2 System
|
||||
silvmil // (c) 1995 Para
|
||||
puzzlove // (c) 1994 Para
|
||||
funybubl // (c) 1999 In Chang Electronic Co
|
||||
funybublc // (c) 1999 Comad Industries
|
||||
dcheese // (c) 1993 HAR
|
||||
|
@ -150,6 +150,7 @@ decospr_device::decospr_device(const machine_config &mconfig, const char *tag, d
|
||||
device_video_interface(mconfig, *this),
|
||||
m_gfxregion(0),
|
||||
m_is_bootleg(false),
|
||||
m_bootleg_type(0),
|
||||
m_x_offset(0),
|
||||
m_y_offset(0),
|
||||
m_flipallx(0),
|
||||
@ -232,7 +233,16 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &
|
||||
{
|
||||
sprite = spriteram[offs + 1];
|
||||
y = spriteram[offs];
|
||||
flash = y & 0x1000;
|
||||
|
||||
if (m_is_bootleg && (m_bootleg_type == 1))
|
||||
{
|
||||
flash = y & 0x0400;
|
||||
}
|
||||
else
|
||||
{
|
||||
flash = y & 0x1000;
|
||||
}
|
||||
|
||||
w = y & 0x0800;
|
||||
|
||||
|
||||
@ -258,7 +268,20 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &
|
||||
|
||||
fx = y & 0x2000;
|
||||
fy = y & 0x4000;
|
||||
multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */
|
||||
|
||||
int tempwidth = 0;
|
||||
|
||||
if (m_is_bootleg && (m_bootleg_type==1)) // puzzlove
|
||||
{
|
||||
tempwidth = (y & 0x1000) >> 12;
|
||||
tempwidth |= (y & 0x0200) >> 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
tempwidth |= (y & 0x0600) >> 9;
|
||||
}
|
||||
|
||||
multi = (1 << (tempwidth)) - 1; /* 1x, 2x, 4x, 8x height */
|
||||
|
||||
/* bootleg support (esd16.c) */
|
||||
if (flipscreen) x = ((x&0x1ff) - m_x_offset)&0x1ff;
|
||||
|
@ -21,6 +21,7 @@ public:
|
||||
static void set_pri_callback(device_t &device, decospr_pri_cb_delegate callback) { downcast<decospr_device &>(device).m_pri_cb = callback; }
|
||||
static void set_col_callback(device_t &device, decospr_col_cb_delegate callback) { downcast<decospr_device &>(device).m_col_cb = callback; }
|
||||
static void set_is_bootleg(device_t &device, bool is_bootleg) { downcast<decospr_device &>(device).m_is_bootleg = is_bootleg; }
|
||||
static void set_bootleg_type(device_t &device, int bootleg_type) { downcast<decospr_device &>(device).m_bootleg_type = bootleg_type; }
|
||||
static void set_flipallx(device_t &device, int flipallx) { downcast<decospr_device &>(device).m_flipallx = flipallx; }
|
||||
static void set_transpen(device_t &device, int transpen) { downcast<decospr_device &>(device).m_transpen = transpen; }
|
||||
static void set_offsets(device_t &device, int x_offset, int y_offset)
|
||||
@ -55,6 +56,7 @@ protected:
|
||||
|
||||
// used by various bootleg / clone chips.
|
||||
bool m_is_bootleg; // used by various bootlegs (disables masking of sprite tile number when multi-sprite is used)
|
||||
int m_bootleg_type; // for Puzzlove, has sprite bits moved around (probably to prevent board swaps)
|
||||
int m_x_offset, m_y_offset; // used by various bootlegs
|
||||
int m_flipallx; // used by esd16.c - hedpanio, multchmp , and nmg5.c
|
||||
int m_transpen; // used by fncywld (tumbleb.c)
|
||||
@ -80,6 +82,9 @@ extern const device_type DECO_SPRITE;
|
||||
#define MCFG_DECO_SPRITE_ISBOOTLEG(_boot) \
|
||||
decospr_device::set_is_bootleg(*device, _boot);
|
||||
|
||||
#define MCFG_DECO_SPRITE_BOOTLEG_TYPE(_bootleg_type) \
|
||||
decospr_device::set_bootleg_type(*device, _bootleg_type);
|
||||
|
||||
#define MCFG_DECO_SPRITE_FLIPALLX(_flip) \
|
||||
decospr_device::set_flipallx(*device, _flip);
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
// master clock is a single stage RC oscillator: R=?K, C=?pf,
|
||||
// S2150 default frequency is 850kHz
|
||||
#define MASTER_CLOCK (850000)
|
||||
#define MASTER_CLOCK (850000/4)
|
||||
|
||||
|
||||
class wildfire_state : public driver_device
|
||||
@ -38,6 +38,7 @@ public:
|
||||
UINT16 m_leds_cache[0x10];
|
||||
UINT8 m_leds_decay[0x100];
|
||||
|
||||
DECLARE_READ8_MEMBER(read_k);
|
||||
DECLARE_WRITE8_MEMBER(write_d);
|
||||
DECLARE_WRITE16_MEMBER(write_a);
|
||||
|
||||
@ -127,6 +128,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(wildfire_state::leds_decay_tick)
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
READ8_MEMBER(wildfire_state::read_k)
|
||||
{
|
||||
// ?
|
||||
return 0xf;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(wildfire_state::write_d)
|
||||
{
|
||||
m_d = data;
|
||||
@ -188,6 +195,7 @@ static MACHINE_CONFIG_START( wildfire, wildfire_state )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", AMI_S2150, MASTER_CLOCK)
|
||||
MCFG_AMI_S2000_READ_I_CB(IOPORT("IN1"))
|
||||
MCFG_AMI_S2000_READ_K_CB(READ8(wildfire_state, read_k))
|
||||
MCFG_AMI_S2000_WRITE_D_CB(WRITE8(wildfire_state, write_d))
|
||||
MCFG_AMI_S2000_WRITE_A_CB(WRITE16(wildfire_state, write_a))
|
||||
|
||||
|
@ -8,6 +8,10 @@
|
||||
<element name="digit" defstate="0">
|
||||
<led7seg><color red="1.0" green="0.20" blue="0.22" /></led7seg>
|
||||
</element>
|
||||
<element name="led" defstate="0">
|
||||
<disk state="0"><color red="0.2" green="0.04" blue="0.05" /></disk>
|
||||
<disk state="1"><color red="1.0" green="0.20" blue="0.22" /></disk>
|
||||
</element>
|
||||
|
||||
|
||||
<!-- build screen -->
|
||||
@ -22,5 +26,99 @@
|
||||
<bezel name="digit1" element="digit"><bounds x="10" y="0" width="10" height="15" /></bezel>
|
||||
<bezel name="digit2" element="digit"><bounds x="20" y="0" width="10" height="15" /></bezel>
|
||||
|
||||
<bezel name="lamp30" element="led"><bounds x="0" y="20" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp31" element="led"><bounds x="2" y="20" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp32" element="led"><bounds x="4" y="20" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp33" element="led"><bounds x="6" y="20" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp34" element="led"><bounds x="8" y="20" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp35" element="led"><bounds x="10" y="20" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp36" element="led"><bounds x="12" y="20" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp37" element="led"><bounds x="14" y="20" width="1" height="1" /></bezel>
|
||||
|
||||
<bezel name="lamp40" element="led"><bounds x="0" y="22" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp41" element="led"><bounds x="2" y="22" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp42" element="led"><bounds x="4" y="22" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp43" element="led"><bounds x="6" y="22" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp44" element="led"><bounds x="8" y="22" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp45" element="led"><bounds x="10" y="22" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp46" element="led"><bounds x="12" y="22" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp47" element="led"><bounds x="14" y="22" width="1" height="1" /></bezel>
|
||||
|
||||
<bezel name="lamp50" element="led"><bounds x="0" y="24" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp51" element="led"><bounds x="2" y="24" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp52" element="led"><bounds x="4" y="24" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp53" element="led"><bounds x="6" y="24" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp54" element="led"><bounds x="8" y="24" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp55" element="led"><bounds x="10" y="24" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp56" element="led"><bounds x="12" y="24" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp57" element="led"><bounds x="14" y="24" width="1" height="1" /></bezel>
|
||||
|
||||
<bezel name="lamp60" element="led"><bounds x="0" y="26" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp61" element="led"><bounds x="2" y="26" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp62" element="led"><bounds x="4" y="26" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp63" element="led"><bounds x="6" y="26" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp64" element="led"><bounds x="8" y="26" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp65" element="led"><bounds x="10" y="26" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp66" element="led"><bounds x="12" y="26" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp67" element="led"><bounds x="14" y="26" width="1" height="1" /></bezel>
|
||||
|
||||
<bezel name="lamp70" element="led"><bounds x="0" y="28" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp71" element="led"><bounds x="2" y="28" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp72" element="led"><bounds x="4" y="28" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp73" element="led"><bounds x="6" y="28" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp74" element="led"><bounds x="8" y="28" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp75" element="led"><bounds x="10" y="28" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp76" element="led"><bounds x="12" y="28" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp77" element="led"><bounds x="14" y="28" width="1" height="1" /></bezel>
|
||||
|
||||
<bezel name="lamp80" element="led"><bounds x="0" y="30" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp81" element="led"><bounds x="2" y="30" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp82" element="led"><bounds x="4" y="30" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp83" element="led"><bounds x="6" y="30" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp84" element="led"><bounds x="8" y="30" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp85" element="led"><bounds x="10" y="30" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp86" element="led"><bounds x="12" y="30" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp87" element="led"><bounds x="14" y="30" width="1" height="1" /></bezel>
|
||||
|
||||
<bezel name="lamp90" element="led"><bounds x="0" y="32" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp91" element="led"><bounds x="2" y="32" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp92" element="led"><bounds x="4" y="32" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp93" element="led"><bounds x="6" y="32" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp94" element="led"><bounds x="8" y="32" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp95" element="led"><bounds x="10" y="32" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp96" element="led"><bounds x="12" y="32" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp97" element="led"><bounds x="14" y="32" width="1" height="1" /></bezel>
|
||||
|
||||
<bezel name="lamp100" element="led"><bounds x="0" y="34" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp101" element="led"><bounds x="2" y="34" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp102" element="led"><bounds x="4" y="34" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp103" element="led"><bounds x="6" y="34" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp104" element="led"><bounds x="8" y="34" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp105" element="led"><bounds x="10" y="34" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp106" element="led"><bounds x="12" y="34" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp107" element="led"><bounds x="14" y="34" width="1" height="1" /></bezel>
|
||||
|
||||
<bezel name="lamp110" element="led"><bounds x="0" y="36" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp111" element="led"><bounds x="2" y="36" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp112" element="led"><bounds x="4" y="36" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp113" element="led"><bounds x="6" y="36" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp114" element="led"><bounds x="8" y="36" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp115" element="led"><bounds x="10" y="36" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp116" element="led"><bounds x="12" y="36" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp117" element="led"><bounds x="14" y="36" width="1" height="1" /></bezel>
|
||||
|
||||
<bezel name="lamp120" element="led"><bounds x="0" y="40" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp121" element="led"><bounds x="2" y="40" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp122" element="led"><bounds x="4" y="40" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp123" element="led"><bounds x="6" y="40" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp124" element="led"><bounds x="8" y="40" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp125" element="led"><bounds x="10" y="40" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp126" element="led"><bounds x="12" y="40" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp127" element="led"><bounds x="14" y="40" width="1" height="1" /></bezel>
|
||||
|
||||
<bezel name="lamp7" element="led"><bounds x="0" y="42" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp17" element="led"><bounds x="2" y="42" width="1" height="1" /></bezel>
|
||||
<bezel name="lamp27" element="led"><bounds x="4" y="42" width="1" height="1" /></bezel>
|
||||
|
||||
</view>
|
||||
</mamelayout>
|
||||
|
@ -64,8 +64,8 @@ public:
|
||||
#endif
|
||||
m_yuv_lookup(NULL),
|
||||
m_yuv_bitmap(NULL),
|
||||
m_hw_scale_width(0),
|
||||
m_hw_scale_height(0),
|
||||
//m_hw_scale_width(0),
|
||||
//m_hw_scale_height(0),
|
||||
m_last_hofs(0),
|
||||
m_last_vofs(0),
|
||||
m_old_blitwidth(0),
|
||||
@ -114,8 +114,6 @@ public:
|
||||
// if we leave scaling to SDL and the underlying driver, this
|
||||
// is the render_target_width/height to use
|
||||
|
||||
int m_hw_scale_width;
|
||||
int m_hw_scale_height;
|
||||
int m_last_hofs;
|
||||
int m_last_vofs;
|
||||
int m_old_blitwidth;
|
||||
@ -135,7 +133,7 @@ struct sdl_scale_mode
|
||||
const char *sdl_scale_mode; /* what to use as a hint ? */
|
||||
#endif
|
||||
int pixel_format; /* Pixel/Overlay format */
|
||||
void (*yuv_blit)(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch);
|
||||
void (*yuv_blit)(const UINT16 *bitmap, UINT8 *ptr, const int pitch, const UINT32 *lookup, const int width, const int height);
|
||||
};
|
||||
|
||||
//============================================================
|
||||
@ -151,10 +149,14 @@ static void drawsdl_exit(void);
|
||||
|
||||
// YUV overlays
|
||||
|
||||
static void yuv_RGB_to_YV12(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch);
|
||||
static void yuv_RGB_to_YV12X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch);
|
||||
static void yuv_RGB_to_YUY2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch);
|
||||
static void yuv_RGB_to_YUY2X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch);
|
||||
static void yuv_RGB_to_YV12(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \
|
||||
const UINT32 *lookup, const int width, const int height);
|
||||
static void yuv_RGB_to_YV12X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \
|
||||
const UINT32 *lookup, const int width, const int height);
|
||||
static void yuv_RGB_to_YUY2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \
|
||||
const UINT32 *lookup, const int width, const int height);
|
||||
static void yuv_RGB_to_YUY2X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \
|
||||
const UINT32 *lookup, const int width, const int height);
|
||||
|
||||
// Static declarations
|
||||
|
||||
@ -163,8 +165,8 @@ static int shown_video_info = 0;
|
||||
|
||||
static const sdl_scale_mode scale_modes[] =
|
||||
{
|
||||
{ "none", 0, 0, 0, 0, SDL_DOUBLEBUF, 0, 0 },
|
||||
{ "async", 0, 0, 0, 0, SDL_DOUBLEBUF | SDL_ASYNCBLIT, 0, 0 },
|
||||
{ "none", 0, 0, 1, 1, SDL_DOUBLEBUF, 0, 0 },
|
||||
{ "async", 0, 0, 1, 1, SDL_DOUBLEBUF | SDL_ASYNCBLIT, 0, 0 },
|
||||
{ "yv12", 1, 1, 1, 1, 0, SDL_YV12_OVERLAY, yuv_RGB_to_YV12 },
|
||||
{ "yv12x2", 1, 1, 2, 2, 0, SDL_YV12_OVERLAY, yuv_RGB_to_YV12X2 },
|
||||
{ "yuy2", 1, 1, 1, 1, 0, SDL_YUY2_OVERLAY, yuv_RGB_to_YUY2 },
|
||||
@ -174,7 +176,7 @@ static const sdl_scale_mode scale_modes[] =
|
||||
#else
|
||||
static const sdl_scale_mode scale_modes[] =
|
||||
{
|
||||
{ "none", 0, 0, 0, 0, DRAW2_SCALEMODE_NEAREST, 0, 0 },
|
||||
{ "none", 0, 0, 1, 1, DRAW2_SCALEMODE_NEAREST, 0, 0 },
|
||||
{ "hwblit", 1, 0, 1, 1, DRAW2_SCALEMODE_LINEAR, 0, 0 },
|
||||
{ "hwbest", 1, 0, 1, 1, DRAW2_SCALEMODE_BEST, 0, 0 },
|
||||
{ "yv12", 1, 1, 1, 1, DRAW2_SCALEMODE_NEAREST, SDL_PIXELFORMAT_YV12, yuv_RGB_to_YV12 },
|
||||
@ -280,8 +282,13 @@ void sdl_info::setup_texture(int tempwidth, int tempheight)
|
||||
m_yuv_bitmap = NULL;
|
||||
}
|
||||
|
||||
fmt = (sdl_sm->pixel_format ? sdl_sm->pixel_format : mode.format);
|
||||
|
||||
if (sdl_sm->is_scale)
|
||||
{
|
||||
int m_hw_scale_width =0;
|
||||
int m_hw_scale_height = 0;
|
||||
|
||||
window().m_target->compute_minimum_size(m_hw_scale_width, m_hw_scale_height);
|
||||
if (video_config.prescale)
|
||||
{
|
||||
@ -291,15 +298,9 @@ void sdl_info::setup_texture(int tempwidth, int tempheight)
|
||||
/* This must be a multiple of 2 */
|
||||
m_hw_scale_width = (m_hw_scale_width + 1) & ~1;
|
||||
}
|
||||
}
|
||||
if (sdl_sm->is_yuv)
|
||||
m_yuv_bitmap = global_alloc_array(UINT16, m_hw_scale_width * m_hw_scale_height);
|
||||
|
||||
if (sdl_sm->is_yuv)
|
||||
m_yuv_bitmap = global_alloc_array(UINT16, m_hw_scale_width * m_hw_scale_height);
|
||||
|
||||
fmt = (sdl_sm->pixel_format ? sdl_sm->pixel_format : mode.format);
|
||||
|
||||
if (sdl_sm->is_scale)
|
||||
{
|
||||
int w = m_hw_scale_width * sdl_sm->mult_w;
|
||||
int h = m_hw_scale_height * sdl_sm->mult_h;
|
||||
|
||||
@ -355,9 +356,6 @@ void sdl_info::yuv_overlay_init()
|
||||
//return 1;
|
||||
}
|
||||
|
||||
m_hw_scale_width = minimum_width;
|
||||
m_hw_scale_height = minimum_height;
|
||||
|
||||
if (!shown_video_info)
|
||||
{
|
||||
osd_printf_verbose("YUV Mode : %s\n", sdl_sm->name);
|
||||
@ -546,10 +544,8 @@ int sdl_info::create(int width, int height)
|
||||
|
||||
if (!m_sdlsurf)
|
||||
return 1;
|
||||
|
||||
window().m_width = m_sdlsurf->w;
|
||||
window().m_height = m_sdlsurf->h;
|
||||
|
||||
if (sm->is_yuv)
|
||||
yuv_overlay_init();
|
||||
|
||||
@ -589,10 +585,11 @@ void sdl_info::resize(int width, int height)
|
||||
|
||||
m_sdlsurf = SDL_SetVideoMode(width, height, 0,
|
||||
SDL_SWSURFACE | SDL_ANYFORMAT | m_extra_flags);
|
||||
|
||||
window().m_width = m_sdlsurf->w;
|
||||
window().m_height = m_sdlsurf->h;
|
||||
|
||||
if (sdl_sm->is_yuv)
|
||||
if (sdl_sm->is_yuv)
|
||||
{
|
||||
yuv_overlay_init();
|
||||
}
|
||||
@ -670,13 +667,6 @@ int sdl_info::xy_to_render_target(int x, int y, int *xt, int *yt)
|
||||
return 0;
|
||||
if (*yt<0 || *xt >= window().m_blitheight)
|
||||
return 0;
|
||||
if (!sm->is_scale)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
/* Rescale */
|
||||
*xt = (*xt * m_hw_scale_width) / window().m_blitwidth;
|
||||
*yt = (*yt * m_hw_scale_height) / window().m_blitheight;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -686,12 +676,7 @@ int sdl_info::xy_to_render_target(int x, int y, int *xt, int *yt)
|
||||
|
||||
void sdl_info::set_target_bounds()
|
||||
{
|
||||
const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode];
|
||||
|
||||
if (!sm->is_scale)
|
||||
window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect());
|
||||
else
|
||||
window().m_target->set_bounds(m_hw_scale_width, m_hw_scale_height);
|
||||
window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect());
|
||||
}
|
||||
|
||||
//============================================================
|
||||
@ -703,12 +688,12 @@ int sdl_info::draw(UINT32 dc, int update)
|
||||
const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode];
|
||||
UINT8 *surfptr;
|
||||
INT32 pitch;
|
||||
int bpp;
|
||||
Uint32 rmask, gmask, bmask;
|
||||
#if (SDLMAME_SDL2)
|
||||
Uint32 amask;
|
||||
#endif
|
||||
INT32 vofs, hofs, blitwidth, blitheight, ch, cw;
|
||||
int bpp;
|
||||
|
||||
if (video_config.novideo)
|
||||
{
|
||||
@ -750,6 +735,12 @@ int sdl_info::draw(UINT32 dc, int update)
|
||||
SDL_LockYUVOverlay(m_yuvsurf);
|
||||
surfptr = m_yuvsurf->pixels[0]; // (UINT8 *) m_yuv_bitmap;
|
||||
pitch = m_yuvsurf->pitches[0]; // (UINT8 *) m_yuv_bitmap;
|
||||
#if 0
|
||||
printf("abcd %d\n", m_yuvsurf->h);
|
||||
printf("abcd %d %d %d\n", m_yuvsurf->pitches[0], m_yuvsurf->pitches[1], m_yuvsurf->pitches[2]);
|
||||
printf("abcd %p %p %p\n", m_yuvsurf->pixels[0], m_yuvsurf->pixels[1], m_yuvsurf->pixels[2]);
|
||||
printf("abcd %ld %ld\n", m_yuvsurf->pixels[1] - m_yuvsurf->pixels[0], m_yuvsurf->pixels[2] - m_yuvsurf->pixels[1]);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
surfptr = (UINT8 *)m_sdlsurf->pixels;
|
||||
@ -832,24 +823,47 @@ int sdl_info::draw(UINT32 dc, int update)
|
||||
|
||||
window().m_primlist->acquire_lock();
|
||||
|
||||
// render to it
|
||||
if (!sm->is_yuv)
|
||||
{
|
||||
int mamewidth, mameheight;
|
||||
int mamewidth, mameheight;
|
||||
|
||||
if (!sm->is_scale)
|
||||
{
|
||||
mamewidth = blitwidth;
|
||||
mameheight = blitheight;
|
||||
#if !SDLMAME_SDL2
|
||||
if (!sm->is_yuv)
|
||||
{
|
||||
surfptr += ((vofs * pitch) + (hofs * bpp));
|
||||
#endif
|
||||
mamewidth = blitwidth; //m_sdlsurf->w;
|
||||
mameheight = blitheight; //m_sdlsurf->h;
|
||||
}
|
||||
else
|
||||
{
|
||||
mamewidth = m_hw_scale_width;
|
||||
mameheight = m_hw_scale_height;
|
||||
mamewidth = m_yuvsurf->w / sm->mult_w;
|
||||
mameheight = m_yuvsurf->h / sm->mult_h;
|
||||
}
|
||||
#else
|
||||
Uint32 fmt = 0;
|
||||
int access = 0;
|
||||
SDL_QueryTexture(m_texture_id, &fmt, &access, &mamewidth, &mameheight);
|
||||
mamewidth /= sm->mult_w;
|
||||
mameheight /= sm->mult_h;
|
||||
#endif
|
||||
//printf("w h %d %d %d %d\n", mamewidth, mameheight, blitwidth, blitheight);
|
||||
|
||||
// rescale bounds
|
||||
float fw = (float) mamewidth / (float) blitwidth;
|
||||
float fh = (float) mameheight / (float) blitheight;
|
||||
|
||||
// FIXME: this could be a lot easier if we get the primlist here!
|
||||
// Bounds would be set fit for purpose and done!
|
||||
|
||||
for (render_primitive *prim = window().m_primlist->first(); prim != NULL; prim = prim->next())
|
||||
{
|
||||
prim->bounds.x0 *= fw;
|
||||
prim->bounds.x1 *= fw;
|
||||
prim->bounds.y0 *= fh;
|
||||
prim->bounds.y1 *= fh;
|
||||
}
|
||||
|
||||
// render to it
|
||||
if (!sm->is_yuv)
|
||||
{
|
||||
switch (rmask)
|
||||
{
|
||||
case 0x0000ff00:
|
||||
@ -881,8 +895,8 @@ int sdl_info::draw(UINT32 dc, int update)
|
||||
{
|
||||
assert (m_yuv_bitmap != NULL);
|
||||
assert (surfptr != NULL);
|
||||
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);
|
||||
sm->yuv_blit((UINT16 *)m_yuv_bitmap, this, surfptr, pitch);
|
||||
software_renderer<UINT16, 3,3,3, 10,5,0>::draw_primitives(*window().m_primlist, m_yuv_bitmap, mamewidth, mameheight, mamewidth);
|
||||
sm->yuv_blit((UINT16 *)m_yuv_bitmap, surfptr, pitch, m_yuv_lookup, mamewidth, mameheight);
|
||||
}
|
||||
|
||||
window().m_primlist->release_lock();
|
||||
@ -992,32 +1006,29 @@ void sdl_info::yuv_init()
|
||||
}
|
||||
}
|
||||
|
||||
static void yuv_RGB_to_YV12(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch)
|
||||
//UINT32 *lookup = sdl->m_yuv_lookup;
|
||||
|
||||
static void yuv_RGB_to_YV12(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \
|
||||
const UINT32 *lookup, const int width, const int height)
|
||||
{
|
||||
int x, y;
|
||||
UINT8 *dest_y;
|
||||
UINT8 *dest_u;
|
||||
UINT8 *dest_v;
|
||||
UINT16 *src;
|
||||
UINT16 *src2;
|
||||
UINT32 *lookup = sdl->m_yuv_lookup;
|
||||
UINT8 *pixels[3];
|
||||
int u1,v1,y1,u2,v2,y2,u3,v3,y3,u4,v4,y4; /* 12 */
|
||||
|
||||
pixels[0] = ptr;
|
||||
pixels[1] = ptr + pitch * sdl->m_hw_scale_height;
|
||||
pixels[2] = pixels[1] + pitch * sdl->m_hw_scale_height / 4;
|
||||
pixels[1] = ptr + pitch * height;
|
||||
pixels[2] = pixels[1] + pitch * height / 4;
|
||||
|
||||
for(y=0;y<sdl->m_hw_scale_height;y+=2)
|
||||
for(y=0;y<height;y+=2)
|
||||
{
|
||||
src=bitmap + (y * sdl->m_hw_scale_width) ;
|
||||
src2=src + sdl->m_hw_scale_width;
|
||||
const UINT16 *src=bitmap + (y * width) ;
|
||||
const UINT16 *src2=src + width;
|
||||
|
||||
dest_y = pixels[0] + y * pitch;
|
||||
dest_v = pixels[1] + (y>>1) * pitch / 2;
|
||||
dest_u = pixels[2] + (y>>1) * pitch / 2;
|
||||
UINT8 *dest_y = pixels[0] + y * pitch;
|
||||
UINT8 *dest_v = pixels[1] + (y>>1) * pitch / 2;
|
||||
UINT8 *dest_u = pixels[2] + (y>>1) * pitch / 2;
|
||||
|
||||
for(x=0;x<sdl->m_hw_scale_width;x+=2)
|
||||
for(x=0;x<width;x+=2)
|
||||
{
|
||||
v1 = lookup[src[x]];
|
||||
y1 = (v1>>Y1SHIFT) & 0xff;
|
||||
@ -1051,31 +1062,34 @@ static void yuv_RGB_to_YV12(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch
|
||||
}
|
||||
}
|
||||
|
||||
static void yuv_RGB_to_YV12X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch)
|
||||
static void yuv_RGB_to_YV12X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \
|
||||
const UINT32 *lookup, const int width, const int height)
|
||||
{
|
||||
/* this one is used when scale==2 */
|
||||
unsigned int x,y;
|
||||
UINT16 *dest_y;
|
||||
UINT8 *dest_u;
|
||||
UINT8 *dest_v;
|
||||
UINT16 *src;
|
||||
int u1,v1,y1;
|
||||
UINT8 *pixels[3];
|
||||
|
||||
pixels[0] = ptr;
|
||||
pixels[1] = ptr + pitch * sdl->m_hw_scale_height * 2;
|
||||
pixels[2] = pixels[1] + pitch * sdl->m_hw_scale_height / 2;
|
||||
pixels[1] = ptr + pitch * height * 2;
|
||||
#if (SDLMAME_SDL2)
|
||||
int p2 = (pitch >> 1);
|
||||
#else
|
||||
int p2 = (pitch + 7) & ~ 7;;
|
||||
p2 = (p2 >> 1);
|
||||
#endif
|
||||
pixels[2] = pixels[1] + p2 * height;
|
||||
|
||||
for(y=0;y<sdl->m_hw_scale_height;y++)
|
||||
for(y=0;y<height;y++)
|
||||
{
|
||||
src = bitmap + (y * sdl->m_hw_scale_width) ;
|
||||
const UINT16 *src = bitmap + (y * width) ;
|
||||
|
||||
dest_y = (UINT16 *)(pixels[0] + 2 * y * pitch);
|
||||
dest_v = pixels[1] + y * pitch / 2;
|
||||
dest_u = pixels[2] + y * pitch / 2;
|
||||
for(x=0;x<sdl->m_hw_scale_width;x++)
|
||||
UINT16 *dest_y = (UINT16 *)(pixels[0] + 2 * y * pitch);
|
||||
UINT8 *dest_v = pixels[1] + y * p2;
|
||||
UINT8 *dest_u = pixels[2] + y * p2;
|
||||
for(x=0;x<width;x++)
|
||||
{
|
||||
v1 = sdl->m_yuv_lookup[src[x]];
|
||||
v1 = lookup[src[x]];
|
||||
y1 = (v1 >> Y1SHIFT) & 0xff;
|
||||
u1 = (v1 >> USHIFT) & 0xff;
|
||||
v1 = (v1 >> VSHIFT) & 0xff;
|
||||
@ -1088,23 +1102,20 @@ static void yuv_RGB_to_YV12X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pit
|
||||
}
|
||||
}
|
||||
|
||||
static void yuv_RGB_to_YUY2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch)
|
||||
static void yuv_RGB_to_YUY2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \
|
||||
const UINT32 *lookup, const int width, const int height)
|
||||
{
|
||||
/* this one is used when scale==2 */
|
||||
unsigned int y;
|
||||
UINT32 *dest;
|
||||
UINT16 *src;
|
||||
UINT16 *end;
|
||||
UINT32 p1,p2,uv;
|
||||
UINT32 *lookup = sdl->m_yuv_lookup;
|
||||
int yuv_pitch = pitch/4;
|
||||
const int yuv_pitch = pitch/4;
|
||||
|
||||
for(y=0;y<sdl->m_hw_scale_height;y++)
|
||||
for(y=0;y<height;y++)
|
||||
{
|
||||
src=bitmap + (y * sdl->m_hw_scale_width) ;
|
||||
end=src+sdl->m_hw_scale_width;
|
||||
const UINT16 *src=bitmap + (y * width) ;
|
||||
const UINT16 *end=src+width;
|
||||
|
||||
dest = (UINT32 *) ptr;
|
||||
UINT32 *dest = (UINT32 *) ptr;
|
||||
dest += y * yuv_pitch;
|
||||
for(; src<end; src+=2)
|
||||
{
|
||||
@ -1117,22 +1128,19 @@ static void yuv_RGB_to_YUY2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch
|
||||
}
|
||||
}
|
||||
|
||||
static void yuv_RGB_to_YUY2X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch)
|
||||
static void yuv_RGB_to_YUY2X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \
|
||||
const UINT32 *lookup, const int width, const int height)
|
||||
{
|
||||
/* this one is used when scale==2 */
|
||||
unsigned int y;
|
||||
UINT32 *dest;
|
||||
UINT16 *src;
|
||||
UINT16 *end;
|
||||
UINT32 *lookup = sdl->m_yuv_lookup;
|
||||
int yuv_pitch = pitch / 4;
|
||||
|
||||
for(y=0;y<sdl->m_hw_scale_height;y++)
|
||||
for(y=0;y<height;y++)
|
||||
{
|
||||
src=bitmap + (y * sdl->m_hw_scale_width) ;
|
||||
end=src+sdl->m_hw_scale_width;
|
||||
const UINT16 *src=bitmap + (y * width) ;
|
||||
const UINT16 *end=src+width;
|
||||
|
||||
dest = (UINT32 *) ptr;
|
||||
UINT32 *dest = (UINT32 *) ptr;
|
||||
dest += (y * yuv_pitch);
|
||||
for(; src<end; src++)
|
||||
{
|
||||
|
@ -1758,7 +1758,10 @@ void sdlinput_poll(running_machine &machine)
|
||||
devinfo = generic_device_find_index( keyboard_list, keyboard_map.logical[0]);
|
||||
#endif
|
||||
devinfo->keyboard.state[OSD_SDL_INDEX_KEYSYM(&event.key.keysym)] = 0x80;
|
||||
#if (!SDLMAME_SDL2)
|
||||
#if (SDLMAME_SDL2)
|
||||
if (event.key.keysym.sym < 0x20)
|
||||
ui_input_push_char_event(machine, sdl_window_list->m_target, event.key.keysym.sym);
|
||||
#else
|
||||
ui_input_push_char_event(machine, sdl_window_list->m_target, (unicode_char) event.key.keysym.unicode);
|
||||
#endif
|
||||
break;
|
||||
@ -1859,7 +1862,7 @@ void sdlinput_poll(running_machine &machine)
|
||||
int cx, cy;
|
||||
osd_ticks_t click = osd_ticks() * 1000 / osd_ticks_per_second();
|
||||
sdl_window_info *window = GET_FOCUS_WINDOW(&event.button);
|
||||
if (window != NULL && window->renderer().xy_to_render_target(event.button.x,event.button.y, &cx, &cy) )
|
||||
if (window != NULL && window->xy_to_render_target(event.button.x,event.button.y, &cx, &cy) )
|
||||
{
|
||||
ui_input_push_mouse_down_event(machine, window->m_target, cx, cy);
|
||||
// FIXME Parameter ?
|
||||
@ -1893,7 +1896,7 @@ void sdlinput_poll(running_machine &machine)
|
||||
int cx, cy;
|
||||
sdl_window_info *window = GET_FOCUS_WINDOW(&event.button);
|
||||
|
||||
if (window != NULL && window->renderer().xy_to_render_target(event.button.x,event.button.y, &cx, &cy) )
|
||||
if (window != NULL && window->xy_to_render_target(event.button.x,event.button.y, &cx, &cy) )
|
||||
{
|
||||
ui_input_push_mouse_up_event(machine, window->m_target, cx, cy);
|
||||
}
|
||||
@ -1918,7 +1921,7 @@ void sdlinput_poll(running_machine &machine)
|
||||
int cx=-1, cy=-1;
|
||||
sdl_window_info *window = GET_FOCUS_WINDOW(&event.motion);
|
||||
|
||||
if (window != NULL && window->renderer().xy_to_render_target(event.motion.x, event.motion.y, &cx, &cy) )
|
||||
if (window != NULL && window->xy_to_render_target(event.motion.x, event.motion.y, &cx, &cy) )
|
||||
ui_input_push_mouse_move_event(machine, window->m_target, cx, cy);
|
||||
}
|
||||
break;
|
||||
@ -1947,6 +1950,7 @@ void sdlinput_poll(running_machine &machine)
|
||||
case SDL_TEXTINPUT:
|
||||
if (*event.text.text)
|
||||
{
|
||||
printf("char %c\n", *event.text.text);
|
||||
sdl_window_info *window = GET_FOCUS_WINDOW(&event.text);
|
||||
unicode_char result;
|
||||
if (window != NULL )
|
||||
|
@ -894,7 +894,7 @@ $(LIBOSD): $(OSDOBJS)
|
||||
#-------------------------------------------------
|
||||
|
||||
TOOLS += \
|
||||
testkeys$(EXE)
|
||||
$(BIN)testkeys$(EXE)
|
||||
|
||||
$(SDLOBJ)/testkeys.o: $(SDLSRC)/testkeys.c
|
||||
@echo Compiling $<...
|
||||
@ -903,7 +903,7 @@ $(SDLOBJ)/testkeys.o: $(SDLSRC)/testkeys.c
|
||||
TESTKEYSOBJS = \
|
||||
$(SDLOBJ)/testkeys.o \
|
||||
|
||||
testkeys$(EXE): $(TESTKEYSOBJS) $(LIBUTIL) $(LIBOCORE) $(SDLUTILMAIN)
|
||||
$(BIN)testkeys$(EXE): $(TESTKEYSOBJS) $(LIBUTIL) $(LIBOCORE) $(SDLUTILMAIN)
|
||||
@echo Linking $@...
|
||||
$(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@
|
||||
|
||||
|
@ -146,7 +146,7 @@ int main(int argc, char *argv[])
|
||||
printf("ITEM_ID_XY %s 0x%x 0x%x %s\n",
|
||||
lookup_key_name(sdl_lookup, event.key.keysym.scancode),
|
||||
(int) event.key.keysym.scancode,
|
||||
0, //(int) event.key.keysym.unicode,
|
||||
(int) event.key.keysym.sym,
|
||||
"");
|
||||
lasttext[0] = 0;
|
||||
#else
|
||||
@ -165,7 +165,7 @@ int main(int argc, char *argv[])
|
||||
printf("ITEM_ID_XY %s 0x%x 0x%x %s\n",
|
||||
lookup_key_name(sdl_lookup, event.key.keysym.scancode),
|
||||
(int) event.key.keysym.scancode,
|
||||
0, //(int) event.key.keysym.unicode,
|
||||
(int) event.key.keysym.sym,
|
||||
lasttext);
|
||||
#else
|
||||
memset(buf, 0, 19);
|
||||
|
@ -55,8 +55,6 @@
|
||||
#define ASSERT_WINDOW_THREAD() ASSERT_USE(window_threadid)
|
||||
#define ASSERT_MAIN_THREAD() ASSERT_USE(main_threadid)
|
||||
|
||||
#define OSDWORK_CALLBACK(name) void *name(void *param, ATTR_UNUSED int threadid)
|
||||
|
||||
// minimum window dimension
|
||||
#define MIN_WINDOW_DIM 200
|
||||
|
||||
@ -141,14 +139,9 @@ private:
|
||||
// PROTOTYPES
|
||||
//============================================================
|
||||
|
||||
static OSDWORK_CALLBACK( draw_video_contents_wt );
|
||||
static OSDWORK_CALLBACK( sdlwindow_video_window_destroy_wt );
|
||||
static OSDWORK_CALLBACK( sdlwindow_resize_wt );
|
||||
static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt );
|
||||
static void sdlwindow_update_cursor_state(running_machine &machine, sdl_window_info *window);
|
||||
static void sdlwindow_sync(void);
|
||||
|
||||
static void *complete_create_wt(void *param, int threadid);
|
||||
static void set_starting_view(running_machine &machine, int index, sdl_window_info *window, const char *defview, const char *view);
|
||||
|
||||
//============================================================
|
||||
@ -483,7 +476,7 @@ void sdl_window_info::blit_surface_size(int window_width, int window_height)
|
||||
// (main thread)
|
||||
//============================================================
|
||||
|
||||
static OSDWORK_CALLBACK( sdlwindow_resize_wt )
|
||||
OSDWORK_CALLBACK( sdl_window_info::sdlwindow_resize_wt )
|
||||
{
|
||||
worker_param * wp = (worker_param *) param;
|
||||
sdl_window_info * window = wp->window();
|
||||
@ -517,7 +510,7 @@ void sdl_window_info::window_resize(INT32 width, INT32 height)
|
||||
// (window thread)
|
||||
//============================================================
|
||||
|
||||
static OSDWORK_CALLBACK( sdlwindow_clear_surface_wt )
|
||||
OSDWORK_CALLBACK( sdl_window_info::sdlwindow_clear_surface_wt )
|
||||
{
|
||||
worker_param *wp = (worker_param *) param;
|
||||
sdl_window_info *window = wp->window();
|
||||
@ -547,7 +540,7 @@ void sdl_window_info::window_clear()
|
||||
// (main thread)
|
||||
//============================================================
|
||||
|
||||
static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt )
|
||||
OSDWORK_CALLBACK( sdl_window_info::sdlwindow_toggle_full_screen_wt )
|
||||
{
|
||||
worker_param *wp = (worker_param *) param;
|
||||
sdl_window_info *window = wp->window();
|
||||
@ -583,7 +576,7 @@ void sdl_window_info::toggle_full_screen(running_machine &machine)
|
||||
execute_async_wait(&sdlwindow_toggle_full_screen_wt, worker_param(machine, this));
|
||||
}
|
||||
|
||||
static OSDWORK_CALLBACK( destroy_all_textures_wt )
|
||||
OSDWORK_CALLBACK( sdl_window_info::destroy_all_textures_wt )
|
||||
{
|
||||
worker_param *wp = (worker_param *) param;
|
||||
|
||||
@ -703,6 +696,10 @@ static OSDWORK_CALLBACK( sdlwindow_update_cursor_state_wt )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int sdl_window_info::xy_to_render_target(int x, int y, int *xt, int *yt)
|
||||
{
|
||||
return renderer().xy_to_render_target(x, y, xt, yt);
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// sdlwindow_video_window_create
|
||||
@ -753,13 +750,13 @@ int sdlwindow_video_window_create(running_machine &machine, int index, sdl_monit
|
||||
{
|
||||
osd_work_item *wi;
|
||||
|
||||
wi = osd_work_item_queue(work_queue, &complete_create_wt, (void *) wp, 0);
|
||||
wi = osd_work_item_queue(work_queue, &sdl_window_info::complete_create_wt, (void *) wp, 0);
|
||||
sdlwindow_sync();
|
||||
result = *((int *) (osd_work_item_result)(wi));
|
||||
osd_work_item_release(wi);
|
||||
}
|
||||
else
|
||||
result = *((int *) complete_create_wt((void *) wp, 0));
|
||||
result = *((int *) sdl_window_info::complete_create_wt((void *) wp, 0));
|
||||
|
||||
// handle error conditions
|
||||
if (result == 1)
|
||||
@ -780,7 +777,7 @@ error:
|
||||
// (main thread)
|
||||
//============================================================
|
||||
|
||||
static OSDWORK_CALLBACK( sdlwindow_video_window_destroy_wt )
|
||||
OSDWORK_CALLBACK( sdl_window_info::sdlwindow_video_window_destroy_wt )
|
||||
{
|
||||
worker_param * wp = (worker_param *) param;
|
||||
sdl_window_info * window = wp->window();
|
||||
@ -1075,7 +1072,7 @@ static void set_starting_view(running_machine &machine, int index, sdl_window_in
|
||||
// (window thread)
|
||||
//============================================================
|
||||
|
||||
static OSDWORK_CALLBACK( complete_create_wt )
|
||||
OSDWORK_CALLBACK( sdl_window_info::complete_create_wt )
|
||||
{
|
||||
worker_param * wp = (worker_param *) param;
|
||||
sdl_window_info * window = wp->window();
|
||||
@ -1139,7 +1136,7 @@ static OSDWORK_CALLBACK( complete_create_wt )
|
||||
// (window thread)
|
||||
//============================================================
|
||||
|
||||
static void measure_fps(sdl_window_info *window, UINT32 dc, int update)
|
||||
void sdl_window_info::measure_fps(UINT32 dc, int update)
|
||||
{
|
||||
const unsigned long frames_skip4fps = 100;
|
||||
static int64_t lastTime=0, sumdt=0, startTime=0;
|
||||
@ -1154,7 +1151,7 @@ static void measure_fps(sdl_window_info *window, UINT32 dc, int update)
|
||||
|
||||
t0 = osd_ticks();
|
||||
|
||||
window->renderer().draw(dc, update);
|
||||
renderer().draw(dc, update);
|
||||
|
||||
frames++;
|
||||
currentTime = osd_ticks();
|
||||
@ -1181,7 +1178,7 @@ static void measure_fps(sdl_window_info *window, UINT32 dc, int update)
|
||||
}
|
||||
}
|
||||
|
||||
static OSDWORK_CALLBACK( draw_video_contents_wt )
|
||||
OSDWORK_CALLBACK( sdl_window_info::draw_video_contents_wt )
|
||||
{
|
||||
UINT32 dc = 0;
|
||||
int update = 1;
|
||||
@ -1203,7 +1200,7 @@ static OSDWORK_CALLBACK( draw_video_contents_wt )
|
||||
else
|
||||
{
|
||||
if( video_config.perftest )
|
||||
measure_fps(window, dc, update);
|
||||
window->measure_fps(dc, update);
|
||||
else
|
||||
window->renderer().draw(dc, update);
|
||||
}
|
||||
|
@ -57,6 +57,8 @@ private:
|
||||
sdl_window_info *m_window;
|
||||
};
|
||||
|
||||
#define OSDWORK_CALLBACK(name) void *name(void *param, ATTR_UNUSED int threadid)
|
||||
|
||||
class sdl_window_info
|
||||
{
|
||||
public:
|
||||
@ -116,7 +118,7 @@ public:
|
||||
void pick_best_mode(int *fswidth, int *fsheight);
|
||||
int index() const { return m_index; }
|
||||
|
||||
osd_renderer &renderer() { return *m_renderer; }
|
||||
int xy_to_render_target(int x, int y, int *xt, int *yt);
|
||||
|
||||
// Pointer to next window
|
||||
sdl_window_info * m_next;
|
||||
@ -167,6 +169,10 @@ public:
|
||||
{
|
||||
m_renderer = renderer;
|
||||
}
|
||||
|
||||
static OSDWORK_CALLBACK( complete_create_wt );
|
||||
protected:
|
||||
osd_renderer &renderer() { return *m_renderer; }
|
||||
private:
|
||||
void constrain_to_aspect_ratio(int *window_width, int *window_height, int adjustment);
|
||||
|
||||
@ -178,6 +184,17 @@ private:
|
||||
int m_index;
|
||||
osd_renderer * m_renderer;
|
||||
|
||||
// static callbacks ...
|
||||
|
||||
static OSDWORK_CALLBACK( sdlwindow_resize_wt );
|
||||
static OSDWORK_CALLBACK( draw_video_contents_wt );
|
||||
static OSDWORK_CALLBACK( sdlwindow_video_window_destroy_wt );
|
||||
static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt );
|
||||
static OSDWORK_CALLBACK( sdlwindow_clear_surface_wt );
|
||||
static OSDWORK_CALLBACK( destroy_all_textures_wt );
|
||||
|
||||
void measure_fps(UINT32 dc, int update);
|
||||
|
||||
};
|
||||
|
||||
struct sdl_draw_info
|
||||
|
Loading…
Reference in New Issue
Block a user