ffe.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. ffe.h - General Front Far East copier routines for uCON64
  3. Copyright (c) 2002 - 2004 dbjh
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. #ifndef FFE_H
  17. #define FFE_H
  18. /*
  19. 0 - Low byte of 8 kB page count
  20. SMD: 16 kB page count
  21. 1 - High byte of 8 kB page count
  22. SMD: File ID code 0 (3, not: high byte of 16 kB page count)
  23. Magic Griffin: Emulation mode select, first byte?
  24. 2 - Emulation mode select (SWC/SMC/Magic Griffin, second byte?)
  25. Bit 7 6 5 4 3 2 1 0
  26. x : 1 = Run in mode 0 (JMP $8000) (higher precedence than bit 1)
  27. x : 0 = Last file of the ROM dump (multi-file)
  28. : 1 = Multi-file (there is another file to follow)
  29. x : SWC & SMC:
  30. 0 = SRAM mapping mode 1 (LoROM)
  31. 1 = mode 2 (HiROM)
  32. x : SWC & SMC:
  33. 0 = DRAM mapping mode 20 (LoROM)
  34. 1 = mode 21 (HiROM)
  35. x x : SWC & SMC (SRAM size):
  36. 00 = 256 kb, 01 = 64 kb, 10 = 16 kb, 11 = no SRAM
  37. x : SWC & SMC:
  38. 0 = Run in mode 3
  39. 1 = Run in mode 2 (JMP RESET)
  40. x : 0 = Disable, 1 = Enable external cartridge memory
  41. image at bank 20-5F,A0-DF in system mode 2/3)
  42. 3-7 - 0, reserved
  43. 8 - File ID code 1 (0xaa)
  44. 9 - File ID code 2 (0xbb)
  45. 10 - File type; check this byte only if ID 1 & 2 match
  46. 1 : Super Magic Card saver data
  47. 2 : Magic Griffin program (PC-Engine)
  48. 3 : Magic Griffin SRAM data
  49. 4 : SNES program
  50. 5 : SWC & SMC password, SRAM data
  51. 6 : Mega Drive program
  52. 7 : SMD SRAM data
  53. 8 : SWC & SMC saver data
  54. 11-511 - 0, reserved
  55. */
  56. #ifdef USE_PARALLEL
  57. extern void ffe_init_io (unsigned int port);
  58. extern void ffe_deinit_io (void);
  59. extern void ffe_send_block (unsigned short address, unsigned char *buffer, int len);
  60. extern void ffe_send_block2 (unsigned short address, unsigned char *buffer, int len);
  61. extern void ffe_send_command0 (unsigned short address, unsigned char byte);
  62. extern unsigned char ffe_send_command1 (unsigned short address);
  63. extern void ffe_send_command (unsigned char command_code, unsigned short a, unsigned short l);
  64. extern void ffe_receive_block (unsigned short address, unsigned char *buffer, int len);
  65. extern void ffe_receive_block2 (unsigned short address, unsigned char *buffer, int len);
  66. extern unsigned char ffe_receiveb (void);
  67. extern void ffe_wait_for_ready (void);
  68. extern void ffe_checkabort (int status);
  69. #endif // USE_PARALLEL
  70. #endif // FFE_H