swc.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. swc.h - Super Wild Card support for uCON64
  3. Copyright (c) 1999 - 2001 NoisyB
  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. #ifdef HAVE_CONFIG_H
  20. #include "config.h"
  21. #endif
  22. #include "misc/getopt2.h" // st_getopt2_t
  23. #define SWC_IO_FORCE_32MBIT 0x001
  24. #define SWC_IO_ALT_ROM_SIZE 0x002
  25. #define SWC_IO_SUPER_FX 0x004
  26. #define SWC_IO_SDD1 0x008
  27. #define SWC_IO_SA1 0x010
  28. #define SWC_IO_SPC7110 0x020
  29. #define SWC_IO_DX2_TRICK 0x040
  30. #define SWC_IO_MMX2 0x080
  31. #define SWC_IO_DUMP_BIOS 0x100
  32. #define SWC_IO_MAX 0x1ff // highest valid dumping mode value
  33. extern const st_getopt2_t swc_usage[];
  34. // For the header format, see ffe.h
  35. typedef struct st_swc_header
  36. {
  37. /*
  38. Don't create fields that are larger than one byte! For example size_low and size_high
  39. could be combined in one unsigned short int. However, this gives problems with little
  40. endian vs. big endian machines (e.g. writing the header to disk).
  41. */
  42. unsigned char size_low;
  43. unsigned char size_high;
  44. unsigned char emulation;
  45. unsigned char pad[5];
  46. unsigned char id1;
  47. unsigned char id2;
  48. unsigned char type;
  49. unsigned char pad2[501];
  50. } st_swc_header_t;
  51. #define SWC_HEADER_START 0
  52. #define SWC_HEADER_LEN (sizeof (st_swc_header_t))
  53. #ifdef USE_PARALLEL
  54. extern int swc_read_rom (const char *filename, unsigned short parport,
  55. int io_mode);
  56. extern int swc_write_rom (const char *filename, unsigned short parport,
  57. unsigned short enableRTS);
  58. extern int swc_read_sram (const char *filename, unsigned short parport);
  59. extern int swc_write_sram (const char *filename, unsigned short parport);
  60. extern int swc_read_rts (const char *filename, unsigned short parport);
  61. extern int swc_write_rts (const char *filename, unsigned short parport);
  62. extern int swc_read_cart_sram (const char *filename, unsigned short parport,
  63. int io_mode);
  64. extern int swc_write_cart_sram (const char *filename, unsigned short parport,
  65. int io_mode);
  66. extern void swc_unlock (unsigned short parport);
  67. #endif
  68. #endif