home *** CD-ROM | disk | FTP | other *** search
- 11-May-88 21:25:21-MDT,7689;000000000000
- Return-Path: <u-lchoqu%sunset@cs.utah.edu>
- Received: from cs.utah.edu by SIMTEL20.ARPA with TCP; Wed, 11 May 88 21:25:10 MDT
- Received: by cs.utah.edu (5.54/utah-2.0-cs)
- id AA03775; Wed, 11 May 88 21:25:45 MDT
- Received: by sunset.utah.edu (5.54/utah-2.0-leaf)
- id AA29283; Wed, 11 May 88 21:25:42 MDT
- Date: Wed, 11 May 88 21:25:42 MDT
- From: u-lchoqu%sunset@cs.utah.edu (Lee Choquette)
- Message-Id: <8805120325.AA29283@sunset.utah.edu>
- To: rthum@simtel20.arpa
- Subject: SEPict.asm.shar
-
- #--------------------------------CUT HERE-------------------------------------
- #! /bin/sh
- #
- # This is a shell archive. Save this into a file, edit it
- # and delete all lines above this comment. Then give this
- # file to sh by executing the command "sh file". The files
- # will be extracted into the current directory owned by
- # you with default permissions.
- #
- # The files contained herein are:
- #
- # 3 SEPict.a
- # 3 SEPict.r
- #
- echo 'Extracting SEPict.a.'
- if test -f SEPict.a; then echo 'shar: will not overwrite SEPict.a'; else
- sed 's/^X//' << '________This_Is_The_END________' > SEPict.a
- X TITLE 'SEPict - show the pictures in the SE ROM'
- X
- X INCLUDE 'Traps.a'
- X INCLUDE 'ToolEqu.a'
- X INCLUDE 'QuickEqu.a'
- X INCLUDE 'SysEqu.a'
- X
- XReadyAlert EQU 1000
- XNotAnSEAlert EQU 1001
- XmyNoButton EQU 1
- XmyOKButton EQU 2
- XmDownMask EQU 2
- XkeyDownMask EQU 8
- X
- XPoint RECORD 0
- Xv DS.W 1
- Xh DS.W 1
- X ENDR
- X
- XEventRecord RECORD 0
- Xwhat DS.W 1
- Xmessage DS.L 1
- Xwhen DS.L 1
- Xwhere DS.L Point
- Xmodifiers DS.W 1
- X ENDR
- X
- XGlobalData RECORD
- XmyEvent DS.L EventRecord
- X ENDR
- X
- X
- X; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- X
- XSEPict MAIN
- X WITH GlobalData
- X
- X PEA -4(A5)
- X _InitGraf
- X _InitFonts
- X MOVE.L #$0000FFFF,D0
- X _FlushEvents
- X _InitWindows
- X _InitMenus
- X _TEInit
- X PEA TheEnd
- X _InitDialogs
- X _InitCursor
- X
- X CLR.L D7
- X MOVE ROMMapInsert,D7 ; save this away...
- X
- X MOVE.L ROMBase,A0 ; the pointer to ROM
- X MOVE 8(A0),D0 ; the signature bytes
- X CMPI #$0276,D0 ; this is the SE, no...
- X BNE.S Oops
- X
- X MOVE.W #0,-(A7) ; WE ARE ON A MAC SE HERE!!!
- X MOVE #ReadyAlert,-(A7)
- X MOVE.L #0,-(A7)
- X _CautionAlert
- X MOVE.W (A7)+,D0
- X
- X CMPI #myNoButton,D0
- X BEQ.S TheEnd
- X MOVE #-1,ROMMapInsert
- X
- X JSR GetTheWidget
- X
- XMainLoop
- X ADDQ.W #4,D6
- X ANDI.L #$0000000C,D6 ; number MOD 12
- X JSR DisplayOnePict
- X
- X MOVEA.W #120,A0
- X _Delay
- X
- X BRA.S MainLoop
- X
- XOops
- X CLR.W -(A7)
- X MOVE #NotAnSEAlert,-(A7)
- X MOVE.L #0,-(A7)
- X _StopAlert
- X MOVE.W (A7)+,D0
- X
- XTheEnd
- X MOVE D7,ROMMapInsert ; restore the state...
- X _ExitToShell
- X
- X; ---------------------------------------------------------------------------------
- X
- XCheckEvents
- X CLR.W -(A7) ; function result
- X MOVE #mDownMask+keyDownMask,-(A7)
- X PEA myEvent ; a place to put the pointer to the event Record
- X _GetNextEvent
- X MOVE (A7)+,D0
- X BNE.S TheEnd
- X RTS
- X
- X; ---------------------------------------------------------------------------------
- X
- XGetTheWidget
- X SUBQ.W #4,A7
- X MOVE.L #'bbmc',-(A7)
- X CLR.W -(A7)
- X _GetResource
- X MOVE.L (A7)+,D0
- X BEQ.S TheEnd
- X MOVEA.L D0,A0
- X MOVE.L (A0),ApplScratch+0
- X MOVEQ #0,D6
- X RTS
- X
- X; ---------------------------------------------------------------------------------
- X
- XDisplayOnePict
- X _HideCursor
- X
- X MOVE.L ApplScratch+0,A0
- X ADDA.W D6,A0
- X MOVE.L (A0),D3
- X MOVE.L ApplScratch+0,ApplScratch+4
- X ADD.L D3,ApplScratch+4
- X MOVE.L ScrnBase,ApplScratch+8
- X MOVE.L #340,D3
- X@1
- X PEA ApplScratch+4
- X PEA ApplScratch+8
- X MOVE.W #72,-(A7)
- X _UnpackBits
- X
- X BSR.S CheckEvents
- X SUBQ.L #8,ApplScratch+8
- X
- X DBRA D3,@1
- X
- X PEA ApplScratch+4
- X PEA ApplScratch+8
- X MOVE.W #64,-(A7)
- X _UnpackBits
- X
- X _ShowCursor
- X
- X RTS
- X
- X; ---------------------------------------------------------------------------------
- X
- X END
- X
- ________This_Is_The_END________
- if test `wc -l < SEPict.a` -ne 151; then
- echo 'shar: SEPict.a was damaged during transit'
- echo ' (should have been 151 bytes)'
- fi
- fi ; : end of overwriting check
- echo 'Extracting SEPict.r.'
- if test -f SEPict.r; then echo 'shar: will not overwrite SEPict.r'; else
- sed 's/^X//' << '________This_Is_The_END________' > SEPict.r
- X#include "Types.r"
- X
- Xresource 'ALRT' (1000, "Warning") {
- X {66, 112, 270, 398},
- X 1000,
- X { /* array: 4 elements */
- X /* [1] */
- X OK, visible, sound1,
- X /* [2] */
- X OK, visible, sound1,
- X /* [3] */
- X OK, visible, sound1,
- X /* [4] */
- X OK, visible, sound1
- X }
- X};
- X
- Xresource 'ALRT' (1001, "Not an SE") {
- X {40, 40, 144, 280},
- X 1001,
- X { /* array: 4 elements */
- X /* [1] */
- X OK, visible, sound1,
- X /* [2] */
- X OK, visible, sound1,
- X /* [3] */
- X OK, visible, sound1,
- X /* [4] */
- X OK, visible, sound1
- X }
- X};
- X
- Xresource 'DITL' (1000, "Warning") {
- X { /* array DITLarray: 4 elements */
- X /* [1] */
- X {168, 32, 192, 104},
- X Button {
- X enabled,
- X "Quit"
- X },
- X /* [2] */
- X {136, 32, 160, 104},
- X Button {
- X enabled,
- X "Show me"
- X },
- X /* [3] */
- X {8, 64, 128, 256},
- X StaticText {
- X disabled,
- X "This program displays some interesting t"
- X "hings that the Macintosh SE design team "
- X "built into the ROM of the SE.\n\nClick the"
- X " mouse or press a key to return to the F"
- X "inder..."
- X },
- X /* [4] */
- X {136, 144, 172, 253},
- X Picture {
- X enabled,
- X 1000
- X }
- X }
- X};
- X
- Xresource 'DITL' (1001, "Not an SE") {
- X { /* array DITLarray: 2 elements */
- X /* [1] */
- X {64, 136, 88, 208},
- X Button {
- X enabled,
- X "Sorry"
- X },
- X /* [2] */
- X {8, 64, 48, 232},
- X StaticText {
- X enabled,
- X "This program only runs on a Macintosh SE"
- X "."
- X }
- X }
- X};
- X
- Xresource 'PICT' (1000) {
- X 460,
- X {169, 140, 205, 249},
- X $"1101 0100 0A00 A900 8C00 CD00 F998 0010"
- X $"00A9 0088 00CD 0100 00A9 008C 00CD 00F9"
- X $"00A9 008C 00CD 00F9 0000 0501 001C F300"
- X $"0501 0038 F300 0501 0030 F300 0B07 03AE"
- X $"0820 2440 0040 F900 0B07 07DF 0820 0440"
- X $"0040 F900 0C08 0FFE 054B 6EE6 7072 40FA"
- X $"000C 080F FC05 4C24 4948 4A40 FA00 0C08"
- X $"0FFC 0288 244F 484A 40FA 000C 080F FC02"
- X $"8824 4848 4A40 FA00 0C08 0FFE 0288 2226"
- X $"4871 C0FA 0009 010F FFFB 0000 40FA 000A"
- X $"0107 FFFC 0001 0180 FA00 0501 03FE F300"
- X $"0501 01DC F300 02F1 000C 0800 0007 1000"
- X $"0041 0360 FA00 0C08 0000 0890 0000 6301"
- X $"20FA 000D 0900 0008 3991 3055 3126 58FB"
- X $"000D 0900 0007 124A 4849 0929 60FB 000C"
- X $"FE00 0693 CA78 4139 2F40 FB00 0D09 0000"
- X $"0892 0440 4149 2840 FB00 0D09 0000 0709"
- X $"8430 4139 2640 FB00 02F1 0002 F100 02F1"
- X $"0002 F100 02F1 0010 0C00 0001 0006 0070"
- X $"0000 0200 0010 FE00 100C 0000 0100 0200"
- X $"8800 0002 0000 10FE 0011 0D00 0002 9CE2"
- X $"6081 9D9C 9732 C017 18FF 0011 0D00 0002"
- X $"9292 9082 5252 924B 0014 A4FF 0011 0D00"
- X $"0007 D292 F082 5252 927A 0014 A0FF 0011"
- X $"0D00 0004 5292 808A 5252 9242 0014 A4FF"
- X $"0011 0F00 0004 5CE2 6071 925C 7132 0414"
- X $"9880 000E FE00 0110 80FE 0003 1000 0004"
- X $"FD00 0EFE 0001 1080 FE00 0310 0000 08FD"
- X $"00FF"
- X};
- X
- X
- ________This_Is_The_END________
- if test `wc -l < SEPict.r` -ne 118; then
- echo 'shar: SEPict.r was damaged during transit'
- echo ' (should have been 118 bytes)'
- fi
- fi ; : end of overwriting check
- exit 0
- 11-May-88 21:25:45-MDT,4021;000000000000
- Return-Path: <u-lchoqu%sunset@cs.utah.edu>
- Received: from cs.utah.edu by SIMTEL20.ARPA with TCP; Wed, 11 May 88 21:25:40 MDT
- Received: by cs.utah.edu (5.54/utah-2.0-cs)
- id AA03863; Wed, 11 May 88 21:26:17 MDT
- Received: by sunset.utah.edu (5.54/utah-2.0-leaf)
- id AA29290; Wed, 11 May 88 21:26:14 MDT
- Date: Wed, 11 May 88 21:26:14 MDT
- From: u-lchoqu%sunset@cs.utah.edu (Lee Choquette)
- Message-Id: <8805120326.AA29290@sunset.utah.edu>
- To: rthum@simtel20.arpa
- Subject: SampleINIT.asm.c
-
- /*
- SampleInit.c
- April 22, 1988
- Written by Juri Munkki
-
- This source code is in the public domain.
- The author makes no guarantees.
-
- Instructions
-
- I wrote this INIT as a sample to one of my clients.
- They wished to monitor what the user does and generate
- statistics on frequently used actions.
-
- This INIT does nothing useful. It modifies GetNextEvent
- so that instead of returning autoKey events with the
- spacebar, the # character is returned. It should be
- quite a surprise to people who are used to using spaces
- instead of tabs. :-) The INIT has no effect on DAs.
-
- You should have Lightspeed C to use this INIT. The
- structure of an INIT depends highly on the development
- system being used. Lightspeed C places global data
- storage after the program code. This means that you
- can't have more than 32K of code AND static variables.
-
- The INIT resource itself should have the "System Heap"
- flag set or it will bomb sooner or later. (usually soon)
-
- Please remember to put a 'sysz' resource into your
- INIT, if you're going to need a lot of space. Also
- remember that any dynamic storage that should live
- through launches should be in the system heap.
-
- I hope this helps those who are desperately trying to
- patch the system.
-
- Juri Munkki
- jmunkki@santra.hut.fi
- jmunkki@fingate.bitnet
- */
-
- #include <MacTypes.h>
- #include <OSUtil.h>
- #include <EventMgr.h>
-
- #define NextEventNum 0x970
-
- long OldNextEvent;
- long ticker;
- EventRecord *theEvent;
-
- void DoEvent(doIt)
- int doIt;
- {
- if(doIt)
- if(theEvent->what==autoKey)
- if((theEvent->message & 0xFF) == ' ')
- theEvent->message+='#'-' ';
- }
-
- void NewGetEvent()
- {
- asm {
- move.l (sp)+,A0 /* Return address */
- move.l (sp)+,A1 /* Pointer to an EventRecord */
- move.w (sp)+,D0 /* EventMask */
-
- move.l A0,-(sp) /* Push return address for RTS */
- move.l A4,-(sp) /* Save A4. */
- move.l @1,A4 /* Set A4 (static base reg) */
-
- move.l A1,theEvent /* Save the ER pointer */
-
- clr.w -(sp) /* Space for returned value */
- move.w D0,-(sp) /* Push EventMask */
- move.l A1,-(sp) /* Push ER pointer */
- move.l OldNextEvent,A0 /* Get ready to jsr */
- jsr (A0) /* Do the old GetNextEvent */
- move.w (sp),10(sp) /* Result to REAL result.
- Leave the result in the stack
- as a parameter for DoEvent */
- jsr DoEvent /* Do our stuff */
- addq.l #2,sp /* Remove parameter */
- move.l (sp)+,A4 /* Restore A4 */
- rts
-
- @1 nop /* "Variable" space */
- }
- }
- /* Save base reg at the end of the previous routine.
- ** This is clearly a kludge...
- */
- void sa0()
- {
- asm {
- @0 lea @0-4,A1
- move.l A0,(A1)
- }
- }
- /* Would you like to close a file before the system
- ** goes down? Would you like to play a sound before
- ** rebooting? This is where you place the code.
- */
- void MyShutDown()
- {
- SysBeep(10);
- SysBeep(10);
- }
- /* This part gets called once. It saves the pointer
- ** to us (our static storage), installs the patch and
- ** puts us in the shutdown queue.
- */
- void main()
- {
- Handle myhandle;
-
- sa0();
- asm { movem.l A0-A4,-(A7)
- move.l A0,A4
- _RecoverHandle
- move.l A0,myhandle
- }
- if(Button())
- SysBeep(10); /* Beep, if install was cancelled */
- else
- { DetachResource(myhandle);
- HLock(myhandle);
-
- OldNextEvent=NGetTrapAddress(NextEventNum,ToolTrap);
- NSetTrapAddress(NewGetEvent,NextEventNum,ToolTrap);
-
- ShutDwnInstall(MyShutDown,8);
- }
-
- asm { movem.l (A7)+,A0-A4 }
- }
- /* File ends here! */
-
-
-