*************************************************************************
 CT60 XBIOS functions v1.01
*************************************************************************
XBIOS Functions list:

ct60_read_core_temperature() XBIOS function 0xc60a.
ct60_rw_parameter()          XBIOS Function 0xc60b.
ct60_cache()                 XBIOS Function 0xc60c.
ct60_flush_cache()           XBIOS Function 0xc60d.
CacheCtrl()                  XBIOS Function 160.

*************************************************************************
				ct60_read_core_temperature    
*************************************************************************

  Opcode:
       XBIOS 0xc60a

  Syntax:
       long ct60_read_core_temperature(short type_deg);

  Description:
          Read the 68060 temperature.

  type_deg:
          CT60_CELCIUS 0
          CT60_FARENHEIT 1  
  
  Binding:
          move.w  type_deg,-(sp)
          move.w  #$c60a,-(sp)
          trap    #14
          addq.l  #4,sp
          
  Return: The value or ERROR (-1) if there is a read error.

*************************************************************************
				ct60_rw_parameter
*************************************************************************

  Opcode:
       XBIOS 0xc60b

  Syntax:
       long ct60_rw_parameter(short mode,long type_param,long value);

  Description:
          Read or write a parameter inside the flash eprom.
          The fonction returns the value.
          
  mode:
          CT60_MODE_READ 0
          The value is read.
          
          CT60_MODE_WRITE 1
          The value is write.

  type_param:
          CT60_PARAM_TOSRAM 0
          If the value is set to 1, TOS is copied to SDRAM during boot 
          (PMMU is used and the PMMU cookie is created).
          If the value is set to 0, TOS in the flash eprom is used.
          
          CT60_BLITTER_SPEED 1
          If the value is set to 0, the blitter runs at 8/10 MHz.
          If the value is set to 1, the blitter runs at 16/20 MHz.          

          CT60_CACHE_DELAY 2
          If the bit 0 of the value is cleared, the Pexec function is 
          normal (flushes cache).
          If the bit 0 of the value is set, the caches are disabled
          for 5 seconds when a program is started under TOS with the
          Pexec function.
          If the bit 1 of the value is set, there are an Fread test
          and maybe a copyback alert if the code begin by $601A. With
          this alert you can remove the cache during 5 seconds.
          If the bit 1 of the value is cleared, there are no copyback
          alert.

          CT60_BOOT_ORDER 3
          New boot
          ========
          If the value is set to 0, TOS boots from SCSI drives (0-7) 
          before IDE drives (0-1).
          If the value is set to 1, TOS boots from IDE drives (0-1) 
          before SCSI drives (0-7).
          If the value is set to 2, TOS boots from SCSI drives (7-0) 
          before IDE drives (1-0).
          If the value is set to 3, TOS boots from IDE drives (1-0) 
          before SCSI drives (7-0).
          Old boot
          ========
          If the value is set to 4, TOS boots from SCSI drives (0-7) 
          before IDE drives (0-1).
          If the value is set to 5, TOS boots from IDE drives (0-1) 
          before SCSI drives (0-7).
          If the value is set to 6, TOS boots from SCSI drives (7-0) 
          before IDE drives (1-0).
          If the value is set to 7, TOS boots from IDE drives (1-0) 
          before SCSI drives (7-0).
          
          CT60_CPU_FPU 4
          If the bit 0 of the value is cleared, the FPU is disabled.

          CT60_BOOT_LOG 5
          If the bit 0 is cleared, the stdout output of the AUTO 
          folder files is writed inside a boot.log on the boot drive.

          CT60_PARAM_OFFSET_TLV 10
          Value contains a signed offset in points.  A point is equal 
          to 2.8 C. 

  Binding:
          move.l  value,-(sp)
          move.l  type_param,-(sp)
          move.w  mode,-(sp)
          move.w  #$c60b,-(sp)
          trap    #14
          lea     12(sp),sp

  Return: The value or:
          EBADRQ (-5) if the parameter is >=15. 
          EWRITF (-10) for a write fault.
          EUNDEV (-15) if the flash device is not found.

*************************************************************************
				ct60_cache
*************************************************************************

  Opcode:   
       XBIOS 0xc60c

 Syntax:
       long ct60_cache(short cache_mode);

  Description:
          This function is used to enable or disable the 68060 caches 
          in the patched version of General.cpx.
          
  cache_mode:
          1 enable the caches.
          0 disable the caches.
          -1 no change.

  Binding:
          move.w  cache_mode,-(sp)
          move.w  #$c60c,-(sp)
          trap    #14
          addq.l  #4,sp

  Return: Returns the contents of the CACR.
  
  Note: For normal programs, the CacheCtrl() function is preferred.

*************************************************************************
				ct60_flush_cache
*************************************************************************

  Opcode:
       XBIOS 0xc60d

  Syntax:
       long ct60_flush_cache(void);

  Description:
          This function is used to flush the instruction and data 
          caches in the patched version of Xcontrol.

  Binding:
          move.w  #$c60d,-(sp)
          trap    #14
          addq.l  #2,sp

  Return: ct60_flush_cache returns E_OK (0).

  Note: For normal programs, the CacheCtrl() function is preferred.

*************************************************************************
				CacheCtrl
*************************************************************************

  Opcode:
       XBIOS 160

  Syntax:
       long CacheCtrl(short OpCode,short Param);

  Description:
          This function is compatible with MilanTOS.

  OpCode:
          OpCode  Param 
            0      -    return 0 to check that function is implemented.
            1      -    Flush Data Cache.
            2      -    Flush Instruction Cache.
            3      -    Flush Data and Instruction Cache.
            4      -    Inquire data cache mode.
            5     mode  Set data cache mode, invalidate/flush caches. 
            6      -    Inquire instruction cache mode.
            7     mode  Set instruction cache mode, invalidate/flush caches.
          with mode : 0 = disable / 1 = enable.

  Binding:
          move.w  Param,-(sp)
          move.w  OpCode,-(sp)
          move.w  #160,-(sp)
          trap    #14
          addq.l  #6,sp

  Return: Inquire value, E_OK (0) or BADRQ (-5) if the OpCode is > 7.

  Note: Under the CT60 XBIOS, OpCodes 5/7 have the same effect :
        mode : 0 = disable all caches.
               1 = enable all caches.
        All caches are : Data Cache, Store Buffer, Branch Cache, 
        Instruction Cache.

*************************************************************************
