#include "fxlib.h" #include "DDJ.h" #include #include srand(RTC_getTicks()); static int SysCallCode[] = {0xD201422B,0x60F20000,0x80010070}; static int (*SysCall)(int R4, int R5, int R6, int R7, int FNo ) = (void*)&SysCallCode; int RTC_getTicks() { return (*SysCall)(0, 0, 0, 0, 0x3B); } unsigned int key; unsigned char plateForme1[]={0xE6,0xBD,0}; unsigned char plateForme2[]={0xE6,0xB2,0}; unsigned char plateForme3[]={0xE6,0xBE,0}; unsigned char fermeture[]={0xE6,0xA2,0}; unsigned char carre[]={0xE6,0xA6,0}; unsigned char espace[2]=" "; int AddIn_main(int isAppli, unsigned short OptionNum) { Bdisp_AllClr_DDVRAM(); locate(3,1); Print((unsigned char*)"DOODLE JUMP CASIO"); locate(1,3); Print((unsigned char*)"1-Jouer | X"); locate(1,4); Print((unsigned char*)"2-Records |"); locate(1,5); Print((unsigned char*)"3-Quitter | "); structure(); locate(1,6); Print((unsigned char*)"4-Installer|"); locate(14,7); Print((unsigned char*)"(v1.0.0)"); while(1){ GetKey(&key); if (key==KEY_CHAR_1){ Bdisp_AllClr_DDVRAM(); locate(1,3); Print((unsigned char*)"Vous devez retourner"); locate(1,4); Print((unsigned char*)"votre calculatrice"); locate(1,5); Print((unsigned char*)"pour pouvoir jouer."); Sleep(250); while(1){ GetKey(&key); if (key==KEY_CTRL_EXE){ Bdisp_AllClr_DDVRAM(); jeu(); } } } } return 1; } void jeu() { int l,k,m,n,o,p,q,r,s,t,u,d,i,e,v,j,c,z; l=k=e=v=0; u=1; m=8; p=4; r=9; s=14; n=q=t=o=100; j=d=2; c=i=10; locate(m,1); structure(); locate(p,3); structure(); locate(r,5); structure(); locate(s,7); structure(); locate(3,1); Print(fermeture); locate(3,2); Print(fermeture); locate(3,3); Print(fermeture); locate(3,4); Print(fermeture); locate(1,5); Print((unsigned char*)"0"); locate(3,5); Print(fermeture); locate(1,6); Print((unsigned char*)"1"); locate(3,6); Print(fermeture); locate(1,7); Print((unsigned char*)"2"); locate(3,7); Print(fermeture); do{ if (j=1){ if (im+3){ locate(i,j); Print(espace); } else if (i>=m && i<=m+3 && m!=100){ locate(i,j); Print(plateForme2); } } else if (j=2){ if (in+3){ locate(i,j); Print(espace); } else if (i>=n && i<=n+3 && n!=100){ locate(i,j); Print(plateForme2); } } else if (j=3){ if (io+3){ locate(i,j); Print(espace); } else if(i>=o && i<=o+3 && o!=100){ locate(i,j); Print(plateForme2); } } else if (j=4){ if (i

p+3){ locate(i,j); Print(espace); } else if(i>=p && i<=p+3 && p!=100){ locate(i,j); Print(plateForme2); } } else if (j=5){ if (iq+3){ locate(i,j); Print(espace); } else if(i>=q && i<=q+3 && q!=100){ locate(i,j); Print(plateForme2); } } else if (j=6){ if (ir+3){ locate(i,j); Print(espace); } else if(i>=r && i<=r+3 && r!=100){ locate(i,j); Print(plateForme2); } } else if (j=7){ if (is+3){ locate(i,j); Print(espace); } else if(i>=s && i<=s+3 && s!=100){ locate(i,j); Print(plateForme2); } } locate(c,d); Print((unsigned char*)"X"); i=c; j=d; GetKey(&key); if (key==KEY_CTRL_F1 || key==KEY_CTRL_LEFT){ c--; } else if (key==KEY_CTRL_F6 || key==KEY_CTRL_RIGHT){ c++; } if (c<=3){ c=21; } else if (c>=22){ c=4; } if (e==4){ e=0; } if (e>0){ e++; d++; } if (e==0 && d==2){ if (c>=m && c<=m+3 && m!=100){ e=1; } else if (cm+3){ d--; } } else if (e==0 && d==3){ if (c>=n && c<=n+3 && n!=100){ e=1; } else if (cn+3){ d--; } } else if (e==0 && d==4){ if (c>=o && c<=o+3 && o!=100){ e=1; } else if (co+3){ d--; } } else if (e==0 && d==5){ if (c>=p && c<=p+3 && p!=100){ e=1; } else if (c

p+3){ d--; } } else if (e==0 && d==6){ if (c>=q && c<=q+3 && q!=100){ e=1; } else if (cq+3){ d--; } } else if (e==0 && d==7){ if (c>=r && c<=r+3 && r!=100){ e=1; } else if (cr+3){ d--; } } else if (e==0 && d==8){ if (c>=s && c<=s+3 && s!=100){ e=1; } else if (cs+3){ d--; } } if (d==1 && l==1){ d=2; c=m+1; l=0; locate(i,j); Print(espace); for(z=1; z<75; z++){ locate(5,2); Print((unsigned char*)"SECONDE CHANCE !"); } locate(5,2); Print((unsigned char*)" "); locate(c,d); Print((unsigned char*)"3"); for (z=1; z<500; z++){ } locate(c,d); Print((unsigned char*)"2"); for (z=1; z<500; z++){ } locate(c,d); Print((unsigned char*)"1"); for (z=1; z<500; z++){ } locate(c,d); Print((unsigned char*)"X"); } if (d==1){ Lbl0(); } if (d>=6){ u--; if (u!=0){ t=100; } else{ t= 4 + rand()%13; u=1 + rand()%3; d--; j--; m=n; n=o; o=p; p=q; q=r; r=s; s=t; if (s!=100){ locate(s,7); structure(); if (rand()%59==0){ locate(4,7); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); Print(carre); } k++; locate(3,7); Print(fermeture); locate(1,7); Print((unsigned char*) k+2); } } } while (1); } int random(int min, int max) { return rand() % (max - min) + min; } void structure() { Print(plateForme1); Print(plateForme2); Print(plateForme2); Print(plateForme3); } #pragma section _BR_Size unsigned long BR_Size; #pragma section #pragma section _TOP //**************************************************************************** // InitializeSystem // // param : isAppli : 1 = Application / 0 = eActivity // OptionNum : Option Number (only eActivity) // // retval : 1 = No error / 0 = Error // //**************************************************************************** int InitializeSystem(int isAppli, unsigned short OptionNum) { return INIT_ADDIN_APPLICATION(isAppli, OptionNum); } #pragma section