home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
system
/
a249_1
/
VIDCClock
< prev
Wrap
Text File
|
1992-03-01
|
4KB
|
120 lines
; > VIDCClock
; This software is Public Domain. It may be altered, included with other
; things, distributed in either source or binary form (or both), sold for
; profit, or whatever. The only condition is that you must acknowledge me
; (Owen Smith) as the original author of this code in anything including
; this code, regardless of whether it is source or binary, original or
; modified code.
; Change List
; 24 Apr 91 0.01 OSS Module created.
; 14 May 91 0.02 OSS Made input list static data - smaller and faster.
; 07 Jul 91 0.03 OSS Changed name from VIDCSupprt to VIDCClock.
; 22 Oct 91 0.04 OSS Put NOP in after TEQP.
; --------------------------------------------------------------------------
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:ModHand
GET Hdr:Services
GET Hdr:Proc
GET Hdr:VduExt
GET Hdr:NewSpace
; --------------------------------------------------------------------------
module_base
DCD 0 ; No start entry
DCD init_entry - module_base ; Initialisation entry
DCD 0 ; No die entry
DCD service_entry - module_base ; Service entry
DCD title_string - module_base ; Title string
DCD help_string - module_base ; Help string
DCD 0 ; No * commands
DCD 0 ; No SWI chunk
; --------------------------------------------------------------------------
help_string
DCB "VIDC Clock", 9, "0.04 (22 Oct 1991)"
DCB " for AtomWide Turbo VIDC", 0
; --------------------------------------------------------------------------
title_string
DCB "VIDCClock", 0
; --------------------------------------------------------------------------
service_entry ROUT
TEQ r1, #Service_ModeChange
TEQNE r1, #Service_Reset ; Not actually necessary.
MOVNE pc, lr ; Some other service call.
; ** Drop through **
init_entry ENTRY "r0-r1", 4 ; 4 bytes of stack.
ADR r0, vidc_clock_speed_list ; Input list is static data.
MOV r1, sp ; Output list is on stack.
SWI XOS_ReadVduVariables
EXIT VS
LDR r1, [sp] ; Get speed (25175 etc.).
LDR r0, =30000
CMP r1, r0
MOVHS r0, #1 ; If >= 30000, go for 36MHz.
MOVLO r0, #0 ; Otherwise, go for 24 MHz.
BL atomwide_on_off
EXIT
vidc_clock_speed_list
DCD VduExt_VIDCClockSpeed
DCD -1
; --------------------------------------------------------------------------
; Just because I am paranoid, a couple of assertions to make sure that things
; don't move around. Admittedly LatchB is unlikely to move (it's hardware!)
; but someone might take it into their heads to move the soft copy for some
; strange reason. Of course, if there was a SWI to read/write LatchB there
; wouldn't be a problem.
ASSERT LatchBSoftCopy = &105
ASSERT LatchB = &03350018
; --------------------------------------------------------------------------
; Entry: r0 = 0 Set clock speed to 24 MHz
; r0 = 1 Set clock speed to 36 MHz
; Exit: All registers preserved
atomwide_on_off ENTRY "r0-r5"
LDR r3, =LatchBSoftCopy ; Zero page location
LDR r4, =LatchB ; Address for speed selection
MOV r2, pc
ORR r1, r2, #(I_bit :OR: F_bit)
TEQP r1, #0 ; Disable IRQs and FIQs
LDRB r5, [r3, #0] ; Get zero page soft copy
BIC r5, r5, #&20 ; Clear existing bit value
ORR r5, r5, r0, LSL #5 ; Set bit for on/off
STRB r5, [r3, #0] ; Store zero page soft copy
STRB r5, [r4, #0] ; Write new LatchB setting
TEQP r2, #0 ; Restore IRQ and FIQ status
NOP ; EXIT uses r13
EXIT
; --------------------------------------------------------------------------
END