/**
 * TrueReality - romimage_extern.h
 * Copyright (C) 1998 Niki W. Waibel
 *
 * This program is free software; you can redistribute it and/
 * or modify it under the terms of the GNU General Public Li-
 * cence as published by the Free Software Foundation; either
 * version 2 of the Licence, or any later version.
 *
 * This program is distributed in the hope that it will be use-
 * ful, but WITHOUT ANY WARRANTY; without even the implied war-
 * ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public Licence for more details.
 *
 * You should have received a copy of the GNU General Public
 * Licence along with this program; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
 * USA.
 *
 * Information about me (the author):
 *   Niki W. Waibel, Reichenau 20, 6890 Lustenau, Austria - EUROPE
 *   niki.waibel@gmx.net
**/





#define __ROMIMAGE_EXTERN_H



#ifndef __TYPE_SIZES_H
#       include "n64/type_sizes.h"
#endif


struct tr_rominfo
{       
        char  *real_name;
        
        HWORD validation;       /* 0x00 */
        BYTE  compression;      /* 0x02 */
        BYTE  unknown1;         /* 0x03 */
        WORD  clockrate;        /* 0x04 */
        WORD  programcounter;   /* 0x08 */
        WORD  release;          /* 0x0c */
        
        WORD  crc1;             /* 0x10 */
        WORD  crc2;             /* 0x14 */
        DWORD unknown2;         /* 0x18 */
        
        BYTE  name[20];         /* 0x20 - 0x33 */
        
        BYTE  unknown3;         /* 0x34 */
        BYTE  unknown4;         /* 0x35 */
        BYTE  unknown5;         /* 0x36 */
        BYTE  unknown6;         /* 0x37 */
        BYTE  unknown7;         /* 0x38 */
        BYTE  unknown8;         /* 0x39 */
        BYTE  unknown9;         /* 0x3a */
        BYTE  manufacturerid;   /* 0x3b */
        HWORD cartridgeid;      /* 0x3c */
        BYTE  countrycode;      /* 0x3e */
        BYTE  unknown10;        /* 0x3f */
};

extern struct tr_rominfo rominfo; 



struct tr_rom
{
        char    *image;                 /* pointer to rom image                 */
        long    length;                 /* length of rom image                  */

        char    *header;                /* pointer to header (same as 'image')  */
        char    *bootcode;              /* pointer to bootcode                  */
        WORD    *prgcode;               /* pointer to prgcode                   */

        WORD    prgcode_base_orig;      /* base of prgcode (from header)        */
        WORD    prgcode_base;           /* base of (prgcode & 0x1fffffff)       */
        long    prgcode_length;         /* length of prgcode                    */
};

extern  struct  tr_rom  rom;


