6. File Format Output by the Converter
.tvd files
  • Overall composition
  • tv_file_header structure
  • texture_info_image structure
  • Palette data
  • Pixel data
  • .bin files

    .tvd files
    Files of this format are output by trans.exe

    Overall composition
    tv_file_header structure
    texture_info_image structure
    Palette data
    Pixel data


    Overall composition
  • Address
    Palettes used
    Palettes not used
    0x00000000 tv_file_header
    0x00000010 texture_info_image
    0x00000100 Palette data Pixel data
    0x00000n00(*1) Pixel data

    (*1) The next 0x200 bytes are used per palette when palettes are used. Thus, n = 2*(tv_file_header.num_of_palette) + 1 However, if the palette is made from 16 colors, then num_of_palette is divided by 16 and the result (rounded up) is used in this equation.

  • tv_file_header structure
  • Type Variable name Description
    char recognize[8] Recognition code "TexTvIEw"
    u16 num_of_texture Number of textures
    u16 num_of_palette Number of palettes
    u32 size_of_pixel_data The volume (in bytes) per texture

    typedef struct {
        char recognize[8];         /* Recognition code TexTvIEw */
        u32  num_of_texture;       /* Number of textures */
        u32  size_of_pixel_data;   /* Pixel size */
    } tv_file_header;
    	

  • texture_info_image structure
  • This structure was made based on the S2DEX structure. It contains some unused members.
    Type Variable name Description
    u16 imageX Not used.
    u16 imageW The width of the image.
    s16 frameX The upper-left position of the image. Effected by the center position of the image when the image is rotated with the Control Stick.
    u16 frameW Not used. However, for images that fit in TMEM, if this value is larger than imageW, then the same image will look like it has been WRAP-processed. This can be used to see bricks, checkers, etc.
    u16 imageY Not used.
    u16 imageH The height of the image.
    s16 frameY The upper-right position of the image. Effected by the center position of the image when the image is rotated with the Control Stick.
    u16 frameH Not used. However, for images that fit in TMEM, if this value is larger than imageH, then the same image will look like it has been WRAP-processed. This can be used to see checkered, polka dot and other patterns.
    u32 loadmode The way to load textures. Presently, you should always specify 2 (use load tiles).
    u32 cms Always 2 (Clamp mode, G_TX_CLAMP). Automatically WRAP when the value of frameW is larger than imageW.
    u32 cmt Always 2 (Clamp mode, G_TX_CLAMP). Automatically WRAP when the value of frameH is larger than imageH.
    u32 tlutMode The palette mode. Either G_TT_NONE, G_TT_RGBA16, or G_TT_IA16
    u16 imagePal[8] The texture palette number. Presently, you should specify 0 for all texture palette numbers.
    u8 imageFmt The texture format. The value of G_IM_FMT_* is entered.
    u8 imageSiz The texture size. The value of G_IM_SIZ_*b is entered.
    u8 mipmapNum The number of MIP maps. If all of the load blocks which comprise the texture data are loaded into TMEM, then MIP maps can be used. N64 can support up to RGBA32 but it does not support WIN applications.
    u8 bg_flag Background attribute. When this variable is "1" then the texture is processed as background.
    typedef	struct
    {
        u16 imageX;         /*  X coordinate of the read texture */
        u16 imageW;         /*  Width of the read texture        */
        s16 frameX;         /*  Upper left X coordinate of the   */
                            /*  transferred frame                */
        u16 frameW;         /*  Width of the transferred frame   */
        u16 imageY;         /*  Y coordinate of the read texture */
        u16 imageH;         /*  Height of the read texture       */
        s16 frameY;         /*  Upper left Y coordinate of the   */
                            /*  transferred frame                */
        u16 frameH;         /*  Height of the transferred frame  */
    
        u32 loadmode;       /*  Load mode  MESH_LOADMODE_*       */
        u32 cms;            /*  Horizontal clamp mode            */
        u32 cmt;            /*  Vertical clamp mode              */
    
        u32 tlutMode;       /*  Palette mode  G_TT_*             */
        u16 imagePal[8];    /*  Palette number                   */
    
        u8  imageFmt;       /*  Format     G_IM_FMT_*            */
        u8  imageSiz;       /*  Bit depth  G_IM_SIZ_*b           */
        u8  mipmapNum;      /*  Number of MIP maps               */
        u8  bg_flag;        /*  Background attribute flag        */
        u8  boundary[4];    /*  Adjust to 64 bit boundary        */
    } texture_info_image;
    	
  • Palette data
  • u16 palette[256];

  • The palette data is entered in order.
    There are (tv_file_header.num_of_palette) units of palette data.
    However, if the palette is made from 16 colors, then num_of_palette is
    divided by 16 and the result (rounded up) is used here.
  • Pixel data
  • char name[12];
    u16 PaletteBlock;
    u16 PaletteNumber;
    u32 pixel[(tv_file_header.size_of_pixel_data+7)/8];

  • "name" contains the name of the texture
    One block is 256 colors. The value entered in PaletteBlock describes which block's palettes to use.
    PaletteNumber is only valid for images with a 16 color palette. The value entered in PaletteNumber specifies which palette to use within the block selected with PaletteBlock
    For PaletteBlock, enter a value from 0 ~ (the number of blocks used-1). For PaletteNumber enter a value from 0~15.
    A pixel is stored as a 1 byte boundary per line (non-4bit textures can be ignored)
    for an overall 8 byte boundary.
    This makes for a combined (tv_file_header.num_of_texture) number of textures.




  • .bin files
    This file represents a number of .tvd files integrated together
    and converted into a format executable by texv.n64
    It is output by texview.exe
  • Address
    Description
    0x00000000
    char code[8]
    Recognition code "TexVHeaD"
    0x0000000c
    u32 num_of_tvd
    The number of integrated .tvd files
    0x00000010
    u32 rom_read_address[num_of_tvd]
    The .tvd file address
    0x00001000
    .tvd file contents (num_of_tvd units)
  • "code" is for data recognition.
    "num_of_tvd" is the number of integrated .tvd files. It includes background.
    "rom_read_address[]" is the address from where to read in ROM.
    The adress is entered on the assumption that data will be nloaded into 0x400000
    The .tvd file contents are entered as-is. It is aligned to byte 0x1000.




  • Copyright 1997-1999 NINTENDO Co.,Ltd./1998-1999 MONEGI CORPORATION All rights reserved.