arcade: use mame machine names for convenience

Update mame2bml to include mame romset version

Add script to update arcade rom database (requires a MAME installation)
このコミットが含まれているのは:
Luke Usher 2024-04-03 06:57:51 +01:00
コミット 1ea995f78d
6個のファイルの変更90行の追加33行の削除

ファイルの表示

@ -23,7 +23,7 @@ auto Cartridge::connect() -> void {
if(information.board == "Linear" ) board = new Board::Linear{*this};
if(information.board == "Taiwan-A" ) board = new Board::TaiwanA{*this};
if(information.board == "Taiwan-B" ) board = new Board::TaiwanB{*this};
if(information.board == "sg1000a" ) board = new Board::ArcadeRom{*this};
if(information.board == "sega/sg1000a") board = new Board::ArcadeRom{*this};
if(!board) board = new Board::Interface{*this};
board->pak = pak;

ファイルの表示

@ -42,7 +42,7 @@ auto Arcade::load() -> bool {
//Determine from the game manifest which core to use for the given arcade rom
#ifdef CORE_SG
if(game->pak->attribute("board") == "sg1000a") {
if(game->pak->attribute("board") == "sega/sg1000a") {
if(!ares::SG1000::load(root, {"[Sega] SG-1000A"})) return false;
systemPakName = "SG-1000A";
gamePakName = "Arcade Cartridge";

ファイルの表示

@ -1,10 +1,10 @@
database
revision: 2023-07-19
revision: 2024-04-03
romset: 0.258 (mame0258)
game
name: chboxing
title: Champion Boxing
board: sg1000a
board: sega/sg1000a
maincpu
rom
name: cb6105.bin
@ -27,7 +27,7 @@ game
game
name: chwrestl
title: Champion Pro Wrestling
board: sg1000a
board: sega/sg1000a
maincpu
rom
name: 5732
@ -50,7 +50,7 @@ game
game
name: dokidoki
title: Doki Doki Penguin Land
board: sg1000a
board: sega/sg1000a
maincpu
rom
name: epr-7356.ic1
@ -70,3 +70,31 @@ game
size: 16384
crc: c6f26b0b
sha1: 3753e05b6e77159832dbe88562ba7a818120d1a3
game
name: sderby2s
title: Super Derby II (satellite board)
board: sega/sg1000a
maincpu
rom
name: epr-6450d.ic10
offset: 0x0
size: 16384
crc: e56986d3
sha1: a2dbdc95128cc94a1492e080aeea402f2d4b89fe
rom
name: epr-6504d.ic11
offset: 0x4000
size: 16384
crc: 7bb364b9
sha1: 9f93572b6d999422d93ad5f7a251b4695565651f
game
name: sderbys
title: Super Derby (satellite board)
board: sega/sg1000a
maincpu
rom
name: v1.2.ic10
offset: 0x0
size: 16384
crc: cf29b579
sha1: e695da9c61167d1d30b32bd70d342ac23b29f087

ファイルの表示

@ -13,7 +13,7 @@ auto Arcade::load(string location) -> bool {
if(!document) return false;
//Sega SG-1000 based arcade
if(document["game/board"].string() == "sg1000a") {
if(document["game/board"].string() == "sega/sg1000a") {
vector<u8> rom = loadRoms(location, document, "maincpu");
if(!rom) return false;

33
scripts/update-arcade-rom-db.sh ノーマルファイル
ファイルの表示

@ -0,0 +1,33 @@
#!/bin/sh
# Updates the Arcade ROM database to the latest version from MAME.
# This script requires MAME to be in your PATH, or you can pass the path to MAME as an argument.
# mame2bml is also required to be present and up-to-date.
# Specify the mame drivers to include in the database
export CORES="sega/sg1000a.cpp"
export PATH=$PATH:$(pwd)/tools/mame2bml/out
if ! command -v mame2bml &> /dev/null
then
echo "mame2bml could not be found. Please build it first."
exit 1
fi
if [ -z "$1" ]
then
if ! command -v mame &> /dev/null
then
echo "MAME could not be found. Please install it first."
exit 1
fi
else
export PATH=$PATH:$1
fi
# Extract mame.xml
mame -listxml > mame.xml
# Convert MAME XML to BML
mame2bml mame.xml mia/Database/Arcade.bml $CORES
rm mame.xml

ファイルの表示

@ -13,26 +13,19 @@ private:
auto Mame2BML::main(Arguments arguments) -> void {
if(arguments.size() < 2) {
return print("usage: mame2bml softwarelist.xml output.bml core - convert a mame software list xml to bml\n"
" mame2bml machinelist.xml output.bml core driver - convert a mame machine list xml to bml\n");
return print("usage: mame2bml softwarelist.xml output.bml ares_core - convert a mame software list xml to bml\n"
" mame2bml machinelist.xml output.bml mame_driver - convert a mame machine list xml to bml\n");
}
string markupName = arguments.take();
string outputName = arguments.take();
string driverName = {};
string systemName = {};
vector<string> driverNames = {};
if(!markupName.endsWith(".xml")) return print("error: arguments in incorrect order\n");
if(!outputName.endsWith(".bml")) return print("error: arguments in incorrect order\n");
if(arguments.size()) {
systemName = arguments.take();
} else {
return print("ares core not specified\n");
}
if(arguments.size()) {
driverName = arguments.take();
if(!driverName.iendsWith(".cpp")) return print("error: driver does not appear to be a mame src filename (eg: sega/segae.cpp)\n");
while(arguments.size()) {
string driverName = arguments.take();
driverNames.append(driverName);
}
string markup = string::read(markupName);
@ -41,7 +34,7 @@ auto Mame2BML::main(Arguments arguments) -> void {
if(!output.open(outputName, file::mode::write)) return print("error: unable to write output file\n");
output.print("database\n");
output.print(" revision: ", chrono::local::date(), "\n\n");
output.print(" revision: ", chrono::local::date(), "\n");
pathname = Location::path(markupName);
auto document = XML::unserialize(markup);
@ -49,16 +42,19 @@ auto Mame2BML::main(Arguments arguments) -> void {
for(auto header : document) {
// machine list xml (from mame.exe -listxml)
if(header.name() == "mame") {
output.print(" romset: ", header["build"].string(), "\n");
for(auto machine : header) {
if(machine.name() != "machine") continue;
if(machine["sourcefile"].string() != driverName) continue;
string driverName = machine["sourcefile"].string();
if(!driverNames.find(driverName)) continue;
print("found game: ", machine["name"].string(), " (", machine["description"].string(), ")\n");
output.print("game\n");
output.print(" name: ", machine["name"].string(), "\n");
output.print(" title: ", machine["description"].string(), "\n");
output.print(" board: ", systemName, "\n");
output.print(" board: ", driverName.trimRight(".cpp"), "\n");
string region = "";
for(auto rom : machine) {
@ -90,7 +86,7 @@ auto Mame2BML::main(Arguments arguments) -> void {
output.print("game\n");
output.print(" name: ", software["name"].string(), "\n");
output.print(" title: ", software["description"].string(), "\n");
output.print(" board: ", systemName, "\n");
output.print(" board: ", driverNames.first(), "\n");
for(auto sub : software["part"]){
if(sub.name() == "feature") {