[Coco] cocoflash hardware detecting menu

rietveld rietveld rietveldh at hotmail.com
Mon Jul 2 20:15:25 EDT 2018


My Flash died and I am forced to re-write the menu code again since I wasn't smart enough to save everything .

I have most files, but not all.


Anyway i decided that there is a less complicated way to have the cocoflash detect the hardware that it is inserted into.


The cocoflash boots up to a MENU program that is stored in banks0/1 of the flash.  I replaced this MENU with a small program that I wrote and flashed it into bank0/1 ; so now that program launches on power up instead of the MENU.


The Hardware detecting program PEEKS for, and sets, two sets of flags called CC(colour computer) and BM(big memory).


The program PEEKS(&HFFFE) .  If it returns a value of &H8C then it sets the CC flag to 1 to say it has found a coco3 else the flag stays at 0 to say you are using a COCO1/2.


If the CC flag is set to 1 it does a GOSUB and runs a 512k memory test routine.  If this test fails it leaves the BM flag set to 0.  If the 512k test is successful then the BM flag is set to 1


If the CC flag is set to 0 it does a GOSUB and runs a 64k memory test routine.   If that test fails the BM flag stays at 0 else it is set to 1 if the test successfuly detects 64k


Now the easy part.  I have four seperate MENUs all based on the same single MENU code with only the DATA lines being changed. The MENU code contains a single PEEK and flag(SS) that is used to detect for the presence of a Speech/Sound cart. If the SS flag is set to 1 then every time a game is selected the name in the DATA line is sent via a GOSUB to a speech routine.


The first MENU contains only programs that will run on a coco 1/2 with less than 64k, the second is a MENU containing all programs that will run on a 64k(or less) coco1/2, the third MENU shows the programs that run on a 128k coco3(excluding the coco2 programs that dont run on the coco3 ) and lastly the fourth MENU contains everything in the 3rd MENU plus any 512k only programs that may be flashed onto the COCOFLASH.


The MENUS are flashed into BANKS 1000,1100,1200,1300, and are listed in DATA line of the Hardware detecting program flashed into Bank 0/1.  The MENUs are called and launched exactly as they would be if they were games being selected from the original MENU selection program.  So if CC flag is set at 1 and BM is set at 0 then the program launches the program 'MENU' in bank 1200.  This MENU is for the 128k coco3  .  That Menu would then PEEK and set the SS flag as detected.  Again if the Hardware detecting program see a CC flag set to 0 and a BM flag to 1 it will launch the MENU from BANK 1100 aas it has determaned that the COCOFLASH is plugged into a 64k COCO1/2 .   If it were plugged into a 16k COCO it would launch the MENU located at BANK 1000 since the CC and BM flags would both be set to 0


I tried to PEEK for 4k machines but as of yet have not been able to come up with a 16k TEST routine














More information about the Coco mailing list