This commit is contained in:
Vas Crabb 2016-03-01 14:43:10 +11:00
commit 743550d4c3
9 changed files with 497 additions and 123 deletions

View File

@ -82,6 +82,7 @@ function osdmodulesbuild()
MAME_DIR .. "src/osd/modules/input/input_x11.cpp",
MAME_DIR .. "src/osd/modules/input/input_windows.cpp",
MAME_DIR .. "src/osd/modules/input/input_windows.h",
MAME_DIR .. "src/osd/modules/input/input_xinput.cpp",
}
if _OPTIONS["targetos"]=="windows" then

View File

@ -46,6 +46,7 @@ function maintargetosdoptions(_target,_subtarget)
"comctl32",
"comdlg32",
"psapi",
"xinput",
}
end

View File

@ -660,26 +660,73 @@ void ui_menu_select_game::build_available_list()
// now check and include NONE_NEEDED
for (int x = 0; x < m_total; ++x)
if (!m_included[x])
{
const game_driver *driver = &driver_list::driver(x);
if (!m_included[x] && driver != &GAME_NAME(___empty))
{
if (&driver_list::driver(x) == &GAME_NAME(___empty))
continue;
const rom_entry *rom = driver_list::driver(x).rom;
const rom_entry *rom = driver->rom;
bool noroms = true;
for (; !ROMENTRY_ISEND(rom); ++rom)
if (!ROMENTRY_ISREGION(rom))
// check NO-DUMP
for (; !ROMENTRY_ISEND(rom) && noroms == true; ++rom)
if (ROMENTRY_ISFILE(rom))
{
noroms = false;
break;
hash_collection hashes(ROM_GETHASHDATA(rom));
if (!hashes.flag(hash_collection::FLAG_NO_DUMP) && !ROM_ISOPTIONAL(rom))
noroms = false;
}
if (!noroms)
{
// check if clone == parent
int cx = driver_list::clone(*driver);
if (cx != -1 && m_included[cx])
{
const game_driver *drv = &driver_list::driver(cx);
const rom_entry *parentrom = drv->rom;
if ((rom = driver->rom) == parentrom)
noroms = true;
// check if clone < parent
if (!noroms)
{
noroms = true;
for (; !ROMENTRY_ISEND(rom) && noroms == true; ++rom)
{
if (ROMENTRY_ISFILE(rom))
{
hash_collection hashes(ROM_GETHASHDATA(rom));
if (hashes.flag(hash_collection::FLAG_NO_DUMP) || ROM_ISOPTIONAL(rom))
continue;
UINT64 lenght = ROM_GETLENGTH(rom);
bool found = false;
for (parentrom = drv->rom; !ROMENTRY_ISEND(parentrom) && found == false; ++parentrom)
{
if (ROMENTRY_ISFILE(parentrom) && ROM_GETLENGTH(parentrom) == lenght)
{
hash_collection parenthashes(ROM_GETHASHDATA(parentrom));
if (parenthashes.flag(hash_collection::FLAG_NO_DUMP) || ROM_ISOPTIONAL(parentrom))
continue;
if (hashes == parenthashes)
found = true;
}
}
noroms = found;
}
}
}
}
}
if (noroms)
{
m_availsortedlist.push_back(&driver_list::driver(x));
m_included[x] = true;
}
}
}
// sort
std::stable_sort(m_availsortedlist.begin(), m_availsortedlist.end(), sort_game_list);
@ -2259,6 +2306,7 @@ void ui_menu_select_game::arts_render(void *selectedref, float origx1, float ori
if (driver != olddriver || !snapx_bitmap->valid() || ui_globals::switch_image)
{
emu_file snapfile(searchstr.c_str(), OPEN_FLAG_READ);
snapfile.set_restrict_to_mediapath(true);
bitmap_argb32 *tmp_bitmap;
tmp_bitmap = auto_alloc(machine(), bitmap_argb32);

View File

@ -1709,6 +1709,7 @@ void ui_menu_select_software::arts_render(void *selectedref, float origx1, float
if (driver != olddriver || !snapx_bitmap->valid() || ui_globals::switch_image)
{
emu_file snapfile(searchstr.c_str(), OPEN_FLAG_READ);
snapfile.set_restrict_to_mediapath(true);
bitmap_argb32 *tmp_bitmap;
tmp_bitmap = auto_alloc(machine(), bitmap_argb32);

View File

@ -10129,11 +10129,11 @@ aliencha // (c) 1994
alienchac // (c) 1994
// IGS009 Games
jingbell // (c) 1995?
jingbella // (c) 1995?
jingbellb // (c) 1995?
jingbellc // (c) 1995?
jingbelld // (c) 1995?
jingbell // (c) 1997
jingbella // (c) 1997
jingbellb // (c) 1997
jingbellc // (c) 1995
jingbelli // (c) 1995?
gp98 // (c) 1998
// IGS011 Games

View File

@ -860,9 +860,142 @@ static MACHINE_CONFIG_DERIVED( gp98, jingbell )
MACHINE_CONFIG_END
/***************************************************************************
Jingle Bell
IGS, 1997.
English versions.
1x HD64180RP8 (u18)
2x NEC D8255AC-2 (u19, u20)
1x custom IGS 009 F56D 246 (u22)
1x YM2413 (u45)
1x AR17961-AP0640 (u46)(sound equivalent to OKI M6295)
4x 27C512 (1, 2, 3, V)
3x 27C2001 (4, 5, 6)
1x 27C256 (7)
1x 27C1001 (sp)
1x UMC UM6264B-10L (u42)
2x UMC UM6164DK-12 (u1, u2)
1x crystal 12.000 MHz.
1x crystal 3.579545 MHz.
1x 38x2 edge connector.
2x 10x2 edge connectors.
1x switch.
1x 3.6 V. lithium battery.
5x 8 DIP switches banks.
***************************************************************************/
/* Jingle Bells (V157 US)
Original IGS.
For amusement.
*/
ROM_START( jingbell )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "27c512_v157_us.u44", 0x00000, 0x10000, CRC(37f95b60) SHA1(db2022802ce553ce7a0e8403408f3194b2f10007) )
ROM_REGION( 0x8000, "data", 0 )
ROM_LOAD( "27c256_v157_us.u43", 0x0000, 0x8000, CRC(a7affa15) SHA1(f9d33e32b57ad267d383e075663994e0af0b3016) )
ROM_REGION( 0x30000, "reels", 0 )
ROM_LOAD( "27c512_v157_us.u17", 0x00000, 0x10000, CRC(cadd7910) SHA1(aa514ddb29c8c9a77478d56bea4ae71995fdd518) )
ROM_LOAD( "27c512_v157_us.u16", 0x10000, 0x10000, CRC(a9e1f5aa) SHA1(68d7f4e9e9a5bbce0904e406ee6fe82e9e52a9ba) )
ROM_LOAD( "27c512_v157_us.u15", 0x20000, 0x10000, CRC(865b7d3a) SHA1(c1dff3a27d747ee499aaee0c4468534f0249a3e5) )
ROM_REGION( 0xc0000, "tiles", 0 )
ROM_LOAD( "27c2001_v157_us.u25", 0x00000, 0x40000, CRC(daa56ce5) SHA1(4f14a8efac16b03bd14dd26d586bcb8d5bef65c1) )
ROM_LOAD( "27c2001_v157_us.u24", 0x40000, 0x40000, CRC(b10b38e1) SHA1(397b2d899e47c6249fbbb6e6262d0390d9b796e6) )
ROM_LOAD( "27c2001_v157_us.u23", 0x80000, 0x40000, CRC(a3304b5a) SHA1(bf51cb1f728758d50ce27275aa19ef649f6b34b9) )
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "mx29f001t_v157_us_sp.u38", 0x00000, 0x20000, CRC(a42d73b1) SHA1(93157e9630d5c8bb34c71186415d0aa8c5d51951) )
ROM_END
/* Jingle Bells (V155 EU)
Original IGS.
For amusement.
*/
ROM_START( jingbella )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "27c512_v155.u44", 0x00000, 0x10000, CRC(0813d12b) SHA1(4c35b656d1e54619bbfd26cbc017eba336e6abda) )
ROM_REGION( 0x8000, "data", 0 )
ROM_LOAD( "27c256_v155.u43", 0x0000, 0x8000, CRC(a7affa15) SHA1(f9d33e32b57ad267d383e075663994e0af0b3016) )
ROM_REGION( 0x30000, "reels", 0 )
ROM_LOAD( "27c512_v155.u17", 0x00000, 0x10000, CRC(cadd7910) SHA1(aa514ddb29c8c9a77478d56bea4ae71995fdd518) )
ROM_LOAD( "27c512_v155.u16", 0x10000, 0x10000, CRC(a9e1f5aa) SHA1(68d7f4e9e9a5bbce0904e406ee6fe82e9e52a9ba) )
ROM_LOAD( "27c512_v155.u15", 0x20000, 0x10000, CRC(865b7d3a) SHA1(c1dff3a27d747ee499aaee0c4468534f0249a3e5) )
ROM_REGION( 0xc0000, "tiles", 0 )
ROM_LOAD( "27c2001_v155.u25", 0x00000, 0x40000, CRC(daa56ce5) SHA1(4f14a8efac16b03bd14dd26d586bcb8d5bef65c1) )
ROM_LOAD( "27c2001_v155.u24", 0x40000, 0x40000, CRC(b10b38e1) SHA1(397b2d899e47c6249fbbb6e6262d0390d9b796e6) )
ROM_LOAD( "27c2001_v155.u23", 0x80000, 0x40000, CRC(a3304b5a) SHA1(bf51cb1f728758d50ce27275aa19ef649f6b34b9) )
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "27c1001_v155_sp.u38", 0x00000, 0x20000, CRC(a42d73b1) SHA1(93157e9630d5c8bb34c71186415d0aa8c5d51951) )
ROM_END
/* Jingle Bells (V153 EU)
Original IGS.
For amusement.
*/
ROM_START( jingbellb )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "27c512_v153.u44", 0x00000, 0x10000, CRC(fd3bc092) SHA1(a92dc9bc15d7a4816887d66d46cea925d230c5b8) )
ROM_REGION( 0x8000, "data", 0 )
ROM_LOAD( "27c256_v153.u43", 0x0000, 0x8000, CRC(a7affa15) SHA1(f9d33e32b57ad267d383e075663994e0af0b3016) )
ROM_REGION( 0x30000, "reels", 0 )
ROM_LOAD( "27c512_v153.u17", 0x00000, 0x10000, CRC(cadd7910) SHA1(aa514ddb29c8c9a77478d56bea4ae71995fdd518) )
ROM_LOAD( "27c512_v153.u16", 0x10000, 0x10000, CRC(a9e1f5aa) SHA1(68d7f4e9e9a5bbce0904e406ee6fe82e9e52a9ba) )
ROM_LOAD( "27c512_v153.u15", 0x20000, 0x10000, CRC(865b7d3a) SHA1(c1dff3a27d747ee499aaee0c4468534f0249a3e5) )
ROM_REGION( 0xc0000, "tiles", 0 )
ROM_LOAD( "27c2001_v153.u25", 0x00000, 0x40000, CRC(daa56ce5) SHA1(4f14a8efac16b03bd14dd26d586bcb8d5bef65c1) )
ROM_LOAD( "27c2001_v153.u24", 0x40000, 0x40000, CRC(b10b38e1) SHA1(397b2d899e47c6249fbbb6e6262d0390d9b796e6) )
ROM_LOAD( "27c2001_v153.u23", 0x80000, 0x40000, CRC(a3304b5a) SHA1(bf51cb1f728758d50ce27275aa19ef649f6b34b9) )
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "27c1001_v153_sp.u38", 0x00000, 0x20000, CRC(a42d73b1) SHA1(93157e9630d5c8bb34c71186415d0aa8c5d51951) )
ROM_END
/* Jingle Bells (V141 EU)
Original IGS.
For amusement.
*/
ROM_START( jingbellc )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "27c512_v141.u44", 0x00000, 0x10000, CRC(6997a903) SHA1(991508d85e55a3c6f811070352e06ae6bf65cc2e) )
ROM_REGION( 0x8000, "data", 0 )
ROM_LOAD( "27c256_v141.u43", 0x0000, 0x8000, CRC(a7affa15) SHA1(f9d33e32b57ad267d383e075663994e0af0b3016) )
ROM_REGION( 0x30000, "reels", 0 )
ROM_LOAD( "27c512_v141.u17", 0x00000, 0x10000, CRC(cadd7910) SHA1(aa514ddb29c8c9a77478d56bea4ae71995fdd518) )
ROM_LOAD( "27c512_v141.u16", 0x10000, 0x10000, CRC(a9e1f5aa) SHA1(68d7f4e9e9a5bbce0904e406ee6fe82e9e52a9ba) )
ROM_LOAD( "27c512_v141.u15", 0x20000, 0x10000, CRC(865b7d3a) SHA1(c1dff3a27d747ee499aaee0c4468534f0249a3e5) )
ROM_REGION( 0xc0000, "tiles", 0 )
ROM_LOAD( "27c2001_v141.u25", 0x00000, 0x40000, CRC(f53bac7e) SHA1(f4375da0780fba59fcb65e24a33099af35e4d286) )
ROM_LOAD( "27c2001_v141.u24", 0x40000, 0x40000, CRC(bddd6001) SHA1(2a6395e9593352d3ea2d477a7f41805f389c9c50) )
ROM_LOAD( "27c2001_v141.u23", 0x80000, 0x40000, CRC(e8322c75) SHA1(c3385538fb673a4ab14c315ce8bce792eb264ec7) )
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "27c1001_v141_sp.u38", 0x00000, 0x20000, CRC(a42d73b1) SHA1(93157e9630d5c8bb34c71186415d0aa8c5d51951) )
ROM_END
/***************************************************************************
Jingle Bell
Italy, V133I
(C) IGS ("COPYRIGHT 1995" in ROM, "FEB. 23 1998" on sticker)
CPU:
@ -895,8 +1028,7 @@ Notes:
12/02/2008 f205v
***************************************************************************/
ROM_START( jingbell )
ROM_START( jingbelli )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "jinglev133i.u44", 0x00000, 0x10000, CRC(df60dc39) SHA1(ff57afd50c045b621395353fdc50ffd1e1b65e9e) )
@ -923,106 +1055,6 @@ ROM_START( jingbell )
ROM_LOAD( "palce22v10h-ch-jin-u27.u27", 0x000, 0x2dd, BAD_DUMP CRC(5c4e9024) SHA1(e9d1e4df3d79c21f4ce053a84bb7b7a43d650f91) )
ROM_END
/* Jingle Bells (V157 US)
Original IGS.
For amusement.
*/
ROM_START( jingbella )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "27c512_v157_us.u44", 0x00000, 0x10000, CRC(37f95b60) SHA1(db2022802ce553ce7a0e8403408f3194b2f10007) )
ROM_REGION( 0x8000, "data", 0 )
ROM_LOAD( "27c256_v157_us.u43", 0x0000, 0x8000, CRC(a7affa15) SHA1(f9d33e32b57ad267d383e075663994e0af0b3016) )
ROM_REGION( 0x30000, "reels", 0 )
ROM_LOAD( "27c512_v157_us.u17", 0x00000, 0x10000, CRC(cadd7910) SHA1(aa514ddb29c8c9a77478d56bea4ae71995fdd518) )
ROM_LOAD( "27c512_v157_us.u16", 0x10000, 0x10000, CRC(a9e1f5aa) SHA1(68d7f4e9e9a5bbce0904e406ee6fe82e9e52a9ba) )
ROM_LOAD( "27c512_v157_us.u15", 0x20000, 0x10000, CRC(865b7d3a) SHA1(c1dff3a27d747ee499aaee0c4468534f0249a3e5) )
ROM_REGION( 0xc0000, "tiles", 0 )
ROM_LOAD( "27c2001_v157_us.u25", 0x00000, 0x40000, CRC(daa56ce5) SHA1(4f14a8efac16b03bd14dd26d586bcb8d5bef65c1) )
ROM_LOAD( "27c2001_v157_us.u24", 0x40000, 0x40000, CRC(b10b38e1) SHA1(397b2d899e47c6249fbbb6e6262d0390d9b796e6) )
ROM_LOAD( "27c2001_v157_us.u23", 0x80000, 0x40000, CRC(a3304b5a) SHA1(bf51cb1f728758d50ce27275aa19ef649f6b34b9) )
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "mx29f001t_v157_us_sp.u38", 0x00000, 0x20000, CRC(a42d73b1) SHA1(93157e9630d5c8bb34c71186415d0aa8c5d51951) )
ROM_END
/* Jingle Bells (V155 EU)
Original IGS.
For amusement.
*/
ROM_START( jingbellb )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "27c512_v155.u44", 0x00000, 0x10000, CRC(0813d12b) SHA1(4c35b656d1e54619bbfd26cbc017eba336e6abda) )
ROM_REGION( 0x8000, "data", 0 )
ROM_LOAD( "27c256_v155.u43", 0x0000, 0x8000, CRC(a7affa15) SHA1(f9d33e32b57ad267d383e075663994e0af0b3016) )
ROM_REGION( 0x30000, "reels", 0 )
ROM_LOAD( "27c512_v155.u17", 0x00000, 0x10000, CRC(cadd7910) SHA1(aa514ddb29c8c9a77478d56bea4ae71995fdd518) )
ROM_LOAD( "27c512_v155.u16", 0x10000, 0x10000, CRC(a9e1f5aa) SHA1(68d7f4e9e9a5bbce0904e406ee6fe82e9e52a9ba) )
ROM_LOAD( "27c512_v155.u15", 0x20000, 0x10000, CRC(865b7d3a) SHA1(c1dff3a27d747ee499aaee0c4468534f0249a3e5) )
ROM_REGION( 0xc0000, "tiles", 0 )
ROM_LOAD( "27c2001_v155.u25", 0x00000, 0x40000, CRC(daa56ce5) SHA1(4f14a8efac16b03bd14dd26d586bcb8d5bef65c1) )
ROM_LOAD( "27c2001_v155.u24", 0x40000, 0x40000, CRC(b10b38e1) SHA1(397b2d899e47c6249fbbb6e6262d0390d9b796e6) )
ROM_LOAD( "27c2001_v155.u23", 0x80000, 0x40000, CRC(a3304b5a) SHA1(bf51cb1f728758d50ce27275aa19ef649f6b34b9) )
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "27c1001_v155_sp.u38", 0x00000, 0x20000, CRC(a42d73b1) SHA1(93157e9630d5c8bb34c71186415d0aa8c5d51951) )
ROM_END
/* Jingle Bells (V153 EU)
Original IGS.
For amusement.
*/
ROM_START( jingbellc )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "27c512_v153.u44", 0x00000, 0x10000, CRC(fd3bc092) SHA1(a92dc9bc15d7a4816887d66d46cea925d230c5b8) )
ROM_REGION( 0x8000, "data", 0 )
ROM_LOAD( "27c256_v153.u43", 0x0000, 0x8000, CRC(a7affa15) SHA1(f9d33e32b57ad267d383e075663994e0af0b3016) )
ROM_REGION( 0x30000, "reels", 0 )
ROM_LOAD( "27c512_v153.u17", 0x00000, 0x10000, CRC(cadd7910) SHA1(aa514ddb29c8c9a77478d56bea4ae71995fdd518) )
ROM_LOAD( "27c512_v153.u16", 0x10000, 0x10000, CRC(a9e1f5aa) SHA1(68d7f4e9e9a5bbce0904e406ee6fe82e9e52a9ba) )
ROM_LOAD( "27c512_v153.u15", 0x20000, 0x10000, CRC(865b7d3a) SHA1(c1dff3a27d747ee499aaee0c4468534f0249a3e5) )
ROM_REGION( 0xc0000, "tiles", 0 )
ROM_LOAD( "27c2001_v153.u25", 0x00000, 0x40000, CRC(daa56ce5) SHA1(4f14a8efac16b03bd14dd26d586bcb8d5bef65c1) )
ROM_LOAD( "27c2001_v153.u24", 0x40000, 0x40000, CRC(b10b38e1) SHA1(397b2d899e47c6249fbbb6e6262d0390d9b796e6) )
ROM_LOAD( "27c2001_v153.u23", 0x80000, 0x40000, CRC(a3304b5a) SHA1(bf51cb1f728758d50ce27275aa19ef649f6b34b9) )
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "27c1001_v153_sp.u38", 0x00000, 0x20000, CRC(a42d73b1) SHA1(93157e9630d5c8bb34c71186415d0aa8c5d51951) )
ROM_END
/* Jingle Bells (V141 EU)
Original IGS.
For amusement.
*/
ROM_START( jingbelld )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "27c512_v141.u44", 0x00000, 0x10000, CRC(6997a903) SHA1(991508d85e55a3c6f811070352e06ae6bf65cc2e) )
ROM_REGION( 0x8000, "data", 0 )
ROM_LOAD( "27c256_v141.u43", 0x0000, 0x8000, CRC(a7affa15) SHA1(f9d33e32b57ad267d383e075663994e0af0b3016) )
ROM_REGION( 0x30000, "reels", 0 )
ROM_LOAD( "27c512_v141.u17", 0x00000, 0x10000, CRC(cadd7910) SHA1(aa514ddb29c8c9a77478d56bea4ae71995fdd518) )
ROM_LOAD( "27c512_v141.u16", 0x10000, 0x10000, CRC(a9e1f5aa) SHA1(68d7f4e9e9a5bbce0904e406ee6fe82e9e52a9ba) )
ROM_LOAD( "27c512_v141.u15", 0x20000, 0x10000, CRC(865b7d3a) SHA1(c1dff3a27d747ee499aaee0c4468534f0249a3e5) )
ROM_REGION( 0xc0000, "tiles", 0 )
ROM_LOAD( "27c2001_v141.u25", 0x00000, 0x40000, CRC(f53bac7e) SHA1(f4375da0780fba59fcb65e24a33099af35e4d286) )
ROM_LOAD( "27c2001_v141.u24", 0x40000, 0x40000, CRC(bddd6001) SHA1(2a6395e9593352d3ea2d477a7f41805f389c9c50) )
ROM_LOAD( "27c2001_v141.u23", 0x80000, 0x40000, CRC(e8322c75) SHA1(c3385538fb673a4ab14c315ce8bce792eb264ec7) )
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "27c1001_v141_sp.u38", 0x00000, 0x20000, CRC(a42d73b1) SHA1(93157e9630d5c8bb34c71186415d0aa8c5d51951) )
ROM_END
DRIVER_INIT_MEMBER(igs009_state,jingbell)
{
@ -1114,9 +1146,9 @@ ROM_END
/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */
GAME( 1995?, jingbell, 0, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (Italy, V133I)", MACHINE_SUPPORTS_SAVE )
GAME( 1997, jingbella, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (US, V157)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 1997, jingbellb, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (EU, V155)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 1997, jingbellc, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (EU, V153)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 1995, jingbelld, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (EU, V141)", MACHINE_SUPPORTS_SAVE )
GAME( 1997, jingbell, 0, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (US, V157)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 1997, jingbella, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (EU, V155)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 1997, jingbellb, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (EU, V153)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 1995, jingbellc, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (EU, V141)", MACHINE_SUPPORTS_SAVE )
GAME( 1995?, jingbelli, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (Italy, V133I)", MACHINE_SUPPORTS_SAVE )
GAME( 1998, gp98, 0, gp98, jingbell, driver_device, 0, ROT0, "Romtec Co. Ltd", "Grand Prix '98 (V100K)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )

View File

@ -0,0 +1,290 @@
// license:BSD-3-Clause
// copyright-holders:Brad Hughes
//============================================================
//
// input_xinput.cpp - XInput API input support for Windows
//
//============================================================
#include "input_module.h"
#include "modules/osdmodule.h"
#if defined(OSD_WINDOWS)
// standard windows headers
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
// XInput header
#include <Xinput.h>
#undef interface
// MAME headers
#include "emu.h"
#include "osdepend.h"
#include "ui/ui.h"
// MAMEOS headers
#include "winmain.h"
#include "window.h"
#include "input_common.h"
#include "input_windows.h"
#define XINPUT_MAX_POV 4
#define XINPUT_MAX_BUTTONS 10
#define XINPUT_MAX_AXIS 4
#define XINPUT_AXIS_MINVALUE -32767
#define XINPUT_AXIS_MAXVALUE 32767
// default axis names
static const char *const xinput_axis_name[] =
{
"LSX",
"LSY",
"RSX",
"RSY"
};
static const input_item_id xinput_axis_ids[] =
{
ITEM_ID_XAXIS,
ITEM_ID_YAXIS,
ITEM_ID_RXAXIS,
ITEM_ID_RYAXIS
};
static const USHORT xinput_pov_dir[] = {
XINPUT_GAMEPAD_DPAD_UP,
XINPUT_GAMEPAD_DPAD_DOWN,
XINPUT_GAMEPAD_DPAD_LEFT,
XINPUT_GAMEPAD_DPAD_RIGHT
};
static const char *const xinput_pov_names[] = {
"DPAD Up",
"DPAD Down",
"DPAD Left",
"DPAD Right"
};
static const USHORT xinput_buttons[] = {
XINPUT_GAMEPAD_A,
XINPUT_GAMEPAD_B,
XINPUT_GAMEPAD_X,
XINPUT_GAMEPAD_Y,
XINPUT_GAMEPAD_LEFT_SHOULDER,
XINPUT_GAMEPAD_RIGHT_SHOULDER,
XINPUT_GAMEPAD_START,
XINPUT_GAMEPAD_BACK,
XINPUT_GAMEPAD_LEFT_THUMB,
XINPUT_GAMEPAD_RIGHT_THUMB,
};
static const char *const xinput_button_names[] = {
"A",
"B",
"X",
"Y",
"Left Shoulder",
"Right Shoulder",
"Start",
"Back",
"Left Thumb",
"Right Thumb"
};
struct gamepad_state
{
BYTE rgbButtons[XINPUT_MAX_BUTTONS];
BYTE rgbPov[XINPUT_MAX_POV];
BYTE bLeftTrigger;
BYTE bRightTrigger;
LONG sThumbLX;
LONG sThumbLY;
LONG sThumbRX;
LONG sThumbRY;
};
// state information for a gamepad; state must be first element
struct xinput_api_state
{
UINT32 playerIndex;
XINPUT_STATE xstate;
XINPUT_CAPABILITIES caps;
};
//============================================================
// xinput_joystick_device
//============================================================
class xinput_joystick_device : public device_info
{
public:
gamepad_state gamepad;
xinput_api_state xinput_state;
xinput_joystick_device(running_machine &machine, const char *name, input_module &module)
: device_info(machine, name, DEVICE_CLASS_JOYSTICK, module),
gamepad({0}),
xinput_state({0})
{
}
void poll() override
{
// poll the device first
HRESULT result = XInputGetState(xinput_state.playerIndex, &xinput_state.xstate);
// If we can't poll the device, skip
if (FAILED(result))
return;
// Copy the XState into State
// Start with the POV (DPAD)
for (int povindex = 0; povindex < XINPUT_MAX_POV; povindex++)
{
int currentPov = xinput_pov_dir[povindex];
gamepad.rgbPov[currentPov] = (xinput_state.xstate.Gamepad.wButtons & currentPov) ? 0xFF : 0;
}
// Now do the buttons
for (int buttonindex = 0; buttonindex < XINPUT_MAX_BUTTONS; buttonindex++)
{
int currentButton = xinput_buttons[buttonindex];
gamepad.rgbButtons[buttonindex] = (xinput_state.xstate.Gamepad.wButtons & currentButton) ? 0xFF : 0;
}
// Now grab the axis values
// Each of the thumbstick axis members is a signed value between -32768 and 32767 describing the position of the thumbstick
// However, the Y axis values are inverted from what MAME expects, so multiply by -1 first
gamepad.sThumbLX = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbLX, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE);
gamepad.sThumbLY = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbLY * -1, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE);
gamepad.sThumbRX = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbRX, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE);
gamepad.sThumbRY = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbRY * -1, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE);
// Now the triggers
gamepad.bLeftTrigger = xinput_state.xstate.Gamepad.bLeftTrigger;
gamepad.bRightTrigger = xinput_state.xstate.Gamepad.bRightTrigger;
}
void reset() override
{
memset(&gamepad, 0, sizeof(gamepad));
}
};
//============================================================
// xinput_joystick_module
//============================================================
class xinput_joystick_module : public wininput_module
{
public:
xinput_joystick_module()
: wininput_module(OSD_JOYSTICKINPUT_PROVIDER, "xinput")
{
}
protected:
virtual void input_init(running_machine &machine) override
{
xinput_joystick_device *devinfo;
// Loop through each gamepad to determine if they are connected
for (UINT i = 0; i < XUSER_MAX_COUNT; i++)
{
XINPUT_STATE state = {0};
if (XInputGetState(i, &state) == ERROR_SUCCESS)
{
// allocate and link in a new device
devinfo = create_xinput_device(machine, i);
if (devinfo == nullptr)
continue;
// Add the axes
for (int i = 0; i < XINPUT_MAX_AXIS; i++)
{
devinfo->device()->add_item(
xinput_axis_name[i],
xinput_axis_ids[i],
generic_axis_get_state,
&devinfo->gamepad.sThumbLX + i);
}
// Populate the POVs
// For XBOX, we treat the DPAD as a hat switch
for (int povnum = 0; povnum < XINPUT_MAX_POV; povnum++)
{
devinfo->device()->add_item(
xinput_pov_names[povnum],
ITEM_ID_OTHER_SWITCH,
generic_button_get_state,
&devinfo->gamepad.rgbPov[povnum]);
}
// populate the buttons
for (int butnum = 0; butnum < XINPUT_MAX_BUTTONS; butnum++)
{
devinfo->device()->add_item(
xinput_button_names[butnum],
(input_item_id)(ITEM_ID_BUTTON1 + butnum),
generic_button_get_state,
&devinfo->gamepad.rgbButtons[butnum]);
}
devinfo->device()->add_item(
"Left Trigger",
(input_item_id)(ITEM_ID_BUTTON1 + XINPUT_MAX_BUTTONS),
generic_button_get_state,
&devinfo->gamepad.bLeftTrigger);
devinfo->device()->add_item(
"Right Trigger",
(input_item_id)(ITEM_ID_BUTTON1 + XINPUT_MAX_BUTTONS + 1),
generic_button_get_state,
&devinfo->gamepad.bRightTrigger);
}
}
}
private:
//============================================================
// create_xinput_device
//============================================================
xinput_joystick_device * create_xinput_device(running_machine &machine, UINT index)
{
xinput_joystick_device *devinfo;
XINPUT_CAPABILITIES caps = {0};
if (FAILED(XInputGetCapabilities(index, 0, &caps)))
{
// If we can't get the capabilities skip this device
return nullptr;
}
char device_name[16];
snprintf(device_name, sizeof(device_name), "XInput Player %u", index + 1);
// allocate the device object
devinfo = devicelist()->create_device<xinput_joystick_device>(machine, device_name, *this);
// Set the player ID
devinfo->xinput_state.playerIndex = index;
// Assign the caps we captured earlier
devinfo->xinput_state.caps = caps;
return devinfo;
}
};
#else
MODULE_NOT_SUPPORTED(xinput_joystick_module, OSD_KEYBOARDINPUT_PROVIDER, "xinput")
#endif
MODULE_DEFINITION(JOYSTICKINPUT_XINPUT, xinput_joystick_module)

View File

@ -235,6 +235,7 @@ void osd_common_t::register_options()
REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_SDL);
REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_DINPUT);
REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_XINPUT);
REGISTER_MODULE(m_mod_man, JOYSTICK_NONE);
// after initialization we know which modules are supported

View File

@ -383,7 +383,7 @@ file_error osd_fflush(osd_file *file)
switch (file->type)
{
case SDLFILE_FILE:
result = fflush(file->handle, offset);
result = fflush(file->handle);
if (result == EOF)
return error_to_file_error(errno);
return FILERR_NONE;