Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Ducati World DC GT20 Header file

Featured Replies

  • Author
  • Localization

domingo, posted Mon Feb 17, 2020 12:44 am (54068)


Hello, I have extracted an IDX and IMG file and all the extracted files carry this header GT20, so I see they are compressed files.
Is there a tool or script to decompress and compress the files again?

Example

  • Author
  • Localization

domingo, posted Wed Mar 25, 2020 9:55 pm (55091)


Would a script be possible, if only to decompress?
I have discovered that the game also reads unzipped files, testing on the pc version
  • Author
  • Localization

aluigi, posted Thu Mar 26, 2020 12:20 pm (55119)


If you know the correct compression algorithm... yes

I think this is the format of the file:
Code:
comtype ???
idstring "GT20"
get SIZE long
get DUMMY long  # 3
get OFFSET long
get ZSIZE asize
math ZSIZE - OFFSET
get NAME basename
clog NAME OFFSET ZSIZE SIZE
  • Author
  • Localization

domingo, posted Thu Mar 26, 2020 3:49 pm (55141)


Oh great, thank you so much Aluigi
  • Author
  • Localization

domingo, posted Fri Mar 27, 2020 11:24 am (55219)


Just today, I received these files from one of the game's programmers, perhaps with them it is possible to get a tool, or identify the algorithm

GTHDR.H file
Code:
/*******************************************************************\
*                                                   *
*   GT Compression header file.                              *
*                                                   *
\*******************************************************************/

#ifndef _GTCOMPRESSION_H
#define _GTCOMPRESSION_H

/*********\
* Defines *
\*********/

#define COMPSIGNATURE   0x30325447      // GT20
#define NOCOMPSIGNATURE 0x54474f4e      // NOGT


/************\
* Structures *
\************/

typedef struct
   {
   UINT32 GTSignature;         // Signature DWORD
   UINT32 GTOrgSize;         // Uncompressed size
   UINT32 GTOverlap;         // Overlap for in-situ decompression
   UINT32 GTSkip;            // Number of bytes to skip to GT data
   }
   GTHEADER,
   * PGTHEADER;


/*********************\
* Function prototypes *
\*********************/

extern void *ungtc(UINT8 *, UINT8 *);

#endif


UNGTDC.C file
Code:
/*******************************************************************\
*                                                   *
*   GT lossless compression system, multi platform C code.         *
*                                                   *
\*******************************************************************/

#ifdef _WINDOWS
#define STRICT
#define WIN32_LEAN_AND_MEAN
#include
#include
#include
#include
#endif

#include "\dev\common\atd.h"
#include "\dev\common\gthdr.h"


#ifdef _WINDOWS
#define READINFOBIT(v,p,c) {v=*((UINT32 *)p) ;c=32;}
#define GETSRCWORD(v,p) v=*((UINT16 *)p)
#else
#define READINFOBIT(v,p,c) {v=((*(p 3))<<24) ((*(p 2))<<16) ((*(p 1))<<8) *p;p =4;c=32;}
#define GETSRCWORD(v,p) v=*p ;v =((*p )<<8)
#endif

#define NEXTINFOBIT(v,p,c) v>>=1; if (!(--c)) READINFOBIT(v,p,c)



/*******************************************************************\
*                                                   *
*   GT32 decompressor written in C for porting speed and also for   *
*   decompression speed. Should still be faster than loading off   *
*   CD for most data.                                    *
*                                                   *
\*******************************************************************/

void *ungtc(UINT8 *GtPtr,UINT8 *DestPtr)
{
   register UINT32 InfoBits;
   register UINT16 InfoCnt;
   register UINT8 *CopySrc;
   register UINT16 CopyCnt;


   /*********************\
   * Advance Past Header *
   \*********************/

   GtPtr =((PGTHEADER)GtPtr)->GTSkip;
   GtPtr =sizeof(GTHEADER);


   /*******************\
   * Pre Read InfoBits *
   \*******************/

   READINFOBIT(InfoBits,GtPtr,InfoCnt);


   /*******************\
   * Process Forever ! *
   \*******************/

   while (1)
      {
      if (!(InfoBits & 1))
         {
         /*********\
         * Literal *
         \*********/

         *DestPtr =*GtPtr ;
         }
      else
         {
         /****************\
         * Encoded String *
         \****************/

         NEXTINFOBIT(InfoBits,GtPtr,InfoCnt);

         if (InfoBits & 1)
            {
            /***************\
            * Medium String *
            \***************/

            GETSRCWORD(CopyCnt,GtPtr);
            CopySrc=DestPtr ((CopyCnt>>3) | 0xffffe000);

            if (CopyCnt = CopyCnt & 7)
               {
               CopyCnt =2;
               }
            else
               {
               /***************\
               * Longer String *
               \***************/

               CopyCnt=*GtPtr ;

               if (CopyCnt & 128) CopySrc-=0x2000;

               CopyCnt &= 127;


               /*************************\
               * Check for Special Codes *
               \*************************/

               if(CopyCnt == 1) return(DestPtr);
               if(!CopyCnt)
                  {
                  GETSRCWORD(CopyCnt,GtPtr);
                  }
               else
                  {
                  CopyCnt =2;
                  }
               }
            while (CopyCnt--) *DestPtr =*CopySrc ;
            }
         else
            {
            /**********************************************\
            * Short String: 2-5 bytes long, up to 256 back *
            \**********************************************/

            CopySrc=DestPtr (0xffffff00 | *GtPtr );

            *DestPtr =*CopySrc ;
            *DestPtr =*CopySrc ;

            NEXTINFOBIT(InfoBits,GtPtr,InfoCnt);


            /***********************************\
            * InfoCnt MUST Be 1 Or Greater Here *
            \***********************************/

            if(InfoBits & 1)
               {
               *DestPtr =*CopySrc ;
               *DestPtr =*CopySrc ;
               }

            NEXTINFOBIT(InfoBits,GtPtr,InfoCnt);

            if(InfoBits & 1)
               {
               *DestPtr =*CopySrc ;
               }
            }
         }
      NEXTINFOBIT(InfoBits,GtPtr,InfoCnt);
      }
}



In addition to this game, there are others that use this same compression system, such as Rollcage and Syberia2, I think I remember.
  • Author
  • Localization

domingo, posted Fri Mar 27, 2020 12:05 pm (55227)


Brilliant!!! Works!!! Great job!!! :lol:
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.