smd.h 1.7 KB

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