int do_test_setters(const char *test_parm) { (void)test_parm; int uid = getuid(); int gid = getgid(); // Second val is to set to TEST_SET(setuid, uid ); TEST_SET(setuid32, uid ); TEST_SET(setgid, gid ); TEST_SET(setgid32, gid ); /* unimpl in kernel yet TEST_SET(setregid, gid ); TEST_SET(setregid32, gid ); TEST_SET(setresgid, gid ); TEST_SET(setresgid32, gid ); TEST_SET(setresuid, uid ); TEST_SET(setresuid32, uid ); TEST_SET(setreuid, uid ); TEST_SET(setreuid32, uid ); */ //TEST_SET(setpgid); //TEST_SET(setgroups); //TEST_SET(setgroups32); return 0; }
int DoTest(int N, TYPE *alpha0, int incY) { int iret; const int npad=Mmax(4*Mabs(incY), 16); const TYPE padval=(-2271.0); TYPE *Yg, *Yt, *y; #ifdef TREAL TYPE alpha = *alpha0; #else TYPE *alpha = alpha0; #endif Yg = getvec(npad, padval, N, incY); Yt = dupvec(npad, N, Yg, incY); y = Yg + (npad SHIFT); if (incY < 1) y -= ((N-1)SHIFT) * incY; good_set(N, alpha, y, incY); y = Yt + (npad SHIFT); if (incY < 1) y -= ((N-1)SHIFT) * incY; TEST_SET(N, alpha, Yt+(npad SHIFT), incY); iret = CheckY(npad, padval, N, Yg, incY, Yt, incY); free(Yg); free(Yt); return(iret); }
// Initialise the screen clear. With this class we clear the screen much faster than SPS2 would // usually. This puts all of the screen clear DMA data into our static DMA buffer. This means it is // only ever added once (very fast), and is then simply CALLed from the dynamic DMA buffer. // Notice that instead of just using one big sprite to clear the screen we use 20 long tall strips. // This is because the GS is optimised for polygons less than or equal to 32 pixels wide, and it // "chokes" on ones that are larger. void CSPS2Manager::InitScreenClear(int R, int G, int B) { int x0 = (2048 - (sps2UScreenGetWidth() >> 1)) << 4; int y0 = (2048 - (sps2UScreenGetHeight() >> 1)) << 4; //int x1 = (2048 + (sps2UScreenGetWidth() >> 1)) << 4; int y1 = (2048 + (sps2UScreenGetHeight() >> 1)) << 4; // Get the address of the screen clear packet so we can CALL it // from the dynamic packet. iScreenClear = VIFStaticDMA.GetPointer(); // Start the VIF direct mode. VIFStaticDMA.StartDirect(); VIFStaticDMA.Add128(GS_GIFTAG_BATCH(4 + (20 * 2), 1, 0, 0, GIF_FLG_PACKED, GS_BATCH_1(GIF_REG_A_D))); VIFStaticDMA.Add64(TEST_SET(0, 0, 0, 0, 0, 0, 1, 1)); VIFStaticDMA.Add64(TEST_1); VIFStaticDMA.Add64(PRIM_SET(0x6, 0, 0, 0, 0, 0, 0, 0, 0)); VIFStaticDMA.Add64(PRIM); VIFStaticDMA.Add64(RGBAQ_SET(R, G, B, 0x80, 0x3f800000)); VIFStaticDMA.Add64(RGBAQ); for(int i = 0; i < 20; i++) { VIFStaticDMA.Add64(XYZ2_SET(x0, y0, 0)); VIFStaticDMA.Add64(XYZ2); VIFStaticDMA.Add64(XYZ2_SET(x0 + (32 << 4), y1, 0)); VIFStaticDMA.Add64(XYZ2); x0 += (32 << 4); } VIFStaticDMA.Add64(TEST_SET(0, 0, 0, 0, 0, 0, 1, 3)); VIFStaticDMA.Add64(TEST_1); VIFStaticDMA.EndDirect(); VIFStaticDMA.DMARet(); }