CRT format for the VIC-20
Posted: Sat Dec 28, 2019 9:44 pm
Back in 1981, almost all the VIC-20 cartridge images were turned into single filers that worked really well when using 16k RAM expansions to run them. This was done using a simple trick created by a member of a VIC-20 user's club in eastern Quebec.
I think it's possible to take advantage of this old trick to create a simple .CRT file format for the VIC-20
The trick was really simple and was based on the following facts:
1. All autostart cartridges of 8k or 4k only use BLK5
2. All autostart cartridges of 16k use BLK5 along with BLK1 or BLK3 - they NEVER use BLK2
3. All Scott Adams games use BLK2 and BLK3 - they never use BLK1 or BLK5
4. VICMON did not allow saving data above $7FFF
The trick involved adding a switch to a 16k RAM expansion for the VIC-20 which would toggle an 8k block of RAM between BLK2 and BLK5 with the VIC-20 turned on. The same switch would turn the expansion to read-only when set to BLK5.
For autostart cartridges of 8k or less, the content of the ROM would be first copied into BLK2 and saved from this address. When loading back the game, the expansion would be set to have normal RAM at BLK2 then the switch would be toggled to BLK5/read only and pressing the reset button would start the game.
For autostart cartridges of 16k, the content of the BLK5 ROM would be copied into BLK2 and this would make the data present either at BLK1 and BLK2 (for games like Donkey Kong or Lunar Leeper) or BLK2 and BLK3. Either way, the data you saved was now a single block of 16kBytes. When loading back the game, the expansion would be set to have normal RAM at BLK2 then the switch would be toggled to BLK5/read only and pressing the reset button would start the game. The only difference was you had to make sure the 'other' block of 8k RAM was present in BLK1 or BLK3 depending on the requirements of the specific game you're trying to play.
For Scott Adams games, you had to set your 16k expansion to offer RAM in BLK2 and BLK3 only. The RAM would be invisible to BASIC and Scott Adams games don't self modify to protect against copying. Just load the file and start with the usual SYS32592.
I think this can be used as a template for .CRT files for the VIC-20. I even think it's possible to use this unified format 'as is'.
When using these only 'unified' files, it's possible in software to determine:
1. The 2 first bytes indicating the LOAD address - a loading address of $6000 could indicate you're dealing with a utility such as VICMON or Programmer's Aid.
2. Finding where in the data is the CBMA0 signature in files of 8k or less - the presence of the signature indicates the data normally loaded in BLK2 has to be moved to BLK5 and the BLK areas used are to be made read-only.
3. Finding where in the data is the CBMA0 signature in a 16k file with a loading address of $4000 - the absence of such a signature is an indicator you're dealing with a Scott Adams game - the presence of the signature indicates the data normally loaded in BLK2 has to be moved to BLK5 and the BLK areas used are to be made read-only with the rest of the data loaded in BLK3
4. A loading address of $2000 along with the presence of the CBMA0 signature should indicate the file contains a 16k games requiring the first part of the data to be loaded in BLK1 and the rest is destined to BLK5.
I think that sums all the possible cases. The way cartridge images are stored in the Behr-Bonz ROM is based on the above.
I think it's possible to take advantage of this old trick to create a simple .CRT file format for the VIC-20
The trick was really simple and was based on the following facts:
1. All autostart cartridges of 8k or 4k only use BLK5
2. All autostart cartridges of 16k use BLK5 along with BLK1 or BLK3 - they NEVER use BLK2
3. All Scott Adams games use BLK2 and BLK3 - they never use BLK1 or BLK5
4. VICMON did not allow saving data above $7FFF
The trick involved adding a switch to a 16k RAM expansion for the VIC-20 which would toggle an 8k block of RAM between BLK2 and BLK5 with the VIC-20 turned on. The same switch would turn the expansion to read-only when set to BLK5.
For autostart cartridges of 8k or less, the content of the ROM would be first copied into BLK2 and saved from this address. When loading back the game, the expansion would be set to have normal RAM at BLK2 then the switch would be toggled to BLK5/read only and pressing the reset button would start the game.
For autostart cartridges of 16k, the content of the BLK5 ROM would be copied into BLK2 and this would make the data present either at BLK1 and BLK2 (for games like Donkey Kong or Lunar Leeper) or BLK2 and BLK3. Either way, the data you saved was now a single block of 16kBytes. When loading back the game, the expansion would be set to have normal RAM at BLK2 then the switch would be toggled to BLK5/read only and pressing the reset button would start the game. The only difference was you had to make sure the 'other' block of 8k RAM was present in BLK1 or BLK3 depending on the requirements of the specific game you're trying to play.
For Scott Adams games, you had to set your 16k expansion to offer RAM in BLK2 and BLK3 only. The RAM would be invisible to BASIC and Scott Adams games don't self modify to protect against copying. Just load the file and start with the usual SYS32592.
I think this can be used as a template for .CRT files for the VIC-20. I even think it's possible to use this unified format 'as is'.
When using these only 'unified' files, it's possible in software to determine:
1. The 2 first bytes indicating the LOAD address - a loading address of $6000 could indicate you're dealing with a utility such as VICMON or Programmer's Aid.
2. Finding where in the data is the CBMA0 signature in files of 8k or less - the presence of the signature indicates the data normally loaded in BLK2 has to be moved to BLK5 and the BLK areas used are to be made read-only.
3. Finding where in the data is the CBMA0 signature in a 16k file with a loading address of $4000 - the absence of such a signature is an indicator you're dealing with a Scott Adams game - the presence of the signature indicates the data normally loaded in BLK2 has to be moved to BLK5 and the BLK areas used are to be made read-only with the rest of the data loaded in BLK3
4. A loading address of $2000 along with the presence of the CBMA0 signature should indicate the file contains a 16k games requiring the first part of the data to be loaded in BLK1 and the rest is destined to BLK5.
I think that sums all the possible cases. The way cartridge images are stored in the Behr-Bonz ROM is based on the above.