Commit d76e605a authored by Jan Holthuis's avatar Jan Holthuis
Browse files

linux-dist: Use a switch case in UpdateInputState

parent 73a9269f
...@@ -449,42 +449,46 @@ void UpdateInputState(u32 port) ...@@ -449,42 +449,46 @@ void UpdateInputState(u32 port)
return; return;
#endif #endif
for(;;) bool done = false;
while(!done)
{ {
key = 0; key = 0;
read(STDIN_FILENO, &key, 1); read(STDIN_FILENO, &key, 1);
if (0 == key || EOF == key) { break; } switch(key)
if ('k' == key) { KillTex=true; } {
case 0:
#ifdef TARGET_PANDORA case EOF:
if (' ' == key) { kcode[port] &= ~Btn_C; } done = true;
if ('6' == key) { kcode[port] &= ~Btn_A; } break;
if ('O' == key) { kcode[port] &= ~Btn_B; } case 'k': KillTex=true; break;
if ('5' == key) { kcode[port] &= ~Btn_Y; } case 'a': rt[port] = 255; break;
if ('H' == key) { kcode[port] &= ~Btn_X; } case 's': lt[port] = 255; break;
if ('A' == key) { kcode[port] &= ~DPad_Up; } //case 0x1b: die("death by escape key"); break; //this actually quits when i press left for some reason
if ('B' == key) { kcode[port] &= ~DPad_Down; }
if ('D' == key) { kcode[port] &= ~DPad_Left; } #ifdef TARGET_PANDORA
if ('C' == key) { kcode[port] &= ~DPad_Right; } case ' ': kcode[port] &= ~Btn_C; break;
case '6': kcode[port] &= ~Btn_A; break;
if ('q' == key) { die("death by escape key"); } case 'O': kcode[port] &= ~Btn_B; break;
#endif case '5': kcode[port] &= ~Btn_Y; break;
//if (0x1b == key){ die("death by escape key"); } //this actually quits when i press left for some reason case 'H': kcode[port] &= ~Btn_X; break;
case 'A': kcode[port] &= ~DPad_Up; break;
if ('a' == key) { rt[port] = 255; } case 'B': kcode[port] &= ~DPad_Down; break;
if ('s' == key) { lt[port] = 255; } case 'D': kcode[port] &= ~DPad_Left; break;
case 'C': kcode[port] &= ~DPad_Right; break;
#if FEAT_SHREC != DYNAREC_NONE case 'q': die("death by escape key"); break;
if ('b' == key) { emit_WriteCodeCache(); } #endif
if ('n' == key) { bm_Reset(); }
if ('m' == key) { bm_Sort(); } #if FEAT_SHREC != DYNAREC_NONE
if (',' == key) case 'b': emit_WriteCodeCache(); break;
{ case 'n': bm_Reset(); break;
emit_WriteCodeCache(); case 'm': bm_Sort(); break;
bm_Sort(); case ',':
} emit_WriteCodeCache();
#endif bm_Sort();
break;
#endif
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment