WonderSwan, ColecoVision support

This commit is contained in:
Alexey Nurgaliev 2023-08-31 17:30:20 +03:00
parent 8e4950424e
commit 5307aaa4c4
3 changed files with 67 additions and 8 deletions

View file

@ -3,14 +3,11 @@ class EmulatorJS {
getCore(generic) {
const core = this.config.system;
/*todo:
Systems: Wonderswan (ws), Neo Geo Pocket, msx
Systems: msx
Cores:
- Beetle NeoPop
- Beetle WonderSwan
- FreeChaF
- FreeIntv
- Gearcoleco
- NeoCD
- O2EM
- Vecx
@ -25,12 +22,14 @@ class EmulatorJS {
'fbneo': 'arcade',
'fceumm': 'nes',
'gambatte': 'gb',
'gearcoleco': 'coleco',
'genesis_plus_gx': 'sega',
'handy': 'lynx',
'mame2003': 'mame2003',
'mednafen_ngp': 'ngp',
'mednafen_pce': 'pce',
'mednafen_psx_hw': 'psx',
'mednafen_wswan': 'ws',
'melonds': 'nds',
'mgba': 'gba',
'mupen64plus_next': 'n64',
@ -73,7 +72,9 @@ class EmulatorJS {
'3do': 'opera',
'psp': 'ppsspp',
'pce': 'mednafen_pce',
'ngp': 'mednafen_ngp'
'ngp': 'mednafen_ngp',
'ws': 'mednafen_wswan',
'coleco': 'gearcoleco',
}
if (this.isSafari && this.isMobile && this.getCore(true) === "n64") {
return "parallel_n64";
@ -88,12 +89,14 @@ class EmulatorJS {
'fbneo': ['zip', '7z'],
'fceumm': ['fds', 'nes', 'unif', 'unf'],
'gambatte': ['gb', 'gbc', 'dmg'],
'gearcoleco': ['col', 'cv', 'bin', 'rom'],
'genesis_plus_gx': ['m3u', 'mdx', 'md', 'smd', 'gen', 'bin', 'cue', 'iso', 'chd', 'bms', 'sms', 'gg', 'sg', '68k', 'sgd'],
'handy': ['lnx'],
'mame2003': ['zip'],
'mednafen_ngp': ['ngp', 'ngc'],
'mednafen_pce': ['pce', 'cue', 'ccd', 'iso', 'img', 'bin', 'chd'],
'mednafen_psx': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'],
'mednafen_wswan': ['ws', 'wsc', 'pc2'],
'mednafen_psx_hw': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'],
'beetle_vb': ['vb', 'vboy', 'bin'],
'melonds': ['nds'],
@ -2086,6 +2089,39 @@ class EmulatorJS {
{id: 6, label: this.localization('LEFT')},
{id: 7, label: this.localization('RIGHT')},
];
} else if ('ws' === this.getControlScheme()) {
buttons = [
{id: 8, label: this.localization('A')},
{id: 0, label: this.localization('B')},
{id: 3, label: this.localization('START')},
{id: 4, label: this.localization('X UP')},
{id: 5, label: this.localization('X DOWN')},
{id: 6, label: this.localization('X LEFT')},
{id: 7, label: this.localization('X RIGHT')},
{id: 13, label: this.localization('Y UP')},
{id: 12, label: this.localization('Y DOWN')},
{id: 10, label: this.localization('Y LEFT')},
{id: 11, label: this.localization('Y RIGHT')},
];
} else if ('coleco' === this.getControlScheme()) {
buttons = [
{id: 8, label: this.localization('LEFT BUTTON')},
{id: 0, label: this.localization('RIGHT BUTTON')},
{id: 9, label: this.localization('1')},
{id: 1, label: this.localization('2')},
{id: 11, label: this.localization('3')},
{id: 10, label: this.localization('4')},
{id: 13, label: this.localization('5')},
{id: 12, label: this.localization('6')},
{id: 15, label: this.localization('7')},
{id: 14, label: this.localization('8')},
{id: 2, label: this.localization('*')},
{id: 3, label: this.localization('#')},
{id: 4, label: this.localization('UP')},
{id: 5, label: this.localization('DOWN')},
{id: 6, label: this.localization('LEFT')},
{id: 7, label: this.localization('RIGHT')},
];
} else {
buttons = [
{id: 0, label: this.localization('B')},
@ -2818,6 +2854,22 @@ class EmulatorJS {
{"type":"button","text":"Option","id":"option","location":"center","left":30,"fontSize":15,"block":true,"input_value":3}
];
info.push(...speedControlButtons);
} else if ('ws' === this.getControlScheme()) {
info = [
{"type":"button","text":"B","id":"b","location":"right","right":75,"top":150,"bold":true,"input_value":0},
{"type":"button","text":"A","id":"a","location":"right","right":5,"top":150,"bold":true,"input_value":8},
{"type":"dpad","location":"left","left":"50%","right":"50%","joystickInput":false,"inputValues":[4,5,6,7]},
{"type":"dpad","location":"right","left":"50%","right":"50%","joystickInput":false,"inputValues":[13,12,10,11]},
{"type":"button","text":"Start","id":"start","location":"center","left":30,"fontSize":15,"block":true,"input_value":3},
];
info.push(...speedControlButtons);
} else if ('coleco' === this.getControlScheme()) {
info = [
{"type":"button","text":"L","id":"buttonLeft","location":"right","left":10,"top":40,"bold":true,"input_value":8},
{"type":"button","text":"R","id":"buttonRight","location":"right","left":81,"top":40,"bold":true,"input_value":0},
{"type":"dpad","location":"left","left":"50%","right":"50%","joystickInput":false,"inputValues":[4,5,6,7]}
];
info.push(...speedControlButtons);
} else {
info = [
{"type":"button","text":"Y","id":"y","location":"right","left":40,"bold":true,"input_value":9},

File diff suppressed because one or more lines are too long

View file

@ -111,6 +111,12 @@
if (["ngp", "ngc"].includes(ext))
return "ngp"
if (["ws", "wsc"].includes(ext))
return "ws"
if (["col", "cv"].includes(ext))
return "coleco"
if (["nds", "gba", "gb", "z64", "n64"].includes(ext))
return ext
@ -135,7 +141,9 @@
"Atari 7800": "atari7800",
"Atari 2600": "atari2600",
"NEC TurboGrafx-16/SuperGrafx/PC Engine": "pce",
"SNK NeoGeo Pocket": "ngp"
"SNK NeoGeo Pocket (Color)": "ngp",
"Bandai WonderSwan (Color)": "ws",
"ColecoVision": "coleco"
}
const button = document.createElement("button")
@ -176,7 +184,6 @@
window.EJS_core = core;
window.EJS_pathtodata = "data/";
window.EJS_startOnLoaded = true;
// window.EJS_disableCue = true;
if (window.location.hostname === "demo.emulatorjs.org") {
window.EJS_AdUrl = "https://ads.emulatorjs.org/";