home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 5 / MA_Cover_5.iso / ppc / atari / atari800-0.8.6 / supercart.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-10  |  2.4 KB  |  83 lines

  1. #ifdef AMIGA_PPC
  2. #include <clib/powerpc_protos.h>
  3. #endif
  4.  
  5. #include "atari.h"
  6. #include "cpu.h"
  7.  
  8.  
  9. #define FALSE 0
  10. #define TRUE 1
  11.  
  12. static char *rcsid = "$Id: supercart.c,v 1.5 1998/02/21 14:51:54 david Exp $";
  13.  
  14. extern UBYTE *cart_image;
  15. extern int cart_type;
  16.  
  17. int SuperCart_PutByte(UWORD addr, UBYTE byte)
  18. {
  19.         switch (cart_type) {
  20.         case OSS_SUPERCART:
  21.                 switch (addr & 0xff0f) {
  22.                 case 0xd500:
  23.                         if (cart_image)
  24. #ifdef AMIGA_PPC
  25.                                 CopyMemPPC(cart_image,memory+0xa000,0x1000);
  26. #else
  27.                                 memcpy(memory + 0xa000, cart_image, 0x1000);
  28. #endif
  29.                         break;
  30.                 case 0xd504:
  31.                         if (cart_image)
  32. #ifdef AMIGA_PPC
  33.                                 CopyMemPPC(cart_image+0x1000,memory+0xa000,0x1000);
  34. #else
  35.                                 memcpy(memory + 0xa000, cart_image + 0x1000, 0x1000);
  36. #endif
  37.                         break;
  38.                 case 0xd503:
  39.                 case 0xd507:
  40.                         if (cart_image)
  41. #ifdef AMIGA_PPC
  42.                                 CopyMemPPC(cart_image+0x2000,memory+0xa000,0x1000);
  43. #else
  44.                                 memcpy(memory + 0xa000, cart_image + 0x2000, 0x1000);
  45. #endif
  46.                         break;
  47.                 }
  48.                 break;
  49.         case DB_SUPERCART:
  50.                 switch (addr & 0xff07) {
  51.                 case 0xd500:
  52.                         if (cart_image)
  53. #ifdef AMIGA_PPC
  54.                                 CopyMemPPC(cart_image,memory+0x8000,0x2000);
  55. #else
  56.                                 memcpy(memory + 0x8000, cart_image, 0x2000);
  57. #endif
  58.                         break;
  59.                 case 0xd501:
  60.                         if (cart_image)
  61. #ifdef AMIGA_PPC
  62.                                 CopyMemPPC(cart_image+0x2000,memory+0x8000,0x2000);
  63. #else
  64.                                 memcpy(memory + 0x8000, cart_image + 0x2000, 0x2000);
  65. #endif
  66.                         break;
  67.                 case 0xd506:
  68.                         if (cart_image)
  69. #ifdef AMIGA_PPC
  70.                                 CopyMemPPC(cart_image+0x4000,memory+0x8000,0x2000);
  71. #else
  72.                                 memcpy(memory + 0x8000, cart_image + 0x4000, 0x2000);
  73. #endif
  74.                         break;
  75.                 }
  76.                 break;
  77.         default:
  78.                 break;
  79.         }
  80.  
  81.         return FALSE;
  82. }
  83.