How to use Poke Finder in Fuse?

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
StanVanman
Manic Miner
Posts: 259
Joined: Wed Dec 15, 2021 9:15 pm

How to use Poke Finder in Fuse?

Post by StanVanman »

I'm messing around with a game trying to tweak it, and I think I've found the thing I'm looking for by using Poke Finder. This seems to be the location of the variable I'm looking for:

Image

The only trouble is, I have no idea what that means in any terms that translate to a POKE. Now what? What location do I need to POKE to change that value, given that POKEs have to be in decimal? (The number translates to 7952 in decimal, but that's not a Speccy game code location.)
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: How to use Poke Finder in Fuse?

Post by Seven.FFF »

7952 is indeed the location in decimal, which is almost always in ROM on a Speccy. Either this game is for the +3 only, where RAM can be mapped at that address (extremely unlikely), or Poke Finder is telling you porky pies. Maybe it is seeing different 128K ROMs being paged in and out as changes, and making a wrong assumption that this is game data. Other emulated hardware could also be paging its own ROM/RAM at that address, but even if this were happening it wouldn't be related to the running game logic.

Analyzing running programs like this is not really an exact science, it involves a lot of guesswork and human interpretation, and you can't really say any suggested poke is the one you need until you have tested that it makes the expected difference, and doesn't have any other adverse effects.

I would carry on looking in addresses above $3FFF.
Last edited by Seven.FFF on Mon Jul 24, 2023 4:37 pm, edited 2 times in total.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
StanVanman
Manic Miner
Posts: 259
Joined: Wed Dec 15, 2021 9:15 pm

Re: How to use Poke Finder in Fuse?

Post by StanVanman »

Seven.FFF wrote: Mon Jul 24, 2023 4:29 pm 7952 is indeed the location in decimal, which is almost always in ROM on a Speccy. Either this game is for the +3 only, where RAM can be mapped at that address (very unlikely)
Actually this does seem to be the case. It's originally from a TRD file and POKEing that location changes the relevant value. My only problem now is that it resets the value on starting a new game (it's the number of lives) and I'm not sure how to stop it.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: How to use Poke Finder in Fuse?

Post by Seven.FFF »

That makes a little more sense. TRDs are Betadisk/TR-DOS disk images (not related to the +3 model), so perhaps starting a new game resets some of the data by reloading it from disk each time. Perhaps the reloading goes through the $1F10 address because Betadisk puts some buffer RAM there as part of the load.

If that was the case, then your mod would not strictly speaking be a poke at all. It would be a changing of the relevent data, inside the file it is loaded from, inside the virtual disk image that the TRD file actually is. That's kinda a whole other thing, and needs some in-depth learning and experience with TR-DOS images.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
StanVanman
Manic Miner
Posts: 259
Joined: Wed Dec 15, 2021 9:15 pm

Re: How to use Poke Finder in Fuse?

Post by StanVanman »

(I'm actually hacking around inside an SZX snapshot of the original disk, not sure if that changes things.)
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: How to use Poke Finder in Fuse?

Post by Seven.FFF »

Stan PM'd me and told me which game it was. It's one of those e-magazine compilations released on +3 disk. There's a bunch of menu stuff written in +3 BASIC. There's a main menu that loads a menu program for each game, and then that menu runs it or reloads the main menu again.

The good news is that particular game only has two files, the BASIC menu and a code file. It could be very easily re packaged for TAP instead of disk, and in fact probably was like that when it was submitted to the e-Magazine.

Sticking with the +3 disk version (run from the .dsk file, not an .szx), If you go to the game's menu (the one that says "{R}un {C}ontents Page {B}oot" at the bottom), you can press BREAK then look at the program in the +3 BASIC editor. Line 8910 will be:

Code: Select all

8910 IF K$="R" THEN POKE VAL"40290",VAL"20":POKE 23611,205:RANDOMIZE USR VAL "4E4"
The good news is that that "20" there is your number of lives, and this BASIC line is what is resetting it every time you start a new game! The Poke Finder stuff is only half the story, as it's not looking inside the BASIC program in a very meaningful way.

Change that part of the line to VAL"3" then resave the program to the disk with

Code: Select all

SAVE "xxxxxxxx" LINE 8800
I didn't say here what the name of the program is (xxxxxxxx), because you haven't revealed what the game is publicly. But it's the 8 character name of the game, with no spaces :)

in fact, if you remove the POKE VAL"40290",VAL"20" statement completely, you can see that the game loads with 4 lives rather than 20. So we can speculate that the author wrote it with 4, and the person preparing the magazine disk decided to change it to 20 for whatever reason.

If you're happy with 4, it would be very easy to package up this game as a standalone TAP. If you wanted a number other than 4, we need to find the 4 inside the code file (xxxx.C on the disk), and change it in the code file before packaging up the TAP.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
StanVanman
Manic Miner
Posts: 259
Joined: Wed Dec 15, 2021 9:15 pm

Re: How to use Poke Finder in Fuse?

Post by StanVanman »

How are you editing it? When I break in with either Fuse or Spectaculator I get this:

Image
Post Reply