Core-specific config

This commit is contained in:
Ethan O'Brien 2023-07-04 19:41:37 -05:00
parent 71c33ff3ee
commit ae18b361c2

View file

@ -1383,35 +1383,121 @@ class EmulatorJS {
this.controlMenu = body.parentElement; this.controlMenu = body.parentElement;
body.classList.add("ejs_control_body"); body.classList.add("ejs_control_body");
const buttons = { let buttons;
0: 'B', if ('nes' === this.getCore(true)) {
1: 'Y', buttons = {
2: 'SELECT', 8: 'A',
3: 'START', 0: 'B',
4: 'UP', 2: 'SELECT',
5: 'DOWN', 3: 'START',
6: 'LEFT', 4: 'UP',
7: 'RIGHT', 5: 'DOWN',
8: 'A', 6: 'LEFT',
9: 'X', 7: 'RIGHT',
10: 'L', 24: this.localization('QUICK SAVE STATE'),
11: 'R', 25: this.localization('QUICK LOAD STATE'),
12: 'L2', 26: this.localization('CHANGE STATE SLOT')
13: 'R2', }
14: 'L3', } else if ('snes' === this.getCore(true)) {
15: 'R3', buttons = {
19: 'L STICK UP', 0: 'B',
18: 'L STICK DOWN', 1: 'Y',
17: 'L STICK LEFT', 2: 'SELECT',
16: 'L STICK RIGHT', 3: 'START',
23: 'R STICK UP', 4: 'UP',
22: 'R STICK DOWN', 5: 'DOWN',
21: 'R STICK LEFT', 6: 'LEFT',
20: 'R STICK RIGHT', 7: 'RIGHT',
24: this.localization('QUICK SAVE STATE'), 8: 'A',
25: this.localization('QUICK LOAD STATE'), 9: 'X',
26: this.localization('CHANGE STATE SLOT') 10: 'L',
11: 'R',
24: this.localization('QUICK SAVE STATE'),
25: this.localization('QUICK LOAD STATE'),
26: this.localization('CHANGE STATE SLOT')
};
} else if ('n64' === this.getCore(true)) {
buttons = {
0: 'A',
1: 'B',
3: 'START',
4: 'UP',
5: 'DOWN',
6: 'LEFT',
7: 'RIGHT',
10: 'L',
11: 'R',
12: 'Z',
19: 'L STICK UP',
18: 'L STICK DOWN',
17: 'L STICK LEFT',
16: 'L STICK RIGHT',
23: 'R STICK UP',
22: 'R STICK DOWN',
21: 'R STICK LEFT',
20: 'R STICK RIGHT',
24: this.localization('QUICK SAVE STATE'),
25: this.localization('QUICK LOAD STATE'),
26: this.localization('CHANGE STATE SLOT')
};
} else if ('nds' === this.getCore(true)) {
buttons = {
0: 'B',
1: 'Y',
2: 'SELECT',
3: 'START',
4: 'UP',
5: 'DOWN',
6: 'LEFT',
7: 'RIGHT',
8: 'A',
9: 'X',
10: 'L',
11: 'R',
14: 'Microphone',
24: this.localization('QUICK SAVE STATE'),
25: this.localization('QUICK LOAD STATE'),
26: this.localization('CHANGE STATE SLOT')
};
} else {
buttons = {
0: 'B',
1: 'Y',
2: 'SELECT',
3: 'START',
4: 'UP',
5: 'DOWN',
6: 'LEFT',
7: 'RIGHT',
8: 'A',
9: 'X',
10: 'L',
11: 'R',
12: 'L2',
13: 'R2',
14: 'L3',
15: 'R3',
19: 'L STICK UP',
18: 'L STICK DOWN',
17: 'L STICK LEFT',
16: 'L STICK RIGHT',
23: 'R STICK UP',
22: 'R STICK DOWN',
21: 'R STICK LEFT',
20: 'R STICK RIGHT',
24: this.localization('QUICK SAVE STATE'),
25: this.localization('QUICK LOAD STATE'),
26: this.localization('CHANGE STATE SLOT')
};
} }
if (['arcade', 'mame'].includes(this.getCore(true))) {
buttons[2] = this.localization('INSERT COIN');
}
//if (_this.statesSupported === false) {
// delete buttons[24];
// delete buttons[25];
// delete buttons[26];
//}
let selectedPlayer; let selectedPlayer;
let players = []; let players = [];
let playerDivs = []; let playerDivs = [];