From abdf4eaa1cc97c0140a28ed31a8a0de27314ac46 Mon Sep 17 00:00:00 2001 From: haven1433 Date: Thu, 29 Sep 2022 21:29:15 -0500 Subject: [PATCH] add new table also, `GetIndexOfNearestAddress` shouldn't ever find a table with distance 0, because that's not what we're wanting to find: we want the table with the nearest values so we can do a cross-reference, and anything with this exact address is likely missing the other games we're looking for. --- src/HexManiac.Core/Models/Code/tableReference.txt | 2 +- src/HexManiac.Core/Models/Singletons.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/HexManiac.Core/Models/Code/tableReference.txt b/src/HexManiac.Core/Models/Code/tableReference.txt index c868b19f..c5c21c4d 100644 --- a/src/HexManiac.Core/Models/Code/tableReference.txt +++ b/src/HexManiac.Core/Models/Code/tableReference.txt @@ -756,7 +756,7 @@ graphics.text.font.japan3.width, ,,,, ,,,, 00679C, [width.]512 data.text.menu.pokemon.battle, , , , , 032C38, 032C38, 032C4C, 032C4C, , "" data.text.menu.pause, 071160, 071164, 071180, 071184, 06EF9C, 06EF9C, 06EFB0, 06EFB0, 09F818, [text<""> code<>] data.text.menu.pokemon.options, 089CCC, 089CCC, 089CEC, 089CEC, 120F74, 120F4C, 120FEC, 120FC4, 1B32F8, [text<""> code<>] -data.text.menu.itemStorage, , , , , , , , , 16B210, [text<""> thumb<>]4 +data.text.menu.itemStorage, 139FAC, 139FAC, 139FCC, 139FCC, 0EBA84, 0EBA5C, 0EBA98, 0EBA70, 16B210, [text<""> thumb<>] sound.fanfares, 074E64, 074E68, 074E84, 074E88, ,,,, , [songID: duration:]12 sound.fanfares, ,,,, 071C08, 071C08, 071C1C, 071C1C, , [songID:songnames duration:]14 diff --git a/src/HexManiac.Core/Models/Singletons.cs b/src/HexManiac.Core/Models/Singletons.cs index f01831c8..d538b67e 100644 --- a/src/HexManiac.Core/Models/Singletons.cs +++ b/src/HexManiac.Core/Models/Singletons.cs @@ -199,6 +199,7 @@ namespace HavenSoft.HexManiac.Core.Models { var index = -1; for (int i = 0; i < Count; i++) { var currentDistance = Math.Abs(this[i].Address - address); + if (currentDistance == 0) continue; if (currentDistance > distance) continue; distance = currentDistance; index = i;