From 4b6e398c8ac2b147f3549387c02c81d8eaa5b7dc Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Sat, 15 Feb 2020 16:19:06 +0800 Subject: [PATCH] Get Backlight driver (DRVR -16511) building --- patchset/Cube-E/2-build-system.patch | 13 +- patchset/Cube-E/3-amphibian-dna.patch | 279 ----- patchset/Cube-E/6-source.patch | 1434 +++++++++++++++++++++++++ 3 files changed, 1446 insertions(+), 280 deletions(-) diff --git a/patchset/Cube-E/2-build-system.patch b/patchset/Cube-E/2-build-system.patch index 43e2020..d3b9254 100644 --- a/patchset/Cube-E/2-build-system.patch +++ b/patchset/Cube-E/2-build-system.patch @@ -33,7 +33,18 @@ diff --git a/DeclData/DeclVideo/VideoDrivers.make b/DeclData/DeclVideo/VideoDriv diff --git a/Drivers/Backlight/Backlight.make b/Drivers/Backlight/Backlight.make --- a/Drivers/Backlight/Backlight.make +++ b/Drivers/Backlight/Backlight.make -@@ -27,6 +27,9 @@ BL_DRVR_OBJ = "{ObjDir}backlight.c.o" ∂ +@@ -20,13 +20,19 @@ + # Backlight driver + + BL_DRVR_OBJ = "{ObjDir}backlight.c.o" ∂ +- "{ObjDir}backlight.a.o" ++ "{ObjDir}backlight.a.o" ∂ ++ "{ObjDir}pwm.c.o" ∂ ++ "{ObjDir}register.c.o" ∂ ++ "{CLibraries}StdCLib.o" + + "{ObjDir}backlight.a.o" ƒ "{AIncludes}SysEqu.a" ∂ + "{AIncludes}SysErr.a" ∂ "{BackLightDir}backlight.a" Asm -o {Targ} "{BackLightDir}backlight.a" {StdAOpts} diff --git a/patchset/Cube-E/3-amphibian-dna.patch b/patchset/Cube-E/3-amphibian-dna.patch index dfe71ec..24faf91 100644 --- a/patchset/Cube-E/3-amphibian-dna.patch +++ b/patchset/Cube-E/3-amphibian-dna.patch @@ -4,285 +4,6 @@ Subject: Amphibian DNA The BuildCubeE mechanism for short-circuiting the makefile system to point to prebuilt binary code. This might rate a change! --- -diff --git a/AmphibianDNA/Backlight.rsrc b/AmphibianDNA/Backlight.rsrc -new file mode 100644 -diff --git a/AmphibianDNA/Backlight.rsrc.rdump b/AmphibianDNA/Backlight.rsrc.rdump -new file mode 100644 ---- /dev/null -+++ b/AmphibianDNA/Backlight.rsrc.rdump -@@ -0,0 +1,272 @@ -+data 'DRVR' (-16511, ".Backlight", sysheap) { -+ $"4C00 0000 0000 0000 0032 0036 003A 003E" /* L........2.6.:.> */ -+ $"0042 0A2E 4261 636B 6C69 6768 7400 0000" /* .B..Backlight... */ -+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */ -+ $"0000 6000 0012 6000 0014 6000 0016 6000" /* ..`...`...`...`. */ -+ $"0018 6000 001A 487A 0040 6016 487A 012C" /* ..`...Hz.@`.Hz., */ -+ $"6010 487A 0138 600A 487A 0238 6004 487A" /* `.Hz.8`.Hz.8`.Hz */ -+ $"00D8 48E7 00C0 4267 2F08 2F09 206F 0012" /* ..H...Bg/./. o.. */ -+ $"4E90 301F 4CDF 0300 584F 0828 0001 0006" /* N.0.L...XO.(.... */ -+ $"6604 2F38 08FC 4E75 4E56 0000 48E7 0118" /* f./8..NuNV..H... */ -+ $"7064 A71E 2848 200C 660A 3D7C FFE9 0010" /* pd..(H .f.=|.... */ -+ $"6000 0088 367C 0D18 206E 0008 214C 0014" /* `...6|.. n..!L.. */ -+ $"397C 0102 001E 08EC 0002 0023 2053 1028" /* 9|.........# S.( */ -+ $"000D 4880 3940 0052 B06C 0056 6F06 302C" /* ..H.9@.R.l.Vo.0, */ -+ $"0052 6004 302C 0056 3940 0054 1E38 0CB3" /* .R`.0,.V9@.T.8.. */ -+ $"1007 5900 670C 0400 000B 6710 5700 670C" /* ..Y.g.....g.W.g. */ -+ $"600A 2F0C 4EBA 09B6 584F 6008 2F0C 4EBA" /* `./.N...XO`./.N. */ -+ $"04FA 584F 294C 000C 397C 0001 0014 41FA" /* ..XO)L..9|....A. */ -+ $"03C6 2948 0016 396C 0058 001A 426C 001C" /* ..)H..9l.X..Bl.. */ -+ $"41EC 0010 A033 426E 0010 4CEE 1880 FFF4" /* A....3Bn..L..... */ -+ $"4E5E 205F 504F 4ED0 4E56 0000 48E7 0018" /* N^ _PON.NV..H... */ -+ $"266E 0008 286B 0014 41EC 0010 A034 4AAC" /* &n..(k..A....4J. */ -+ $"0034 670A 2F0C 206C 0034 4E90 584F 204C" /* .4g./. l.4N.XO L */ -+ $"A01F 7000 2740 0014 426E 0010 4CEE 1800" /* ..p.'@..Bn..L... */ -+ $"FFF8 4E5E 205F 504F 4ED0 4E56 0000 3D7C" /* ..N^ _PON.NV..=| */ -+ $"FFDC 0010 4E5E 205F 504F 4ED0 4E56 0000" /* ....N^ _PON.NV.. */ -+ $"48E7 0318 266E 000C 206E 0008 2868 0014" /* H...&n.. n..(h.. */ -+ $"08AC 0002 0023 7C00 302B 001A 0440 4303" /* .....#|.0+...@C. */ -+ $"670C 5740 672A 5340 6778 6000 00AE 4A6B" /* g.W@g*S@gx`...Jk */ -+ $"001C 6704 7001 6002 7000 4880 48C0 022C" /* ..g.p.`.p.H.H.., */ -+ $"00FE 0023 0200 0001 812C 0023 6000 009C" /* ...#.....,.#`... */ -+ $"302B 001C 48C0 2E00 7004 B087 6C04 7004" /* 0+..H...p...l.p. */ -+ $"600A 4A87 6C04 7000 6002 2007 2E00 3947" /* `.J.l.p.`. ...9G */ -+ $"0056 302C 0052 B06C 0056 6F06 302C 0052" /* .V0,.R.l.Vo.0,.R */ -+ $"6004 302C 0056 3940 0054 2F0C 302C 005A" /* `.0,.V9@.T/.0,.Z */ -+ $"48C0 2F00 206C 0024 4E90 3940 005A 504F" /* H./. l.$N.9@.ZPO */ -+ $"6048 082C 0005 0023 6604 7CEF 603C 4A6B" /* `H.,...#f.|.`.PO.. */ -+ $"0002 0023 3D47 0010 4CEE 1880 FFF4 4E5E" /* ...#=G..L.....N^ */ -+ $"205F 504F 4ED0 4E56 0000 48E7 0118 367C" /* _PON.NV..H...6| */ -+ $"0D18 202E 0008 5980 2040 2850 396C 0058" /* .. ...Y. @(P9l.X */ -+ $"001A 082C 0002 0023 56C0 0240 0001 48C0" /* ...,...#V..@..H. */ -+ $"6746 4AAC 0038 670A 2F0C 206C 0038 4E90" /* gFJ..8g./. l.8N. */ -+ $"584F 082C 0000 0023 6608 2F0C 4EBA 0034" /* XO.,...#f./.N..4 */ -+ $"584F 2053 1028 000D 4880 48C0 2E00 7002" /* XO S.(..H.H...p. */ -+ $"B087 6714 302C 0052 48C0 BE80 670A 2F07" /* ..g.0,.RH...g./. */ -+ $"2F0C 4EBA 006E 504F 4CEE 1880 FFF4 4E5E" /* /.N..nPOL.....N^ */ -+ $"4E75 4E56 FFCE 48E7 0308 286E 0008 302C" /* NuNV..H...(n..0, */ -+ $"005A 48C0 2E00 2F0C 206C 0028 4E90 2C00" /* .ZH.../. l.(N.,. */ -+ $"2F0C 2F06 206C 0024 4E90 3940 005A 082C" /* /./. l.$N.9@.Z., */ -+ $"0003 0023 4FEF 000C 661E 302C 005A 48C0" /* ...#O...f.0,.ZH. */ -+ $"BE80 6714 3D7C 4302 FFE8 2F0C 486E FFCE" /* ..g.=|C.../.Hn.. */ -+ $"206C 002C 4E90 504F 4CEE 10C0 FFC2 4E5E" /* l.,N.POL.....N^ */ -+ $"4E75 4E56 0000 48E7 0708 2C2E 000C 286E" /* NuNV..H...,...(n */ -+ $"0008 302C 0052 48C0 BC80 5EC0 0240 0001" /* ..0,.RH...^..@.. */ -+ $"48C0 1A00 3006 3940 0052 B06C 0056 6F06" /* H...0.9@.R.l.Vo. */ -+ $"302C 0052 6004 302C 0056 3940 0054 2F0C" /* 0,.R`.0,.V9@.T/. */ -+ $"206C 0028 4E90 2E00 4A05 584F 671E 4A86" /* l.(N...J.XOg.J. */ -+ $"671A 082C 0003 0023 6612 4A87 670E 302C" /* g..,...#f.J.g.0, */ -+ $"005A E240 48C0 2E00 6602 7E01 2F0C 2F07" /* .Z.@H...f.~././. */ -+ $"206C 0024 4E90 3940 005A 504F 4CEE 10E0" /* l.$N.9@.ZPOL... */ -+ $"FFF0 4E5E 4E75 4E56 FFFE 7074 3F00 7201" /* ..N^NuNV..pt?.r. */ -+ $"3F01 486E FFFF 205F 201F A051 7000 102E" /* ?.Hn.. _ ..Qp... */ -+ $"FFFF 322E 000A C240 302E 000E E069 7000" /* ..2....@0....ip. */ -+ $"3001 4A80 4E5E 4E75 4E56 FFFE 48E7 0300" /* 0.J.N^NuNV..H... */ -+ $"3C2E 000E 7E70 3007 5840 3F00 7001 3F00" /* <...~p0.X@?.p.?. */ -+ $"486E FFFF 205F 201F A051 3006 4640 C12E" /* Hn.. _ ..Q0.F@.. */ -+ $"FFFF 302E 000A 48C0 322E 0012 E3A8 48C6" /* ..0...H.2.....H. */ -+ $"2206 C280 832E FFFF 3007 5840 3F00 7001" /* ".......0.X@?.p. */ -+ $"3F00 486E FFFF 205F 201F A052 4CEE 00C0" /* ?.Hn.. _ ..RL... */ -+ $"FFF6 4E5E 4E75 2F08 4EBA FE0C 205F 4E75" /* ..N^Nu/.N... _Nu */ -+ $"48E7 4040 43FA 003E 2208 4A29 0005 6726" /* H.@@C..>".J)..g& */ -+ $"0C41 0003 670E 4A29 0004 671A 0C41 0005" /* .A..g.J)..g..A.. */ -+ $"6614 601A 3238 017A E359 B229 0005 6606" /* f.`.28.z.Y.)..f. */ -+ $"50E9 0004 6008 51E9 0004 2251 4E91 4CDF" /* P...`.Q..."QN.L. */ -+ $"0202 4E75 0000 0000 0000 0000 2F00 2F08" /* ..Nu.......././. */ -+ $"4EBA 06DA 205F 201F 7000 4E75 0001 0203" /* N... _ .p.Nu.... */ -+ $"0405 0607 0809 0A0B 0C0D 0E0F 1011 1213" /* ................ */ -+ $"1415 1617 191C 2024 282D 3200 0002 0507" /* ...... $(-2..... */ -+ $"090B 0D0F 1113 1517 191B 1D1F 2123 2527" /* ............!#%' */ -+ $"2A2D 3033 363A 3E42 464B 5000 001E 000F" /* *-036:>BFKP..... */ -+ $"000F 0007 0003 0005 0607 0809 0A0A 0B0C" /* ................ */ -+ $"0D0E 0F0F 1011 1213 1414 1516 1718 1919" /* ................ */ -+ $"1A1B 1C1D 1E1F 1F1E 1D1C 1B1A 1918 1716" /* ................ */ -+ $"1514 1312 1110 0F0E 0D0C 0B0A 0908 0706" /* ................ */ -+ $"0504 0302 0100 1F1E 1E1D 1C1C 1B1A 1919" /* ................ */ -+ $"1817 1616 1514 1413 1211 1110 0F0E 0E0D" /* ................ */ -+ $"0C0B 0B0B 0A0A 001F 000F 000F 0007 0003" /* ................ */ -+ $"0000 0001 0001 0002 0003 4E56 0000 48E7" /* ..........NV..H. */ -+ $"0108 286E 0008 08EC 0003 0023 08EC 0004" /* ..(n.......#.... */ -+ $"0023 08EC 0005 0023 397C 000A 0058 41FA" /* .#.....#9|...XA. */ -+ $"FFC6 2948 004E 41FA FF9E 2948 0046 41FA" /* ..)H.NA...)H.FA. */ -+ $"FF76 2948 004A 2948 0042 7E00 1E38 0CB3" /* .v)H.J)H.B~..8.. */ -+ $"2007 0480 0000 000F 671A 5780 662A 08AC" /* .......g.W.f*.. */ -+ $"0004 0023 08AC 0005 0023 41FA FF2A 2948" /* ...#.....#A..*)H */ -+ $"0042 6014 7000 1039 50FB 4000 7202 C200" /* .B`.p..9P.@.r... */ -+ $"6706 08AC 0005 0023 082C 0005 0023 6740" /* g......#.,...#g@ */ -+ $"397C 0001 003C 397C 00A3 003E 397C 00AD" /* 9|...<9|...>9|.. */ -+ $"0040 41FA 0348 2948 0038 2F0C 4EBA 03AA" /* .@A..H)H.8/.N... */ -+ $"022C 00BF 0023 ED08 0200 0040 812C 0023" /* .,...#.....@.,.# */ -+ $"082C 0006 0023 584F 6706 296C 0046 0042" /* .,...#XOg.)l.F.B */ -+ $"41FA 0064 2948 0024 41FA 01EE 2948 0028" /* A..d)H.$A...)H.( */ -+ $"41FA 003E 2948 0034 41FA 0258 2948 002C" /* A..>)H.4A..X)H., */ -+ $"41FA 029E 2948 0030 2F0C 4EBA 01CC 2E00" /* A...)H.0/.N..... */ -+ $"397C FFFF 005A 2F0C 2F07 4EBA 002A 3940" /* 9|...Z/./.N..*9@ */ -+ $"005A 4FEF 000C 4CEE 1080 FFF8 4E5E 4E75" /* .ZO...L.....N^Nu */ -+ $"4E56 0000 2F2E 0008 7000 2F00 4EBA 0008" /* NV../...p./.N... */ -+ $"7000 4E5E 4E75 4E56 FFF2 48E7 0108 2E2E" /* p.N^NuNV..H..... */ -+ $"0008 286E 000C 302C 0054 48C0 206C 004E" /* ..(n..0,.TH. l.N */ -+ $"D080 3030 0800 48C0 B087 6C14 302C 0054" /* ..00..H...l.0,.T */ -+ $"48C0 206C 004E D080 3030 0800 48C0 600A" /* H. l.N..00..H.`. */ -+ $"4A87 6C04 7000 6002 2007 2E00 206C 0042" /* J.l.p.`. ... l.B */ -+ $"1D70 7800 FFFF 4A6C 005A 6D12 7000 102E" /* .px...Jl.Zm.p... */ -+ $"FFFF B06C 005C 6606 2007 6000 008C 4A2C" /* ...l.\f. .`...J, */ -+ $"0023 6C50 302C 005C 48C0 7200 122E FFFF" /* .#lP0,.\H.r..... */ -+ $"9081 2F00 4EBA 0908 322C 003C 48C1 B280" /* ../.N...2,.. .TOL.....N^ */ -+ $"4E75 4E56 FFF2 2F07 1D6E 000B FFFE 3D7C" /* NuNV../..n....=| */ -+ $"00D8 FFF2 3D7C 0001 FFF4 41EE FFFE 2D48" /* ....=|....A...-H */ -+ $"FFF6 41EE FFFF 2D48 FFFA 558F 486E FFF2" /* ..A...-H..U.Hn.. */ -+ $"205F A085 3E80 3E1F 6704 7000 6008 7000" /* _..>.>.g.p.`.p. */ -+ $"102E FFFF 4A80 2E2E FFEE 4E5E 4E75 4E56" /* ....J.....N^NuNV */ -+ $"FFF0 48E7 0108 49EE FFFC 3D7C 0069 FFF0" /* ..H...I...=|.i.. */ -+ $"426E FFF2 7000 2D40 FFF4 2D4C FFF8 558F" /* Bn..p.-@..-L..U. */ -+ $"486E FFF0 205F A085 3E80 3E1F 6704 7000" /* Hn.. _..>.>.g.p. */ -+ $"600C 302E 000A 7200 1234 0000 3001 4CEE" /* `.0...r..4..0.L. */ -+ $"1080 FFE8 4E5E 4E75 4E56 0000 48E7 0108" /* ....N^NuNV..H... */ -+ $"286E 0008 082C 0004 0023 670C 7000 2F00" /* (n...,...#g.p./. */ -+ $"4EBA FF50 584F 600A 7002 2F00 4EBA FF90" /* N..PXO`.p./.N... */ -+ $"584F 7E00 1E00 302C 0062 48C0 9087 2F00" /* XO~...0,.bH.../. */ -+ $"4EBA 07BC 7205 B280 584F 6D08 302C 0062" /* N...r...XOm.0,.b */ -+ $"48C0 2E00 3947 0062 E68F 4A87 6718 302C" /* H...9G.b..J.g.0, */ -+ $"0054 D040 41FA FCDA 3030 0000 48C0 E0AF" /* .T.@A...00..H... */ -+ $"4A87 6602 7E01 2007 4CEE 1080 FFF8 4E5E" /* J.f.~. .L.....N^ */ -+ $"4E75 4E56 0000 48E7 0318 266E 0008 286E" /* NuNV..H...&n..(n */ -+ $"000C 7E00 082C 0000 0023 6604 7EEF 6024" /* ..~..,...#f.~.`$ */ -+ $"302B 001A 0440 4301 6618 302B 001C 48C0" /* 0+...@C.f.0+..H. */ -+ $"2C00 2F0C 2F06 4EBA FDBE 3940 005A 504F" /* ,././.N...9@.ZPO */ -+ $"6002 7EEF 3007 4CEE 18C0 FFF0 4E5E 4E75" /* `.~.0.L.....N^Nu */ -+ $"4E56 0000 48E7 0118 266E 000C 286E 0008" /* NV..H...&n..(n.. */ -+ $"4247 302C 001A 0440 5301 670A 5540 670E" /* BG0,...@S.g.U@g. */ -+ $"5740 6716 6028 396B 005A 001C 6022 397C" /* W@g.`(9k.Z..`"9| */ -+ $"001F 001C 426C 001E 6016 302B 0054 48C0" /* ....Bl..`.0+.TH. */ -+ $"206B 004E D080 3970 0800 001C 6002 7EEE" /* k.N..9p....`.~. */ -+ $"3007 4CEE 1880 FFF4 4E5E 4E75 4E56 0000" /* 0.L.....N^NuNV.. */ -+ $"48E7 0108 286E 0008 082C 0006 0023 56C0" /* H...(n...,...#V. */ -+ $"0240 0001 48C0 2E00 2F0C 4EBA 004C 022C" /* .@..H.../.N..L., */ -+ $"00BF 0023 ED08 0200 0040 812C 0023 082C" /* ...#.....@.,.#., */ -+ $"0006 0023 56C0 0240 0001 48C0 BE80 584F" /* ...#V..@..H...XO */ -+ $"671C 08EC 0007 0023 082C 0006 0023 6706" /* g......#.,...#g. */ -+ $"202C 0046 6004 202C 004A 2940 0042 4CEE" /* ,.F`. ,.J)@.BL. */ -+ $"1080 FFF8 4E5E 4E75 4E56 0000 48E7 0318" /* ....N^NuNV..H... */ -+ $"266E 0008 387C 0D18 082B 0006 0023 56C6" /* &n..8|...+...#V. */ -+ $"4406 4207 4A06 6712 2054 7000 1028 0052" /* D.B.J.g. Tp..(.R */ -+ $"7200 322B 0040 B240 6316 4A06 661A 2054" /* r.2+.@.@c.J.f. T */ -+ $"7000 1028 0052 7200 322B 003E B240 6208" /* p..(.Rr.2+.>.@b. */ -+ $"2054 7E01 CE28 000F 4A07 6704 7000 6002" /* T~..(..J.g.p.`. */ -+ $"7001 4CEE 18C0 FFF0 4E5E 4E75 4E56 0000" /* p.L.....N^NuNV.. */ -+ $"48E7 0118 286E 0008 47FA FA6A 426B 0004" /* H...(n..G..jBk.. */ -+ $"397C 0001 0058 7002 C039 00FC 0200 6708" /* 9|...Xp..9....g. */ -+ $"41FA FA8A 2008 6006 41FA FA62 2008 2940" /* A... .`.A..b .)@ */ -+ $"0042 41FA FA98 2948 004E 41FA 01BA 2948" /* .BA...)H.NA...)H */ -+ $"0024 41FA 0314 2948 0028 41FA 03EE 2948" /* .$A...)H.(A...)H */ -+ $"0034 41FA 04CC 2948 0030 41FA 0414 2948" /* .4A...)H.0A...)H */ -+ $"002C 7005 2F00 4878 00E0 4EBA F92A 3940" /* .,p./.Hx..N..*9@ */ -+ $"0060 7000 2F00 721F 2F01 4EBA F91A 2E00" /* .`p./.r./.N..... */ -+ $"5387 302C 0060 48C0 2F00 4EBA 0534 4A87" /* S.0,.`H./.N..4J. */ -+ $"4FEF 0014 6C16 7E01 7000 2F00 721F 2F01" /* O...l.~.p./.r./. */ -+ $"7002 2F00 4EBA F922 4FEF 000C 397C 001E" /* p./.N.."O...9|.. */ -+ $"005A 206C 0042 7000 1028 001E 3940 005C" /* .Z l.Bp..(..9@.\ */ -+ $"2F0C 7000 2F00 4EBA 012E 3940 005A 2F0C" /* /.p./.N...9@.Z/. */ -+ $"2F07 4EBA 0122 3940 005A 70A3 B039 00FC" /* /.N.."9@.Zp..9.. */ -+ $"0200 4FEF 0010 6612 397C 0010 0004 41FA" /* ..O...f.9|....A. */ -+ $"F98C 2948 0006 204C A28A 487A 0050 7003" /* ..)H.. L..Hz.Pp. */ -+ $"3F00 3F3C 0003 A895 4CEE 1880 FFF4 4E5E" /* ?.?<....L.....N^ */ -+ $"4E75 4E56 0000 48E7 0708 286E 0008 2A2E" /* NuNV..H...(n..*. */ -+ $"000C 1C2E 0013 4A85 6718 0006 0080 2E05" /* ......J.g....... */ -+ $"E38F 600A 0A06 0080 1886 2007 5387 4A87" /* ..`....... .S.J. */ -+ $"66F2 4CEE 10E0 FFF0 4E5E 4E75 4E56 0000" /* f.L.....N^NuNV.. */ -+ $"7000 2F00 4EBA 0062 4E5E 4E75 4E56 0000" /* p./.N..bN^NuNV.. */ -+ $"2F0C 286E 0008 202E 000C 5380 6B42 0C80" /* /.(n.. ...S.kB.. */ -+ $"0000 0003 6E3A D080 303B 0806 4EFB 0000" /* ....n:..0;..N... */ -+ $"0032 000A 001C 0032 08AC 0002 0023 7000" /* .2.....2.....#p. */ -+ $"2F00 4EBA 0024 584F 6016 4A6C 005A 670A" /* /.N..$XO`.Jl.Zg. */ -+ $"7001 2F00 4EBA 0012 584F 08EC 0002 0023" /* p./.N...XO.....# */ -+ $"286E FFFC 4E5E 4E75 4E56 0000 48E7 0708" /* (n..N^NuNV..H... */ -+ $"1A2E 000B 287C 00FC 0202 7E04 CE39 00FC" /* ....(|....~..9.. */ -+ $"0200 1C3C 00A0 4A07 6704 4A05 6608 4A07" /* ...<..J.g.J.f.J. */ -+ $"6608 4A05 6604 0006 0002 1886 4CEE 10E0" /* f.J.f.......L... */ -+ $"FFF0 4E5E 4E75 4E56 FFFE 48E7 0F18 286E" /* ..N^NuNV..H...(n */ -+ $"000C 2E2E 0008 4A6C 005A 5DC0 0240 0001" /* ......Jl.Z]..@.. */ -+ $"48C0 1A00 302C 0054 48C0 206C 004E D080" /* H...0,.TH. l.N.. */ -+ $"3030 0800 48C0 B087 6C14 302C 0054 48C0" /* 00..H...l.0,.TH. */ -+ $"206C 004E D080 3030 0800 48C0 600A 4A87" /* l.N..00..H.`.J. */ -+ $"6C04 7000 6002 2007 2E00 206C 0042 1A30" /* l.p.`. ... l.B.0 */ -+ $"7800 7000 1005 B06C 005C 6606 2007 6000" /* x.p....l.\f. .`. */ -+ $"00A0 1C39 00FC 0200 7004 C006 1D40 FFFF" /* ...9....p....@.. */ -+ $"7801 C806 267C 00FC 0202 1C3C 00A0 4A2E" /* x...&|.....<..J. */ -+ $"FFFF 6704 4A87 660A 4A2E FFFF 6608 4A87" /* ..g.J.f.J...f.J. */ -+ $"6604 0006 0002 4A04 670A 302C 005A 48C0" /* f.....J.g.0,.ZH. */ -+ $"B087 6C0E 4A04 660E 302C 005A 48C0 B087" /* ..l.J.f.0,.ZH... */ -+ $"6E04 0006 0040 4A87 6608 203C 0000 0100" /* n....@J.f. <.... */ -+ $"6014 302C 005C 48C0 7200 1205 9081 2F00" /* `.0,.\H.r...../. */ -+ $"4EBA 032C 584F 2800 0206 00DF 1686 7000" /* N..,XO(.......p. */ -+ $"1006 2F00 2F04 2F0B 4EBA FE28 0006 0020" /* ../././.N..(... */ -+ $"1686 7000 1005 3940 005C 2007 4FEF 000C" /* ..p...9@.\ .O... */ -+ $"4CEE 18F0 FFE6 4E5E 4E75 4E56 0000 48E7" /* L.....N^NuNV..H. */ -+ $"0308 2C2E 0008 286E 000C 4A86 6604 7000" /* ..,...(n..J.f.p. */ -+ $"602C 7E00 102C 0007 4880 323C 0088 C200" /* `,~..,..H.2<.... */ -+ $"6702 5287 7011 C02C 0007 6702 5487 7044" /* g.R.p..,..g.T.pD */ -+ $"C02C 0007 6702 5887 BC87 57C0 4400 4CEE" /* .,..g.X...W.D.L. */ -+ $"10C0 FFF4 4E5E 4E75 4E56 FFF0 48E7 0718" /* ....N^NuNV..H... */ -+ $"47EE FFF0 286E 0008 302C 005A 48C0 2A00" /* G...(n..0,.ZH.*. */ -+ $"302C 0054 48C0 206C 004E D080 3030 0800" /* 0,.TH. l.N..00.. */ -+ $"48C0 2C00 302C 005A 48C0 BC80 6C06 2006" /* H.,.0,.ZH...l. . */ -+ $"6000 009E 2F0B A976 2F0B 302C 0060 48C0" /* `.../..v/.0,.`H. */ -+ $"2F00 4EBA FF66 4A00 504F 660C 426C 005E" /* /.N..fJ.POf.Bl.^ */ -+ $"08AC 0001 0023 6076 526C 005E 082C 0001" /* .....#`vRl.^.,.. */ -+ $"0023 6704 7005 6002 7001 4880 48C0 322C" /* .#g.p.`.p.H.H.2, */ -+ $"005E 48C1 B041 6C56 08EC 0001 0023 397C" /* .^H..AlV.....#9| */ -+ $"0001 005E 7E00 7040 C02B 000F 6608 7010" /* ...^~.p@.+..f.p. */ -+ $"C02B 000F 6702 7E01 7020 C02B 000F 6608" /* .+..g.~.p .+..f. */ -+ $"7008 C02B 000F 6702 7EFF 302C 005A 48C0" /* p..+..g.~.0,.ZH. */ -+ $"D087 BC80 6C02 7E00 302C 005A 48C0 D087" /* ....l.~.0,.ZH... */ -+ $"6C02 7E00 302C 005A 48C0 2A00 DA87 2005" /* l.~.0,.ZH.*... . */ -+ $"4CEE 18E0 FFDC 4E5E 4E75 4E56 0000 2F0C" /* L.....N^NuNV../. */ -+ $"286E 0008 397C 001E 005A 2F0C 7000 2F00" /* (n..9|...Z/.p./. */ -+ $"4EBA FDA4 3940 005A 204C A48A 487A FCEE" /* N...9@.Z L..Hz.. */ -+ $"3F3C 0004 A895 7000 286E FFFC 4E5E 4E75" /* ?<....p.(n..N^Nu */ -+ $"4E56 0000 48E7 0318 266E 0008 286E 000C" /* NV..H...&n..(n.. */ -+ $"7C00 302B 001A 0440 4301 6B00 0086 0C40" /* |.0+...@C.k....@ */ -+ $"0004 6E7E D040 303B 0006 4EFB 0000 000C" /* ..n~.@0;..N..... */ -+ $"0024 0076 0040 005C 302B 001C 48C0 2E00" /* .$.v.@.\0+..H... */ -+ $"2F0C 2F07 4EBA FD40 3940 005A 504F 6054" /* /./.N..@9@.ZPO`T */ -+ $"7000 2F00 721F 2F01 342C 005A 48C2 5282" /* p./.r./.4,.ZH.R. */ -+ $"2F02 4EBA F4F4 4FEF 000C 6038 302B 001C" /* /.N...O...`80+.. */ -+ $"48C0 2E00 7007 C087 3940 0060 48C0 2F00" /* H...p...9@.`H./. */ -+ $"4EBA 00CE 584F 601C 7005 2F00 4878 00E0" /* N...XO`.p./.Hx.. */ -+ $"322C 0060 48C1 2F01 4EBA F4BE 4FEF 000C" /* 2,.`H./.N...O... */ -+ $"6002 7CEF 3006 4CEE 18C0 FFF0 4E5E 4E75" /* `.|.0.L.....N^Nu */ -+ $"4E56 0000 48E7 0118 266E 000C 286E 0008" /* NV..H...&n..(n.. */ -+ $"4247 302C 001A 0440 5301 6B76 0C40 0005" /* BG0,...@S.kv.@.. */ -+ $"6E70 D040 303B 0006 4EFB 0000 000E 0016" /* np.@0;..N....... */ -+ $"001E 002A 0040 0054 396B 005A 001C 6054" /* ...*.@.T9k.Z..`T */ -+ $"396B 0060 001C 604C 397C 001E 001C 426C" /* 9k.`..`L9|....Bl */ -+ $"001E 6040 7000 2F00 721F 2F01 4EBA F418" /* ..`@p./.r./.N... */ -+ $"5340 3940 001C 504F 602A 7005 2F00 4878" /* S@9@..PO`*p./.Hx */ -+ $"00E0 4EBA F402 3940 001C 504F 6016 302B" /* ..N...9@..PO`.0+ */ -+ $"0054 48C0 206B 004E D080 3970 0800 001C" /* .TH. k.N..9p.... */ -+ $"6002 7EEE 3007 4CEE 1880 FFF4 4E5E 4E75" /* `.~.0.L.....N^Nu */ -+ $"4E56 0000 48E7 0308 2C2E 0008 4207 0806" /* NV..H...,...B... */ -+ $"0000 6704 0007 0010 7002 C086 6704 0007" /* ..g.....p...g... */ -+ $"0002 7004 C086 6704 0007 0008 49FA F486" /* ..p...g.....I... */ -+ $"1947 0005 4CEE 10C0 FFF4 4E5E 4E75 4E56" /* .G..L.....N^NuNV */ -+ $"0000 2F07 2E2E 0008 6D04 2007 6004 2007" /* ../.....m. .`. . */ -+ $"4480 2E2E FFFC 4E5E 4E75 8361 6273 0000" /* D.....N^Nu.abs.. */ -+}; -+ diff --git a/AmphibianDNA/Gestalt.rsrc b/AmphibianDNA/Gestalt.rsrc new file mode 100644 diff --git a/AmphibianDNA/Gestalt.rsrc.rdump b/AmphibianDNA/Gestalt.rsrc.rdump diff --git a/patchset/Cube-E/6-source.patch b/patchset/Cube-E/6-source.patch index e4acf23..9f13f39 100644 --- a/patchset/Cube-E/6-source.patch +++ b/patchset/Cube-E/6-source.patch @@ -2,6 +2,1440 @@ From: Horst Beepmanh <> Subject: Source --- +diff --git a/Drivers/Backlight/PWM.c b/Drivers/Backlight/PWM.c +--- a/Drivers/Backlight/PWM.c ++++ b/Drivers/Backlight/PWM.c +@@ -10,26 +10,6 @@ + + Change History (most recent first): + +- 2/11/93 CSS Update from Horror. Comments follow: +- 6/30/92 ag Moved cpu depended initialization code to cpu.c file, input +- routines to input.c, and table routines to backlight.c file. +- 5/26/92 ag Added write to PONTI to turnoff backlight through PONTI bit. +- 5/7/92 ag Use new table record for min/max limits. Added new entry for +- Dartanian. +- 4/24/92 ag set default to single table operation except on TIM (LC). added +- new vector for custom input control to handle hardware +- dependencies. +-
12/17/91 SWC Added boxDBLiteLC to the list in InitPWMControls. Grouped boxTIM +- and boxDartanian since their code is identical. +-
12/16/91 HJR Added boxDartanian to the list. +-

