Jimmy MONTESINOS writes:
> I'm searching what is the right way to detect if TK2 is installed on
> a QL system.
>
> I need to make the difference between a TK2 loaded from ROM cartridge
> or LRESPR command too.
>
> If anyone know the superbasic code to check this out...
I dont know if there is an "official" way, or how secure this method is (but
no doubt you will hear the howls of disapproval if Im wrong ;) but you could
try something along these lines:
First check if a TK2 ROM is plugged in:
rom = 49152: rem $C000
if peek_l(rom) = '1257963522' then
rem $4AFB0001 is the ROM signature
rem You may get a bus error or some other
rem hysterics if nothing is plugged in. Dont know
rem how the various emulators will react..
rem OK with QL2K plug plugg
s$ = ""
for i = 1 to peek_w(rom + 10)
s$ = s$ & chr$(peek(rom + 11 + i))
endfor i
if "Care / Qjump Toolkit" instr s$ then
rem you can assume that TK2 is in ROM
else
rem Not in ROM, at least
rem Check whether TK2 is loaded
sv = 163840: rem $28000 sys vars
p = peek_l(sv + 172): rem $ac => PROGD
if p <> 0 then
rem you can assume that TK2 is RESPRed
endif,etc
Per