swc.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. swc.h - Super Wild Card support for uCON64
  3. Copyright (c) 1999 - 2001 NoisyB <noisyb@gmx.net>
  4. Copyright (c) 2001 - 2004 dbjh
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. */
  17. #ifndef SWC_H
  18. #define SWC_H
  19. #define SWC_IO_FORCE_32MBIT 0x001
  20. #define SWC_IO_ALT_ROM_SIZE 0x002
  21. #define SWC_IO_SUPER_FX 0x004
  22. #define SWC_IO_SDD1 0x008
  23. #define SWC_IO_SA1 0x010
  24. #define SWC_IO_SPC7110 0x020
  25. #define SWC_IO_DX2_TRICK 0x040
  26. #define SWC_IO_MMX2 0x080
  27. #define SWC_IO_DUMP_BIOS 0x100
  28. #define SWC_IO_MAX 0x1ff // highest valid dumping mode value
  29. extern const st_getopt2_t swc_usage[];
  30. // For the header format, see ffe.h
  31. typedef struct st_swc_header
  32. {
  33. /*
  34. Don't create fields that are larger than one byte! For example size_low and size_high
  35. could be combined in one unsigned short int. However, this gives problems with little
  36. endian vs. big endian machines (e.g. writing the header to disk).
  37. */
  38. unsigned char size_low;
  39. unsigned char size_high;
  40. unsigned char emulation;
  41. unsigned char pad[5];
  42. unsigned char id1;
  43. unsigned char id2;
  44. unsigned char type;
  45. unsigned char pad2[501];
  46. } st_swc_header_t;
  47. #define SWC_HEADER_START 0
  48. #define SWC_HEADER_LEN (sizeof (st_swc_header_t))
  49. #ifdef USE_PARALLEL
  50. extern int swc_read_rom (const char *filename, unsigned int parport, int io_mode);
  51. extern int swc_write_rom (const char *filename, unsigned int parport, int enableRTS);
  52. extern int swc_read_sram (const char *filename, unsigned int parport);
  53. extern int swc_write_sram (const char *filename, unsigned int parport);
  54. extern int swc_read_rts (const char *filename, unsigned int parport);
  55. extern int swc_write_rts (const char *filename, unsigned int parport);
  56. extern int swc_read_cart_sram (const char *filename, unsigned int parport, int io_mode);
  57. extern int swc_write_cart_sram (const char *filename, unsigned int parport, int io_mode);
  58. extern void swc_unlock (unsigned int parport);
  59. #endif
  60. #endif // SWC_H