9/10/91 SWC Changed Get_AtoD to get the current setting of the up/down +- buttons. +-

8/27/91 SWC Changed references to get/set contrast to use get/set brightness +- on machines other than TIM. On TIM, they used the contrast +- command to control screen brightness. Added PWM table for +- DB-Lite. +-

8/5/91 SWC Changed Get_AtoD to use GetScreenCmd to get the current contrast +- instead of reading from the A-D if not on TIM. + <3> 3/24/92 JSM Nuke boxFlag codenames. + <2> 3/23/92 JSM OSEvents.h is obsolete, use Events.h. + <1> 10/24/91 SAM/KSM Rolled in Regatta file. +@@ -78,30 +58,78 @@ + #include "PowerMgr.h" + #include "backlight.h" + ++#define READ_ATOD_CHANNEL 0xD8 ++#define READ_BUTTON_VALUE 0xD9 ++ ++#define BACKLIGHT_POT_CHANNEL 0 ++#define STATUS 0 ++#define POWERBYTE 1 ++#define TEMPBYTE 2 ++ ++extern short PotInputRangeShiftTblPWM[]; ++extern unsigned char timTblLow[]; ++extern unsigned char timTbl[]; ++extern unsigned char asahiTbl[]; ++extern short PWMMaxTbl[]; ++ + /*page + *************************************************************************************************** + ** PWM software *********************************************************************************** + *************************************************************************************************** + */ + +-OSErr InitPWMControls(driverGlobalPtr globalPtr) ++void InitPWMControls(driverGlobalPtr globalPtr) + + { + unsigned int startvalue; ++ int boxFlag; ++ ++ /* setup default values */ ++ globalPtr->flyByWire = true; ++ globalPtr->freeflag = true; ++ globalPtr->dualTable = true; ++ ++ globalPtr->userInputSampleRate = 10; ++ globalPtr->maximumTable = &PWMMaxTbl; ++ globalPtr->settingTableLow = &timTblLow; ++ globalPtr->settingTable = globalPtr->settingTableHigh = &timTbl; ++ ++ boxFlag = *(unsigned char *)0xCB3; ++ switch (boxFlag) ++ { ++ case 18: // PowerBook 100, Asahi ++ globalPtr->freeflag = false; ++ globalPtr->dualTable = false; ++ globalPtr->settingTable = &asahiTbl; ++ break; ++ case 15: // PowerBook 170, TIM ++ if (*JAWS_SPEED_FSTN_REG_PTR & JAWS_FSTN) ++ globalPtr->dualTable = false; ++ break; ++ } + + /* initialize dual table variables */ + if (globalPtr->dualTable) + { + globalPtr->slewLimit = true; /* maximum change per/accrun */ +- (*globalPtr->tableProc)(globalPtr); /* determine table based on current charger state */ ++ globalPtr->lowThreshold = 163; ++ globalPtr->hiThreshold = 173; ++ globalPtr->tableProc = ChargerAdjust; ++ globalPtr->lowTable = LowTable(globalPtr); ++ if (globalPtr->lowTable) ++ globalPtr->settingTable = globalPtr->settingTableLow; + }; + ++ globalPtr->setlevelproc = SetPWM; ++ globalPtr->userInputProc = PotControl; ++ globalPtr->closeProc = PWMCloseRoutine; ++ globalPtr->controlProc = PWMControl; ++ globalPtr->statusProc = PWMStatus; ++ + /* initialize backlight hardware */ +- startvalue = (*globalPtr->userInputProc)(globalPtr); /* */ ++ startvalue = PotControl(globalPtr); + globalPtr->userBrightness = -1; +- globalPtr->userBrightness = (*globalPtr->setlevelproc)(startvalue,globalPtr); /* */ +- +- return(noErr); ++ globalPtr->userBrightness = SetPWM(startvalue,globalPtr); + }; + + /* +@@ -113,10 +141,148 @@ OSErr InitPWMControls(driverGlobalPtr globalPtr) + int PWMCloseRoutine (driverGlobalPtr globalPtr) + + { +- (*globalPtr->setlevelproc)(globalPtr->settingTable->minimum,globalPtr); ++ SetPWM(0,globalPtr); + return(0); + }; + ++/* ++ *************************************************************************************************** ++ * ++ * ++ *************************************************************************************************** ++ */ ++ ++int SetPWM(int new,driverGlobalPtr globalPtr) ++{ ++ PMgrPBlock pb; /* power manager pb */ ++ unsigned char val; /* hardware value setting */ ++ ++ PEG_TO_LIMITS(new, globalPtr->maximumTable[globalPtr->powerRange], 0); /* limit value to valid range */ ++ val = globalPtr->settingTable[new]; /* look up value from table */ ++ ++ if ((globalPtr->userBrightness >= 0) && (val == globalPtr->lastHWSetting)) return(new);/* nothing to do; 90/05/15 just turn on; 90/07/02 avoid touching */ ++ if (globalPtr->slewChange) ++ { ++ if (abs(globalPtr->lastHWSetting - val) > globalPtr->slewLimit) ++ val = globalPtr->lastHWSetting + ((globalPtr->lastHWSetting > val) ? -globalPtr->slewLimit : globalPtr->slewLimit); ++ else ++ globalPtr->slewChange = false; ++ }; ++ globalPtr->lastHWSetting = val; /* save the new hardware setting */ ++ ++ pb.pmgrCmd = ScreenSetCmd; /* everyone else uses "set brightness" */ ++ pb.pmgrCnt = 1; ++ pb.pmgrXPtr = &val; ++ pb.pmgrRPtr = nil; ++ PMgr(&pb); /* set the pwm */ ++ ++ return(new); /* return the current value */ ++}; ++ ++/*page ++ *************************************************************************************************** ++ * ++ * ++ *************************************************************************************************** ++ */ ++ ++unsigned char Get_AtoD(int channel) ++{ ++ PMgrPBlock pb; /* power manager pb */ ++ char atodChannel; /* a to d channel to read [0-8] */ ++ unsigned char value; /* return value */ ++ OSErr error; /* pmgr error */ ++ ++ ++ atodChannel = channel; /* load channel value into buffer */ ++ ++ pb.pmgrCmd = READ_ATOD_CHANNEL; /* load read channel command */ ++ pb.pmgrCnt = 1; /* transmit buffer count is 1 byte */ ++ pb.pmgrXPtr = &atodChannel; /* pointer to transmit buffer */ ++ pb.pmgrRPtr = &value; /* pointer to receive buffer */ ++ ++ error = PMgr(&pb); ++ ++ return( (error) ? 0 : value); ++}; ++ ++/*page ++ *************************************************************************************************** ++ * ++ * ++ *************************************************************************************************** ++ */ ++ ++unsigned char Get_PGEButton(int channel) ++{ ++ PMgrPBlock pb; /* power manager pb */ ++ char atodChannel; /* a to d channel to read [0-8] */ ++ unsigned char value; /* return value */ ++ OSErr error; /* pmgr error */ ++ ++ ++ atodChannel = channel; /* load channel value into buffer */ ++ ++ pb.pmgrCmd = READ_BUTTON_VALUE; /* load read channel command */ ++ pb.pmgrCnt = 1; /* transmit buffer count is 1 byte */ ++ pb.pmgrXPtr = &atodChannel; /* pointer to transmit buffer */ ++ pb.pmgrRPtr = &value; /* pointer to receive buffer */ ++ ++ error = PMgr(&pb); ++ ++ return( (error) ? 0 : value); ++}; ++ ++/*page ++ *************************************************************************************************** ++ * ++ * ++ *************************************************************************************************** ++ */ ++unsigned char GetPortableValues(int parameter) ++{ ++ ++ PMgrPBlock pb; /* power manager pb */ ++ OSErr err; /* power manager error */ ++ unsigned char rbuf[3]; /* buffer for send command */ ++ ++ pb.pmgrCmd = BatteryStatusImmCmd; /* on old pmgr, read battery status (immediate not averaged) */ ++ pb.pmgrCnt = 0; ++ pb.pmgrXPtr = nil; ++ pb.pmgrRPtr = rbuf; ++ ++ err = PMgr(&pb); ++ return( (err) ? 0 : rbuf[parameter]); /* return 0 if error, else read value */ ++} ++ ++/*page ++ *************************************************************************************************** ++ * ++ * ++ *************************************************************************************************** ++ */ ++int PotControl (driverGlobalPtr globalPtr) ++ ++{ ++#pragma unused (globalPtr) ++ ++ unsigned int potvalue; ++ ++ potvalue = globalPtr->freeflag ? Get_AtoD(BACKLIGHT_POT_CHANNEL) : GetPortableValues(TEMPBYTE); ++ ++ if (abs(globalPtr->lastatod - potvalue) <= 5) /* was the change less than 100mv */ ++ potvalue = globalPtr->lastatod; /* is less than, the use old value */ ++ ++ globalPtr->lastatod = potvalue; /* update last a to d value */ ++ potvalue >>= 3; /* scale to 0 to 31 */ ++ if (potvalue) /* if non-zero, check for subrange limiting */ ++ { ++ potvalue >>= PotInputRangeShiftTblPWM[globalPtr->powerRange]; /* rescale in low power levels */ ++ if (!potvalue) potvalue = 1; /* make sure we don't change the backlight state */ ++ }; ++ return(potvalue); ++}; ++ + /*page + *************************************************************************************************** + * +@@ -144,7 +310,7 @@ OSErr PWMControl(CntrlParam *ctlPB,driverGlobalPtr globalPtr) /* 'open' entry p + { + case kSetScreenBrightness: /* set brightness level */ + tempvalue = ctlPB->csParam[0]; +- globalPtr->userBrightness = (*globalPtr->setlevelproc)(tempvalue,globalPtr); ++ globalPtr->userBrightness = SetPWM(tempvalue,globalPtr); + break; + + default: +@@ -154,37 +320,43 @@ OSErr PWMControl(CntrlParam *ctlPB,driverGlobalPtr globalPtr) /* 'open' entry p + return(error); + }; + +-/* ++/*page + *************************************************************************************************** + * ++ * The status routine… ++ * ++ * return: ++ * noErr - task completed successfully ++ * statusErr - illegal status selector ++ * + * + *************************************************************************************************** + */ + +-int SetPWM(int new,driverGlobalPtr globalPtr) ++OSErr PWMStatus(CntrlParam *ctlPB,driverGlobalPtr globalPtr) + { +- PMgrPBlock pb; /* power manager pb */ +- unsigned char val; /* hardware value setting */ +- +- PEG_TO_LIMITS(new, globalPtr->maximumTable[globalPtr->powerRange], globalPtr->settingTable->minimum); /* use new tables */ /* limit value to valid range */ +- val = globalPtr->settingTable->table[new]; /* look up value from table */ ++ OSErr error; + +- if ((globalPtr->userBrightness >= 0) && (val == globalPtr->lastHWSetting)) return(new);/* nothing to do; 90/05/15 just turn on; 90/07/02 avoid touching */ +- if (globalPtr->slewChange) ++ error = noErr; ++ ++ switch(ctlPB->csCode) + { +- if (abs(globalPtr->lastHWSetting - val) > globalPtr->slewLimit) +- val = globalPtr->lastHWSetting + ((globalPtr->lastHWSetting > val) ? -globalPtr->slewLimit : globalPtr->slewLimit); +- else +- globalPtr->slewChange = false; ++ case kGetScreenBrightness: /* get brightness level */ ++ ctlPB->csParam[0] = globalPtr->userBrightness; ++ break; ++ ++ case kGetBrightnessRange: ++ ctlPB->csParam[0] = 31; ++ ctlPB->csParam[1] = 0; ++ break; ++ ++ case kGetMaximum: ++ ctlPB->csParam[0] = globalPtr->maximumTable[globalPtr->powerRange]; ++ break; ++ ++ default: ++ error = statusErr; + }; +- globalPtr->lastHWSetting = val; /* save the new hardware setting */ +- +- pb.pmgrCmd = SetBrightnessCmd; /* everyone else uses "set brightness" */ +- pb.pmgrCnt = 1; +- pb.pmgrXPtr = &val; +- pb.pmgrRPtr = nil; +- PMgr(&pb); /* set the pwm */ +- +- return(new); /* return the current value */ +-}; + ++ return(error); ++} +diff --git a/Drivers/Backlight/Register.c b/Drivers/Backlight/Register.c +--- a/Drivers/Backlight/Register.c ++++ b/Drivers/Backlight/Register.c +@@ -9,13 +9,6 @@ + + Change History (most recent first): + +- 12/13/93 PN Roll in KAOs and Horror changes to support Malcom and AJ +- machines +- 2/11/93 CSS Update from Horror. Comments follow: +-

