Пример #1
0
void main()
{		
	GenerateTables();
	hires();

    CurrentPixelX=40;
    CurrentPixelY=30;
	OtherPixelX=40+160;
    OtherPixelY=30;
    DrawLine8();
    //DrawLineROM();
    
    text();
    // call(0xc6f0); // Call Basic NEW
    SwitchToCommand(command1);

}
Пример #2
0
/* Generate key from the 0x40-0x4c data in g_RegExt */
void WiimoteGenerateKey(wiimote_key* const key, const u8* const keydata)
{
  u8 rand[10];
  u8 skey[6];
  u8 testkey[6];
  int idx;

  for (int i = 0; i < 10; ++i)
    rand[9 - i] = keydata[i];
  for (int i = 0; i < 6; ++i)
    skey[5 - i] = keydata[i + 10];

  for (idx = 0; idx < 7; ++idx)
  {
    GenerateKey(rand, idx, testkey);
    if (0 == memcmp(testkey, skey, 6))
      break;
  }
  // default case is idx = 7 which is valid (homebrew uses it for the 0x17 case)

  GenerateTables(rand, skey, idx, key->ft, key->sb);

  // for homebrew, ft and sb are all 0x97 which is equivalent to 0x17
}
Пример #3
0
Rijndael::Rijndael()
{
  if (S[0]==0)
    GenerateTables();
}
Пример #4
0
void SkJS::InitializeDisplayables(const SkBitmap& bitmap, JSContext *cx, JSObject *obj, JSObject *proto) {
    SkJSDisplayable::gCanvas = new SkCanvas(bitmap);
    SkJSDisplayable::gPaint = new SkPaint();
#if SK_USE_CONDENSED_INFO == 0
    GenerateTables();
#else
    SkASSERT(0); // !!! compressed version hasn't been implemented
#endif
    AddInit(cx, obj, proto);
    AddCircleInit(cx, obj, proto);
    AddOvalInit(cx, obj, proto);
    AddPathInit(cx, obj, proto);
    AddRectangleInit(cx, obj, proto);
    AddRoundRectInit(cx, obj, proto);
//  AfterInit(cx, obj, proto);
    ApplyInit(cx, obj, proto);
    // AnimateInit(cx, obj, proto);
//  AnimateColorInit(cx, obj, proto);
    AnimateFieldInit(cx, obj, proto);
//  AnimateRotateInit(cx, obj, proto);
//  AnimateScaleInit(cx, obj, proto);
//  AnimateTranslateInit(cx, obj, proto);
    BitmapInit(cx, obj, proto);
//  BaseBitmapInit(cx, obj, proto);
//  BeforeInit(cx, obj, proto);
    BitmapShaderInit(cx, obj, proto);
    BlurInit(cx, obj, proto);
    ClipInit(cx, obj, proto);
    ColorInit(cx, obj, proto);
    CubicToInit(cx, obj, proto);
    DashInit(cx, obj, proto);
    DataInit(cx, obj, proto);
//  DimensionsInit(cx, obj, proto);
    DiscreteInit(cx, obj, proto);
    DrawToInit(cx, obj, proto);
    EmbossInit(cx, obj, proto);
    EventInit(cx, obj, proto);
//  FontInit(cx, obj, proto);
//  FocusInit(cx, obj, proto);
    ImageInit(cx, obj, proto);
    IncludeInit(cx, obj, proto);
//  InputInit(cx, obj, proto);
    LineInit(cx, obj, proto);
    LinearGradientInit(cx, obj, proto);
    LineToInit(cx, obj, proto);
    MatrixInit(cx, obj, proto);
    MoveInit(cx, obj, proto);
    MoveToInit(cx, obj, proto);
    OvalInit(cx, obj, proto);
    PathInit(cx, obj, proto);
    PaintInit(cx, obj, proto);
    DrawPointInit(cx, obj, proto);
    PolyToPolyInit(cx, obj, proto);
    PolygonInit(cx, obj, proto);
    PolylineInit(cx, obj, proto);
    PostInit(cx, obj, proto);
    QuadToInit(cx, obj, proto);
    RadialGradientInit(cx, obj, proto);
    RandomInit(cx, obj, proto);
    RectToRectInit(cx, obj, proto);
    RectangleInit(cx, obj, proto);
    RemoveInit(cx, obj, proto);
    ReplaceInit(cx, obj, proto);
    RotateInit(cx, obj, proto);
    RoundRectInit(cx, obj, proto);
    ScaleInit(cx, obj, proto);
    SetInit(cx, obj, proto);
    SkewInit(cx, obj, proto);
    // 3D_CameraInit(cx, obj, proto);
    // 3D_PatchInit(cx, obj, proto);
    SnapshotInit(cx, obj, proto);
//  StrokeInit(cx, obj, proto);
    TextInit(cx, obj, proto);
    TextOnPathInit(cx, obj, proto);
    TextToPathInit(cx, obj, proto);
    TranslateInit(cx, obj, proto);
//  UseInit(cx, obj, proto);
}
Пример #5
0
Rijndael::Rijndael()
{
  if (S[0]==0)
    GenerateTables();
  CBCMode = true; // Always true for RAR.
}
Пример #6
0
void main()
{		
		char j, a;
		unsigned int *seed;
		backupPageZero();
        GenerateTables();
		DiscLoad("FONT.BIN");
        // testing
        
        //sedoric("!LOAD(\"TEAM.BIN\")");
       	//cls();
       	
       	#ifdef debug 
        printf("char : %d, short %d, int %d, long %d, float %d\n",
        	sizeof(char), sizeof(short), sizeof(int), sizeof(long), sizeof(float));
        	
       
        printf("taper sur une touche pour continuer\n");
        a = (char)getchar();
        #endif
        io_needed = 1;
        loadCharacters();
        
        #ifdef debug
        printf("taper sur une touche pour continuer\n");
        a = (char)getchar();
        #endif
        loadLaby();
        if (ca==0) {
        	if (c[x+y*XMAX] != 0) {
        		unsigned char nb = 255;
        		// un coffre ou un combat a été fini
        		char cas = c[x+y*XMAX];
        		if (cas>=21 && cas<=28) nb = cas - 21;
        		else if (cas >=30 && cas <= 50) nb = cas - 30 + 8; // les 8 premiers bits stockent les coffres
				if (nb < 40) {
					SetBit(combats_coffres[ville-1], nb);
					//printf("Coffre ou Combat %d fini!\n", nb);
					c[x+y*XMAX] = 0;
				}
        	}
        }
        
        #ifdef debug
        for (a=0; a<8; a++)
        	for (j=0; j<40; j++)
				if(TestBit(combats_coffres[a], j))
					printf("Bit %d is set\n", j);
        
        // testing
        // SetBit(combats_coffres[ville-1], 0);
        #endif
        
        printf("Taper sur une touche pour continuer\n");
        get();
		
		seed = (unsigned int *) 630; // timer
		srand(*seed);
		#ifdef debug
		printf("timer vaut %d\n", *seed);
		printf("alea vaut %d\n", rand());
				
		printf("taper sur une touche pour continuer\n");
        a = (char)getchar();
		#endif
		
        // Sedoric(command2);
      
		// 330 CASE=C(X,Y)
		prep();
		drawLaby();

		ca = c[x+y*XMAX];
		// manageCell();
		// 320 GOSUB 500:GOSUB 1000
		
		
		
		while(1) {
						
			// 380 GET A$
			//a = (char)getchar();
			//printf("x=%d, y=%d, s=%d ca=%d\n", x,y,s,ca);
			a = get();
			
			switch(a) {
				//#ifdef debug
				case 'F': // pour debug
				case 'f':
					// 390 IF A$="F" THEN END
					a = 'F';
					text();
					io_needed = 1;
					saveCharacters();
					restorePageZero();
					printf("sauvegarde ok\n");
					SwitchToCommand("!DIR"); // évite une erreur bizarre
					return;
					break;
				//#endif
				case ' ':
					// 400 IF A$=" "AND F(1)>1 AND F(1)<7 THEN GOSUB 3000:GOTO 330
					if(f[0]>1&&f[0]<7) {
						#ifdef debug
						for (j=0;j<4;j++) {	
							printf("cle(%d,%d) = %d ", 3, j, cles[3][j]);
						}
						#endif
						// 3000 REM ClÈ
						// 3010 IF F(1)=2 THEN 3030
						// 3020 IF CLEF(VIL,(F(1)-2))=0 THEN ZAP:PRINT TX$(4):GOTO 3050
						// 3030 F(1)=0:GOSUB 600:PING
						// 3050 RETURN
						if (f[0] == 2) {
							f[0]=0;
							forward();
							ping();
							// on avance deux fois
							prep();
							printf("On passe la porte\n");
							wait(180);
							drawLaby();
							forward();
						} else {
							////// MODIF Maximus *******
							if(cles[ville-1][f[0]-3]==0) {
								zap();
								printf("Ou est la cl{ ?\n");
							} else {
								#ifdef debug
								printf("Porte %d cle(%d,%d) %d  ", 
									f[0], ville-1, (f[0]-3), cles[ville-1][f[0]-3]);
								a = (char)getchar();
								#endif
								InvertBit(&dedans,f[0]-3);
								f[0]=0;
								forward();
								ping();
								// on avance deux fois
								prep();
								printf("On passe la porte\n");
								wait(180);
								drawLaby();
								forward();
								
							}
						}
					}
					break;
				case 'I':
				case 'i':
				case 'Z':
				case 'z':
					// 410 IF A$="I" OR A$="i" THEN GOSUB 600:GOTO 330
					forward();
					break;
				case 'J':
				case 'j':
				case 'Q':
				case 'q':
					// 420 IF A$="J" OR A$="j" THEN S=S-1:IF S=0 THEN S=4
					s--;
					if(s<0) s=3;
					prep(); drawLaby();
					break;
				case 'L':
				case 'l':
				case 'D':
				case 'd':
					// 430 IF A$="L" OR A$="l" THEN S=S+1:IF S=5 THEN S=1
					s++;
					if(s>3) s=0;
					prep(); drawLaby();
					break;
				case 'C':
				case 'c':
					// 435 IF A$="C" THEN GOTO 21000
					text();
					io_needed = 1;
					saveCharacters();
					restorePageZero();
					SwitchToCommand("CAMP");
					break;
				//#ifdef debug
				case 'A':
				case 'a':
					printf("alea vaut %d\n", rand());
					break;
				case 'K':
				case 'k':					
					for (j=0;j<4;j++) {	
						cles[ville-1][j] = !cles[ville-1][j];
					}
					break;
				case 'V':
				case 'v':
					text();
					io_needed = 1;
					saveCharacters();
					restorePageZero();
					SwitchToCommand("VILLE");
					break;
				//#endif
				default:
					puts("I:avance, J:droite, L:gauche\nESPACE: ouvrir porte");
					wait(200);
			}
			// 450 GOTO 300
		}
}