GP32 Mr.mirko's Gpgetrtc() & Gp_installrtc Won't Work


Arda

Member
Joined
Jul 16, 2003
Messages
142
Location
istanbul
Website
arda.kisafilm.org
this time, unlike gp_DMAmemcopy, gpGetRTC() is working just fine on geepee32 emulator, but gpGetRTC() always returns 0 on a REAL gp32.

here is the code:

Code:
       char buf[256];
        int fps,fpsb;

        gp_InstallRTC();
        fpsb=0;
        fps=0;
        cs=0;    // current screen = 0

 while (1) {

...
...set buffer.. cleear screen etc...
...
      // print fps on buffer:
       sprintf (buf, "%d", fpsb);
       gp_SetFont8(10,10,strlen (buf),buf,0,fbufs[cs]);
      
     ciz(posx1,posy1);  // make some complicated drawings

      // add fps count:
       fps++;

     //check to see if a second has passed
	if (gp_GetRTC () > 128) {
  fpsb=fps;
  fps=0;
  gp_ResetRTC ();
	}


 }

the above code is working fine on emulator.
but not on a real gp32.

(SDK's Rtc timer example won't work on real gp32 too)
 
uhhh a bug,

go to file: lib.src/common/gp_timer.c
and change:

(*(volatile unsigned char *)rTICINT) = 0x81;
to:
rTICINT = 0x81;

now it works on real gp32...
 
Back
Top