By Deano

## Program Protection Protecting a disk from copying probably involves altering the way the ST reads a disk. A protection is a piece of machine code which is stored in the boot sector of a disk and if its read by something other than a ST it can cause all things to happen like damaging the copy on the copy disk. Whilst programming the boot sector takes machine code programming there is a simply way we can use STOS to do it. Note this protection can only be used on a brand new unformatted disk and will not fool the more advanced copiers like Procopy or Blitz Turbo. How ever, to someone who only uses fastcopy 3 or GEM or copies the files by hand the protection can stop them. Basically what we are doing is putting a magic number onto an empty track on a disk. Your program then reads the number and if its not there then the disk is a copy and you can then tell your program to reset or do something nasty like format the disk. You may think that something like Fastcopy will copy all the tracks including the one with the number on. Well this is what we use an unformatted disk for. Fastcopy will not read an unformatted track. This is how to set up a disk for the copy protection. First load up Fastcopy 3 or Fastcopy Pro. In the right hand corner you will notice that the program allows you to set the start and end tracks to format on the disk. Set the end track to 72 and format your disk with Fastcopy. When you scan the disk you'll notice that Fastcopy thinks the disk has only 72 tracks and will only read that. In fact the bootsector will tell your ST the same. Now set the start track to 79 and click on format again. This will format track 79 which is the track our magic number will appear on. You now have a disk with tracks 0 to 72 formatted, tracks 73 to 78 unformatted, and track 79 is formatted. Now click on the scan option again and you'll see the scan option only scans the first 72 tracks. If you set Fastcopy to read all sectors then it will refuse to read the next few tracks after track 72. And after clicking on retry and finding about two bad tracks the user will probably just think the end of the disk is damaged. Therefore when the copy disk is made it will just be a normal disk with all tracks formatted. All the files from your disk will be on.....but not the magic number. Now to put the number on the track we use the FLOPWRT command which will write a number onto track 79. This command is from the MISTY extension. Insert your protected disk and run this program. 10 reserve as work 10,512 20 poke start(10),100 30 flopwrt start(10),10,0,79,1,0 This will write 100 on track 79 of a ten sector disk in drive A. Copy all your files by hand onto the disk. Using a copier will obviously wipe out the magic number. Next enter this routine at the start of your program. 10 reserve as work 10,512 20 floprd start(10),10,0,79,1,0 30 PROTECT=peek(start(10)) 40 if PROTECT<>100 then print"You have copied this disk" : wait 400 : stop A really nasty thing to do (Hee Hee) is to run this routine when the game is in play. For example....when someones been playing the first level for about two minutes. After all, someone copying the game for his mate will just check that the game loads before sending it to him. Imagine getting a really good score when the game stops and calls you a pirate. You can use this routine for this effect. 200 if SCORE>10000 then goto 1000 : rem the disk checking routine.