Support Forum

Please or Register to create posts and topics.

How to test machine version?

  1. Ok my first project is nearing completion. I am trying to make my game compatible with 48k original and also have enhancements if running on a spectrum next.   So to work out what machine i am running on i figured a peek of 23400 which returns 0 on 48k and 111 in my 2mb next would be a good test - this is the amount of banks available.  However when I test my program on cspect it always comes back as a 48k.  Also when I tested sna on real hardware it also came back as 48k.  If I peek from next basic it does return correctly but when returned from inside the compiled sna file it doesnt so is this ram variable stored in the sna at compile time?   Is there a better way to test if running on real hardware like a rom byte that can be checked?


When you load a SNA into your Next it will automatically switch ROMs, try renaming to SNX

You can also read Reg 03 and get the machine type :

so r=GetReg(3) should return the machine type and bits 2-0 will give you the model.

If you want to test in CSpect, as it is at the moment CSpect only launches into your code, so there is no OS initiated underneath, so max ram banks will be empty. You will need to set up Cspect with the full NextZXOS image. Info is on the distro page on how to do this.

Don't think this solution will work for me.  I Have Already renamed the sna to snx but same result. I guess I cant run the getreg  next command on an original 48k can I?  I wanted one single sna file that I could load on an original 48k with divmmc and it detect and run fine but also on a next load the same sna and detect if really a next and load some extra stuff from sd card.  I don't care for cspect if it detects incorrectly. I need the check for real hardware.   I may just compile seperate versions but was hoping for an all in one solution.  Ah well.  Donkey Kong lcd game and watch game almost ready for release.   Just one more question.   How to read the real time clock!