6/30/92 ag Moved cpu depended initialization code to cpu.c file, and input +- routines to input.c. +-

5/7/92 ag Use new table record for min/max limits. +-

4/24/92 ag return error from initialization. + <2> 3/23/92 JSM OSEvents.h is obsolete, use Events.h. + <1> 10/24/91 SAM/KSM Rolled in Regatta file. + +@@ -117,7 +110,10 @@ typedef struct + char keymodifiers; + short unused; + } posteventtype, *posteventtypeptr; +-extern setTableType PortableTbl5V; ++extern posteventtype postEventData; ++extern unsigned char PortableTbl5V[]; ++extern unsigned char PortableTable7V[]; ++extern short PortableMaxTbl[]; + + int GetBacklightInfo(short mask, short shift); + void SaveBacklightInfo(short new,short mask, short shift); +@@ -125,23 +121,82 @@ void SaveBacklightInfo(short new,short mask, short shift); + TurnOnOff(Boolean on); + setNewKeys(int keycombo); + ++/*page ++ *************************************************************************************************** ++ * ++ * ++ *************************************************************************************************** ++ */ ++void ChargerAdjust (driverGlobalPtr globalPtr) ++{ ++ unsigned int oldTable; ++ ++ oldTable = globalPtr->lowTable; /* save the current table being used */ ++ globalPtr->lowTable = LowTable(globalPtr); /* get the new table to use */ ++ if (globalPtr->lowTable == oldTable) return; /* are we changing tables ???, no exit */ ++ ++ globalPtr->slewChange = true; /* if change, set tmp slew on */ ++ globalPtr->settingTable = globalPtr->lowTable ? globalPtr->settingTableLow :globalPtr->settingTableHigh ; ++}; ++ ++/*page ++ *************************************************************************************************** ++ * ++ * ++ *************************************************************************************************** ++ */ ++unsigned int LowTable (driverGlobalPtr globalPtr) ++ ++{ ++ PmgrGlobals **pmgrglobalhdl; /* handle to power manager globals */ ++ Boolean wasLowTable; /* current table being used */ ++ Boolean hiTable; /* use hi level table now */ ++ ++ pmgrglobalhdl = (PmgrGlobals **) 0x0D18; /* handle to power manager globals */ ++ ++ wasLowTable = globalPtr->lowTable; /* current table */ ++ hiTable = false; /* assume low table */ ++ if ((wasLowTable && ((*pmgrglobalhdl)->BatAvg >= globalPtr->hiThreshold)) || ++ (!wasLowTable && ((*pmgrglobalhdl)->BatAvg >= globalPtr->lowThreshold))) ++ { ++ hiTable = (*pmgrglobalhdl)->Charger & 0x01; /* qualify table with charger */ ++ }; ++ return(hiTable ? 0 : 1); /* return 1 if low table, 0 if high */ ++}; ++ + /*page + *************************************************************************************************** + ** Register control software ********************************************************************** + *************************************************************************************************** + */ + +-OSErr InitRegControls(driverGlobalPtr globalPtr) ++void InitRegControls(driverGlobalPtr globalPtr) + + { + int SetBrightness(); + int KbdControl(); + int RegisterClose(); +- unsigned int pramBrightness; ++ OSErr RegisterStatus(CntrlParam *, driverGlobalPtr); ++ OSErr RegisterControl(CntrlParam *, driverGlobalPtr); ++ int pramBrightness; + void ShutdownBacklight(); ++ posteventtypeptr postdataptr; + + +- if (BACKLIGHTSIGREG & TABLE_5V) globalPtr->settingTable = &PortableTbl5V; ++ postdataptr = &postEventData; ++ postdataptr->keysActive = 0; ++ postdataptr->keymodifiers = 0; ++ ++ globalPtr->userInputSampleRate = 1; ++ ++ globalPtr->settingTable = (BACKLIGHTSIGREG & TABLE_5V) ? PortableTbl5V : PortableTable7V; ++ ++ globalPtr->maximumTable = &PortableMaxTbl; ++ globalPtr->setlevelproc = SetBrightness; ++ globalPtr->userInputProc = KbdControl; ++ globalPtr->closeProc = RegisterClose; ++ globalPtr->statusProc = RegisterStatus; ++ globalPtr->controlProc = RegisterControl; + + globalPtr->keycodes = GetPramKeyData(); + pramBrightness = GetPramBrightness(); /* get pram setting */ +@@ -149,13 +204,14 @@ OSErr InitRegControls(driverGlobalPtr globalPtr) + setNewKeys(globalPtr->keycodes); + if (pramBrightness < 0) /* check for valid brightness value */ + { +- pramBrightness = globalPtr->settingTable->minimum+1; /*

load default brightness */ +- SaveBrightness(globalPtr->settingTable->minimum+1); /*

validate, as save new brightness */ ++ pramBrightness = 1; ++ SaveBrightness(1); + }; + + +- globalPtr->userBrightness = globalPtr->settingTable->maximum; /*

*/ +- globalPtr->userBrightness = SetBrightness(globalPtr->settingTable->minimum,globalPtr); /*

initialize pot */ ++ globalPtr->userBrightness = 30; ++ globalPtr->lastHWSetting = globalPtr->settingTable[30]; ++ globalPtr->userBrightness = SetBrightness(0,globalPtr); + globalPtr->userBrightness = SetBrightness(pramBrightness,globalPtr); /* set brightness level */ + + if (BACKLIGHTSIGREG == BACKLIGHTSIG_UPGRD) +@@ -166,8 +222,6 @@ OSErr InitRegControls(driverGlobalPtr globalPtr) + }; + + ShutDwnInstall( (ShutDwnProcPtr) ShutdownBacklight,sdRestartOrPower); /* install shutdown task */ +- +- return(noErr); + }; + + /*page +@@ -274,20 +328,16 @@ int SetBrightness(int new, driverGlobalPtr globalPtr) + char signature; + Boolean onBitHigh; + Boolean countDownBit; +- int current; + unsigned char tablevalue; + Boolean initialize; + + + + initialize = (globalPtr->userBrightness < 0); +- PEG_TO_LIMITS(new, globalPtr->maximumTable[globalPtr->powerRange], globalPtr->settingTable->minimum); /*

limit value to valid range */ +- current = (initialize) +- ? globalPtr->settingTable->minimum /*

*/ +- : globalPtr->userBrightness; ++ PEG_TO_LIMITS(new, globalPtr->maximumTable[globalPtr->powerRange], 0); + +- tablevalue = globalPtr->settingTable->table[new]; /*

look up value from table */ +- if (!initialize && (tablevalue == globalPtr->lastHWSetting) ) ++ tablevalue = globalPtr->settingTable[new]; ++ if (tablevalue == globalPtr->lastHWSetting) + return(new); /* nothing to do; 90/05/15 just turn on; 90/07/02 avoid touching */ + + /* setup control bits */ +@@ -297,13 +347,13 @@ int SetBrightness(int new, driverGlobalPtr globalPtr) + backlightreg = (Ptr) PORTABLE_HW; + regvalue = COUNT_BIT + L_CS_BIT; /* start with count and CS inactive */ + +- if ((onBitHigh && (new != globalPtr->settingTable->minimum)) || (!onBitHigh && (new == globalPtr->settingTable->minimum))) /*

*/ ++ if ((onBitHigh && new) || (!onBitHigh && !new)) + regvalue |= ON_BIT; /* upgrade has opposite polarity */ + +- if ((countDownBit && (new <= current)) || (!countDownBit && (new >= current))) ++ if ((countDownBit && (new <= globalPtr->userBrightness)) || (!countDownBit && (new >= globalPtr->userBrightness))) + regvalue |= COUNTDN_BIT; /* set the count down bit if new > current */ + +- strobes = (new == globalPtr->settingTable->minimum) /*

*/ ++ strobes = (new == 0) + ? MAXSTROBECOUNT /* if minimum, bang against stops */ + : abs(globalPtr->lastHWSetting - tablevalue); + +@@ -410,8 +460,8 @@ int KbdControl (driverGlobalPtr globalPtr) + int RegisterClose (driverGlobalPtr globalPtr) + + { +- globalPtr->userBrightness = globalPtr->settingTable->maximum; /*

*/ +- globalPtr->userBrightness = SetBrightness(globalPtr->settingTable->minimum,globalPtr); /*

initialize pot */ ++ globalPtr->userBrightness = 30; ++ globalPtr->userBrightness = SetBrightness(0,globalPtr); + + SleepQRemove(&globalPtr->sleepQelement); /* remove sleep task */ + ShutDwnRemove( (ShutDwnProcPtr) ShutdownBacklight); /* remove shutdown task */ +@@ -445,7 +495,7 @@ OSErr RegisterControl(CntrlParam *ctlPB,driverGlobalPtr globalPtr) /* 'open' en + { + case kSetScreenBrightness: /* set brightness level */ + tempvalue = ctlPB->csParam[0]; +- globalPtr->userBrightness = (*globalPtr->setlevelproc)(tempvalue,globalPtr); ++ globalPtr->userBrightness = SetBrightness(tempvalue,globalPtr); + break; + case kSaveScreenBrightness: /* save brightness level */ + SaveBrightness(globalPtr->userBrightness); +@@ -488,15 +538,25 @@ OSErr RegisterStatus(CntrlParam *ctlPB,driverGlobalPtr globalPtr) /* 'open' en + error = noErr; + switch(ctlPB->csCode) + { ++ case kGetScreenBrightness: ++ ctlPB->csParam[0] = globalPtr->userBrightness; ++ break; + case kGetBrightnessKeys: /* return current saved brightness */ + ctlPB->csParam[0] = globalPtr->keycodes; + break; ++ case kGetBrightnessRange: ++ ctlPB->csParam[0] = 30; ++ ctlPB->csParam[1] = 0; ++ break; + case kGetPBacklight: + ctlPB->csParam[0] = GetPramBrightness(); + break; + case kGetPKey: + ctlPB->csParam[0] = GetPramKeyData(); + break; ++ case kGetMaximum: ++ ctlPB->csParam[0] = globalPtr->maximumTable[globalPtr->powerRange]; ++ break; + + default: + error = statusErr; +@@ -508,11 +568,14 @@ setNewKeys(int keycombo) + + { + char newKey; ++ posteventtypeptr postdataptr; + + newKey = 0; + if (keycombo & 0x01) newKey |= 0x10; + if (keycombo & 0x02) newKey |= 0x02; + if (keycombo & 0x04) newKey |= 0x08; + ++ postdataptr = &postEventData; ++ postdataptr->keymodifiers = newKey; + }; + +diff --git a/Drivers/Backlight/backlight.a b/Drivers/Backlight/backlight.a +--- a/Drivers/Backlight/backlight.a ++++ b/Drivers/Backlight/backlight.a +@@ -9,27 +9,6 @@ + ; + ; Change History (most recent first): + ; +-; 12/13/93 PN Roll in KAOs and Horror changes to support Malcom and AJ +-; machines +-; 11/8/93 JRH boxDBLite16 is now boxPowerBookDuo250. boxDBLite20 is now +-; boxPenLite. boxEscher25 is now boxYeagerFSTN. boxEscher33 is now +-; boxPowerBookDuo270C. +-; 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: +-; 1/21/93 RLE add support for Escher +-; 7/13/92 SWC Yet another pass at the DBLite table. Deja vu, eh? +-; 6/30/92 ag Added cpu info tables for cpu dependent information. +-; 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. +-;
4/10/92 SWC Yet another pass at the DBLite table. +-;
3/4/92 SWC Next pass at the DBLite table. +-;

2/12/92 SWC Changed the DB-Lite table limits to have a narrower range of +-; values. +-;

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. +-;

8/26/91 SWC Added a PWM lookup table for DB-Lite. + ; <9> 10/28/91 SAM Rolled in Regatta file. + ; + ; Regatta Change History: +@@ -92,6 +71,40 @@ VBLEntry PROC EXPORT + rts + + ++;---------------------------------------------------------------------------------- ++; ++MyPostEvent PROC EXPORT ++ 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 ++ ++ + ;----------------------------------------------------------------------------------- + ; + ; +@@ -105,28 +118,11 @@ SleepEntry PROC EXPORT + move.l (sp)+,d0 + clr.l d0 + rts ; +-;-------------------------------------------------------------------------------------------------------------- +-; +-GetBkltPrimInfo proc export +- with PmgrRec,PmgrPrimitivesRec +- +- movea.l PmgrBase,a0 ; point to power manager globals +- LoadTbl BklightTblPtr,a0,a0 ; get backlight table pointer in a0 +- move.l a0,d0 ; move pointer to d0 for C return +- rts +- +- +- +- +- END + + ;----------------------------------------------------------------------------------- + ; + PortableTable7V PROC EXPORT +- dc.w 0 ; minimum value +- dc.w @end - @start ; +- +-@start dc.b 0 ; 0 ++ dc.b 0 ; 0 + dc.b 1 ; 1 + dc.b 2 ; 2 + dc.b 3 ; 3 +@@ -156,16 +152,14 @@ PortableTable7V PROC EXPORT + dc.b 36 ; 27 + dc.b 40 ; 28 + dc.b 45 ; 29 +-@end dc.b 50 ; 30 ++ dc.b 50 ; 30 ++ dc.b 0 + + + ;-------------------------------------------------------------------------------------------------------------- + ; + PortableTbl5V PROC EXPORT +- dc.w 0 ; minimum value +- dc.w @end - @start ; +-@start +- dc.b 0 ; 0 ++ dc.b 0 ; 0 + dc.b 2 ; 1 + dc.b 5 ; 2 + dc.b 7 ; 3 +@@ -195,55 +189,61 @@ PortableTbl5V PROC EXPORT + dc.b 66 ; 27 + dc.b 70 ; 28 + dc.b 75 ; 29 +-@end dc.b 80 ; 30 ++ dc.b 80 ; 30 ++ dc.b 0 ++ ++ ++;------------------------------------------------------------------------------------------------------------- ++; ++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.w 0 ; minimum value +- dc.w @end - @start ; +- +-@start dc.b 0 ; 0 +- 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 24 ; 24 ++ dc.b 0 ; 0 ++ 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 +-@end dc.b 31 ; 31 ++ dc.b 31 ; 31 ++ + + ;-------------------------------------------------------------------------------------------------------------- + ; + timTbl PROC EXPORT +- dc.w 0 ; minimum value +- dc.w @end - @start ; +- +-@start dc.b 31 ; 0 ++ dc.b 31 ; 0 + dc.b 30 ; 1 + dc.b 29 ; 2 + dc.b 28 ; 3 +@@ -274,15 +274,13 @@ timTbl PROC EXPORT + dc.b 3 ; 28 + dc.b 2 ; 29 + dc.b 1 ; 30 +-@end dc.b 0 ; 31 ++ dc.b 0 ; 31 ++ + + ;-------------------------------------------------------------------------------------------------------------- + ; + timTblLow PROC EXPORT +- dc.w 0 ; minimum value +- dc.w @end - @start ; +- +-@start dc.b 31 ; 0 ++ dc.b 31 ; 0 + dc.b 30 ; 1 + dc.b 30 ; 2 + dc.b 29 ; 3 +@@ -313,16 +311,8 @@ timTblLow PROC EXPORT + dc.b 11 ; 28 + dc.b 11 ; 29 + dc.b 10 ; 30 +-@end dc.b 10 ; 31 ++ dc.b 10 ; 31 + +-;-------------------------------------------------------------------------------------------------------------- +-; +-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 + + ;-------------------------------------------------------------------------------------------------------------- + ; +@@ -342,289 +332,4 @@ PotInputRangeShiftTblPWM PROC EXPORT + dc.w 2 ; 3 + dc.w 3 ; 4 + +-;-------------------------------------------------------------------------------------------------------------- +-; +-dbTbl PROC EXPORT ;

+- dc.w 0 ; minimum value +- dc.w @end - @start ; +- +-@start DC.B 127 ; 0 +- DC.B 89 ; 1 +- DC.B 87 ; 2 +- DC.B 86 ; 3 +- DC.B 84 ; 4 +- DC.B 82 ; 5 +- DC.B 81 ; 6 +- DC.B 79 ; 7 +- DC.B 77 ; 8 +- DC.B 76 ; 9 +- DC.B 74 ; 10 +- DC.B 71 ; 11 +- DC.B 69 ; 12 +- DC.B 67 ; 13 +- DC.B 66 ; 14 +- DC.B 64 ; 15 +- DC.B 62 ; 16 +- DC.B 61 ; 17 +- DC.B 59 ; 18 +- DC.B 57 ; 19 +- DC.B 56 ; 20 +- DC.B 54 ; 21 +- DC.B 52 ; 22 +- DC.B 51 ; 23 +- DC.B 49 ; 24 +- DC.B 47 ; 25 +- DC.B 46 ; 26 +- DC.B 44 ; 27 +- DC.B 42 ; 28 +- DC.B 41 ; 29 +- DC.B 39 ; 30 +-@end DC.B 38 ; 31 +- +- +-;-------------------------------------------------------------------------------------------------------------- +-; +-DartTable proc export +- dc.w 0 ; minimum value +- dc.w @end - @start +- +-@start dc.b 3 ; 0 +- dc.b 2 ; 1 +- dc.b 1 ; 2 +-@end dc.b 0 ; 3 +- +-; +-; +-DartMaxTbl PROC EXPORT ; power range +- dc.w 3 ; 0 +- dc.w 2 ; 1 +- dc.w 2 ; 2 +- dc.w 1 ; 3 +- dc.w 0 ; 4 +- +-;-------------------------------------------------------------------------------------------------------------- +-; +-; generic exit for non-supported functions +-; +-StandardExit PROC EXPORT +- rts +-;-------------------------------------------------------------------------------------------------------------- +-; +-; list to supported cpu's (boxflags) +-; +-cpuTable PROC EXPORT +- +- dc.w boxPortable +- dc.l Portableinfo - cpuTable +- +- dc.w boxPowerBook100 +- dc.l PowerBook100info - cpuTable +- +- dc.w boxPowerBookDuo250 ; +- dc.l PowerBookDuoinfo - cpuTable +- +- dc.w boxDBLite20 +- dc.l PowerBookDuoinfo - cpuTable +- +- dc.w boxPowerBookDuo210 +- dc.l PowerBookDuoinfo - cpuTable +- +- dc.w boxPowerBookDuo230 +- dc.l PowerBookDuoinfo - cpuTable +- +- dc.w boxPowerBook140 ; cpu id +- dc.l PowerBook170info - cpuTable +- +- dc.w boxPowerBook170 ; cpu id +- dc.l PowerBook170info - cpuTable +- +- dc.w boxPowerBook180 +- dc.l PowerBook180info - cpuTable +- +- dc.w boxPowerBook160 +- dc.l PowerBook180info - cpuTable +- +- dc.w boxYeagerFSTN ; +- dc.l PowerBookDuoinfo - cpuTable +- +- dc.w boxPowerBookDuo270C ; +- dc.l PowerBookDuoinfo - cpuTable +- +- +- dc.w -1 +- +-;-------------------------------------------------------------------------------------------------------------- +-; +-; +- import StandardExit +- import SetBrightness,KbdControl,InitRegControls,RegisterClose,RegisterControl,RegisterStatus +- import SetPWM,PotControl,InitPWMControls,PWMCloseRoutine,PWMControl,GenericStatus,PortableBacklightValue +- import SetDart,GetDart,InitTimControls,InitDartControls,PowerMgrPot,ChargerAdjust +- import PGE_button +- +- with backlightflags +- +-;-------------------------------------------------------------------------------------------------------------- +-; +-; +-Portableinfo +- dc.l (0 << disableHWinput)\ ; operating flag (stops user input) +- +(0 << kbdactive)\ ; operating flag (kbd control inprogress) +- +(1 << vbl_ok)\ ; operating flag (allow vbl operations) +- +(0 << flyByWire)\ ; config flag (hardware input) +- +(0 << freeflag)\ ; (n/a) unused flag +- +(0 << dualTable)\ ; config flag (use multi tables) +- +(0 << lowTable)\ ; operating flag (currently using low table) +- +(0 << slewChange) ; operating flag (table transition inprogress) +- dc.l SetBrightness - Portableinfo ; set routine +- dc.l KbdControl - Portableinfo ; get user input routine +- dc.l InitRegControls - Portableinfo ; initialization routine +- dc.l RegisterClose - Portableinfo ; close routine +- dc.l RegisterControl - Portableinfo ; control routine +- dc.l RegisterStatus - Portableinfo ; status routine +- dc.l StandardExit - Portableinfo ; (n/a) charger state change routine +- dc.l PortableMaxTbl - Portableinfo ; table of maximum value for different power ranges +- dc.l PortableTable7V - Portableinfo ; low range table +- dc.l PortableTable7V - Portableinfo ; high range table +- dc.l PowerMgrPot - Portableinfo ; hardware dependent var +- dc.w 1 ; vbl count SampleRate +- dc.w 0 ; (n/a) lowThreshold +- dc.w 0 ; (n/a) hiThreshold +- +-;-------------------------------------------------------------------------------------------------------------- +-; +-; +-PowerBook100info +- dc.l (0 << disableHWinput)\ ; operating flag (stops user input) +- +(0 << kbdactive)\ ; operating flag (kbd control inprogress) +- +(1 << vbl_ok)\ ; operating flag (allow vbl operations) +- +(1 << flyByWire)\ ; config flag (hardware input) +- +(0 << freeflag)\ ; unused flag +- +(0 << dualTable)\ ; config flag (use multi tables) +- +(0 << lowTable)\ ; operating flag (currently using low table) +- +(0 << slewChange) ; operating flag (table transition inprogress) +- dc.l SetPWM - PowerBook100info ; set routine +- dc.l PotControl - PowerBook100info ; get user input routine +- dc.l InitPWMControls - PowerBook100info ; initialization routine +- dc.l PWMCloseRoutine - PowerBook100info ; close routine +- dc.l PWMControl - PowerBook100info ; control routine +- dc.l GenericStatus - PowerBook100info ; status routine +- dc.l StandardExit - PowerBook100info ; (n/a) charger state change routine +- dc.l PWMMaxTbl - PowerBook100info ; table of maximum value for different power ranges +- dc.l asahiTbl - PowerBook100info ; low range table +- dc.l asahiTbl - PowerBook100info ; high range table +- dc.l PortableBacklightValue- PowerBook100info; hardware dependent var +- dc.w 10 ; vbl count SampleRate +- dc.w 0 ; (n/a) lowThreshold +- dc.w 0 ; (n/a) hiThreshold +- +-;-------------------------------------------------------------------------------------------------------------- +-; +-; +-HITABLETHRESHOLD170 equ (685 - 512) +-LOWTABLETHRESHOLD170 equ (675 - 512) +- +-PowerBook170info +- dc.l (0 << disableHWinput)\ ; operating flag (stops user input) +- +(0 << kbdactive)\ ; (n/a) operating flag (kbd control inprogress) +- +(1 << vbl_ok)\ ; operating flag (allow vbl operations) +- +(1 << flyByWire)\ ; config flag (hardware input) +- +(1 << freeflag)\ ; (n/a) +- +(0 << dualTable)\ ; config flag (use multi tables) +- +(0 << lowTable)\ ; operating flag (currently using low table) +- +(0 << slewChange) ; operating flag (table transition inprogress) +- dc.l SetPWM - PowerBook170info ; set routine +- dc.l PotControl - PowerBook170info ; get user input routine +- dc.l InitTimControls - PowerBook170info ; initialization routine +- dc.l PWMCloseRoutine - PowerBook170info ; close routine +- dc.l PWMControl - PowerBook170info ; control routine +- dc.l GenericStatus - PowerBook170info ; status routine +- dc.l ChargerAdjust - PowerBook170info ; charger state change routine +- dc.l PWMMaxTbl - PowerBook170info ; table of maximum value for different power ranges +- dc.l timTblLow - PowerBook170info ; low range table +- dc.l timTbl - PowerBook170info ; high range table +- dc.l PowerMgrPot - PowerBook170info ; hardware dependent var +- dc.w 10 ; vbl count SampleRate +- dc.w LOWTABLETHRESHOLD170 ; voltage threshold before switching from high to low table +- dc.w HITABLETHRESHOLD170 ; voltage threshold before switching from low to high table +- +- +-;-------------------------------------------------------------------------------------------------------------- +-; +-; +-PowerBook180info +- dc.l (0 << disableHWinput)\ ; operating flag (stops user input) +- +(0 << kbdactive)\ ; (n/a) operating flag (kbd control inprogress) +- +(1 << vbl_ok)\ ; operating flag (allow vbl operations) +- +(1 << flyByWire)\ ; config flag (hardware input) +- +(1 << freeflag)\ ; (n/a) +- +(1 << dualTable)\ ; config flag (use multi tables) +- +(0 << lowTable)\ ; operating flag (currently using low table) +- +(0 << slewChange) ; operating flag (table transition inprogress) +- dc.l SetPWM - PowerBook180info ; set routine +- dc.l PotControl - PowerBook180info ; get user input routine +- dc.l InitPWMControls - PowerBook180info ; initialization routine +- dc.l PWMCloseRoutine - PowerBook180info ; close routine +- dc.l PWMControl - PowerBook180info ; control routine +- dc.l GenericStatus - PowerBook180info ; status routine +- dc.l ChargerAdjust - PowerBook180info ; charger state change routine +- dc.l PWMMaxTbl - PowerBook180info ; table of maximum value for different power ranges +- dc.l timTblLow - PowerBook180info ; low range table +- dc.l timTbl - PowerBook180info ; high range table +- dc.l PowerMgrPot - PowerBook180info ; hardware dependent var +- dc.w 10 ; vbl count SampleRate +- dc.w LOWTABLETHRESHOLD170 ; voltage threshold before switching from high to low table +- dc.w HITABLETHRESHOLD170 ; voltage threshold before switching from low to high table +- +-PowerBook180infoHWControl +- dc.l (0 << disableHWinput)\ ; operating flag (stops user input) +- +(0 << kbdactive)\ ; operating flag (kbd control inprogress) +- +(1 << vbl_ok)\ ; operating flag (allow vbl operations) +- +(1 << flyByWire)\ ; config flag (hardware input) +- +(1 << freeflag)\ +- +(0 << dualTable)\ ; config flag (use multi tables) +- +(0 << lowTable)\ ; operating flag (currently using low table) +- +(0 << slewChange) ; operating flag (table transition inprogress) +- dc.l SetPWM - PowerBook180info ; set routine +- dc.l PotControl - PowerBook180info ; get user input routine +- dc.l InitDartControls - PowerBook180info ; initialization routine +- dc.l PWMCloseRoutine - PowerBook180info ; close routine +- dc.l PWMControl - PowerBook180info ; control routine +- dc.l GenericStatus - PowerBook180info ; status routine +- dc.l 0 ; (n/a) charger state change routine +- dc.l DartMaxTbl - PowerBook180info ; table of maximum value for different power ranges +- dc.l DartTable - PowerBook180info ; low range table +- dc.l DartTable - PowerBook180info ; high range table +- dc.l PowerMgrPot - PowerBook180info ; hardware dependent var +- dc.w 10 ; vbl count SampleRate +- dc.w 0 ; (n/a) lowThreshold +- dc.w 0 ; (n/a) hiThreshold +- +-;-------------------------------------------------------------------------------------------------------------- +-; +-; +-PowerBookDuoinfo +- dc.l (0 << disableHWinput)\ ; operating flag (stops user input) +- +(0 << kbdactive)\ ; operating flag (kbd control inprogress) +- +(1 << vbl_ok)\ ; operating flag (allow vbl operations) +- +(1 << flyByWire)\ ; config flag (hardware input) +- +(1 << freeflag)\ +- +(0 << dualTable)\ ; config flag (use multi tables) +- +(0 << lowTable)\ ; operating flag (currently using low table) +- +(0 << slewChange) ; operating flag (table transition inprogress) +- dc.l SetPWM - PowerBookDuoinfo ; set routine +- dc.l PotControl - PowerBookDuoinfo ; get user input routine +- dc.l InitPWMControls - PowerBookDuoinfo ; initialize routine +- dc.l PWMCloseRoutine - PowerBookDuoinfo ; close routine +- dc.l PWMControl - PowerBookDuoinfo ; control routine +- dc.l GenericStatus - PowerBookDuoinfo ; status routine +- dc.l StandardExit - PowerBookDuoinfo ; (n/a) charger state change routine +- dc.l PWMMaxTbl - PowerBookDuoinfo ; table of maximum value for different power ranges +- dc.l dbTbl - PowerBookDuoinfo ; low range table +- dc.l dbTbl - PowerBookDuoinfo ; high range table +- dc.l PGE_button - PowerBookDuoinfo ; hardware dependent var +- dc.w 10 ; vbl count SampleRate +- dc.w 0 ; (n/a) lowThreshold +- dc.w 0 ; (n/a) hiThreshold +- + END +diff --git a/Drivers/Backlight/backlight.c b/Drivers/Backlight/backlight.c +--- a/Drivers/Backlight/backlight.c ++++ b/Drivers/Backlight/backlight.c +@@ -9,16 +9,6 @@ + + Change History (most recent first): + +- 12/13/93 PN Roll in KAOs and Horror changes to support Malcom and AJ +- machines +- 9/2/93 SKH Update from Horror. +- 2/11/93 CSS Update from Horror. Comments follow : +-
11/9/92 ag Corrected compare statement. The compiler generated a long +- compare, so we must type cast the value to avoid the mismatch in +- types. +-

6/30/92 ag Use cpu info tables for configuring cpu dependent information. +-

4/24/92 ag added support for error returns on hardware initialization. +- this will return an open error on unknown hardware. +

8/5/91 SWC Make InitPWMControls the default init choice in DRVROpen so that + proc vectors are always initialized. + <12> 3/30/92 JSM Rolled this file into SuperMario project. +@@ -172,13 +162,8 @@ pascal OSErr DRVROpen(CntrlParam *ctlPB,DCtlPtr dCtl) /* 'open' entry point * + #pragma unused (ctlPB) + register driverGlobalPtr globalPtr; /* pointer to globals */ + PmgrGlobals **pmgrglobalhdl; /* handle to power manager globals */ +- OSErr error; +- cpuDependentInfoType *cpuinfo; +- OSErr (*openProc)(); ++ char boxFlag; + +- cpuinfo = GetBkltPrimInfo(); +- if (!cpuinfo) return(openErr); +- + globalPtr = (driverGlobalPtr) NewPtrSysClear(sizeof(driverGlobaltypes)); + if (!globalPtr) return(openErr); /* not enough memory, return error */ + +@@ -188,45 +173,24 @@ pascal OSErr DRVROpen(CntrlParam *ctlPB,DCtlPtr dCtl) /* 'open' entry point * + /* setup variables */ + globalPtr->version = DRIVERVERSION; /* driver version number, in globals for easy patching */ + +- *((unsigned int *)(((int)&(globalPtr->version)) + sizeof(globalPtr->version))) = cpuinfo->bkltinfo->flags; +- globalPtr->lowThreshold = cpuinfo->bkltinfo->lowThreshold; /*low hysteresis threshold */ +- globalPtr->hiThreshold = cpuinfo->bkltinfo->hiThreshold; /* high hysteresis threshold */ +- globalPtr->userInputSampleRate = cpuinfo->bkltinfo->userInputSampleRate; /* sample every 160ms */ ++ globalPtr->vbl_ok = true; + + globalPtr->lastLevel = (*pmgrglobalhdl)->LastLevel; /* get current power level */ + // globalPtr->userRange = 0; /* allow full power level */ + globalPtr->powerRange = Larger(globalPtr->lastLevel,globalPtr->userRange); + +-/* initialize tables */ +- globalPtr->maximumTable = (short *) (cpuinfo->bkltroutines->maxTable); +- globalPtr->settingTableLow = (setTableType *) (cpuinfo->bkltroutines->lowTable); /* */ +- globalPtr->settingTableHigh = (setTableType *) (cpuinfo->bkltroutines->hiTable); /* */ +- globalPtr->settingTable = globalPtr->settingTableHigh; +- +-/* initialize vectors */ +- globalPtr->setlevelproc = (intFunction) (cpuinfo->bkltroutines->setProc); /* proc to set level */ +- globalPtr->userInputProc = (intFunction) (cpuinfo->bkltroutines->getProc); /* proc to read user input */ +- openProc = (osFunction) (cpuinfo->bkltroutines->open); /* routine to close pwm hardware */ +- globalPtr->closeProc = (intFunction) (cpuinfo->bkltroutines->close); /* routine to close pwm hardware */ +- globalPtr->controlProc = (osFunction) (cpuinfo->bkltroutines->control); /* passed control routine */ +- globalPtr->statusProc = (osFunction) (cpuinfo->bkltroutines->status); /* passed status routine */ +- globalPtr->hardwareDependentPtr = (Ptr) (cpuinfo->bkltroutines->hwDependentVar); +- globalPtr->tableProc = (voidFunction) (cpuinfo->bkltroutines->tableProc); +- +- +-/* call custom initialization routine */ +- if (openProc) ++ boxFlag = *(char *)0xCB3; ++ switch (boxFlag) + { +- error = (*openProc)(globalPtr); +- if (error) +- { +- DisposPtr((Ptr) globalPtr); /* release memory */ +- dCtl->dCtlStorage = NULL; +- return(error); /* clear out saved value for next open */ +- }; +- }; +- +- ++ case 4: // Portable ++ InitRegControls(globalPtr); ++ break; ++ case 15: // PowerBook 170, TIM ++ case 18: // PowerBook 100, Asahi ++ default: ++ InitPWMControls(globalPtr); ++ break; ++ } + + globalPtr->brightnessVbl.globals = (Ptr) globalPtr; + globalPtr->brightnessVbl.vblpb.qType = vType; +@@ -257,7 +221,6 @@ pascal OSErr DRVRClose(CntrlParam *ctlPB,DCtlPtr dCtl) /* 'open' entry point * + + globalPtr = (driverGlobalPtr) dCtl->dCtlStorage; /* set context to my global data area */ + +- globalPtr->slewChange = false; /* always turn off slew during close
*/ + VRemove((QElemPtr) &globalPtr->brightnessVbl.vblpb); /* remove vbl task */ + if (globalPtr->closeProc != NULL) /* if hw close proc … */ + (*globalPtr->closeProc)(globalPtr); /* … call close proc */ +@@ -390,27 +353,10 @@ pascal OSErr DRVRStatus(CntrlParam *ctlPB,DCtlPtr dCtl) /* 'open' entry point + globalPtr->vbl_ok = false; /* disable vbl task */ + switch(ctlPB->csCode) + { +- case kGetUserInput: +- ctlPB->csParam[0] = globalPtr-> +- userInputProc( globalPtr ); /* Get the button inputs */ +- break; +- + case KGetVersion: + ctlPB->csParam[0] = globalPtr->version; /* return current driver version */ + break; + +- case kGetScreenBrightness: /*

return current saved brightness */ +- ctlPB->csParam[0] = globalPtr->userBrightness; +- break; +- +- case kGetBrightnessRange: /*

return range of brightness values */ +- ctlPB->csParam[0] = globalPtr->settingTable->maximum;/*

using new tables, return max setting */ +- ctlPB->csParam[1] = globalPtr->settingTable->minimum;/*

using new tables, return min setting */ +- break; +- case kGetMaximum: /*

*/ +- ctlPB->csParam[0] = globalPtr->maximumTable[globalPtr->powerRange]; +- break; +- + default: + error = (*globalPtr->statusProc)(ctlPB,globalPtr); + }; +@@ -526,7 +472,7 @@ PowerChange (driverGlobalPtr globalPtr, int currentPowerLevel) + { + if (!globalPtr->flyByWire && userInput) /* if only software controls and backlight on */ + { +- userInput >>= 1; /* reduce power by 1/2 */ ++ userInput = globalPtr->userBrightness >> 1; /* reduce power by 1/2 */ + if (!userInput) userInput = 1; /* insure at least on */ + }; + }; +@@ -539,47 +485,20 @@ PowerChange (driverGlobalPtr globalPtr, int currentPowerLevel) + * + *************************************************************************************************** + */ +- +-/*page +- *************************************************************************************************** +- * +- * +- *************************************************************************************************** +- */ +-unsigned int LowTable (driverGlobalPtr globalPtr) +- ++int GetBacklightInfo(short mask, short shift) + { +- PmgrGlobals **pmgrglobalhdl; /* handle to power manager globals */ +- Boolean wasLowTable; /* current table being used */ +- Boolean hiTable; /* use hi level table now */ +- +- pmgrglobalhdl = (PmgrGlobals **) 0x0D18; /* handle to power manager globals */ +- +- wasLowTable = globalPtr->lowTable; /* current table */ +- hiTable = false; /* assume low table */ +- if ((wasLowTable && ((*pmgrglobalhdl)->BatAvg >= globalPtr->hiThreshold)) || +- (!wasLowTable && ((*pmgrglobalhdl)->BatAvg >= globalPtr->lowThreshold))) +- { +- hiTable = (*pmgrglobalhdl)->Charger & 0x01; /* qualify table with charger */ +- }; +- return(hiTable ? 0 : 1); /* return 1 if low table, 0 if high */ +-}; ++ unsigned char buf; ++ ReadXPram(0x74, sizeof(buf), &buf); ++ return (buf & mask) >> shift; ++} + +-/*page +- *************************************************************************************************** +- * +- * +- *************************************************************************************************** +- */ +-void ChargerAdjust (driverGlobalPtr globalPtr) +-{ +- unsigned int oldTable; +- +- oldTable = globalPtr->lowTable; /* save the current table being used */ +- globalPtr->lowTable = LowTable(globalPtr); /* get the new table to use */ +- if (globalPtr->lowTable == oldTable) return; /* are we changing tables ???, no exit */ +- +- globalPtr->slewChange = true; /* if change, set tmp slew on */ +- globalPtr->settingTable = globalPtr->lowTable ? globalPtr->settingTableLow :globalPtr->settingTableHigh ; +-}; ++void SaveBacklightInfo(short new, short mask, short shift) ++{ ++ int addr = 0x70; ++ unsigned char buf; ++ ReadXPram(addr + 4, sizeof(buf), &buf); ++ buf &= ~mask; ++ buf |= (new << shift) & mask; ++ WriteXPram(addr + 4, sizeof(buf), &buf); ++} + +diff --git a/Drivers/Backlight/backlight.h b/Drivers/Backlight/backlight.h +--- a/Drivers/Backlight/backlight.h ++++ b/Drivers/Backlight/backlight.h +@@ -9,23 +9,6 @@ + + Change History (most recent first): + +- 1/5/94 kc Add Function ProtoTypes to prevent compiler warnings. +- 12/13/93 PN Roll in KAOs and Horror changes to support Malcom and AJ +- machines +- 9/2/93 SKH Roll in changes from Horror +- 2/11/93 CSS Remove boxflags from this file. +- Update from Horror. Comments follow : +- 1/21/93 RLE add Escher box flags +- 6/30/92 ag Added new type definitions. +- 5/7/92 ag Added new type definitions to accomodate table changes. +- 4/24/92 ag added new hardware dependent field for general use by hardware +- dependent code. added new typedefs to allow for easier type +- conhersion. +-
12/17/91 SWC Added boxDBLiteLC. +-
12/16/91 HJR Added boxDartanian. +-

