mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2026-02-06 11:17:36 +00:00
check emulation state inside autofire interval
This commit is contained in:
parent
67351a5669
commit
91dcb94e51
@ -3620,18 +3620,13 @@ class EmulatorJS {
|
||||
|
||||
if (["buttonup", "buttondown"].includes(e.type) && (controlValue === e.label || controlValue === e.index)) {
|
||||
const inputValue = isAnalog ? 0x7fff : 1;
|
||||
if (e.type === "buttonup") {
|
||||
if (this.isAutofireEnabled(i, j) && !isAnalog) {
|
||||
this.stopAutofire(i, j);
|
||||
} else {
|
||||
this.gameManager.simulateInput(i, j, 0);
|
||||
}
|
||||
const isButtonUp = e.type === "buttonup";
|
||||
const value = isButtonUp ? 0 : inputValue;
|
||||
|
||||
if (this.isAutofireEnabled(i, j) && !isAnalog) {
|
||||
isButtonUp ? this.stopAutofire(i, j) : this.startAutofire(i, j, inputValue);
|
||||
} else {
|
||||
if (this.isAutofireEnabled(i, j) && !isAnalog) {
|
||||
this.startAutofire(i, j, inputValue);
|
||||
} else {
|
||||
this.gameManager.simulateInput(i, j, inputValue);
|
||||
}
|
||||
this.gameManager.simulateInput(i, j, value);
|
||||
}
|
||||
} else if (e.type === "axischanged") {
|
||||
if (typeof controlValue === "string" && controlValue.split(":")[0] === e.axis) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user