Permalink
Browse files

get_vice_files and related code. No guarantee that this is coherent.

  • Loading branch information...
Sgeo committed Aug 28, 2018
1 parent 5ecbeb7 commit 7b0afc87debe0a955c09754e1b51e111dccf123c
Showing with 39 additions and 1 deletion.
  1. +38 −0 loader.js
  2. +1 −1 vice_todo.txt
View
@@ -190,6 +190,11 @@ var Module = null;
config_args.push(cfgr.startExe(metadata.getElementsByTagName("emulator_start")
.item(0)
.textContent));
} else if (module && module.indexOf("vice-") === 0) {
config_args.push(cfgr.autoLoad(metadata.getElementsByTagName("emulator_start")
.item(0)
.textContent));
}
} else if (module && module.indexOf("sae-") === 0) {
config_args.push(cfgr.model(modulecfg.driver),
cfgr.rom(modulecfg.bios_filenames));
@@ -267,6 +272,35 @@ var Module = null;
});
return files;
}
function get_vice_files(cfgr, metadata, modulecfg, filelist) {
var default_drive = "8",
drives = {}, files = [],
meta = dict_from_xml(metadata);
files_with_ext_from_filelist(filelist, meta.emulator_ext).forEach(function (file, i) {
drives[default_drive] = file.name;
});
meta_props_matching(meta, /^vice_drive_([89])$/).forEach(function (result) {
let key = result[0], match = result[1];
drives[match[1]] = meta[key];
});
var mounts = Object.keys(drives),
len = mounts.length;
mounts.forEach(function (drive, i) {
var title = "Game File ("+ (i+1) +" of "+ len +")",
filename = drives[drive],
url = (filename.includes("/")) ? get_zip_url(filename)
: get_zip_url(filename, get_item_name(game));
if (filename.toLowerCase().endsWith(".zip")) {
files.push(cfgr.mountZip(drive,
cfgr.fetchFile(title, url)));
} else {
files.push(cfgr.mountFile('/'+ filename,
cfgr.fetchFile(title, url)));
}
});
return files;
}
function get_mame_files(cfgr, metadata, modulecfg, filelist) {
var files = [],
@@ -573,6 +607,10 @@ var Module = null;
config.runner = VICERunner;
}
VICELoader.__proto__ = BaseLoader;
VICELoader.autoLoad = function (path) {
return { emulatorStart: path };
};
/**
* SAELoader
View
@@ -1,5 +1,5 @@
* Add logo
* Define get_vice_files: This is where to add support for metadata entries (ala dosbox_drive_d)
* Define get_vice_files: This is where to add support for metadata entries (ala dosbox_drive_d) [done, imperfectly]
* Define VICELoader
* Define VICERunner
* Add entry in config_args push area (don't fall through to MAME)

0 comments on commit 7b0afc8

Please sign in to comment.