POKE in the ZX Spectrum

I play with the old ZX Spectrum 48k and I wonder how exactly you can enter POKE codes .

You load the game with tape - then somehow exit the program type in the POKE statements and run the program again?

I did a lot for this, but could not determine exactly how this is done, so any conclusions will be accepted with great pleasure.

+5
source share
3 answers

Most Spectrum programs use a two-step process to launch the game:

  • Download and run the small BASIC program
  • This small BASIC program loads a much longer machine code, and then moves on to the machine code input point (for example, RANDOMIZE USR 28455 ).

If you manage to stop between these steps, you can POKE around (increase the number of lives, ...), and then run the machine code using RANDOMIZE USR 28455 , assuming that you somehow found out the correct address.

Once a machine program is running, there is usually no way to stop it and return to the BASIC interpreter. If the host program does not provide some explicit (or unintended) way to do this.

+1
source

As I remember for a long time ... When a game in Spectrum loads, it is initially loaded into a small bootloader program and launches it, and the tape continues, and the main part of the program loads. The last command in the bootloader program issues the poke command, which calls everything loaded and launches the game. Therefore, as I recall, you need to pause the tape after loading the bootloader program and stop the automatic output of a line of code, and then continue. Then, as soon as the main part loads, you issue your trick from the command line, and then the original to start the game. The bootloader program will be loaded after the first set of red and blue lines, and then with very short yellow and blue lines on the screen (as I recall, it prints the name of the program found at this point). Stop the tape, click Break, then List to see the code. Good luck and a big question!

0
source

POKE codes printed in ZX Spectrum magazines usually assume that you have a plug-in hardware device (such as Multiface). After loading the game, you can press the Multiface button to stop the game, enter POKE, and then return to the game.

Without a special device, you need to play with bootloader programs, as described in other answers. You need to load the small bootloader's initial program, and then BREAK into the code. If you're lucky, the code will do something simple with loading the rest of the game, and then perform a real game with computer code using the RANDOMIZE USR call. In this case, you can change the BASIC bootloader program to perform POKES after loading the game, but before the game starts.

However, many games make this harder because they include custom loader code. This is often written in machine code embedded in a small BASIC program in REM statements. Machine code will load the game and execute it, and since they never return control to the BASIC code, there is no way to enter POKE. If you are dedicated enough, you can try changing the machine code to return control to BASIC so you can BUY, or do POKE through machine code calls. This is quite complicated because, if I remember correctly, the editor used to scramble the lines containing non-printable characters in REM operations. There were software tools like RoyBot that could help you modify code in memory.

Some game developers did really crazy things to prevent the game from hacking, for example, injecting bootloader code that actually overwrote its own code during its execution.

0
source

All Articles