I'm still ploughing through the old code and updating it. The new battle box autosizing code is done...
This will give you some idea as to how naive I was about coding a while back. Just look at the train wreck in the older code:
Older
Bytes used: ~110
Starting 6D21AE
===============================================
movsx eax,word ptr [ebp-00000158]
cmp cx,0DA8
Jne label1
-------------------------
mov word ptr [ebp-00000168],FF58
movsx eax,word ptr [ecx+edx+04]
cdq
sub eax,edx
mov ecx,eax
sar ecx,1
movsx eax,word ptr [ebp-00000158]
cdq
sub eax,edx
sar eax,1
sub ecx,eax
-------------------------
LABEL1
mov word ptr [ebp-00000168],0009
add ax,001A
mov [0091D21C],ax
mov cx,0280
sub cx,ax
sar cx,1
mov [ebp-00000174],ecx
xor ecx,ecx
add ecx,0C
===============================================
Newer
Bytes used: ~70
Starting 6D21A2
===============================================
xor ebx,ebx [Prepare reg for TextX]
mov ax,[ebp-00000158] [TextWidth]
mov dx,FF58 [HelpTextY]
cmp cl,17
je label1 [If help text is true]
-------------------------
add eax,1a [Add 1A to TextWidth]
add ebx,0D [Add 0D to TextX]
mov dx,0009 [AttackTextY]
-------------------------
LABEL1
mov [0091D21C],ax [Resize boxes]
mov [ebp-00000158],bx [Set TextX]
mov [ebp-00000168],dx [Set TextY]
mov cx,0280 [ScreenWidth = 640]
sub cx, ax
shr cx,1 [Box now centred]
mov [ebp-00000174],cx [Set BoxX]
===============================================
The battle boxes work in a very strange way in battle... the text is linked to the box for starters. And the box cannot be removed easily from what i can see, because the main function also contains a complete draw method for it (unlike nearly all other boxes that can just have their draw function nopped. Because of this, I have to hide the box Y pos, move the text Y up. Also, the code is shared for both help menu text and attack text. So it gets rather complicated. I am not sure how NFITC1 etc would handle it better, if possible, but my code isn't TOO bad.)