int main(int argc, char *argv[]) { char *cdrom_name = NULL; u32 f_size=0; int per_index=0; u64 tickfreq; tickfreq = GetTickFreq(); atexit(cleanup); #ifndef _arch_dreamcast if (argc != 2) { ProgramUsage(); } printf("%s v%s - by Cyber Warrior X(c)%s\n", PROG_NAME, VER_NAME, COPYRIGHT_YEAR); per_index = atoi(argv[1]); #endif if (per_index < 0 || per_index >= (sizeof(PERCoreList) / sizeof(PerInterface_struct *))) { printf("peripheral core index out of range\n"); exit(1); } CurPer = PERCoreList[per_index]; printf("Testing %s\n", CurPer->Name); if (CurPer->Init() != 0) { printf("PerInit error: Unable to initialize peripheral core\n"); exit(1); } else testspassed++; testspassed += TestInput("Press a button on a gamepad/joystick...", PERSF_BUTTON, 10, tickfreq); testspassed += TestInput("Press a key on the keyboard...", PERSF_KEY, 10, tickfreq); testspassed += TestInput("Move d-pad/stick on a gamepad/joystick...", PERSF_AXIS|PERSF_BUTTON, 10, tickfreq); testspassed += TestInput("Move mouse...", PERSF_MOUSEMOVE, 10, tickfreq); }
double Timer::GetTime() { return ( (double)GetTickCount() ) / GetTickFreq(); }