Since I recognised that there are different firmware calls for 464 and 6128 I was wondering, how I can identify which model my code is running on, but I failed to find that anywhere.
So, how do I know if my code is running on a 464 or a 6128 so that I can call the correct address. How can I easily know if it's a Plus?
And what happens if a 464 has been updated to a Basic 1.1 ROM (like the Spanish 472 e.g.). Will the firmware addresses then be identical to the 6128?
Früher (TM) we used this:
if peek(6)=128 then ?"I am a glorious 464" else if peek(6)=145 print "Sorry only 6128 ..."
or
10 '***********************************
20 '* RAMTEST and MACHINE TYPE routine*
30 '* by Rob Scott *
40 '***********************************
50 '
60 code=&8000
70 FOR a=&8000 TO &803E:READ c$
80 POKE a,VAL("&"+c$):NEXT
90 CALL code:CALL code+3
110 machine=PEEK(code+&3E)
120 ramyes=PEEK(code+&3D)
140 END
150 DATA C3,06,80,C3,33,80,21,00,40,3E
160 DATA C4,06,7F,ED,79,77,3E,C0,ED,79
170 DATA 3E,C4,ED,79,AF,7E,FE,C4,CA,29
180 DATA 80,D6,04,ED,79,3E,00,32,3D,80
190 DATA C9,D6,04,ED,79,3E,01,32,3D,80
200 DATA C9,0E,00,CD,15,B9,7C,32,3E,80
210 DATA C9,00,00
If is only theme of adjusting calls directions there is not needed of detect the computer...
Imagine you have call &bd00
And there is the typical rst 08 5f 43
Check it. Is 08 5f 43 there? No, this is another firmware, check another know localization.
Also to the theme of basic,there are some subrevisions that can be checked, i m not sure if the 472 mount only one for them.
Gx4000 can be detected alone with the printer.
And plus can be detected with the asic.
The official firmware jumpblock entry points should only vary with the difference between BASIC 1.0 and 1.1, so that should be all you need to detect. If you start wanting to play around inside other BASIC structures and unofficial entry points then there may be more need to look for other versions but I'm not sure about that.
A cool project could be to make an Ultimate CPC Hardware detector.
CPC model
BASIC ver
Total RAM (DkTronics, Zaxon 4Mb, Toto 1Mb, Multiface 2, Rombo Vidi) all non-destructive so detection can be run at any time...
Total ROMS
Any other hardware added that is detectable
That's kind of what ROManager 2.37 does. But back to topic.
ROMs can be exchanged, so:
- Test for 64 KB RAM only
- Test for presence of FDC
- Test for RAM banking
- Test for Plus features
All that together is not 100% perfect, but can help.
Quote from: SRS on 19:47, 05 July 21Früher (TM) we used this:
if peek(6)=128 then ?"I am a glorious 464" else if peek(6)=145 print "Sorry only 6128 ..."
Nice. thanks. Is this actually 464 vs 6128 or Basic 1.0 vs 1.1?
And would you have the assembler source code for the other example?
Quote from: dragon on 20:06, 05 July 21Also to the theme of basic,there are some subrevisions that can be checked, i m not sure if the 472 mount only one for them.
Are the subrevisions documented somewhere? Probably not really relevant usually, but just for curiosity I would be interested which revisions exist and what the differences are.
Despite the fact that the Locomotive BASIC keeps displaying 1.1 on startup, several revisions exist if we refer to the ROM header:
CPC664 (v1.10) (https://www.grimware.org/lib/exe/fetch.php/documentations/hardware/amstrad.cpc/roms/basic.v1.1.cpc.664.zip)
- CPC6128 (v1.20) (https://www.grimware.org/lib/exe/fetch.php/documentations/hardware/amstrad.cpc/roms/basic.v1.2.0.cpc.6128.zip)
- CPC6128 (v1.21) (https://www.grimware.org/lib/exe/fetch.php/documentations/hardware/amstrad.cpc/roms/basic.v1.2.1.cpc.6128.zip)
- CPC6128 (v1.23) (https://www.grimware.org/lib/exe/fetch.php/documentations/hardware/amstrad.cpc/roms/basic.v1.2.3.cpc.6128.zip)
- Amstrad Plus (v1.40) (https://www.grimware.org/lib/exe/fetch.php/documentations/hardware/amstrad.plus/roms/basic.v1.4.plus.zip)
- AFAIK the differences, if any, between the v1.10 and later versions are undocumented. You can check the version installed on your own CPC with [color=rgb(53, 173, 27) !important]a small BASIC listing (https://www.grimware.org/doku.php/documentations/software/locomotive.basic/romversion)[/color]. (And if you discover a version not listed here, eg. v1.22, spread the infos and the ROM dump! Thanx!)
https://www.grimware.org/doku.php/documentations/software/locomotive.basic/start (https://www.grimware.org/doku.php/documentations/software/locomotive.basic/start)
[size=0px]KL_ROM_RESTORE equ &B90C KL_ROM_SELECT equ &B90F org &4000
; Select and enable Upper ROM 0 (BASIC)ld
c,0call KL_ROM_SELECT push
bc ; (&C001) = Mark number; (&C002) = Version number; (&C003) = Revision levelld
hl,&C001ld
de,&0000ld
bc,3ldir
; Restore previous Upper ROM statepop
bcld
a,
bcall KL_ROM_SELECT jp KL_ROM_RESTORE[/size][size=0px][/color][/size][size=0px][/color]10 MODE 2:FOR i=0 TO 24:READ a:POKE &4000+i,a:NEXT:CALL &4000 20 PRINT"Version ";PEEK(0);".";(PEEK(1)*10+PEEK(2)) 30 DATA &0E,&00,&CD,&0F,&B9,&C5,&21,&01 40 DATA &C0,&11,&00,&00,&01,&03,&00,&ED 50 DATA &B0,&C1,&78,&CD,&0F,&B9,&C3,&0C 60 DATA &B9[/size]
Quote from: dragon on 14:01, 06 July 21
- CPC6128 (v1.20) (https://www.grimware.org/lib/exe/fetch.php/documentations/hardware/amstrad.cpc/roms/basic.v1.2.0.cpc.6128.zip)
- CPC6128 (v1.21) (https://www.grimware.org/lib/exe/fetch.php/documentations/hardware/amstrad.cpc/roms/basic.v1.2.1.cpc.6128.zip)
- CPC6128 (v1.23) (https://www.grimware.org/lib/exe/fetch.php/documentations/hardware/amstrad.cpc/roms/basic.v1.2.3.cpc.6128.zip)
Well, I can't open the archives. Can somebody please compare them?
Quote from: GUNHED on 00:03, 07 July 21Well, I can't open the archives.
me neither. not sure what format that should be, it's not a valid ZIP
Checks your roms and view versions :).