Add VICE cores for C64, C128, VIC20, Plus/4, and PET (#758)

* Add VICE cores for C64, C128, VIC20, Plus/4, and PET

* Added core options to emulator.js file

* Removed extra space

* Disable cue creation for new VICE cores

* Cores are now sorted at run time

* Debug mode can now be enabled by appending ?debug=1 to the URL
This commit is contained in:
Michael Green 2024-02-01 16:50:43 +11:00 committed by GitHub
parent 0682a46e28
commit 1d2cde5915
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 46 additions and 7 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@ yarn.lock
roms/
data/emulator.min.js
data/emulator.min.css
data/cores

View file

@ -1,5 +1,5 @@
class EmulatorJS {
version = 11; //Increase by 1 when cores are updated
version = 12; //Increase by 1 when cores are updated
getCore(generic) {
const core = this.config.system;
/*todo:
@ -48,7 +48,11 @@ class EmulatorJS {
'virtualjaguar': 'jaguar',
'yabause': 'segaSaturn',
'puae': 'amiga',
'vice_x64': 'c64'
'vice_x64sc': 'c64',
'vice_x128': 'c128',
'vice_xpet': 'pet',
'vice_xplus4': 'plus4',
'vice_xvic': 'vic20'
}
return options[core] || core;
}
@ -82,7 +86,11 @@ class EmulatorJS {
'ws': 'mednafen_wswan',
'coleco': 'gearcoleco',
'amiga': 'puae',
'c64': 'vice_x64'
'c64': 'vice_x64sc',
'c128': 'vice_x128',
'pet': 'vice_xpet',
'plus4': 'vice_xplus4',
'vic20': 'vice_xvic'
}
if (this.isSafari && this.isMobile && this.getCore(true) === "n64") {
return "parallel_n64";
@ -124,6 +132,11 @@ class EmulatorJS {
'snes9x': ['smc', 'sfc', 'swc', 'fig', 'bs', 'st'],
'stella2014': ['a26', 'bin', 'zip'],
'vice_x64': ['d64', 'd6z', 'd71', 'd7z', 'd80', 'd81', 'd82', 'd8z', 'g64', 'g6z', 'g41', 'g4z', 'x64', 'x6z', 'nib', 'nbz', 'd2m', 'd4m', 't64', 'tap', 'tcrt', 'prg', 'p00', 'crt', 'bin', 'cmd', 'm3u', 'vfl', 'vsf', 'zip', '7z', 'gz', '20', '40', '60', 'a0', 'b0', 'rom'],
'vice_x64sc': ['d64', 'd6z', 'd71', 'd7z', 'd80', 'd81', 'd82', 'd8z', 'g64', 'g6z', 'g41', 'g4z', 'x64', 'x6z', 'nib', 'nbz', 'd2m', 'd4m', 't64', 'tap', 'tcrt', 'prg', 'p00', 'crt', 'bin', 'cmd', 'm3u', 'vfl', 'vsf', 'zip', '7z', 'gz', '20', '40', '60', 'a0', 'b0', 'rom'],
'vice_x128': ['d64', 'd6z', 'd71', 'd7z', 'd80', 'd81', 'd82', 'd8z', 'g64', 'g6z', 'g41', 'g4z', 'x64', 'x6z', 'nib', 'nbz', 'd2m', 'd4m', 't64', 'tap', 'tcrt', 'prg', 'p00', 'crt', 'bin', 'cmd', 'm3u', 'vfl', 'vsf', 'zip', '7z', 'gz', '20', '40', '60', 'a0', 'b0', 'rom'],
'vice_xpet': ['d64', 'd6z', 'd71', 'd7z', 'd80', 'd81', 'd82', 'd8z', 'g64', 'g6z', 'g41', 'g4z', 'x64', 'x6z', 'nib', 'nbz', 'd2m', 'd4m', 't64', 'tap', 'tcrt', 'prg', 'p00', 'crt', 'bin', 'cmd', 'm3u', 'vfl', 'vsf', 'zip', '7z', 'gz', '20', '40', '60', 'a0', 'b0', 'rom'],
'vice_xplus4': ['d64', 'd6z', 'd71', 'd7z', 'd80', 'd81', 'd82', 'd8z', 'g64', 'g6z', 'g41', 'g4z', 'x64', 'x6z', 'nib', 'nbz', 'd2m', 'd4m', 't64', 'tap', 'tcrt', 'prg', 'p00', 'crt', 'bin', 'cmd', 'm3u', 'vfl', 'vsf', 'zip', '7z', 'gz', '20', '40', '60', 'a0', 'b0', 'rom'],
'vice_xvic': ['d64', 'd6z', 'd71', 'd7z', 'd80', 'd81', 'd82', 'd8z', 'g64', 'g6z', 'g41', 'g4z', 'x64', 'x6z', 'nib', 'nbz', 'd2m', 'd4m', 't64', 'tap', 'tcrt', 'prg', 'p00', 'crt', 'bin', 'cmd', 'm3u', 'vfl', 'vsf', 'zip', '7z', 'gz', '20', '40', '60', 'a0', 'b0', 'rom'],
'virtualjaguar': ['j64', 'jag', 'rom', 'abs', 'cof', 'bin', 'prg'],
'yabause': ['cue', 'iso', 'ccd', 'mds', 'chd', 'zip', 'm3u']
}
@ -920,7 +933,7 @@ class EmulatorJS {
const altName = this.getBaseFileName(true);
let disableCue = false;
if (['pcsx_rearmed', 'genesis_plus_gx', 'picodrive', 'mednafen_pce', 'vice_x64'].includes(this.getCore()) && this.config.disableCue === undefined) {
if (['pcsx_rearmed', 'genesis_plus_gx', 'picodrive', 'mednafen_pce', 'vice_x64', 'vice_x64sc', 'vice_x128', 'vice_xvic', 'vice_xplus4', 'vice_xpet'].includes(this.getCore()) && this.config.disableCue === undefined) {
disableCue = true;
} else {
disableCue = this.config.disableCue;

View file

@ -106,6 +106,18 @@
</div>
<script>
var enableDebug = false;
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
if (urlParams.get('debug') == 1)
enableDebug = true;
if (enableDebug == true) {
console.log("Debug is enabled");
} else {
console.log("Debug is disabled");
}
input.onchange = async () => {
const url = new Blob([input.files[0]])
const parts = input.files[0].name.split(".")
@ -133,13 +145,13 @@
return "coleco"
if (["d64"].includes(ext))
return "vice_x64"
return "vice_x64sc"
if (["nds", "gba", "gb", "z64", "n64"].includes(ext))
return ext
return await new Promise(resolve => {
const cores = {
var coreValues = {
"Nintendo 64": "n64",
"Nintendo Game Boy": "gb",
"Nintendo Game Boy Advance": "gba",
@ -163,9 +175,21 @@
"SNK NeoGeo Pocket (Color)": "ngp",
"Bandai WonderSwan (Color)": "ws",
"ColecoVision": "coleco",
"Commodore 64": "vice_x64"
"Commodore 64": "vice_x64sc",
"Commodore 128": "vice_x128",
"Commodore VIC20": "vice_xvic",
"Commodore Plus/4": "vice_xplus4",
"Commodore PET": "vice_xpet"
}
const cores = Object.keys(coreValues).sort().reduce(
(obj, key) => {
obj[key] = coreValues[key];
return obj;
},
{}
);
const button = document.createElement("button")
const select = document.createElement("select")
@ -206,6 +230,7 @@
window.EJS_core = core;
window.EJS_pathtodata = "data/";
window.EJS_startOnLoaded = true;
window.EJS_DEBUG_XX = enableDebug;
script.src = "data/loader.js";
document.body.appendChild(script);