Fix bnusio_close not being present and input
This commit is contained in:
parent
b119478ce3
commit
7f97f80e83
@ -50,6 +50,7 @@ RETURN_FALSE (i64, bnusio_SramRead, i32 a1, u8 a2, i32 a3, u16 a4);
|
|||||||
RETURN_FALSE (i64, bnusio_SramWrite, i32 a1, u8 a2, i32 a3, u16 a4);
|
RETURN_FALSE (i64, bnusio_SramWrite, i32 a1, u8 a2, i32 a3, u16 a4);
|
||||||
RETURN_FALSE (i64, bnusio_ResetCoin);
|
RETURN_FALSE (i64, bnusio_ResetCoin);
|
||||||
RETURN_FALSE (i64, bnusio_DecCoin, i32 a1, u16 a2);
|
RETURN_FALSE (i64, bnusio_DecCoin, i32 a1, u16 a2);
|
||||||
|
RETURN_FALSE (i64, bnusio_Close);
|
||||||
size_t
|
size_t
|
||||||
bnusio_GetFirmwareVersion () {
|
bnusio_GetFirmwareVersion () {
|
||||||
return 126;
|
return 126;
|
||||||
@ -72,26 +73,20 @@ Keybindings P2_LEFT_RED = {};
|
|||||||
Keybindings P2_RIGHT_RED = {};
|
Keybindings P2_RIGHT_RED = {};
|
||||||
Keybindings P2_RIGHT_BLUE = {};
|
Keybindings P2_RIGHT_BLUE = {};
|
||||||
|
|
||||||
struct AnalogGameButton {
|
u16 drumMin = 10000;
|
||||||
Keybindings *bindings;
|
u16 drumMax = 20000;
|
||||||
i32 offset;
|
u16 lastHitValue = drumMin;
|
||||||
};
|
Keybindings *analogButtons[] = {&P1_LEFT_BLUE, &P1_LEFT_RED, &P1_RIGHT_RED, &P1_RIGHT_BLUE, &P2_LEFT_BLUE, &P2_LEFT_RED, &P2_RIGHT_RED, &P2_RIGHT_BLUE};
|
||||||
|
|
||||||
u16 drumMin = 10000;
|
|
||||||
u16 drumMax = 20000;
|
|
||||||
AnalogGameButton analogButtons[] = {{&P1_LEFT_BLUE}, {&P1_LEFT_RED}, {&P1_RIGHT_RED}, {&P1_RIGHT_BLUE}, {&P2_LEFT_BLUE}, {&P2_LEFT_RED}, {&P2_RIGHT_RED}, {&P2_RIGHT_BLUE}};
|
|
||||||
|
|
||||||
u16
|
u16
|
||||||
bnusio_GetAnalogIn (u8 which) {
|
bnusio_GetAnalogIn (u8 which) {
|
||||||
auto button = &analogButtons[which];
|
auto button = analogButtons[which];
|
||||||
if (!IsButtonDown (*button->bindings)) {
|
if (IsButtonTapped (*button)) {
|
||||||
button->offset = drumMin;
|
lastHitValue++;
|
||||||
return 0;
|
if (lastHitValue >= drumMax) lastHitValue = drumMin;
|
||||||
} else if (button->offset == drumMax) {
|
return lastHitValue;
|
||||||
return drumMax;
|
|
||||||
} else {
|
} else {
|
||||||
button->offset += 1;
|
return 0;
|
||||||
return button->offset;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user