/* ======================================================================== */ /* WII Platform Support */ /* Adapted to jzIntv by Daniele Moglia. */ /* ======================================================================== */ #include "config.h" #include #include #include #include #include #include #include void wii_init() { #ifndef USE_AS_BACKEND fatInitDefault(); #endif } /* http://lists.ozlabs.org/pipermail/linuxppc-dev/1999-October/003889.html */ LOCAL uint_64 wii_get_timebase() { unsigned long long retval; unsigned long junk; __asm__ __volatile__ ("\n\ 1: mftbu %1\n\ mftb %L0\n\ mftbu %0\n\ cmpw %0,%1\n\ bne 1b" : "=r" (retval), "=r" (junk)); return retval; } double wii_get_time() { return (double)wii_get_timebase() / (1000.0 * (double)TB_TIMER_CLOCK); }