Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!dkuug!imada!micro From: micro@imada.ou.dk (Klaus Pedersen) Newsgroups: comp.sys.atari.st.tech Subject: Re: Force Desktop Res Change? Message-ID: <1991May20.231624.25518@imada.ou.dk> Date: 20 May 91 23:16:24 GMT References: <1991Apr28.014020.3838@lonex.radc.af.mil> <3094.05.91@drdhh.hanse.de> <1991May12.234615.15781@wam.umd.edu> <91133.112834ONM07@DMSWWU1A.BITNET> <1991May13.121912.16552@informatik.uni-erlangen.de> <2941@atari.UUCP> <1991May17.115339.20960@informatik.uni-er Sender: news@imada.ou.dk (USENET News System) Organization: Dept. of Math. & Computer Science, Odense University, Denmark Lines: 98 >csbrod@immd4.informatik.uni-erlangen.de (Claus Brod) writes: >>But this also means that I don't have any chance to do >>parameter fiddling _before_ AES or VDI do their job unless I wait >>for AES to come up, and then install my own Trap #2 handler. Can you describe what you want to do? I know that I mixed it up in the last post (first in the chain/first installed)! To make it good I have included some, that does what you say you want, but what good is it, can you give an example? The routine I have included will every it is called check if it is the first routine on that vector chain. If it is not it will unlink it self, insert itself in the start of the chain, and then call the remaining routines in the chain. One funny thing is to install two of these, they really fight to get the first 'seat'. The code will only work if all routines uses the XBRA protocol. It is written using the shareware assembler, TurboAss, available at atari.archive. >>Claus Brod, Am Felsenkeller 2, Things. Take. Time. Klaus, micro@imada.ou.dk gemdos EQU 1 Ptermres EQU 49 ; Gemdos Cconws EQU 9 xbios EQU 14 Supexec EQU 38 ; xbios vector EQU $80+4*gemdos ; hook into GEMDOS v_bas_add EQU $044E first: bra.s install ********* XBRA HEADER ******************************************* ** The routine is AES/VDI ready, as it don't use any registers ** ** test VDI/AES in the 'SaveRegs' array. ** DC.B 'XBRA' ; XBRA identifier DC.B 'name' ; program ID DS.L 1 ; old vector x_hook: movem.l D0/A0-A1,SaveRegs lea x_hook-4(PC),A0 move.l (A0)+,-(SP) ; Push the address old routine cmpa.l vector.w,A0 beq.s all_ok ; I am the first! move.l A0,D0 ; I was not first and I want to be! movea.l vector.w,A0 ; - make me first NOW! xb_next: movea.l A0,A1 cmpi.l #'XBRA',-12(A1) ; Is 'XBRA' ok ? bne.s not_xbra ; NO -> PANIC!!! movea.l -(A1),A0 cmpa.l D0,A0 ; Is it me ? bne.s xb_next ; NO -> try next in chain... xb_inchain: move.l -(A0),(A1) ; unlink from the chain. move.l (A0),(SP) ; replace the return address on the stack move.l vector.w,(A0)+ ; reinsert first in the chain. move.l A0,vector.w ; NOW DO SOME REAL WORK movea.l #2,A0 bsr.s DO_THE_FUN all_ok: suba.l A0,A0 bsr.s DO_THE_FUN not_xbra: * auch... can't find myself! * * get the fool out of the auto folder!!!! * movem.l SaveRegs(PC),D0/A0-A1 rts SaveRegs: DS.L 3 DO_THE_FUN: adda.l v_bas_add.w,A0 addq.w #1,(A0) rts ******************************************************* ***************** INSTALATION ROUTINE ***************** install: pea take_vec(PC) move.w #Supexec,-(SP) trap #xbios clr.w (SP) ; Resident terminate move.l #($0100+install-first),-(SP) ; = Program length move.w #Ptermres,-(SP) trap #gemdos take_vec: lea x_hook-4(PC),A0 move.l vector.w,(A0)+ move.l A0,vector.w rts END