How To Find Cheats For Machine Code Games By M.T.Farnworth (16C) Finding a cheat for a game is something that most people wish they could do. There never seems to be a cheat available for the game you are having the most trouble with. There are two methods of finding cheats: a) Studying the program and then altering the necessary instruction. b) Trial and error. The first of the two alternatives can take a long time especially if you are not used to comprehending machine code. The second also sounds like a long drawn out process, as changing every part of the program, and then testing it could take months. However you do not need to change every instruction in the program, only the ones that could have some reference to what you are trying to do. For example most of the time people are interested in having infinite lives. The programmer will normally store the number of lives in a memory location in zero page, so the quickest way of reducing the number of lives is: DEC &xx There are not normally very many DEC instructions in a program, and very few indeed referring to zero page locations, so it does not take long to change them all individually and play the game. I think that I should point out that when I say change the instruction I mean replace it with NOP (No OPeration). This will prevent the number of lives being reduced. Finding and replacing the instruction could not be simpler. Just load up an unchanged version of the program. Then using a simple BASIC program find the value &C6 (represents DEC &xx) in the program and change it for &EA (NOP) along with the byte after it which would have been the second half of the the instruction. An example program is: 10 *LOAD original 2000 20 occurrence=1 30 counter=&1FFF:loadaddress=&3000:executeaddress=&3100 40 lengthoffile=&1000:start=&2000 40 FOR I%=1 TO occurrence 50 REPEAT 60 counter=counter+1 70 UNTIL ?counter=&C6 OR counter>lengthoffile+start 80 NEXT 90 IF counter>lengthoffile+start PRINT"Not found":END 100 ?counter=&EA:counter?1=&EA 110 OSCLI"SAVE hacked 2000+"+STR$~lengthoffile+" "+STR$~executeaddress+" "+STR$~loadaddress The load address, execute address, and length of file will vary from program to program so you will have to change them according to which file you are altering. Their values for each particular game can be found by using *INFO. The program listed will change the first zero-page DEC command, and the address byte after it, into two NOPs. After running this program the first time you would then test the game. If it did not achieve the results you wanted (more than likely), you would then start again, but set occurrence at 2, so that it will change the second zero-page DEC instruction it comes across, and so on. When using a program such as the one above it is best to copy all the files connected with the game onto a blank disk then rename the file which you which to place the cheat into. When the program has run it should save the file under the original name. Then it is a simple matter of loading the game as usual but the altered file will be loaded instead. This method will save you messing around with the filenames in programs. e.g. If the file is called POWER it could be renamed POWERX. Then when POWERX is modified it would be saved as POWER. It should be remembered at this time that DEC can also be used in many other ways, each of which produce a different OPCODE. e.g. DEC &xxxx has opcode &CE When looking for this instruction line 100 of the above program would be changed for 100 ?counter=&EA:counter?1=&EA:counter?2=&EA Table of useful Opcodes ======================= Mnemonic Opcode No of Bytes ======== ====== =========== DEC &xx &C6 2 DEC &xxxx &CE 3 SBC #xx &E9 2 STA &xx &85 2 STA &xxxx &8D 3 The opcodes above are a good start when attempting to write an infinite lives cheat. STA is useful as it prevents new values being stored in memory. So if they are not using DEC it is highly likely that preventing an STA will maintain lives at their set level. However STA is one of the most commonly used commands so there will be many occurrences of it in the program; you will have a lot of errors in your trial & error! Please remember that the list above is not a definitive guide and other instructions may have been used. In games where damage is recorded commands such as INC and ADC should be checked instead. You now have enough information to write a cheat for most games, so I will leave you to do your cheat writing. Remember finding cheats is fun, and you can often end up with some interesting results! If you wish to contact me directly please write to: M.T.Farnworth Or else write to me via the 8BS messaging system (which is a lot slower!)