Determining in SuperBASIC is it's a 128K BBQL

A place to discuss general QL issues.
Post Reply
stephen_usher
Gold Card
Posts: 433
Joined: Tue Mar 11, 2014 8:00 pm
Location: Oxford, UK.
Contact:

Determining in SuperBASIC is it's a 128K BBQL

Post by stephen_usher »

I seem to remember someone recently asking in a thread how to determine if the program is running on a 128K BBQL.

This is how I do it in a loader for "The Lost Pharaoh":

Code: Select all

10 loader$ = "flp1_pharaoh"
20 IF PEEK_W(163872) = 4 THEN LRUN loader$
30 TK2_EXT
40 MODE 4
50 PRINT "Not curently in 128K mode. Rebooting."
60 a$ = INKEY$(500)
70 RES_128
Of course this won't necessarily work with Minerva or systems which move the system variables but programs which require a standard 128K BBQL probably won't run on those anyway.


Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Determining in SuperBASIC is it's a 128K BBQL

Post by Derek_Stewart »

Hi,

Why can't you look the Ramtop, if not128K, then rest to 128K

According the Rwap adverts, The Lost Pharaoh, needs 256K to run, is the advert wrong ?


Regards,

Derek
stephen_usher
Gold Card
Posts: 433
Joined: Tue Mar 11, 2014 8:00 pm
Location: Oxford, UK.
Contact:

Re: Determining in SuperBASIC is it's a 128K BBQL

Post by stephen_usher »

Derek_Stewart wrote: Sun Mar 26, 2023 3:34 pm Hi,

Why can't you look the Ramtop, if not128K, then rest to 128K

According the Rwap adverts, The Lost Pharaoh, needs 256K to run, is the advert wrong ?
I'm looking at the system variable offset 0x20 from the start, which is supposed to be a word holding the top of memory -1 but instead seems to hold 4 on a 128K machine and 64 on the SGC.

My copy of The Lost Pharoah only runs on a 128K machine or with res_128. It's an original copy on Microdrive initially.


User avatar
Pr0f
QL Wafer Drive
Posts: 1308
Joined: Thu Oct 12, 2017 9:54 am

Re: Determining in SuperBASIC is it's a 128K BBQL

Post by Pr0f »

4 sound about right for a ramtop for a 128 Machine - as it's a word - and you are probably looking at the top order byte - so 4 x 65536 - which is at 256K boundary (the first 128k of space in the QL memory map is ROM and I/O or reserved, and the 128K of RAM is after this)


Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Determining in SuperBASIC is it's a 128K BBQL

Post by Derek_Stewart »

Hi,

My apologies, I forgot the definition of the system variables.

Looking the QL Technical Manual :

163872 ($28020) is SV_RAMT, long word


Regards,

Derek
Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Determining in SuperBASIC is it's a 128K BBQL

Post by Derek_Stewart »

Hi,

A side question from this topic, I was wondering if a Test Rom for the QL could be plugged into the QL Rom Port, to test the QL internal circuitry, perform ram test, test the 8049, 8302, 8301.

Is this a possibility or just me being silly...


Regards,

Derek
stephen_usher
Gold Card
Posts: 433
Joined: Tue Mar 11, 2014 8:00 pm
Location: Oxford, UK.
Contact:

Re: Determining in SuperBASIC is it's a 128K BBQL

Post by stephen_usher »

Whether it would be useful would depend upon how much of the system needs to be operational before the external ROM gets called. That would probably be determined by the start-up code in the system ROM.


User avatar
tofro
Font of All Knowledge
Posts: 2702
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Determining in SuperBASIC is it's a 128K BBQL

Post by tofro »

Derek_Stewart wrote: Wed Mar 29, 2023 11:45 pm Hi,

A side question from this topic, I was wondering if a Test Rom for the QL could be plugged into the QL Rom Port, to test the QL internal circuitry, perform ram test, test the 8049, 8302, 8301.

Is this a possibility or just me being silly...
A plugin ROM can unfortunately not disable the original ROMs from behind the ROM port. If you'd make it to be selected from address 0 onwards (which is perfectly possible), it would create a bus conflict with the original ROMs. You could only use such a ROM card when the original ROMs are removed.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Post Reply