[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [MiNT] ACC & resolution change



> From: owner-mint@fishpool.com [mailto:owner-mint@fishpool.com]On Behalf
> Of Konrad M. Kokoszkiewicz
> Sent: Monday, June 19, 2000 12:11 PM
> To: Petr Stehlik
> Cc: Guillaume Deflache; MiNT mailing list
> Subject: Re: [MiNT] ACC & resolution change
>
>
>
> > > 	Oh and I think (correct me please if I am wrong) that
> accessoiries never
> > > get AP_TERM messages.
> >
> > This is what I am missing. AP_TERM would be best, but it's not sent.
>
> Yes. As far as I know, there is no way to detect that the accesory is
> being terminated due to resolution change, so you cannot perform a
> cleanup. E.g. you cannot unhook a vector you have grabbed. Conclusion: you
> cannot grab vectors from within an accessory. The program, if it has to
> patch the vector chain, must split into a TSR (loaded from AUTO) which
> uses the interrupt, and a controlling accessory (which does not use any
> interrupts).
>
> You could possibly consider using the GEMDOS terminate vector to detect
> whether the accessory process is being terminated or not. However, this
> won't work under plain TOS, as, as far as I know, the accessories run in
> the context of the main application.
>
> The best solution is not to use interrupts in GEM programs, however.

I agree with the analysis.

However... If you really need to stay with just an Acc, you may try to hook
into the GEMDOS trap and wait for the Mfree() called with your basepage
address. This is the last moment for cleanups... :-)