What hardware? - Sinclair
This is a discussion on What hardware? - Sinclair ; Hi,
Anyone know of a means to determine which spectrum (out of the list
below) a BASIC program is running on?
1. Spectrum (16k or 48k - I can already determine the difference of
those)
2. Spectrum +2 (The Grey ...
-
What hardware?
Hi,
Anyone know of a means to determine which spectrum (out of the list
below) a BASIC program is running on?
1. Spectrum (16k or 48k - I can already determine the difference of
those)
2. Spectrum +2 (The Grey Case Amstrad one)
3. Spectrum +2a or +2b or +3
Ideally I'm looking for some peek commands that can be used to
determine which platform a BASIC program is running on. I also need
(ideally) to know if a program is running on a +2(or a or b or 3) in
48k mode, though this is less important.
Any help greatly appreciated. I've searched extensively online, and
come up with nothing useful.
Cheers,
Gav.
-
Re: What hardware?
Sinclair PC200 512k (V1.5) on 17 January 2008
Loading gregsta .SYS.....
: Ideally I'm looking for some peek commands that can be used to
: determine which platform a BASIC program is running on. I also need
: (ideally) to know if a program is running on a +2(or a or b or 3) in
: 48k mode, though this is less important.
This program tries to guess by PEEKing at the ROM. It isn't infallible (it
detects the Spectrum SE as a 48k, for example) but it manages all right on
the originals.
10 LET A = PEEK 2898
20 IF A = 195 THEN GOTO 128
30 IF A = 214 THEN GOTO 48
40 PRINT "Unknown" : STOP
48 LET A = PEEK 1194
50 IF A = 205 THEN PRINT "16/48k": STOP
60 IF A = 17 THEN PRINT "TK95": STOP
70 IF A = 62 THEN PRINT "Groot": STOP
80 IF A = 202 THEN PRINT "IMC": STOP
90 PRINT "Unknown 48k": STOP
128 LET A = PEEK 2899
130 IF A = 159 THEN GOTO 200
140 IF A = 126 THEN GOTO 300
150 PRINT "Unknown 128k": STOP
200 LET A = PEEK 5440
210 IF A = 83 THEN PRINT "Sinclair 128k": STOP
220 IF A = 65 THEN PRINT "Amstrad +2" : STOP
230 PRINT "Unknown 128/+2": STOP
300 LET A = PEEK 76
310 IF A = 56 THEN PRINT "Amstrad +2a/+3": STOP
320 IF A = 59 THEN PRINT "IMC 48k Disk BASIC": STOP
330 PRINT "Unknown +3" : STOP
--
--------------------------- ,@@.o ,@@. SPELL SUCCEEDS
John Elliott | @@@@ @@@@ n \_O_
CHAOS in a sig... | '||` '||` Hr \I `
--------------------------- JL JL I\ /\\
-
Re: What hardware?
On Jan 17, 11:02 pm, John Elliott wrote:
> Sinclair PC200 512k (V1.5) on 17 January 2008
>
> This program tries to guess by PEEKing at the ROM. It isn't infallible (it
> detects the Spectrum SE as a 48k, for example) but it manages all right on
> the originals.
>
Just what I was looking for! Thanks!
-
Re: What hardware?
Blimey, the old brain must be faulty. I used to have this off by heart so
that downloaded software would configure itself for the users machine. The
best I can do is that one of the tests relied on an i/o port value as I
recall.
It became more complex than just one test, as to decide the difference
between the old plus 2 and the sinclair 128 needed two decisions.
This had to be done due to the different way tey worked with the VTX5000
modem, or did not work in some cases.
Brian
--
Brian Gaff....Note, this account does not accept Bcc: email.
graphics are great, but the blind can't hear them
Email: briang1@blueyonder.co.uk
__________________________________________________ __________________________________________________ __________
"gregsta" wrote in message
news:8b828e32-ca37-4a2f-94fa-e8377d92fe0b@u10g2000prn.googlegroups.com...
> Hi,
>
> Anyone know of a means to determine which spectrum (out of the list
> below) a BASIC program is running on?
>
> 1. Spectrum (16k or 48k - I can already determine the difference of
> those)
> 2. Spectrum +2 (The Grey Case Amstrad one)
> 3. Spectrum +2a or +2b or +3
>
> Ideally I'm looking for some peek commands that can be used to
> determine which platform a BASIC program is running on. I also need
> (ideally) to know if a program is running on a +2(or a or b or 3) in
> 48k mode, though this is less important.
>
> Any help greatly appreciated. I've searched extensively online, and
> come up with nothing useful.
>
> Cheers,
> Gav.
-
Re: What hardware?
John Elliott wrote:
> This program tries to guess by PEEKing at the ROM. It isn't infallible (it
> detects the Spectrum SE as a 48k, for example) but it manages all right on
> the originals.
That's because the Spectrum SE uses the unaltered original ROM.
Once you have established that it's the original ROM (and not the
slightly modified version in the TC2048) this will tell you if it's an SE:
LET A=IN 255
If A = zero (unless you already changed the screen mode) then it's an SE.