ffe.h 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. ffe.h - General Front Far East copier routines for uCON64
  3. Copyright (c) 2002 - 2005 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. #ifdef HAVE_CONFIG_H
  19. #include "config.h"
  20. #endif
  21. /*
  22. 0 - Low byte of 8 kB page count
  23. SMD: 16 kB page count
  24. 1 - High byte of 8 kB page count
  25. SMD: File ID code 0 (3 for Genesis/Mega Drive games, 1 for
  26. SMS/Game Gear games, not: high byte of 16 kB page count)
  27. Magic Griffin: Emulation mode select, first byte?
  28. 2 - Emulation mode select (SWC/SMC/Magic Griffin, second byte?)
  29. Bit 7 6 5 4 3 2 1 0
  30. x : 1 = Run in mode 0 (JMP $8000) (higher precedence than bit 1)
  31. x : 0 = Last file of the ROM dump (multi-file)
  32. : 1 = Multi-file (there is another file to follow)
  33. x : SWC & SMC:
  34. 0 = SRAM mapping mode 1 (LoROM)
  35. 1 = mode 2 (HiROM)
  36. x : SWC & SMC:
  37. 0 = DRAM mapping mode 20 (LoROM)
  38. 1 = mode 21 (HiROM)
  39. x x : SWC & SMC (SRAM size):
  40. 00 = 256 kb, 01 = 64 kb, 10 = 16 kb, 11 = no SRAM
  41. x : SWC & SMC:
  42. 0 = Run in mode 3
  43. 1 = Run in mode 2 (JMP RESET)
  44. x : 0 = Disable, 1 = Enable external cartridge memory
  45. image at bank 20-5F,A0-DF in system mode 2/3)
  46. 3-7 - 0, reserved
  47. 8 - File ID code 1 (0xaa)
  48. 9 - File ID code 2 (0xbb)
  49. 10 - File type; check this byte only if ID 1 & 2 match
  50. 1 : Super Magic Card saver data
  51. 2 : Magic Griffin program (PC-Engine)
  52. 3 : Magic Griffin SRAM data
  53. 4 : SNES program
  54. 5 : SWC & SMC password, SRAM data
  55. 6 : Mega Drive program
  56. 7 : SMD SRAM data
  57. 8 : SWC & SMC saver (RTS) data
  58. 11-511 - 0, reserved
  59. */
  60. #ifdef USE_PARALLEL
  61. extern void ffe_init_io (unsigned short port);
  62. extern void ffe_deinit_io (void);
  63. extern void ffe_send_block (unsigned short address, unsigned char *buffer,
  64. unsigned short len);
  65. extern void ffe_send_block2 (unsigned short address, unsigned char *buffer,
  66. unsigned short len);
  67. extern void ffe_send_command0 (unsigned short address, unsigned char byte);
  68. extern unsigned char ffe_send_command1 (unsigned short address);
  69. extern void ffe_send_command (unsigned char command_code, unsigned short a,
  70. unsigned short l);
  71. extern void ffe_receive_block (unsigned short address, unsigned char *buffer,
  72. unsigned short len);
  73. extern void ffe_receive_block2 (unsigned short address, unsigned char *buffer,
  74. unsigned short len);
  75. extern unsigned char ffe_receiveb (void);
  76. extern void ffe_wait_for_ready (void);
  77. extern void ffe_checkabort (int status);
  78. #endif
  79. #endif