[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CDA access from the desktop (was Re: CDA access by NDA?)
- Subject: CDA access from the desktop (was Re: CDA access by NDA?)
- From: amorton@ee.mu.OZ.AU (Anthony Morton)
- Date: Tue, 20 Dec 1994 01:07:05 GMT
- Followup-to: comp.sys.apple2.programmer
- Newsgroups: comp.sys.apple2
- Organization: Department of Electrical & Electronic Engineering, University of Melbourne
- References: <3clf0v$o5v@charm.magnus.acs.ohio-state.edu> <3cng86$pkm@tuba.cit.cornell.edu>
- Sender: news@cs.mu.OZ.AU
In article <3cng86$pkm@tuba.cit.cornell.edu> jmk3@crux4.cit.cornell.edu (Jay Krell) writes:
>[stuff deleted]
>
>Anyway, if you just want to enter the CDA menu, my first guess would be
>to post an event, either command-control-esc, or I recall there being
>a "da event" but that might just be a flag bit.
>
Yes, you just post a Desk Accessory event, type $000A. It's easy, you don't
need to set any special event message or anything.
>If PostEvent doesn't work, I would next explore calling the bank E1
>vector, calling ChooseCDA, or seeing what those two do and copying
>them, but this stuff isn't good to be doing. It is interesting to
>disassemble and see what is done, but it is _much_, _much_ better to
>take the high level approach and PostEvent.
>
I agree, if you just want the CDA menu, using PostEvent is the best by far to
avoid breaking things. I'd strongly advise against calling ChooseCDA directly;
you need to at least call SaveTextState and RestoreTextState around it, and
possibly other things as well.
There's a facility I've put into the DTUtils kernel to invoke a CDA directly;
this requires a bit of fiddling. From memory, you need to call SaveTextState,
then make a copy of the memory at $0/0000 to $0/01FF (the absolute zero page
and emulation mode stack), set the D register to $0000 and the stack pointer to
whatever's in the EmulStack variable (see the Firmware Reference for details),
then call the CDA entry point and make sure you restore everything properly
afterwards. (There may be another kludge or two required, but it's a while
since I wrote this code and my memory fails me. If anyone else has tried
doing this recently they may be able to fill in the details.)
This procedure does actually work; it's been in DTUtils3 implementing the wide
menu and Instant DA functions for a while now, and seems quite stable. But I
wouldn't use it unless it was absolutely necessary, in order to implement
features such as these.
The discussion's getting a bit technical, so I've set followups to
csa2.programmer where they belong.
Tony Morton (amorton@ee.mu.oz.au)
Electrical Engineering Masters student & diehard IIGS lover
University of Melbourne, Australia
Co-author of Desktop Utilities for the IIGS - version 4.0 beta out now!