Omegamatrix Posted June 6, 2010 Share Posted June 6, 2010 For my game I need to generate a random seed. This didn't work so well on the Harmony. I think the menu rom is clearing all the ram registers. This is a very bad situation as I need to use the random seed in the first frame of my program. Does the menu program use a frame counter that goes 0-255? It'd make my day if the answer was yes, and also that this frame counter had been in the exact same ram register between all the different versions of the bios (and hopefully future versions of the bios). This would be the perfect situation. I tried using registers $80-$83, but every time there was no randomization. On a regular Atari $80-$83 are a good choice. A lot of old era games had their frame counters there giving the best opportunity for randomization. I'm really looking to get random generation without using the ARM, as I want my game to be able to be played on anything... the Krok cart, Cuttle cart, burned eeproms, Harmony cart, etc... 1 Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted June 6, 2010 Share Posted June 6, 2010 The preferred method is to read INTIM before any initialization occurs. I dunno if Harmony might interfere there. Quote Link to comment Share on other sites More sharing options...
+batari Posted June 6, 2010 Share Posted June 6, 2010 For my game I need to generate a random seed. This didn't work so well on the Harmony. I think the menu rom is clearing all the ram registers. This is a very bad situation as I need to use the random seed in the first frame of my program. Does the menu program use a frame counter that goes 0-255? It'd make my day if the answer was yes, and also that this frame counter had been in the exact same ram register between all the different versions of the bios (and hopefully future versions of the bios). This would be the perfect situation. I tried using registers $80-$83, but every time there was no randomization. On a regular Atari $80-$83 are a good choice. A lot of old era games had their frame counters there giving the best opportunity for randomization. I'm really looking to get random generation without using the ARM, as I want my game to be able to be played on anything... the Krok cart, Cuttle cart, burned eeproms, Harmony cart, etc... I don't think your idea will work with Harmony in multicart mode. When loading, the spinner screen runs from RAM, and its contents will be fixed when the game starts. As suggested, INTIM may work. This will work for burned EPROMs, Krok cart in single-image mode, Harmony in single-image mode, emulators, and possibly Harmony in multicart mode. Harmony doesn't use INTIM in the spinner screen, so it's possible its value will be random by the time the game boots. Better than all of the above would be to rely on the infallibility of the user to seed the random number generator, by a button push or RESET. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted June 6, 2010 Share Posted June 6, 2010 (edited) Yup...keep your own timer going until the user hits the switch beginning a new game. You could mix that value with the powerup INTIM value (via EOR) to provide a pretty good seed range that differs upon game restart. To keep INTIM from being reloaded directly (and thus destroying the seed method), you could use seperate entry points for ram clear...one for powerup that loads and stores INTIM, another for restarts that reads your "wait for user" counter and EORs it with the stored INTIM value. Or, just continually INCrease the "wait for user" variable ever since it was given the pseudo-random INTIM value on cartridge powerup. Cost = 1 byte of ram or less...depending on the range desired. Edited June 6, 2010 by Nukey Shay Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted June 6, 2010 Author Share Posted June 6, 2010 Thanks guys. Using INTIM is a great idea. Why didn't I just think of that? I'm going to EOR it with some switches and other registers too, and then save that seed from there on in. I'm going to write a test program and try Harmony out in single image and multi-image mode. This would be to strictly a test for INTIM to see if I'm getting fairly random results. Does anyone know how the INTIM behaves on a FB2? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.