home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.7z / ftp.whtech.com / emulators / v9t9 / linux / sources / V9t9 / source / roms.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-10-19  |  2.1 KB  |  80 lines

  1.  
  2. /*
  3.  
  4.  
  5. */
  6.  
  7. #include "centry.h"
  8.  
  9. int findbinary(char *path, char *syspath, char *filename, OSSpec *spec);
  10. int loadbinary(char *path, char *syspath, char *filename, char *type,
  11.                u8 * loadat, int swap, int offset, int imagesize,
  12.                int maxsize);
  13.  
  14. /*
  15.  *    Save data to an image found somewhere in 'path' or 'syspath'
  16.  *    (if not existing, placed in first entry of 'path').
  17.  *    Existing file is not overwritten.
  18.  *
  19.  *    path / syspath:    search paths
  20.  *    type:            string emitted in error, i.e., "RAM image"
  21.  *    filename:        name of image
  22.  *    fileoffs:        offset into file to write
  23.  *    saveat:            start of memory to write 
  24.  *    swap:            if true, byteswap word data to TI format
  25.  *    memsize:        size of memory to write
  26.  */
  27. int  
  28. savebinary(char *path, char *syspath, char *type,
  29.            char *filename, int fileoffs,
  30.            u8 * saveat, int swap, int memsize);
  31.  
  32. int    loaddsr(char *path, char *syspath, char *filename, char *name, void *mem);
  33. //int    loadspeech(char *path, char *syspath, char *filename, void *mem);
  34. /*
  35. int    loadconsolerom(char *path, char *filename);
  36. int loadconsolegrom(char *path, char *filename);
  37. int loadmodule(char *path, char *filename, int bank);
  38. */
  39.  
  40. /*    GRAM Kracker file segment types */
  41. enum
  42. {
  43.     GK_TYPE_PROGRAM = 0x00,
  44.     GK_TYPE_GROM_0    = 0x01,
  45.     GK_TYPE_GROM_1    = 0x02,
  46.     GK_TYPE_GROM_2    = 0x03,
  47.     GK_TYPE_GROM_3    = 0x04,
  48.     GK_TYPE_GROM_4    = 0x05,
  49.     GK_TYPE_GROM_5    = 0x06,
  50.     GK_TYPE_GROM_6    = 0x07,
  51.     GK_TYPE_GROM_7    = 0x08,
  52.     GK_TYPE_ROM_1    = 0x09,
  53.     GK_TYPE_ROM_2    = 0x0A
  54. };
  55.  
  56. typedef struct gram_kracker_header
  57. {
  58.     u8    more_to_load;                /* 0x00 means no */
  59.     u8    gk_type;                    /* GK_TYPE_xxx anove */
  60.     u16    length;                        /* translated to host-endian */
  61.     u16    address;                    /* translated to host-endian */
  62.     int absolute_image_file_offset;    /* offset in containing host file */
  63. }    gram_kracker_header;
  64.  
  65. /*
  66.  *    Search paths for a file matching 'filename'.
  67.  *    If found, and it is a valid GRAM-Kracker file,
  68.  *    set 'spec' to point to it, and return its header info in 'header'.
  69.  *
  70.  *    Returns non-zero file size for success.
  71.  *    
  72.  */
  73. int roms_find_gram_kracker(char *path, char *systempath, char *filename, 
  74.                            OSSpec *spec, gram_kracker_header *header);
  75.  
  76. #include "cexit.h"
  77.  
  78.  
  79.  
  80.