Soooo found this about the EGRET on Apple Developer Archives.... "EGRET WAKEUP"..... What?

jajan547

Active Tinkerer
Mar 25, 2022
732
295
63
North Carolina, USA
I found this weird little mess of files on the old apple Developer archives. From what I can tell it's a sample code, any thoughts?
 

Attachments

  • EgretWakeup.zip
    2.5 KB · Views: 109

BFEXTU

Tinkerer
Jul 15, 2022
177
147
43
I repaired the MPW files for you. Always use a binary format for cross-platform compatibility - don't use .zip of raw mac files, don't use .sit, etc. -- use .hqx, etc. All of the online sites like garden and repo drive me crazy based on trying to download and migrate to emulation via Windows.

I will take a look at the files.
 

Attachments

  • EgretWakeup.sit.hqx
    4.3 KB · Views: 62
  • Love
Reactions: retr01

BFEXTU

Tinkerer
Jul 15, 2022
177
147
43
OK - it looks like it is a MacDTS (Developer Tech Support) sample derived from the IIsi (so 1990ish or later). Also, it looks like the EgretWakeup.p file is missing from the archive, but it probably showed a single call, passing seconds. Just hard-code it if you want to use it - quick and easy.

The archive includes:
EgretWakeup.make -- a typical MPW make file
EgretWakeup.equ -- 68K MPW assembly equates file
EgretWakeup.a -- 68K MPW assembly code file
(no .p file, but not really needed - the .a code explains it)

The most interesting thing about it is that it shows how to invoke a retro trap call to _EgretDispatch ($A092) -- check MPW:Interfaces:AIncludes:Traps.a in MPW 3.2 -- from around 1990. It also shows how to fill in the related PBlock, or a "Parameter Block," which is the typical structure used for many MacOS calls. So, _EgretDispatch will probably work on older systems -- and probably pre-7.1. I would have to try it or research it and it might throw an unimplemented error on newer/non-Egret machines -- not sure. I never really had to use it for anything. Based on the trap number, it appears to have been included around the same time as _SysEnvirons ($A090), ADB, the rise of 32-bit support (24/32 swapping) and Color QuickDraw (pixpats).

Egret appeared with various machines as the OP noted above -- IIsi, LC, vx - etc. -- and was 6805-based.

Notably, as Apple moved into the '90s, they started creating PowerBooks -- the 100, 140, 160, 170, 180...and the color variants for the 160 and 180, etc. -- then the Duo and PowerBook 500 series computers. The first Mac laptop was the Portable in the late '80s, but it was really not very "portable." :D

With the expansion of mobile computing, Apple developed/expanded the Power Manager/PG&E that was mostly 6805-based, low-level power management code for portable machines (battery-powered). Also, all of the expanded wakeup features became more relevant as telecommunications grew - internal/external modems, originally from Bell 103 through 56K -- wake on ring functionality, timed wakeups, etc. Also -- wake from sleep, wake on network, remote wakeup, wake on ADB event, entering auto-sleep, drive spin-down, etc. , not to mention the underlying charging functions. On the PowerBook 500 and Duo series, the Power Manager was directly responsible for data exchange between the internal modem (DMA in the case of the PowerBook 500) and the host. I think the Power Manager used to only be on PowerBooks, where the related gestalt was originally a valid PowerBook vs. Desktop test. However, there was direct cross-over between the contemporary hardware/micro designs of the IIsi and the first generation of PowerBooks (140/170) -- and note that the 6805 i/o pmgr interface implementations persisted at least through the Duo/500 PowerBooks (and beyond).

Over time, things became more and more unified between the system interfaces for mobile vs. desktop (conserving energy, etc.) -- certainly highly-integrated by System 7.5 to OSX timeframe. But, by that time, I was in the PC space.

Anyway -- back to the code -- the example is very simple -- it just shows setting up the PBlock with the cmdType and cmd, entering a longword value passed from the Pascal calling interface that contains the wakeup time in seconds, then executing the trap call. The Equates.a file shows the values for the command type and command byte, and contains the PBlock definition to generate the stackframe. The code and equates don't use any low-memory globals (contrary to the DTS note) -- just a trap dispatcher call. And, the equates.a file defines the command as a word instead of byte (but the compiler doesn't care and will just take the low-order byte).

I would try it on my IIsi, except that it has been battery-acid-ravaged, unfortunately. It will be a project, if it's even fixable. :(

Anyway - I hope that info helps explain and provide some interesting context. It should be mostly correct, but don't quote me -- it was a while ago. :p Please feel free to add, correct, amend, etc.
 

retr01

Senior Tinkerer
Jun 6, 2022
2,474
1
796
113
Utah, USA
retr01.com
I repaired the MPW files for you. Always use a binary format for cross-platform compatibility - don't use .zip of raw mac files, don't use .sit, etc. -- use .hqx, etc. All of the online sites like garden and repo drive me crazy based on trying to download and migrate to emulation via Windows.

I will take a look at the files.

I agree. I had a tough time getting the StuffIt program set up on my Mini G4 under OS 9 from Macintosh Garden because people do not think twice about uploading those programs that should be in a disk or CD image to make it easier. How do you expand .SIT files when you can't expand to install the StuffIt program? So I ended up getting the Expander 6.1 from Macintosh Repository.
 
  • Like
Reactions: BFEXTU

BFEXTU

Tinkerer
Jul 15, 2022
177
147
43
Well...it's not just the .sit files, it's also the fact that they lose their type/creator and resource forks when moving via the PC environment. MacRepo and Garden are great, but, IMO, for greatest compatibility, all the files should be in a least-common-denominator .hqx format...and they are not. I think I have Expander 5.5 and half the time it doesn't work, or it can't expand files it doesn't recognize, etc. Just a headache vs. 1.5.1 or 4.0 files protethat have been binhexed to protect file integrity.
 

BFEXTU

Tinkerer
Jul 15, 2022
177
147
43
Use ResEdit to restore the appropriate type and creator, then hope it decompresses without errors -- but still prone to issues...or don't have the problem in the first place. ;)