How To Apply.txt 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. Even though the source code tells you how, Better use this here with the step-by-step
  2. for both supported verisons.
  3. Saving the new Block:
  4. Needed: Save_and_load.out, ROM to apply
  5. Common to both versions
  6. 1. Copy the contents to a free location in your ROM, 4 bytes aligned.
  7. Write down the location (called loc through this guide).
  8. For Emerald
  9. 2. At loc + 0x14, place the reverse pointer for the correct return address
  10. (ready to place should be 6d 27 15 08)
  11. 3. At loc + 0x48, place place the reverse pointer for the correct return address
  12. (ready to place should be Ad 20 2e 08)
  13. 4. At 0x15276a place 00 47
  14. 4.5 At 0x15279c place the reversed pointer (loc+0x1 in reverse)
  15. 5. At 0x152ea0 place 00 48 00 47 (loc+0x19 in reverse)
  16. For Fire Red
  17. 2. At 0x0d983a place 00 47
  18. 2.5 At 0x0d986c place the reversed pointer (loc+0x1 in reverse)
  19. 3. At 0x0D9EE4 place 00 48 00 47 (loc+0x19 in reverse)
  20. This will allow RAM 0x0203e000 to be saved to the Flash ROM.
  21. Not happy with the RAM Address? Know a better one? Then all you need to do is change
  22. (loc + 0x40) to the new RAM Address you wish to save.
  23. This second part fixes the Variables, according to this Rules:
  24. 0x4000-0x4fff are the old ones. Use with caution
  25. 0x5000-0x57ff == 0x5800-0x5fff The variables in the new RAM Area
  26. 0x6000-0x6fff are Byte-address to the above variables ([0x5000] = [0x6000] OR [0x6001]<<8)
  27. 0x7000-0x73ff are Word address to the above variables ([0x7000] = [0x5000] or [0x5001]<<10)
  28. 0x7400-0x7fff are useless, as non-variables.
  29. This part of the fix is to use that area as Variables. The first part saved the area for us
  30. to use, so you can simply write with the "WriteByteTooOffeset" command to use it as savable
  31. pool of data. If you wish to keep the old variable system intact, ignore this last part.
  32. "Fixing" the Variables:
  33. Needed: Var_decrypt.out, Var_loader.out, Var_store.out, ROM to apply
  34. Common to all ROMS
  35. 1. copy Var_decrypt.out content to a 4byte aligned free location (called loc_decrypt)
  36. 2. copy Var_loader.out content to a 4byte aligned free location (called loc_loader)
  37. 3. copy Var_store.out content to a 4byte aligned free location (called loc_store)
  38. For Emerald
  39. 4. at loc_decrypt + 0x44, place 9c 93
  40. 5. at 0x09D648 place 70 b5
  41. 5.2 at 0x09d64e place 0e 1c
  42. 5.4 at 0x09D682 place 10 47
  43. 5.6 at 0x09D688 place 70 bd
  44. 5.8 at 0x09D690 place (loc_decrypt+0x1 in reverse)
  45. 6. at 0x09d6a0 place 00 49 08 47 (loc_loader+0x1 in reverse)
  46. 7. at 0x09d6b0 30 b5 05 04 28 0c
  47. 7.5 at 0x09d6be 01 49 08 47 00 00 (loc_store+0x1 in reverse)
  48. For Fire Red
  49. 4. at 0x06e4f4 place 10 47
  50. 4.5 at 0x06e508 place (loc_decrypt+0x1 in reverse)
  51. 5. at 0x06e574 place 00 49 08 47 (loc_loader+0x1 in reverse)
  52. 6. at 0x06e584 30 b5 05 04 28 0c
  53. 6.5 at 0x06e592 01 49 08 47 00 00 (loc_store+0x1 in reverse)
  54. If, for some reason, you changed the RAM stored Address, fix it by placing the new address at
  55. (loc_decrypt + 0x48)