23 lines
659 B
C
23 lines
659 B
C
#include <syscall.h>
|
|
|
|
void syscall_getkey(cpu_status_t* status){
|
|
while(true){
|
|
SDL_PumpEvents();
|
|
const unsigned char* key = SDL_GetKeyboardState(NULL);
|
|
if (key[SDL_SCANCODE_RETURN]) { //exe
|
|
cpu_write32(status, status->r[4],(int) 30004);
|
|
return;
|
|
}
|
|
else if(key[SDL_SCANCODE_UP]) { //up
|
|
cpu_write32(status, status->r[4],(int) 30018);
|
|
return;
|
|
}
|
|
else if(key[SDL_SCANCODE_A]) { //shift
|
|
cpu_write32(status, status->r[4],(int) 30006);
|
|
return;
|
|
}
|
|
else if (key[SDL_SCANCODE_ESCAPE]) {
|
|
exit(0);
|
|
}
|
|
}
|
|
} |