smd.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. smd.h - Super Magic Drive support for uCON64
  3. Copyright (c) 1999 - 2001 NoisyB
  4. Copyright (c) 2002 - 2003 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 SMD_H
  18. #define SMD_H
  19. #ifdef HAVE_CONFIG_H
  20. #include "config.h"
  21. #endif
  22. #include "misc/getopt2.h" // st_getopt2_t
  23. extern const st_getopt2_t smd_usage[];
  24. // For the header format, see ffe.h
  25. typedef struct st_smd_header
  26. {
  27. unsigned char size;
  28. unsigned char id0;
  29. unsigned char split;
  30. char pad[5];
  31. unsigned char id1;
  32. unsigned char id2;
  33. unsigned char type;
  34. char pad2[501];
  35. } st_smd_header_t;
  36. #ifdef USE_PARALLEL
  37. extern int smd_read_rom (const char *filename, unsigned short parport);
  38. extern int smd_write_rom (const char *filename, unsigned short parport);
  39. extern int smd_read_sram (const char *filename, unsigned short parport);
  40. extern int smd_write_sram (const char *filename, unsigned short parport);
  41. #endif
  42. // the following two functions are used by non-transfer code in genesis.c and sms.c
  43. extern void smd_interleave (unsigned char *buffer, int size);
  44. extern void smd_deinterleave (unsigned char *buffer, int size);
  45. #define SMD_HEADER_LEN (sizeof (st_smd_header_t))
  46. #endif