💾 Archived View for mirrors.apple2.org.za › active › ftp.apple.asimov.net › images › gs › hardware ›… captured on 2024-07-09 at 08:38:42.
View Raw
More Information
-=-=-=-=-=-=-
- *********
- JMinstall and JoyMouse driver by Derek Taubert (July 1990)
- Prodos Quit routine must be found and changed to an RTL to change application
- compiled by TML Pascal II to an initilization routine. Resources were removed
- from the application as well (not necessary). Program will run as an
application,
- one could be written to remove the JoyMouse driver as well.
- Place JMinstall in */system/system.setup and JoyMouse in */system/desk.accs
- to use. JoyMouse moves the cursor with atari-style relative movements.
- *********
Program JMinstall;
USES Types,
GSOS,
TMLUtils,
Locator,
Memory,
MiscTool;
VAR
gMyMemoryID,
gNewMemoryID : integer;
gStartStopRef : ref;
gDriverHndl : Handle;
F : Str255;
i : integer;
DriverFileName : GSString255;
parmsInfo : FileInfoRecGS;
parmsOpen : OpenRecGS;
parmsEOF : EOFRecGS;
parmsRead : IORecGS;
parmsClose : RefNumRecGS;
fake : integer;
location : integer;
BEGIN
gMyMemoryID := MMStartup;
MTStartUp;
F := '*:SYSTEM:DRIVERS:JOYMOUSE';
DriverFileName.length := length(F);
for i := 1 to length(F) do
DriverFileName.text[i] := F[i];
parmsInfo.pCount := 4;
parmsInfo.pathname := @DriverFileName;
GetFileInfoGS(parmsInfo);
if (BAND(parmsInfo.auxType,$8000) = $8000) or (_ToolErr <> noError)
then Exit;
{this checks to see if driver has been "inactivated" by the finder's
Get Info}
parmsOpen.pCount := 2;
parmsOpen.pathname := @DriverFileName;
OpenGS(parmsOpen);
if _ToolErr <> noError then Exit;
parmsEOF.pCount := 2;
parmsEOF.refNum := parmsOpen.refNum;
GetEOFGS(parmsEOF);
if _ToolErr <> noError then begin
parmsClose.pcount := 1;
parmsClose.refNum := parmsOpen.refNum;
CloseGS(parmsClose);
Exit
end;
gNewMemoryID := GetNewID($dd00);
gDriverHndl := NewHandle(parmsEOF.eof,gNewMemoryID,attrFixed+attrNoCross+
attrLocked+attrNoSpec+attrNoPurge,nil);
if _ToolErr <> noError then begin
parmsClose.pcount := 1;
parmsClose.refNum := parmsOpen.refNum;
CloseGS(parmsClose);
Exit
end;
parmsRead.pcount := 4;
parmsRead.refNum := parmsOpen.refNum;
parmsRead.dataBuffer := gDriverHndl^;
parmsRead.requestCount := parmsEOF.eof;
ReadGS(parmsRead);
if _ToolErr <> noError then begin
HUnlock(gDriverHndl);
DisposeHandle(gDriverHndl);
parmsClose.pcount := 1;
parmsClose.refNum := parmsOpen.refNum;
CloseGS(parmsClose);
Exit
end;
parmsClose.pcount := 1;
parmsClose.refNum := parmsOpen.refNum;
CloseGS(parmsClose);
SetHeartBeat(gDriverHndl^);
if _ToolErr <> noError then Exit;
MTShutDown;
MMShutDown(gMyMemoryID)
END.