rom.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef __ROM_H__
  2. #define __ROM_H__
  3. /* Based on Daedalus header */
  4. #define N64HEADER_SIZE 0x40
  5. #define BYTES_IN_MBIT 0x20000
  6. #define SwapEndian(x) \
  7. ((x >> 24)&0x000000FF) \
  8. | ((x >> 8 )&0x0000FF00) \
  9. | ((x << 8 )&0x00FF0000) \
  10. | ((x << 24)&0xFF000000)
  11. typedef enum {
  12. UNKNOWN = 0,
  13. EEP4K = 1,
  14. EEP16K = 2,
  15. SRAM = 3,
  16. FLASHRAM = 4
  17. } savetype_t;
  18. typedef struct { /* From Daedalus */
  19. unsigned char x1; /* initial PI_BSB_DOM1_LAT_REG value */
  20. unsigned char x2; /* initial PI_BSB_DOM1_PGS_REG value */
  21. unsigned char x3; /* initial PI_BSB_DOM1_PWD_REG value */
  22. unsigned char x4; /* initial PI_BSB_DOM1_RLS_REG value */
  23. unsigned long int ClockRate;
  24. unsigned long int BootAddress;
  25. unsigned long int Release;
  26. unsigned long int CRC1;
  27. unsigned long int CRC2;
  28. unsigned long int Unknown0;
  29. unsigned long int Unknown1;
  30. char Name[20];
  31. unsigned long int Unknown2;
  32. unsigned short int Unknown3;
  33. unsigned char Unknown4;
  34. unsigned char Manufacturer;
  35. unsigned short int CartID;
  36. char CountryID;
  37. unsigned char Unknown5;
  38. } n64header_t;
  39. typedef enum {
  40. OS_TV_NTSC = 0,
  41. OS_TV_PAL,
  42. OS_TV_MPAL
  43. } tv_type_t;
  44. typedef struct
  45. {
  46. char nCountryID;
  47. char szName[15];
  48. unsigned long int nTvType;
  49. } CountryIDInfo_t;
  50. #endif