Skip to content

Commit

Permalink
Fixed missing enemy name refs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffman committed Apr 17, 2017
1 parent 6bb8edb commit b318259
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions RopeSnake/Mother3/Text/TextModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using RopeSnake.Core;
using RopeSnake.Core.Validation;
using RopeSnake.Mother3.IO;
using RopeSnake.Gba;

namespace RopeSnake.Mother3.Text
{
Expand Down Expand Up @@ -420,6 +421,19 @@ private void UpdateBattleTables(Block romData, AllocatedBlockCollection allocate
battleLocation, battleLocation);
}

private void UpdateAsmReferences(Block romData, AllocatedBlockCollection allocatedBlocks)
{
int enemyNamesLocation = allocatedBlocks.GetAllocatedPointer(EnemyNamesKey);
var asmRefs = RomConfig.GetReferences("Text.EnemyNames.AsmRefs");

var stream = romData.ToBinaryStream();
foreach (var asmRef in asmRefs)
{
stream.Position = asmRef;
stream.WriteGbaPointer(enemyNamesLocation + 4);
}
}

public override void WriteToRom(Block romData, AllocatedBlockCollection allocatedBlocks)
{
UpdateWideOffsetTable(allocatedBlocks, TextBankKey, _textKeys);
Expand All @@ -435,6 +449,7 @@ public override void WriteToRom(Block romData, AllocatedBlockCollection allocate
if (RomConfig.IsEnglish)
{
UpdateRomReferences(romData, allocatedBlocks, EnemyNamesShortKey, GetOffsetAndDataKeys(ItemDescriptionsSpecialKey));
UpdateAsmReferences(romData, allocatedBlocks);
}

_textKeys = null;
Expand Down
6 changes: 3 additions & 3 deletions RopeSnakeRomConfigs.state.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository at the time that this commit was made.
Refer to this file to see exactly which version (by commit hash) of each ROM
config file existed at the time of this commit.

75aed0722a4dd62d6cc062e04a6ae3cc68d7c7d6 refs/heads/mother3-english-v10
b49c8a1d4248a526dcd34f3c1bfe84540abd815c refs/heads/mother3-english-v11
b61d96ff3e728c387a24869088571612c1572a84 refs/heads/mother3-english-v12
a5cdf7c9b1c3a8eb51ad2647d6c55a9dcc15aba9 refs/heads/mother3-english-v10
2a3e5f434867ee571f70c72326f9bd740857a459 refs/heads/mother3-english-v11
16a08386ab8204c6e6de865b155599ded93e42ee refs/heads/mother3-english-v12
7d6a378a7c6324a006a827e4df803bc1030e7aae refs/heads/mother3-jp

0 comments on commit b318259

Please sign in to comment.