Merge pull request #653 from n-at/feature-pcfx

PC-FX support
This commit is contained in:
Ethan O'Brien 2023-08-31 11:54:56 -04:00 committed by GitHub
commit 9968db9f47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 1 deletions

Binary file not shown.

View file

@ -28,6 +28,7 @@ class EmulatorJS {
'mame2003': 'mame2003', 'mame2003': 'mame2003',
'mednafen_ngp': 'ngp', 'mednafen_ngp': 'ngp',
'mednafen_pce': 'pce', 'mednafen_pce': 'pce',
'mednafen_pcfx': 'pcfx',
'mednafen_psx_hw': 'psx', 'mednafen_psx_hw': 'psx',
'mednafen_wswan': 'ws', 'mednafen_wswan': 'ws',
'melonds': 'nds', 'melonds': 'nds',
@ -72,6 +73,7 @@ class EmulatorJS {
'3do': 'opera', '3do': 'opera',
'psp': 'ppsspp', 'psp': 'ppsspp',
'pce': 'mednafen_pce', 'pce': 'mednafen_pce',
'pcfx': 'mednafen_pcfx',
'ngp': 'mednafen_ngp', 'ngp': 'mednafen_ngp',
'ws': 'mednafen_wswan', 'ws': 'mednafen_wswan',
'coleco': 'gearcoleco', 'coleco': 'gearcoleco',
@ -95,6 +97,7 @@ class EmulatorJS {
'mame2003': ['zip'], 'mame2003': ['zip'],
'mednafen_ngp': ['ngp', 'ngc'], 'mednafen_ngp': ['ngp', 'ngc'],
'mednafen_pce': ['pce', 'cue', 'ccd', 'iso', 'img', 'bin', 'chd'], 'mednafen_pce': ['pce', 'cue', 'ccd', 'iso', 'img', 'bin', 'chd'],
'mednafen_pcfx': ['cue', 'ccd', 'toc', 'chd'],
'mednafen_psx': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'], 'mednafen_psx': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'],
'mednafen_wswan': ['ws', 'wsc', 'pc2'], 'mednafen_wswan': ['ws', 'wsc', 'pc2'],
'mednafen_psx_hw': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'], 'mednafen_psx_hw': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'],
@ -869,7 +872,7 @@ class EmulatorJS {
} }
let resData = {}; let resData = {};
const needsCue = (["mednafen_psx", "mednafen_psx_hw", "mednafen_pce"].includes(this.getCore())) && !this.config.disableCue; const needsCue = (["mednafen_psx", "mednafen_psx_hw", "mednafen_pce", "mednafen_pcfx"].includes(this.getCore())) && !this.config.disableCue;
const altName = this.config.gameUrl.startsWith("blob:") ? (this.config.gameName || "game") : this.config.gameUrl.split('/').pop().split("#")[0].split("?")[0]; const altName = this.config.gameUrl.startsWith("blob:") ? (this.config.gameName || "game") : this.config.gameUrl.split('/').pop().split("#")[0].split("?")[0];
this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Data"), (fileName, fileData) => { this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Data"), (fileName, fileData) => {
if (fileName.includes("/")) { if (fileName.includes("/")) {
@ -2122,6 +2125,23 @@ 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 ('pcfx' === this.getControlScheme()) {
buttons = [
{id: 8, label: this.localization('I')},
{id: 0, label: this.localization('II')},
{id: 9, label: this.localization('III')},
{id: 1, label: this.localization('IV')},
{id: 10, label: this.localization('V')},
{id: 11, label: this.localization('VI')},
{id: 3, label: this.localization('RUN')},
{id: 2, label: this.localization('SELECT')},
{id: 12, label: this.localization('MODE1')},
{id: 13, label: this.localization('MODE2')},
{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')},
@ -2870,6 +2890,19 @@ class EmulatorJS {
{"type":"dpad","location":"left","left":"50%","right":"50%","joystickInput":false,"inputValues":[4,5,6,7]} {"type":"dpad","location":"left","left":"50%","right":"50%","joystickInput":false,"inputValues":[4,5,6,7]}
]; ];
info.push(...speedControlButtons); info.push(...speedControlButtons);
} else if ('pcfx' === this.getControlScheme()) {
info = [
{"type":"button","text":"I","id":"i","location":"right","right":5,"top":70,"bold":true,"input_value":8},
{"type":"button","text":"II","id":"ii","location":"right","right":75,"top":70,"bold":true,"input_value":0},
{"type":"button","text":"III","id":"iii","location":"right","right":145,"top":70,"bold":true,"input_value":9},
{"type":"button","text":"IV","id":"iv","location":"right","right":5,"top":0,"bold":true,"input_value":1},
{"type":"button","text":"V","id":"v","location":"right","right":75,"top":0,"bold":true,"input_value":10},
{"type":"button","text":"VI","id":"vi","location":"right","right":145,"top":0,"bold":true,"input_value":11},
{"type":"dpad","location":"left","left":"50%","right":"50%","joystickInput":false,"inputValues":[4,5,6,7]},
{"type":"button","text":"Select","id":"select","location":"center","left":-5,"fontSize":15,"block":true,"input_value":2},
{"type":"button","text":"Run","id":"run","location":"center","left":60,"fontSize":15,"block":true,"input_value":3}
];
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

@ -141,6 +141,7 @@
"Atari 7800": "atari7800", "Atari 7800": "atari7800",
"Atari 2600": "atari2600", "Atari 2600": "atari2600",
"NEC TurboGrafx-16/SuperGrafx/PC Engine": "pce", "NEC TurboGrafx-16/SuperGrafx/PC Engine": "pce",
"NEC PC-FX": "pcfx",
"SNK NeoGeo Pocket (Color)": "ngp", "SNK NeoGeo Pocket (Color)": "ngp",
"Bandai WonderSwan (Color)": "ws", "Bandai WonderSwan (Color)": "ws",
"ColecoVision": "coleco" "ColecoVision": "coleco"