TM2 TIM2

From XentaxWiki
Jump to: navigation, search

Contents: GRAFs page - All - 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - Edit

Format Type: Archive
Extensions: tm2 tim2 tim
Platforms: unknown
Endian Order: Little Endian



Format Specifications

// Specs based off "Rainbow" from https://github.com/marco-calautti/Rainbow/

// IMAGE HEADER
  4 - Header (TIM2)
  2 - Version
  2 - Number of Images
  
// IMAGE DATA
  // for each Image
    4 - Total Image Length
    4 - Palette Length
    4 - Image Data Length
    2 - Header Length
    2 - Color Entries
    1 - Image Format (0=8bpp paletted?)
    1 - Mipmap Count
    1 - CLUT Format
    1 - Bits Per Pixel (1=16bbp, 2=24bpp, 3=32bbp, 4=4bbp, 5=8bpp)
    2 - Image Width
    2 - Image Height
    8 - GsTEX0
    8 - GsTEX1
    4 - GsRegs
    4 - GsTexClut
    X - User Data (optional) (length = HeaderLength-48)
    
    parameters.linearPalette = (clutFormat & 0x80) != 0;
    clutFormat &= 0x7F;
    parameters.colorSize = parameters.bpp > 8 ? parameters.bpp / 8 : (clutFormat & 0x07) + 1;
            
    X - Image Data (length = ImageDataLength){
      if (bitsPerPixel <= 8){
        // indexed colors
        }
      else {
        if (colorSize == 2){
          // 16BITLE_ABGR_5551 Format
          }
        else if (colorSize == 3){
          // 24BIT_RGB Format
          }
        else if (colorSize == 4){
          // 32BIT_RGBA Format
          }
        }
      }
    
    X - Palette Data (length = PaletteLength) (only if Bits Per Pixel <= 8?){
      int numberOfPalettes = paletteData.Length / ((int)colorEntries * parameters.colorSize);
      int singlePaletteSize = paletteData.Length / numberOfPalettes;
      
      // for each palette
        if (colorSize == 2){
          // 16BITLE_ABGR_5551 Format
          numColors = singlePaletteSize/2;
          }
        else if (colorSize == 3){
          // 24BIT_RGB Format
          numColors = singlePaletteSize/3;
          }
        else if (colorSize == 4){
          // 32BIT_RGBA Format
          numColors = singlePaletteSize/4;
          }
          
      if (!linearPalette && bitsPerPixel != 8){
        // read the palette then apply the following...
        int parts = thisPaletteLength / 32;
        int stripes=2;
        int colors = 8;
        int blocks = 2;

        int i = 0;
        for (int part = 0; part < parts; part++){
          for (int block = 0; block < blocks; block++){
            for (int stripe = 0; stripe < stripes; stripe++){
              for (int color = 0; color < colors; color++){
                newPalette[i++] = oldPalette[ part * colors * stripes * blocks + block * colors + stripe * stripes * colors + color ];
                }
              }
            }
          }
        }
      else {
        // color palette is OK as is
        }
        
      }



MultiEx BMS Script

No BMS script

Supported Programs



Notes

No additional notes

Games

  • LMA Manager 2007
  • PlayStation 2 (PS2)
  • PlayStation Portable (PSP)
  • Rule of Rose [PS2]



Navigation

Jump to a listing by...
All Formats - Common Formats - Standard Formats - Malformed Pages
Platforms
Microsoft:
Xbox
Xbox 360
Nintendo:
GameCube
DS
Desktop:
PC
Sega:
Dreamcast
Sony:
PlayStation
PlayStation 2
PlayStation 3
PlayStation Portable
Type
Animation - Archive - Audio - Image - Mesh - Miscellaneous - Model - Video
Endianness
Little-endian - Big-endian
BMS Scripts
Pages Without a BMS Script

All Pages with Scripts:
Recently Added Scripts

Program Support
No Known Support

MultiEx Commander - Game Extractor

Format Specification Completion
Work in Progress - Almost Done - Completed
Compression and Encryption
No Compression or Encryption Used - Unknown Compression or Encryption Used

One or Both Used:
Compression Used - Both Compression and Encryption Used