fig.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. fig.h - Super PRO Fighter support for uCON64
  3. Copyright (c) 1999 - 2002 NoisyB
  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. #ifdef HAVE_CONFIG_H
  21. #include "config.h"
  22. #endif
  23. #include "misc/getopt2.h" // st_getopt2_t
  24. extern const st_getopt2_t fig_usage[];
  25. /*
  26. Super Pro Fighter (FIG) Header Format
  27. Last edited: 19.06.2002
  28. Offset | Content
  29. -------------+------------------------------------
  30. $0000 | Lo-Byte of 8K-Block#
  31. -------------+------------------------------------
  32. $0001 | Hi-Byte of 8K-Block#
  33. -------------+------------------------------------
  34. $0002 | $00 = Last File
  35. | $40 = More Files Present
  36. -------------+------------------------------------
  37. $0003 | $00 = LoROM
  38. | $80 = HiROM
  39. -------------+------------------------------------
  40. $0004-$0005 | $77 $83 = No SRAM (LoROM)
  41. | $00 $80 = 16 KBit (LoROM)
  42. | $00 $80 = 64 KBit (LoROM)
  43. | $00 $00 = 256 KBit (LoROM)
  44. | $47 $83 = No SRAM (LoROM) (DSP)
  45. | $11 $02 = 256 KBit (LoROM) (SFX)
  46. | $77 $83 = No SRAM (HiROM)
  47. | $DD $82 = 16 KBit (HiROM)
  48. | $DD $82 = 64 KBit (HiROM)
  49. | $DD $02 = 256 KBit (HiROM)
  50. | $F7 $83 = No SRAM (HiROM) (DSP)
  51. | $FD $82 = 16 KBit (HiROM) (DSP)
  52. -------------+------------------------------------
  53. $0006-$01FF | Reserved (=$00)
  54. NOTE 1: The Super Pro Fighter does not distinguish between 16 KBit SRAM
  55. and 64 KBit SRAM.
  56. NOTE 2: When splitting files, the SPF writes all relevant header fields
  57. to all files. So each file has the same header with exception of
  58. the last one, because it has $0002 set to $00 to indicate that it
  59. is the last file.
  60. */
  61. typedef struct st_fig_header
  62. {
  63. /*
  64. Don't create fields that are larger than one byte! For example size_low and size_high
  65. could be combined in one unsigned short int. However, this gives problems with little
  66. endian vs. big endian machines (e.g. writing the header to disk).
  67. */
  68. unsigned char size_low;
  69. unsigned char size_high;
  70. unsigned char multi;
  71. unsigned char hirom;
  72. unsigned char emulation1;
  73. unsigned char emulation2;
  74. unsigned char pad[506];
  75. } st_fig_header_t;
  76. #define FIG_HEADER_START 0
  77. #define FIG_HEADER_LEN (sizeof (st_fig_header_t))
  78. #ifdef USE_PARALLEL
  79. extern int fig_read_rom (const char *filename, unsigned short parport);
  80. extern int fig_write_rom (const char *filename, unsigned short parport);
  81. extern int fig_read_sram (const char *filename, unsigned short parport);
  82. extern int fig_write_sram (const char *filename, unsigned short parport);
  83. extern int fig_read_cart_sram (const char *filename, unsigned short parport);
  84. extern int fig_write_cart_sram (const char *filename, unsigned short parport);
  85. #endif
  86. #endif