11/5/91 SWC Fixed boxDBLite again because we got pushed out to a new value. +-

9/10/91 SWC Fixed boxAsahi and boxDBLite to reflect final values. +-

8/5/91 SWC Added boxDBLite to list of CPUs we work with. + <8> 3/30/92 JSM Rolled this file into SuperMario project. + <7> 3/24/92 JSM Nuke boxFlag codenames. + <6> 10/28/91 SAM Rolled in Regatta file. +@@ -65,7 +48,7 @@ + * + */ + #define DRIVERMAJORVERSION 0x0100 +-#define DRIVERMINORVERSION 0x0001 ++#define DRIVERMINORVERSION 0x0002 + #define DRIVERVERSION (DRIVERMAJORVERSION + DRIVERMINORVERSION) + + /* Control Calls */ +@@ -154,13 +137,6 @@ typedef struct + VBLTask vblpb; + } vblstruct; + +-typedef struct +- { +- short minimum; +- short maximum; +- unsigned char table[]; +- } setTableType; /* new structure for tables */ +- + typedef struct + { + SleepQRec sleepQelement; /* sleep queue element, MUST stay on top */ +@@ -187,9 +163,9 @@ typedef struct + short slewLimit; + unsigned short lowThreshold; + unsigned short hiThreshold; +- setTableType *settingTable; /* pointer to record now */ +- setTableType *settingTableLow; /* pointer to record now */ +- setTableType *settingTableHigh; /* pointer to record now */ ++ unsigned char *settingTable; ++ unsigned char *settingTableLow; ++ unsigned char *settingTableHigh; + short *maximumTable; + + short lastLevel; /* last power level */ +@@ -203,8 +179,6 @@ typedef struct + short mousedownTicks; /* first notice of mouse down in tick count */ + short keycodes; /* key combinations */ + short lastatod; /* last raw a to d value */ +- +- Ptr hardwareDependentPtr; /* private storage for hardware dependent code */ + } driverGlobaltypes, *driverGlobalPtr; + + typedef struct +@@ -248,20 +222,20 @@ typedef struct + #define SaveBrightness(new) SaveBacklightInfo(new+1,VALUE_MASK, 0) + #define SaveKeyData(new) SaveBacklightInfo(new,KEY_MASK, 5) + +-/* new ponti defintions */ +-#define PONTILMPCTLREG *((unsigned char *) 0x50f96C00) +-#define PONTILMPON 0 +-#define PONTILMPHWCTL 1 +-#define PONTILMPMUX0 2 +-#define PONTILMPMUX1 3 +- + typedef int (*intFunction)(); + typedef OSErr (*osFunction)(); + typedef void (*voidFunction)(); + + int abs(int); + unsigned char GetPortableValues(int parameter); +-OSErr InitPWMControls(driverGlobalPtr globalPtr); ++void InitPWMControls(driverGlobalPtr globalPtr); + unsigned char Get_AtoD(int channel); + unsigned char Get_PGEButton(int channel); +-int SetPWM(int new, driverGlobalPtr globalPtr); +\ No newline at end of file ++int SetPWM(int new, driverGlobalPtr globalPtr); ++void InitRegControls(driverGlobalPtr globalPtr); ++int PotControl (driverGlobalPtr globalPtr); ++int PWMCloseRoutine (driverGlobalPtr globalPtr); ++OSErr PWMControl(CntrlParam *ctlPB,driverGlobalPtr globalPtr); ++OSErr PWMStatus(CntrlParam *ctlPB,driverGlobalPtr globalPtr); ++unsigned int LowTable (driverGlobalPtr globalPtr); ++void ChargerAdjust (driverGlobalPtr globalPtr); diff --git a/Drivers/Video/TFBDriver.a b/Drivers/Video/TFBDriver.a --- a/Drivers/Video/TFBDriver.a +++ b/Drivers/Video/TFBDriver.a