fig.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. fig.h - Super PRO Fighter support for uCON64
  3. Copyright (c) 1999 - 2002 NoisyB <noisyb@gmx.net>
  4. Copyright (c) 2001 - 2003 dbjh
  5. Copyright (c) 2003 JohnDie
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18. #ifndef FIG_H
  19. #define FIG_H
  20. extern const st_getopt2_t fig_usage[];
  21. #ifdef USE_PARALLEL
  22. #endif // USE_PARALLEL
  23. /*
  24. Super Pro Fighter (FIG) Header Format
  25. Last edited: 19.06.2002
  26. Offset | Content
  27. -------------+------------------------------------
  28. $0000 | Lo-Byte of 8K-Block#
  29. -------------+------------------------------------
  30. $0001 | Hi-Byte of 8K-Block#
  31. -------------+------------------------------------
  32. $0002 | $00 = Last File
  33. | $40 = More Files Present
  34. -------------+------------------------------------
  35. $0003 | $00 = LoROM
  36. | $80 = HiROM
  37. -------------+------------------------------------
  38. $0004-$0005 | $77 $83 = No SRAM (LoROM)
  39. | $00 $80 = 16 KBit (LoROM)
  40. | $00 $80 = 64 KBit (LoROM)
  41. | $00 $00 = 256 KBit (LoROM)
  42. | $47 $83 = No SRAM (LoROM) (DSP)
  43. | $11 $02 = 256 KBit (LoROM) (SFX)
  44. | $77 $83 = No SRAM (HiROM)
  45. | $DD $82 = 16 KBit (HiROM)
  46. | $DD $82 = 64 KBit (HiROM)
  47. | $DD $02 = 256 KBit (HiROM)
  48. | $F7 $83 = No SRAM (HiROM) (DSP)
  49. | $FD $82 = 16 KBit (HiROM) (DSP)
  50. -------------+------------------------------------
  51. $0006-$01FF | Reserved (=$00)
  52. NOTE 1: The Super Pro Fighter does not distinguish between 16 KBit SRAM
  53. and 64 KBit SRAM.
  54. NOTE 2: When splitting files, the SPF writes all relevant header fields
  55. to all files. So each file has the same header with exception of
  56. the last one, because it has $0002 set to $00 to indicate that it
  57. is the last file.
  58. */
  59. typedef struct st_fig_header
  60. {
  61. /*
  62. Don't create fields that are larger than one byte! For example size_low and size_high
  63. could be combined in one unsigned short int. However, this gives problems with little
  64. endian vs. big endian machines (e.g. writing the header to disk).
  65. */
  66. unsigned char size_low;
  67. unsigned char size_high;
  68. unsigned char multi;
  69. unsigned char hirom;
  70. unsigned char emulation1;
  71. unsigned char emulation2;
  72. unsigned char pad[506];
  73. } st_fig_header_t;
  74. #define FIG_HEADER_START 0
  75. #define FIG_HEADER_LEN (sizeof (st_fig_header_t))
  76. #ifdef USE_PARALLEL
  77. extern int fig_read_rom (const char *filename, unsigned int parport);
  78. extern int fig_write_rom (const char *filename, unsigned int parport);
  79. extern int fig_read_sram (const char *filename, unsigned int parport);
  80. extern int fig_write_sram (const char *filename, unsigned int parport);
  81. extern int fig_read_cart_sram (const char *filename, unsigned int parport);
  82. extern int fig_write_cart_sram (const char *filename, unsigned int parport);
  83. #endif
  84. #endif // FIG_H