00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #include <cubeos.h>
00018 #include <mc68332.h>
00019 
00020 
00021 
00022 int RCJ_init ()
00023 {
00024 #ifdef RCJ_BASE
00025 
00026 #ifndef RCJ_BLOCK
00027 #define RCJ_BLOCK 0 
00028 #endif
00029         if ((RCJ_BASE) != 0) {
00030                 
00031 
00032                 unsigned short v;
00033 
00034                 writeshort (SIM_CSBAR3, ((RCJ_BASE >> 8) & 0xfff8) | (RCJ_BLOCK & 0x0007)  );           
00035                 writeshort (SIM_CSOR3, 0x7d3e);         
00036                         
00037                  
00038                     
00039                 v = readshort (SIM_CSPAR0);
00040                 v |= 0x300;
00041 
00042                 writeshort (SIM_CSPAR0, v);     
00043 
00044                 return 0;
00045         } else {
00046                 return (-1);
00047         }
00048 
00049 #else
00050         return -1;
00051 #endif
00052 
00053 }
00054 
00055 int RCJ_slow()
00056 {
00057 #ifdef RCJ_BASE
00058         if ((RCJ_BASE) != 0) {
00059                 writeshort (SIM_CSOR3, 0x7d3e); 
00060                 return 0;
00061         }
00062 #endif
00063         return -1;
00064 
00065 }
00066 
00067 int RCJ_fast()
00068 {
00069 #ifdef RCJ_BASE
00070         if ((RCJ_BASE) != 0) {
00071                 writeshort (SIM_CSOR3, 0x7c3e);         
00072                 return 0;
00073         }
00074 #endif
00075         return -1;
00076 }
00077