Talk:Save data structure (Generation I): Difference between revisions

(Update to rebattling trainers)
Line 26: Line 26:


:I have an update. I believe that all of the flags are located between the offset 0x29C0 and may extend as far up as 0x2B2E. Zeroing out most of these values should enable you to rebattle trainers. Although, I cannot confirm if there are any side effects, if there are also event flags mixed in this range, or if all trainers are covered with this range. [[User:Oaoutpost0|Oaoutpost0]] ([[User talk:Oaoutpost0|talk]]) 02:01, 13 February 2018 (UTC)
:I have an update. I believe that all of the flags are located between the offset 0x29C0 and may extend as far up as 0x2B2E. Zeroing out most of these values should enable you to rebattle trainers. Although, I cannot confirm if there are any side effects, if there are also event flags mixed in this range, or if all trainers are covered with this range. [[User:Oaoutpost0|Oaoutpost0]] ([[User talk:Oaoutpost0|talk]]) 02:01, 13 February 2018 (UTC)
::Take a look at [https://github.com/pret/pokered/blob/master/constants/event_constants.asm this page]. There's two things in here.
::One: this seems to identify addresses that are different from what you've identified, starting at 0xD747. Now, I believe the save file is basically just a portion of the game's working RAM that's saved, so it's possible that the addresses you've identified above for the save file are equivalent to these addresses, but I can't say for sure.
::Two: these flags have many spaces between the "BEAT" flags, meaning it looks like you would indeed be messing with other flags if you just zeroed out everything between the first "beat" flag and the last. This is also complicated by the fact that these flags are single bits, meaning you also can't just set a whole byte to zero without still potentially messing with an unintended flag.
::I haven't tested this in any way myself. But the ROM disassembly is usually very reliable. And I believe it should mostly correspond to Red, Blue, and Yellow, at least the English versions, but the safest thing would be to just experiment with setting/resetting a desired flag in Red or Blue (and/or checking what changes when you trigger specific flags in those games).
::If you can make that list correspond to the save file, then you can just filter for all the lines with "BEAT" to identify which flags are for Trainer battles. Give or take a few like "BEAT_ZAPDOS". [[User:Tiddlywinks|Tiddlywinks]] ([[User talk:Tiddlywinks|talk]]) 03:15, 13 February 2018 (UTC)