[Scummvm-tracker] [ScummVM :: Bugs] #12820: TWINE: polygon rendering for the holomap trajectory vehicle rendering is broken

ScummVM :: Bugs trac at scummvm.org
Thu Aug 19 17:16:04 UTC 2021


#12820: TWINE: polygon rendering for the holomap trajectory vehicle rendering is
broken
----------------------+-----------------------------------
Reporter:  mgerhardy  |       Owner:  (none)
    Type:  defect     |      Status:  new
Priority:  normal     |   Component:  Engine: TwinE
 Version:             |  Resolution:
Keywords:             |        Game:  Little Big Adventure
----------------------+-----------------------------------
Comment (by mgerhardy):

 This is the ida disassembly result - but atm this is not rendering
 anything...

 void Renderer::renderPolygonsBopper(int vtop, int32 vsize, uint8 color)
 const {
         const int screenWidth = _engine->width();
         const int screenHeight = _engine->height();

         uint8 *v2 = (uint8 *)_engine->_frontVideoBuffer.getBasePtr(0,
 vtop);
         //v2 = screenLockupTable[(uint16)vtop] + frontVideoBuffer;
         int8 *v3 = (int8 *)&_polyTab[(uint16)vtop];
         int v5 = vsize; //(uint16)vbottom - (uint16)vtop + 1;

         int16 v14 = 0; // bx at 9
         LOBYTE(v14) = color;

         int j = 0; // ecx at 9
         HIWORD(j) = 0;

         do {
                 uint16 v16 = *(uint16 *)(v3 + screenHeight * 2);
                 int v7 = *(uint16 *)v3;
                 v3 += 2;

                 uint8 v34 = v16 < (uint16)v7;
                 if (!v34) {
                         LOWORD(j) = j + 1;
                         void *v18 = (void *)(v7 + v2);
                         HIBYTE(v14) = v14;
                         LOWORD(v7) = v14;
                         v7 <<= 16;
                         LOWORD(v7) = v14;
                         if ((intptr_t)v18 & 1) {
                                 *(uint8 *)v18 = v14;
                                 v18 = (char *)v18 + 1;
                                 --j;
                         }
                         char v19 = j;
                         unsigned int v20 = (unsigned int)j / sizeof(int);
                         memset32(v18, v7, v20);
                         uint8 *v21 = ((uint8 *)v18 + sizeof(int) * v20);
                         for (j = v19 & 2; j; --j)
                                 *(uint8 *)v21++ = v7;
                         LOBYTE(v14) = v14 + 1;
                         if (!(v14 & 0xF)) {
                                 while (1) {
                                         LOBYTE(v14) = v14 - 1;
                                         if (!(v14 & 0xF))
                                                 break;
                                         v2 += screenWidth;
                                         --v5;
                                         if (!v5)
                                                 return /*v7*/;
                                         uint16 v22 = *(uint16 *)(v3 +
 screenHeight * 2);
                                         v7 = *(uint16 *)v3;
                                         v3 += 2;
                                         v34 = v22 < (uint16)v7;
                                         if (!v34) {
                                                 LOWORD(j) = j + 1;
                                                 void *v24 = (void *)(v7 +
 v2);
                                                 HIBYTE(v14) = v14;
                                                 LOWORD(v7) = v14;
                                                 v7 <<= 16;
                                                 LOWORD(v7) = v14;
                                                 if ((intptr_t)v24 & 1) {
                                                         *(uint8 *)v24 =
 v14;
                                                         v24 = (char *)v24
 + 1;
                                                         --j;
                                                 }
                                                 char v25 = j;
                                                 unsigned int v26 =
 (unsigned int)j / sizeof(int);
                                                 memset32(v24, v7, v26);
                                                 uint8 *v27 = ((uint8 *)v24
 + sizeof(int) * v26);
                                                 for (j = v25 & 2; j; --j)
                                                         *(uint8 *)v27++ =
 v7;
                                         }
                                 }
                         }
                 }
                 v2 += screenWidth;
                 --v5;
         } while (v5);
 }
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/12820#comment:3>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list