sys7.1-doc-wip/Drivers/Backlight/backlight.a
2020-04-26 16:46:44 +08:00

369 lines
9.4 KiB
Plaintext

;
; Hacks to match MacOS (most recent first):
;
; <Sys7.1> 8/3/92 Reverted Horror and SuperMario changes
; For some reason, <6> needed to be put back in
; Guessed the name of the unused _PostEvent patch
; Removed tables for DB and Dartanian
; Removed per-machine tables (in favour of C init code)
; 9/2/94 SuperMario ROM source dump (header preserved below)
;
;
; File: backlight.a
;
; Contains: backlight driver low level glue
;
; Written by: Andy Gong 4-6595
;
; Copyright: © 1990-1993 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <SM4> 12/13/93 PN Roll in KAOs and Horror changes to support Malcom and AJ
; machines
; <SM3> 11/8/93 JRH boxDBLite16 is now boxPowerBookDuo250. boxDBLite20 is now
; boxPenLite. boxEscher25 is now boxYeagerFSTN. boxEscher33 is now
; boxPowerBookDuo270C.
; <SM2> 2/11/93 CSS Updated some code names to real names, and include
; boxflags from InternalOnlyEqu.a rather than from
; backlightequ.a. Update from Horror. Comments follow:
; <H10> 1/21/93 RLE add support for Escher
; <H9> 7/13/92 SWC Yet another pass at the DBLite table. Deja vu, eh?
; <H8> 6/30/92 ag Added cpu info tables for cpu dependent information.
; <H7> 5/7/92 ag Changed the structure of the backlight tables. Included in the
; tables are a header which indicates the minimun and maximum
; values.
; <H6> 4/10/92 SWC Yet another pass at the DBLite table.
; <H5> 3/4/92 SWC Next pass at the DBLite table.
; <H4> 2/12/92 SWC Changed the DB-Lite table limits to have a narrower range of
; values.
; <H3> 9/10/91 SWC Changed the DB-Lite table to have a span of 0..127 instead of
; 0..255 since the backlight values don't go that high.
; <H2> 8/26/91 SWC Added a PWM lookup table for DB-Lite.
; <9> 10/28/91 SAM Rolled in Regatta file.
;
; Regatta Change History:
;
; <6> 8/29/91 SAM (ag) changed asahi look up table to avoid 1-4 because the new
; backlight sometimes flickers at these settings.
; <5> 7/18/91 SAM (ag) added asahi look up table.
; <4> 6/30/91 SAM Merged from Terror [<3><4>]
; <3> 6/14/91 SAM (ag) added new table for low power scaling.
; <1> 5/15/91 SAM Split off from TERRORProj.;
;
; Change History 7.0:
;
; <8> 11/10/90 ag added 5 volt table
; <7> 11/8/90 ag changed range of table because of reduced slider range. slider
; is 0 to 29 now
; <6> 11/7/90 ag bump up maximum value
; <5> 9/25/90 ag added sleep queue entry point for turning on and off the
; backlight during wakeup and sleep.
; <4> 9/12/90 ag Added backlight setting lookup table to increase backlight
; brightness
; <3> 8/29/90 ag added lookup table for the brightness values.
; <1+> 8/15/90 ag removing sleep stuff
; 90/03/15 ag new today
;
; To Do:
;
;_______________________________________________________________________
BLANKS ON
PRINT OFF
INCLUDE 'SysEqu.a'
INCLUDE 'SysErr.a'
INCLUDE 'HardwarePrivateEqu.a'
INCLUDE 'PowerPrivEqu.a'
INCLUDE 'Traps.a'
INCLUDE 'InternalOnlyEqu.a' ; <SM2> CSS
INCLUDE 'backlightequ.a'
PRINT ON
CASE OBJECT
MACHINE MC68020
IMPORT VBL_Task
IMPORT Sleep_Task
STRING PASCAL
;-----------------------------------------------------------------------------------
; glue for vbl task
;
;
;
VBLEntry PROC EXPORT
move.l a0,-(sp) ; param block
jsr VBL_Task
move.l (sp)+,a0 ; param block
rts
;----------------------------------------------------------------------------------
;
MyPostEvent PROC EXPORT ; <Sys7.1>
movem.l d1/a1,-(sp)
lea postEventData,a1
move.l a0,d1
tst.b 5(a1) ; postEventData.keymodifiers
beq.s @noKey
cmp.w #3,d1
beq.s @specialMode
tst.b 4(a1) ; postEventData.keysActive
beq.s @noKey
cmp.w #5,d1
bne.s @noKey
bra.s @return
@specialMode move.w $17A,d1
rol.w #1,d1 ; d1=1 if command key down
cmp.b 5(a1),d1
bne.s @noKey
@yesKey st 4(a1) ; postEventData.keysActive
bra.s @return
@noKey sf 4(a1) ; postEventData.keysActive
move.l 0(a1),a1
jsr (a1)
@return movem.l (sp)+,d1/a1
rts
EXPORT postEventData
postEventData dcb.b 8,0 ; see struct in Register.c
;-----------------------------------------------------------------------------------
;
;
;
;
SleepEntry PROC EXPORT
move.l d0,-(sp) ; sleep selector
move.l a0,-(sp) ; parameter block pointer
jsr Sleep_Task ; call sleep task
move.l (sp)+,a0
move.l (sp)+,d0
clr.l d0
rts ;
;-----------------------------------------------------------------------------------
;
PortableTable7V PROC EXPORT
dc.b 0 ; 0 ; ex<H7> <Sys7.1>
dc.b 1 ; 1
dc.b 2 ; 2
dc.b 3 ; 3
dc.b 4 ; 4
dc.b 5 ; 5
dc.b 6 ; 6
dc.b 7 ; 7
dc.b 8 ; 8
dc.b 9 ; 9
dc.b 10 ; 10
dc.b 11 ; 11
dc.b 12 ; 12
dc.b 13 ; 13
dc.b 14 ; 14
dc.b 15 ; 15
dc.b 16 ; 16
dc.b 17 ; 17
dc.b 18 ; 18
dc.b 19 ; 19
dc.b 20 ; 20
dc.b 21 ; 21
dc.b 22 ; 22
dc.b 23 ; 23
dc.b 25 ; 24
dc.b 28 ; 25
dc.b 32 ; 26
dc.b 36 ; 27
dc.b 40 ; 28
dc.b 45 ; 29
dc.b 50 ; 30
dc.b 0
;--------------------------------------------------------------------------------------------------------------
;
PortableTbl5V PROC EXPORT
dc.b 0 ; 0 ; ex<H7> <Sys7.1>
dc.b 2 ; 1
dc.b 5 ; 2
dc.b 7 ; 3
dc.b 9 ; 4
dc.b 11 ; 5
dc.b 13 ; 6
dc.b 15 ; 7
dc.b 17 ; 8
dc.b 19 ; 9
dc.b 21 ; 10
dc.b 23 ; 11
dc.b 25 ; 12
dc.b 27 ; 13
dc.b 29 ; 14
dc.b 31 ; 15
dc.b 33 ; 16
dc.b 35 ; 17
dc.b 37 ; 18
dc.b 39 ; 19
dc.b 42 ; 20
dc.b 45 ; 21
dc.b 48 ; 22
dc.b 51 ; 23
dc.b 54 ; 24
dc.b 58 ; 25
dc.b 62 ; 26
dc.b 66 ; 27
dc.b 70 ; 28
dc.b 75 ; 29
dc.b 80 ; 30
dc.b 0
;-------------------------------------------------------------------------------------------------------------
;
; <Sys7.1> moved from lower down in the file
PortableMaxTbl PROC EXPORT ; power range
dc.w 30 ; 0
dc.w 15 ; 1
dc.w 15 ; 2
dc.w 7 ; 3
dc.w 3 ; 4
;--------------------------------------------------------------------------------------------------------------
;
asahiTbl PROC EXPORT
dc.b 0 ; 0 ; ex<H7> <Sys7.1> and redo <6>
dc.b 5 ; 1
dc.b 6 ; 2
dc.b 7 ; 3
dc.b 8 ; 4
dc.b 9 ; 5
dc.b 10 ; 6
dc.b 10 ; 7
dc.b 11 ; 8
dc.b 12 ; 9
dc.b 13 ; 10
dc.b 14 ; 11
dc.b 15 ; 12
dc.b 15 ; 13
dc.b 16 ; 14
dc.b 17 ; 15
dc.b 18 ; 16
dc.b 19 ; 17
dc.b 20 ; 18
dc.b 20 ; 19
dc.b 21 ; 20
dc.b 22 ; 21
dc.b 23 ; 22
dc.b 24 ; 23
dc.b 25 ; 24
dc.b 25 ; 25
dc.b 26 ; 26
dc.b 27 ; 27
dc.b 28 ; 28
dc.b 29 ; 29
dc.b 30 ; 30
dc.b 31 ; 31
;--------------------------------------------------------------------------------------------------------------
;
timTbl PROC EXPORT ; ex<H7> <Sys7.1>
dc.b 31 ; 0
dc.b 30 ; 1
dc.b 29 ; 2
dc.b 28 ; 3
dc.b 27 ; 4
dc.b 26 ; 5
dc.b 25 ; 6
dc.b 24 ; 7
dc.b 23 ; 8
dc.b 22 ; 9
dc.b 21 ; 10
dc.b 20 ; 11
dc.b 19 ; 12
dc.b 18 ; 13
dc.b 17 ; 14
dc.b 16 ; 15
dc.b 15 ; 16
dc.b 14 ; 17
dc.b 13 ; 18
dc.b 12 ; 19
dc.b 11 ; 20
dc.b 10 ; 21
dc.b 9 ; 22
dc.b 8 ; 23
dc.b 7 ; 24
dc.b 6 ; 25
dc.b 5 ; 26
dc.b 4 ; 27
dc.b 3 ; 28
dc.b 2 ; 29
dc.b 1 ; 30
dc.b 0 ; 31
;--------------------------------------------------------------------------------------------------------------
;
timTblLow PROC EXPORT ; ex<H7> <Sys7.1>
dc.b 31 ; 0
dc.b 30 ; 1
dc.b 30 ; 2
dc.b 29 ; 3
dc.b 28 ; 4
dc.b 28 ; 5
dc.b 27 ; 6
dc.b 26 ; 7
dc.b 25 ; 8
dc.b 25 ; 9
dc.b 24 ; 10
dc.b 23 ; 11
dc.b 22 ; 12
dc.b 22 ; 13
dc.b 21 ; 14
dc.b 20 ; 15
dc.b 20 ; 16
dc.b 19 ; 17
dc.b 18 ; 18
dc.b 17 ; 19
dc.b 17 ; 20
dc.b 16 ; 21
dc.b 15 ; 22
dc.b 14 ; 23
dc.b 14 ; 24
dc.b 13 ; 25
dc.b 12 ; 26
dc.b 11 ; 27
dc.b 11 ; 28
dc.b 11 ; 29
dc.b 10 ; 30
dc.b 10 ; 31
;--------------------------------------------------------------------------------------------------------------
;
PWMMaxTbl PROC EXPORT
dc.w 31 ; 0
dc.w 15 ; 1
dc.w 15 ; 2
dc.w 7 ; 3
dc.w 3 ; 4
;--------------------------------------------------------------------------------------------------------------
;
PotInputRangeShiftTblPWM PROC EXPORT
dc.w 0 ; 0
dc.w 1 ; 1
dc.w 1 ; 2
dc.w 2 ; 3
dc.w 3 ; 4
END