51 static int s_firsttime = 1;
55 printf (
"Extended MMX detected. Using the fastest method !\n");
59 printf (
"MMX detected. Using fast method !\n");
62 printf (
"Too bad ! No MMX detected.\n");
71 static int firsttime = 1;
73 printf (
"No MMX support compiled in\n");
88 extern const void ppc_zoom (
unsigned int *frompixmap,
unsigned int *topixmap,
89 unsigned int sizex,
unsigned int sizey,
143 static inline int ShiftRight(
int x,
int s) {
return (x<0) ? -((-x)>>s) : (x>>s); }
159 static int s_firstime = 1;
164 for (
int coefh = 0; coefh < 16; coefh++) {
166 for (
int coefv = 0; coefv < 16; coefv++) {
173 if (!(coefh || coefv))
176 int i1 = diffcoeffh * diffcoeffv;
177 int i2 = coefh * diffcoeffv;
178 int i3 = diffcoeffh * coefv;
179 int i4 = coefh * coefv;
189 i = (i1) | (i2 << 8) | (i3 << 16) | (i4 << 24);
206 static int s_wave = 0;
207 static int s_wavesp = 0;
209 int yy = y + (
RAND () % 4) - (
RAND () % 4) + (s_wave / 10);
210 yy = std::max(yy, 0);
214 *px = (x << 4) +
firedec[yy] + (s_wave / 10);
218 s_wavesp +=
RAND () % 3 -
RAND () % 3;
223 s_wave += (s_wavesp / 10) +
RAND () % 3 -
RAND () % 3;
225 s_wavesp = (s_wavesp * 9) / 10;
262 dist = vx9 * vx9 + vy9 * vy9;
300 fvitesse = std::max(fvitesse, -3024);
305 ppx = -(-(vx * fvitesse) >> 16);
309 ppx = ((vx * fvitesse) >> 16);
313 ppy = -(-(vy * fvitesse) >> 16);
315 ppy = ((vy * fvitesse) >> 16);
330 fprintf (
stderr,
"setPixel ERROR : hors du tableau... %i, %i\n", x, y);
335 buffer[(y *
resolx) + x] =
345 printf (
"setPixel ERROR : hors du tableau... %i\n", x);
360 printf (
"getPixel ERROR : hors du tableau... %i, %i\n", x, y);
366 unsigned int i = *(buffer + (x + y *
resolx));
367 c->
b = (i >> (
BLEU * 8)) & 0xff;
368 c->
v = (i >> (
VERT * 8)) & 0xff;
369 c->
r = (i >> (
ROUGE * 8)) & 0xff;
376 unsigned char *tmp8 =
nullptr;
380 printf (
"getPixel ERROR : hors du tableau... %i\n", x);
385 #ifdef __BIG_ENDIAN__
386 c->
b = *(
unsigned char *) (tmp8 = (
unsigned char *) (buffer + x));
387 c->
r = *(
unsigned char *) (++tmp8);
388 c->
v = *(
unsigned char *) (++tmp8);
389 c->
b = *(
unsigned char *) (++tmp8);
393 c->
b = *(tmp8 = (
unsigned char *) (buffer + x));
401 void c_zoom (
unsigned int *lexpix1,
unsigned int *lexpix2,
402 unsigned int lprevX,
unsigned int lprevY,
403 const signed int *lbrutS,
const signed int *lbrutD)
408 unsigned int ax = (lprevX - 1) <<
PERTEDEC;
409 unsigned int ay = (lprevY - 1) <<
PERTEDEC;
411 int bufsize = lprevX * lprevY * 2;
412 int bufwidth = lprevX;
414 lexpix1[0]=lexpix1[lprevX-1]=lexpix1[(lprevX*lprevY)-1]=lexpix1[(lprevX*lprevY)-lprevX]=0;
416 for (
int myPos = 0; myPos < bufsize; myPos += 2) {
421 int brutSmypos = lbrutS[myPos];
423 int myPos2 = myPos + 1;
426 brutSmypos = lbrutS[myPos2];
429 px = std::max(px, 0);
430 py = std::max(py, 0);
436 if ((py >= (
int)ay) || (px >= (
int)ax)) {
446 int c2 = (c1 & 0x0000ff00) >> 8;
447 int c3 = (c1 & 0x00ff0000) >> 16;
448 int c4 = (c1 & 0xff000000) >> 24;
451 couleur.r = col1.r * c1 + col2.r * c2 + col3.r * c3 + col4.r * c4;
456 couleur.v = col1.v * c1 + col2.v * c2 + col3.v * c3 + col4.v * c4;
461 couleur.b = col1.b * c1 + col2.b * c2 + col3.b * c3 + col4.b * c4;
492 [[maybe_unused]]
static unsigned char s_pertedec = 8;
493 static char s_firstTime = 1;
495 static constexpr int8_t INTERLACE_INCR { 16 };
498 static int s_interlaceStart = -2;
526 if (s_interlaceStart != -2)
531 static bool s_reverse =
false;
548 if (s_firstTime || zf) {
556 freebrutS = (
signed int *) calloc ((resx * resy * 2) + 128,
sizeof(
signed int));
557 brutS = (
signed int *) ((1 + ((uintptr_t) (
freebrutS)) / 128) * 128);
559 freebrutD = (
signed int *) calloc ((resx * resy * 2) + 128,
sizeof(
signed int));
560 brutD = (
signed int *) ((1 + ((uintptr_t) (
freebrutD)) / 128) * 128);
562 freebrutT = (
signed int *) calloc ((resx * resy * 2) + 128,
sizeof(
signed int));
563 brutT = (
signed int *) ((1 + ((uintptr_t) (
freebrutT)) / 128) * 128);
570 for (
Uint y = 0; y < resy; y++, yofs += resx) {
571 int xofs = yofs << 1;
574 for (
Uint x = 0; x < resx; x++) {
575 brutS[xofs++] = xperte;
576 brutS[xofs++] = yperte;
584 for (
uint16_t us = 0; us < 0xffff; us++) {
586 roundf(1024 * sinf ((
float) us * 360
594 for (
int loopv =
prevY; loopv != 0;) {
595 static int s_decc = 0;
596 static int s_spdc = 0;
597 static int s_accel = 0;
601 s_decc += s_spdc / 10;
603 s_spdc +=
RAND () % 3 -
RAND () % 3;
611 s_spdc = s_spdc -
RAND () % 3 + s_accel / 10;
613 s_spdc = s_spdc +
RAND () % 3 + s_accel / 10;
615 if (s_decc > 8 && s_spdc > 1)
616 s_spdc -=
RAND () % 3 - 2;
618 if (s_decc < -8 && s_spdc < -1)
619 s_spdc +=
RAND () % 3 + 2;
621 if (s_decc > 8 || s_decc < -8)
622 s_decc = s_decc * 8 / 9;
625 s_accel +=
RAND () % 2 -
RAND () % 2;
634 s_interlaceStart = 0;
637 if (s_interlaceStart==-1) {
642 for (
Uint x = 0; x < y; x += 2) {
643 int brutSmypos =
brutS[x];
661 s_interlaceStart = -2;
664 if (s_interlaceStart>=0) {
665 int maxEnd = (s_interlaceStart+INTERLACE_INCR);
676 brutT[premul_y_prevX] = px;
677 brutT[premul_y_prevX + 1] = py;
681 s_interlaceStart += INTERLACE_INCR;
682 if (y >=
prevY-1) s_interlaceStart = -1;
685 if (switchIncr != 0) {
690 if (switchMult != 1.0F) {
726 if ((x > 1) && (y > 1) && (x <
resolx - 2) && (y <
c_resoly - 2)) {