mirror of
https://github.com/libretro/FBNeo.git
synced 2024-11-23 08:59:39 +00:00
modify joyprocess's HoldCoin<N, T = UINT8> for UINT16(&etc) happytime
This commit is contained in:
parent
b588fb6d7b
commit
71162f4450
@ -69,10 +69,10 @@ struct ButtonToggle {
|
||||
};
|
||||
|
||||
// E-Z HoldCoin logic (see pgm_run.cpp, d_discoboy.cpp)
|
||||
template <int N>
|
||||
template <int N, typename T = UINT8>
|
||||
struct HoldCoin {
|
||||
UINT8 prev[N];
|
||||
UINT8 counter[N];
|
||||
T prev[N];
|
||||
T counter[N];
|
||||
|
||||
void reset() {
|
||||
memset(&prev, 0, sizeof(prev));
|
||||
@ -84,7 +84,7 @@ struct HoldCoin {
|
||||
SCAN_VAR(counter);
|
||||
}
|
||||
|
||||
void check(UINT8 num, UINT8 &inp, UINT8 bit, UINT8 hold_count) {
|
||||
void check(UINT8 num, T &inp, T bit, UINT8 hold_count) {
|
||||
if ((prev[num] & bit) != (inp & bit) && (inp & bit) && !counter[num]) {
|
||||
counter[num] = hold_count + 1;
|
||||
}
|
||||
@ -98,7 +98,7 @@ struct HoldCoin {
|
||||
}
|
||||
}
|
||||
|
||||
void checklow(UINT8 num, UINT8 &inp, UINT8 bit, UINT8 hold_count) {
|
||||
void checklow(UINT8 num, T &inp, T bit, UINT8 hold_count) {
|
||||
if ((prev[num] & bit) != (inp & bit) && (~inp & bit) && !counter[num]) {
|
||||
counter[num] = hold_count + 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user