News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_eto

how to identify the CPC model in Assembler?

Started by eto, 19:16, 05 July 21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

eto

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?

SRS

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


dragon

#2
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.









andycadley

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.

zhulien

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


GUNHED

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.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

eto

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?

eto

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.

dragon

#8
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)


[size=0px]KL_ROM_RESTORE   equ &B90C KL_ROM_SELECT   equ &B90F   org &4000   ; Select and enable Upper ROM 0 (BASIC)ldc,0call KL_ROM_SELECT pushbc   ; (&C001) = Mark number; (&C002) = Version number; (&C003) = Revision levelldhl,&C001ldde,&0000ldbc,3ldir   ; Restore previous Upper ROM statepopbclda,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]




GUNHED

http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

eto

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

dragon

Checks your roms and view versions :).




Powered by SMFPacks Menu Editor Mod