[futurebasic] Re: [FB] MacsBug

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2001 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Fri, 28 Sep 2001 15:08:39 +0200
Pete wrote:
> 
> I'm writing an .INCL that will allow me to determine if MacsBug is
> installed, and if it is, then I can call some debugging FNs.
> 
> What I'm having trouble with, is determining if MacsBig is
> installed/running.
> 

Pete,

Is it really necessary nowadays to test for the 24 bit addressing mode?
According to your explanation and a visit to the Apple universal
headers, I would try something like this:

clear local mode
local fn MagsBugEstaInstalado
  dim @ respuesta  as long
  dim   bandera    as unsigned byte

  long if [_Macjmp] > 0
    long if fn Gestalt(_gestaltAddressingModeAttr, respuesta) = _noErr
      long if (respuesta and _gestalt32BitAddressing%) != 0
        bandera = |0x0BFF|
      xelse
        bandera = |[_Macjmp]|
      end if
    end if
  end if
end fn = (bandera != 0) and ((bandera and 0xe0) == 0x60 )

long if fn MagsBugEstaInstalado
  print "Puede llamar a MacsBug cuando quiera"
xelse
  print "Lo siento pero no MacsBug para usted"
end if

do
until fn button


I'm not a bit twidler and I cannot guarantee that the conversion is
correct. All I can say is that it gives the good result on my configuration.
-- 

Cheers

Alain

-----------------------------------------------------
FB^3 in Europe:  http://euro.futurebasic.com/
FB II Pouch:     http://www.pixmix.com/FB/outils.html
-----------------------------------------------------