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

→‎Rebattle Trainers: Continued discussion
(→‎Rebattle Trainers: Continued discussion)
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.
::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.
::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.
Line 31: Line 32:
::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).
::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)
::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)
:::Thank you, that is a good source of information (although I'll use the Yellow edition in my testing since that is what ROM I've been working with). I suspect that the offsets are different because, as you said, the save file is just a portion of the RAM, not the whole thing. Also, these constants would suggest that the range of the flags goes form 0x29C0 to 0x2AFF (assuming I found the correct starting point), which isn't as high as I originally estimated (but I did think my original estimate was too high to begin with). It isn't surprising at all that there are other flags mixed in here, or that they are controlled with bits instead of bytes. The values that the flags were changed to before and after the battle were not easily predictable (that is, it seemed like certain bits were being set as opposed to the whole byte). [[User:Oaoutpost0|Oaoutpost0]] ([[User talk:Oaoutpost0|talk]]) 22:44, 13 February 2018 (UTC)
5

edits