AutoHold for L and R

This commit is contained in:
gocha 2009-06-18 08:43:58 +00:00
parent a55e58a804
commit fbf63505cf
3 changed files with 7 additions and 1 deletions

View File

@ -2477,7 +2477,7 @@ static std::string MakeInputDisplayString(u16 pad, u16 padExt) {
void ClearAutoHold(void) {
for (int i=0; i < 10; i++) {
for (int i=0; i < 12; i++) {
AutoHold.hold(i)=false;
}
}
@ -2560,6 +2560,8 @@ void NDS_setPad(bool R,bool L,bool D,bool U,bool T,bool S,bool B,bool A,bool Y,b
if(AutoHold.A) A=!padarray[7];
if(AutoHold.Y) Y=!padarray[8];
if(AutoHold.X) X=!padarray[9];
if(AutoHold.L) W=!padarray[10];
if(AutoHold.R) E=!padarray[11];
//this macro is the opposite of what you would expect
#define FIX(b) (b?0:0x80)

View File

@ -84,6 +84,8 @@ struct autohold {
bool A;
bool Y;
bool X;
bool L;
bool R;
bool &hold(int i) { return ((bool*)this)[i]; }
};

View File

@ -2208,6 +2208,8 @@ void input_process()
if(AutoHoldPressed && A) AutoHold.A ^= true;
if(AutoHoldPressed && Y) AutoHold.Y ^= true;
if(AutoHoldPressed && X) AutoHold.X ^= true;
if(AutoHoldPressed && W) AutoHold.L ^= true;
if(AutoHoldPressed && E) AutoHold.R ^= true;
NDS_setPad( R, L, D, U, T, S, B, A, Y, X, W, E, G, F);