From 8ef5eb0452bbea38ec7673df6b8ef491362855a0 Mon Sep 17 00:00:00 2001 From: Alexey Nurgaliev Date: Wed, 30 Aug 2023 19:37:35 +0300 Subject: [PATCH] TurboGrafx-16/SuperGrafx/PC Engine suport --- data/emulator.js | 27 +++++++++++++++++++++++++-- index.html | 6 +++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/data/emulator.js b/data/emulator.js index 66b8c25..89d22cf 100644 --- a/data/emulator.js +++ b/data/emulator.js @@ -3,7 +3,7 @@ class EmulatorJS { getCore(generic) { const core = this.config.system; /*todo: - Systems: TurboGrafx-16 (pce), Wonderswan (ws), Neo Geo Pocket, msx + Systems: Wonderswan (ws), Neo Geo Pocket, msx Cores: - Beetle NeoPop @@ -28,6 +28,7 @@ class EmulatorJS { 'genesis_plus_gx': 'sega', 'handy': 'lynx', 'mame2003': 'mame2003', + 'mednafen_pce': 'pce', 'mednafen_psx_hw': 'psx', 'melonds': 'nds', 'mgba': 'gba', @@ -69,7 +70,8 @@ class EmulatorJS { 'arcade': 'fbneo', 'psx': 'pcsx_rearmed', '3do': 'opera', - 'psp': 'ppsspp' + 'psp': 'ppsspp', + 'pce': 'mednafen_pce' } if (this.isSafari && this.isMobile && this.getCore(true) === "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'], 'handy': ['lnx'], 'mame2003': ['zip'], + 'mednafen_pce': ['pce'], 'mednafen_psx': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'], 'mednafen_psx_hw': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'], 'beetle_vb': ['vb', 'vboy', 'bin'], @@ -2059,6 +2062,17 @@ class EmulatorJS { {id: 6, label: this.localization('LEFT')}, {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 { buttons = [ {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} ]; 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 { info = [ {"type":"button","text":"Y","id":"y","location":"right","left":40,"bold":true,"input_value":9}, diff --git a/index.html b/index.html index 800df81..964d54b 100644 --- a/index.html +++ b/index.html @@ -105,6 +105,9 @@ if (["z64", "n64"].includes(ext)) return "n64" + if (["pce"].includes(ext)) + return "pce" + if (["nds", "gba", "gb", "z64", "n64"].includes(ext)) return ext @@ -127,7 +130,8 @@ "Sega Game Gear": "segaGG", "Sega Saturn": "segaSaturn", "Atari 7800": "atari7800", - "Atari 2600": "atari2600" + "Atari 2600": "atari2600", + "NEC TurboGrafx-16/SuperGrafx/PC Engine": "pce" } const button = document.createElement("button")