#include "fxlib.h" #include #include "addresses.h" #include "Sound4Calc.h" #include "syscall.h" //#define DEBUG #define PI 3.14159265358 /*#define SH7305_PJDR ((volatile unsigned char*)0xA4050130) #define SH7305_PJCR ((volatile unsigned short*)0xA4050110) #define SH7305_PUCR ((volatile unsigned short*)0xA4050142) #define SH7305_PUDR ((volatile unsigned char*)0xA4050162) #define SH7305_MSTPCR0 ((volatile unsigned int*)0xA4150030) #define SH7305_SCSCR ((volatile unsigned short*)0xA4410008) //SH3 addresses #define SH7337_STBCR3 ((volatile unsigned int*)0xA40A0000) #define SH7337_SCSCR2 ((volatile unsigned int*)0xA4410008) #define SH7337_PGCR ((volatile unsigned int*)0xA400010C) #define SH7337_PLCR ((volatile unsigned int*)0xA4000114) #define SH7337_SCPCR ((volatile unsigned int*)0xA4000116) #define SH7337_PGDR ((volatile unsigned int*)0xA400012C) #define SH7337_SCPDR ((volatile unsigned int*)0xA4000136)*/ //typedef unsigned volatile; char *itoa(int n, unsigned char* str, int base) { int i=1, j=0, x; if(n<0) str[j++] = '-', n = -n; for(x=n;x;x/=base) j++; for(x=n;x;x/=base) str[j-i++] = x%base + '0' + 39*(x%base>9); str[j] = 0; return str; } int main(void) { unsigned int key; char buffer[50]; unsigned char str[20]; int sleep = 2000; int i; char before = 0, during = 0, after = 0; setup(); //ResetPin(); while(1) { Bdisp_AllClr_VRAM(); PrintMini(1, 1, itoa(sleep, str, 10), 0); PrintMini(1, 10, itoa(is_SH4, str, 10), 0); #ifdef DEBUG PrintMini(1, 20, itoa(before, str, 16), 0); PrintMini(1, 28, itoa(during, str, 16), 0); PrintMini(1, 36, itoa(after, str, 16), 0); #endif GetKey(&key); switch(key) { case KEY_CTRL_RIGHT : sleep+=50; break; case KEY_CTRL_LEFT : sleep-=50; break; case KEY_CTRL_EXE : while(Keyboard_KeyDown()) { #ifdef DEBUG before=*SH7305_PJDR; ResetPin(); during=*SH7305_PJDR; for(i=0;i