mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 06:47:45 -04:00
initial import
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@2 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
commit
720ee7f624
36 changed files with 6740 additions and 0 deletions
37
gp2x/test.c
Normal file
37
gp2x/test.c
Normal file
|
@ -0,0 +1,37 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include "gp2x.h"
|
||||
|
||||
void spend_cycles(int c);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
struct timeval tval; // timing
|
||||
int thissec = 0, frames_done = 0;
|
||||
|
||||
gp2x_init();
|
||||
|
||||
for (;;)
|
||||
{
|
||||
gettimeofday(&tval, 0);
|
||||
|
||||
if(thissec != tval.tv_sec)
|
||||
{
|
||||
thissec = tval.tv_sec;
|
||||
|
||||
printf("frames_done: %i\n", frames_done);
|
||||
frames_done = 0;
|
||||
}
|
||||
|
||||
|
||||
//gp2x_video_wait_vsync();
|
||||
//usleep(1); // sleeps a minimum of ~20ms
|
||||
//gp2x_video_flip(); // can be called ~430000 times/sec
|
||||
spend_cycles(1000);
|
||||
frames_done++;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue