[comp.sys.amiga.tech] Intuition Shutdown

BBOURBIN@UMDD.BITNET (Brett S Bourbin) (04/19/88)

I have just switched from doing all my work on the Amiga in assembly to 'C'
and assembly mixture.  I want to write a system (read: GAME) that will take
over the system, not multitasking, but uses all system calls and does not
go to the hardware.  I want to keep compatibility with future Amigas along
with being able to port it to other machines, if I wish.

Now comes the question:  I have disabled the Intuition Handler (set the
SetMPort to -1) and I am using port 2 for joystick input.  After thinking
about it for awhile, I realized that this method still keeps the Intuition
Handler running and also taking up memory.  It will also intercept any of
the keyboard messages (Amiga-arrows, etc).  I don't want to waste more
more memory to write code to intercept the input devices before Intuition
get a hold of them, instead I wish to shut down Intuition TOTALLY and
take it from there.  Can I FindTask(mytask) and issue a CloseDevice() to
the input.device and return the memory allocated for the handler?

I want to keep compatibility but I do not need the overhead.

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
Brett S Bourbin                         /--> bbourbin@umdd.BITNET
ICP -- University of Maryland   Email--|
College Park, MD 20742                  \--> brett@rover.umd.edu

cmcmanis%pepper@Sun.COM (Chuck McManis) (04/20/88)

In article <8804181807.AA15039@jade.berkeley.edu> (Brett S Bourbin) writes:
|>I have just switched from doing all my work on the Amiga in assembly to 'C'
|>and assembly mixture.  I want to write a system (read: GAME) that will take
|>over the system, not multitasking, but uses all system calls and does not
|>go to the hardware.  I want to keep compatibility with future Amigas along
|>with being able to port it to other machines, if I wish.

Noble sentiment.

|>Now comes the question:  I have disabled the Intuition Handler (set the
|>SetMPort to -1) and I am using port 2 for joystick input.  After thinking
|>about it for awhile, I realized that this method still keeps the Intuition
|>Handler running and also taking up memory.  It will also intercept any of
|>the keyboard messages (Amiga-arrows, etc).  I don't want to waste more
|>more memory to write code to intercept the input devices before Intuition
|>get a hold of them, instead I wish to shut down Intuition TOTALLY and
|>take it from there.

Well, SetMPort will keep the mouse from getting messages but it does not
shut down Intuition. To do that you really need to insert an input handler
into the input food chain before Intuition. Jim Mackraz has an example
of this in his copper talk, I believe that this will be available after
the developers conference. What an input handler does is intercept all 
InputEvents from the input.device and 'eat' them. They never get passed
to Intuition so Intuition *never* runs. No cycles, no wasted time. When
would you want to blow away Intuition? Well, if you can no longer get
memory from Exec it may be time to start things shutting down. You
can close the Workbench (recommended) and close any fonts, libraries
or devices you aren't using. Try the Alloc again. If it fails then you
either have to compact your code (you might also try running on a 
freshly booted system), require > 512K of RAM, or blow away memory that
isn't "yours". If you do the latter be sure and reset the machine on 
exit so that you don't have the chance of going back to I/D/E 
(Intuition/DOS/Exec) with the memory in a corrupted state.

> Can I FindTask(mytask) and issue a CloseDevice() to
> the input.device and return the memory allocated for the handler?

No, besides you want the input device to feed your game events from
things like the joystick, keyboard, etc. 


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.