TurboGrafx-16/SuperGrafx/PC Engine suport

This commit is contained in:
Alexey Nurgaliev 2023-08-30 19:37:35 +03:00
parent 3e6621bf63
commit 8ef5eb0452
2 changed files with 30 additions and 3 deletions

View file

@ -3,7 +3,7 @@ class EmulatorJS {
getCore(generic) { getCore(generic) {
const core = this.config.system; const core = this.config.system;
/*todo: /*todo:
Systems: TurboGrafx-16 (pce), Wonderswan (ws), Neo Geo Pocket, msx Systems: Wonderswan (ws), Neo Geo Pocket, msx
Cores: Cores:
- Beetle NeoPop - Beetle NeoPop
@ -28,6 +28,7 @@ class EmulatorJS {
'genesis_plus_gx': 'sega', 'genesis_plus_gx': 'sega',
'handy': 'lynx', 'handy': 'lynx',
'mame2003': 'mame2003', 'mame2003': 'mame2003',
'mednafen_pce': 'pce',
'mednafen_psx_hw': 'psx', 'mednafen_psx_hw': 'psx',
'melonds': 'nds', 'melonds': 'nds',
'mgba': 'gba', 'mgba': 'gba',
@ -69,7 +70,8 @@ class EmulatorJS {
'arcade': 'fbneo', 'arcade': 'fbneo',
'psx': 'pcsx_rearmed', 'psx': 'pcsx_rearmed',
'3do': 'opera', '3do': 'opera',
'psp': 'ppsspp' 'psp': 'ppsspp',
'pce': 'mednafen_pce'
} }
if (this.isSafari && this.isMobile && this.getCore(true) === "n64") { if (this.isSafari && this.isMobile && this.getCore(true) === "n64") {
return "parallel_n64"; return "parallel_n64";
@ -87,6 +89,7 @@ class EmulatorJS {
'genesis_plus_gx': ['m3u', 'mdx', 'md', 'smd', 'gen', 'bin', 'cue', 'iso', 'chd', 'bms', 'sms', 'gg', 'sg', '68k', 'sgd'], 'genesis_plus_gx': ['m3u', 'mdx', 'md', 'smd', 'gen', 'bin', 'cue', 'iso', 'chd', 'bms', 'sms', 'gg', 'sg', '68k', 'sgd'],
'handy': ['lnx'], 'handy': ['lnx'],
'mame2003': ['zip'], 'mame2003': ['zip'],
'mednafen_pce': ['pce'],
'mednafen_psx': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'], 'mednafen_psx': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'],
'mednafen_psx_hw': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'], 'mednafen_psx_hw': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'],
'beetle_vb': ['vb', 'vboy', 'bin'], 'beetle_vb': ['vb', 'vboy', 'bin'],
@ -2059,6 +2062,17 @@ class EmulatorJS {
{id: 6, label: this.localization('LEFT')}, {id: 6, label: this.localization('LEFT')},
{id: 7, label: this.localization('RIGHT')}, {id: 7, label: this.localization('RIGHT')},
]; ];
} else if ('pce' === this.getControlScheme()) {
buttons = [
{id: 8, label: this.localization('I')},
{id: 0, label: this.localization('II')},
{id: 2, label: this.localization('SELECT')},
{id: 3, label: this.localization('RUN')},
{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 { } else {
buttons = [ buttons = [
{id: 0, label: this.localization('B')}, {id: 0, label: this.localization('B')},
@ -2774,6 +2788,15 @@ class EmulatorJS {
{"type":"button","text":"P","id":"start","location":"center","left":60,"fontSize":15,"block":true,"bold":true,"input_value":3} {"type":"button","text":"P","id":"start","location":"center","left":60,"fontSize":15,"block":true,"bold":true,"input_value":3}
]; ];
info.push(...speedControlButtons); info.push(...speedControlButtons);
} else if ("pce" === this.getControlScheme()) {
info = [
{"type":"button","text":"II","id":"ii","location":"right","right":75,"top":70,"bold":true,"input_value":0},
{"type":"button","text":"I","id":"i","location":"right","right":5,"top":70,"bold":true,"input_value":8},
{"type":"dpad","location":"left","left":"50%","right":"50%","joystickInput":false,"inputValues":[4,5,6,7]},
{"type":"button","text":"Run","id":"run","location":"center","left":60,"fontSize":15,"block":true,"input_value":3},
{"type":"button","text":"Select","id":"select","location":"center","left":-5,"fontSize":15,"block":true,"input_value":2}
];
info.push(...speedControlButtons);
} else { } else {
info = [ info = [
{"type":"button","text":"Y","id":"y","location":"right","left":40,"bold":true,"input_value":9}, {"type":"button","text":"Y","id":"y","location":"right","left":40,"bold":true,"input_value":9},

View file

@ -105,6 +105,9 @@
if (["z64", "n64"].includes(ext)) if (["z64", "n64"].includes(ext))
return "n64" return "n64"
if (["pce"].includes(ext))
return "pce"
if (["nds", "gba", "gb", "z64", "n64"].includes(ext)) if (["nds", "gba", "gb", "z64", "n64"].includes(ext))
return ext return ext
@ -127,7 +130,8 @@
"Sega Game Gear": "segaGG", "Sega Game Gear": "segaGG",
"Sega Saturn": "segaSaturn", "Sega Saturn": "segaSaturn",
"Atari 7800": "atari7800", "Atari 7800": "atari7800",
"Atari 2600": "atari2600" "Atari 2600": "atari2600",
"NEC TurboGrafx-16/SuperGrafx/PC Engine": "pce"
} }
const button = document.createElement("button") const button = document.createElement("button")