From 741065fd91c997f0426bb75dc005a6864730cc70 Mon Sep 17 00:00:00 2001 From: Sme Date: Fri, 21 Apr 2023 19:46:00 -0400 Subject: [PATCH] Fix weirdness with durability-based items and shop text (#477) --- .../DurabilityBasedItems/ScrollNames.lyn.event | 7 ++++--- .../Necessary/DurabilityBasedItems/ScrollNames.s | 14 ++++++++++++++ Events/Release_map.event | 5 ++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/EngineHacks/Necessary/DurabilityBasedItems/ScrollNames.lyn.event b/EngineHacks/Necessary/DurabilityBasedItems/ScrollNames.lyn.event index b09a278a04..9aace28f12 100644 --- a/EngineHacks/Necessary/DurabilityBasedItems/ScrollNames.lyn.event +++ b/EngineHacks/Necessary/DurabilityBasedItems/ScrollNames.lyn.event @@ -3,7 +3,7 @@ PUSH ORG CURRENTOFFSET+$1;GetItemNameString: ORG CURRENTOFFSET+$74;NewItemNameGetter1: ORG CURRENTOFFSET+$64;NewItemNameGetter2: -ORG CURRENTOFFSET+$64;GetItemDescStringIndex: +ORG CURRENTOFFSET+$74;GetItemDescStringIndex: ORG CURRENTOFFSET+$3c;NewItemNameGetter3: POP SHORT $B4F0 $1C04 $21FF $4008 $C1 $1809 $89 $4813 $1809 $8808 $4D12 $8829 $2900 $D01C $4288 $D001 $3508 $E7F8 $6869 $1C20 $A00 $40 $1840 $8800 $4B0C $469E @@ -18,9 +18,10 @@ SHORT $8858 $2800 $D009 $4809 $7801 $2900 $D005 $293A $D001 $3001 $E7F8 $2100 $7 POIN ItemTable POIN DurabilityBasedItemNameList BYTE $41 $A2 $0 $8 $AC $A6 $2 $2 $61 $6A $1 $8 $5D $6A $1 $8 -SHORT $89 $4812 $180C $8820 $4B11 $8819 $2900 $D01B $4288 $D001 $3308 $E7F8 $6859 $1C30 $A00 $40 $1840 $8800 $4B0B $469E +SHORT $89 $4816 $180C $8820 $4B15 $8819 $2900 $D022 $4288 $D001 $3308 $E7F8 $6859 $1C30 $A00 $40 $1840 $8800 $4B0F $469E BYTE $0 $F8 -SHORT $8859 $2900 $D009 $4809 $7801 $2900 $D005 $293A $D001 $3001 $E7F8 $2100 $7001 $4B05 $4718 $4B05 $4718 +SHORT $8859 $2900 $D010 $480D $7801 $2900 $D00C $293A $D001 $3001 $E7F8 $2100 $7001 $3001 $7801 $2900 $D002 $2100 $7001 $E7F8 $4B06 $4718 $4B06 $4718 +BYTE $0 $0 POIN ItemTable POIN DurabilityBasedItemNameList BYTE $41 $A2 $0 $8 $AC $A6 $2 $2 $81 $68 $1 $8 $7D $68 $1 $8 diff --git a/EngineHacks/Necessary/DurabilityBasedItems/ScrollNames.s b/EngineHacks/Necessary/DurabilityBasedItems/ScrollNames.s index dd17e0dfaa..308b2ac1a4 100644 --- a/EngineHacks/Necessary/DurabilityBasedItems/ScrollNames.s +++ b/EngineHacks/Necessary/DurabilityBasedItems/ScrollNames.s @@ -241,6 +241,20 @@ FoundColon3: mov r1,#0 strb r1,[r0] +@For this specific instance, we also need to empty the text buffer +@Keep going until we find an existing 0 in the buffer + +LoopStart3B: +add r0,#1 +ldrb r1,[r0] +cmp r1,#0 +beq LoopExit3B +mov r1,#0 +strb r1,[r0] +b LoopStart3B + +LoopExit3B: + SkipColonTermination3: LoopExit3: ldr r3,=ReturnPoint4 diff --git a/Events/Release_map.event b/Events/Release_map.event index 0f101f49e4..40e66c27ab 100644 --- a/Events/Release_map.event +++ b/Events/Release_map.event @@ -232,5 +232,8 @@ SHLI Thunder Elfire Nosferatu Divine Mend Physic PureWater Elixir ALIGN 4 ArmoryItems: -SHLI SteelAxe SteelLance SteelBow SteelSword HandAxe Javelin + +BYTE SteelAxe 0 +BYTE SkillScroll 20 +SHLI SteelLance SteelBow SteelSword HandAxe Javelin ALIGN 4 \ No newline at end of file