;Entry_ADFScreenCaching
;----------------------
;Turns screen caching off on RO4 / SA
;
;Entry:
; R0 - command line
;      0 - force off
;      1 - force on
; R12 - pointer to module private word

.Entry_ADFScreenCaching
 LDR     R12, [R12, #0]

 LDR     R1, [R12, #cpu_id - VARS]
 TEQ     R1, #CPUID_StrongARM		;StrongARM?
 MOVNE   PC, R14			;NO, exit

 LDR     R1, [R12, #os_version - VARS]
 SUB     R1, R1, #&380 << 8
 CMP     R1, #(&500 - &380) << 8	;<RO3.80 or >=RO5.0
 MOVHS   PC, R14			;YES, exit

 STR     R14, [R13, #-4]!

 CMP     R0, #1				;are we being called by BootFloppy?
 BLHI    On_Off_Option			;Read the On/Off option
 TEQ     R0, #0				;Off?
 MOVEQ   R0, #1				;YES
 MOVNE   R0, #0				;NO

 TEMP    R1
 STR     R0, Screen_Cache_Off
 LOCK    R1

 SUBS    R0, R0, R0			;clear V
LDR     PC, [R13], #4
