Comments
North Carolina, USAMagicPokey1 year ago

Congratulations man! Great run!

thread: Safari Hunt
North Carolina, USAMagicPokey4 years ago

Dude this is awesome work so far! I'm sorry I've been awol for a bit but feel free to email me (same username at gmail) if you want some input or a second set of eyes on the TAS!

arnaud33200 likes this
thread: Safari Hunt
North Carolina, USAMagicPokey4 years ago

arnaud33200 Awesome, I was NOT looking forward to doing memory map breakdowns. I will tell you that when it comes to computers, ESPECIALLY older models like the Master System (and the MOS 6502 [Commodore 64], which I am more familiar with) there is no such thing as true random number generation. There is always a seed and a series of mathematical operations are done on that seed number to generate a random value.

This is going to get kinda technical.

For most games this seed is taken from a series of variables like time of day, the uptime of the cpu (in cycles), which inputs and when they were received, and possibly some variables from the cartrige rom. The seed constantly changes, and the generation of the random number calls the seed and then performs a series of maths operations. We might think the seed generation would be done on the cartridge (well, in system RAM), but since the z80 processor has its own rng function, I think Safari Hunt might just use the built in rng instead. From wikipedia "the refresh register, R, increments each time the CPU fetches an opcode (or opcode prefix) and has no simple relationship with program execution. This has sometimes been used to generate pseudorandom numbers in games, and also in software protection schemes"

In practice we can assume that Safari Hunt, made in 1986, well into the lifecycle of the z80, probably just uses a random number generated from the z80 itself since the programmers would have likely been familiar with the z80 and why waste precious bytes on the cartridge with a software rng when a hardware one is available and you can just write a call to that in your assembler code. This isnt always the case but if it is then manipulating the rng becomes possible, since I/O functions will increment the 'R' register and we can add inputs.

Note, I said it was (probably) POSSIBLE, not that I would even BEGIN to know how to figure out the correct inputs without a ton of trial and error. But I am almost POSITIVE there are smarter people than me who could figure it out. Heck, I could be wrong about all of this, this is all a lattice of guesswork and wikipedia research based on educated guesses and what I remember about how the 6502 functions. One starting place I would look into though is the original Pac Man arcade boards. They use the exact same CPU as the SMS and I am sure there is way more documentation about how that was coded than Safari hunt.

thread: Safari Hunt
North Carolina, USAMagicPokey4 years ago

That's an interesting question, unfortunately I'm not as familiar with the inner workings of Master System as I am with other game consoles, but I will def look into it (from my decidedly amateur perspective, obviously).

Either way, it might be possible to do some rng manipulation the way they do in Gen 1 Pokemon speedruns. but that's a discussion for way down the line.

Edit: A quick Googleing has yielded some results.

This link: https://www.copetti.org/projects/consoles/master-system/ is a good breakdown of the master system hardware including how the cpu addresses memory and sprite collision/detection, and there are some 'further reading' links at the bottom of the page that I just don't have time to delve into at the moment.

Hope this helps!

AntBlueR and Greystone848 like this
About MagicPokey
Joined
7 years ago
Online
6 months ago
Runs
3
Games run
Kenseiden
Kenseiden
Last run 4 years ago
2
Runs
Safari Hunt
Safari Hunt
Last run 4 years ago
1
Run
Games followed
Kenseiden
Kenseiden
Last visit 6 months ago
54
visits
Safari Hunt
Safari Hunt
Last visit 1 year ago
66
visits