News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Atlas crash on FF3us script insertion  (Read 2043 times)

screamingtrees

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Atlas crash on FF3us script insertion
« on: August 20, 2020, 01:25:26 am »
Hello RHDN,

I'm REALLY stumped on this one. I've got a script properly dumped with Cartographer that I'm looking to reinsert into FF3us. But no matter what I try I get an immediate crash involving msvcr90.dll (buffer overflow exception error) on running Atlas. This is what I've tried:

1. Uninstalling/reinstalling all Microsoft Visual C++ Redistributables (I believe msvcr90.dll is from the 2008 libraries)
2. Both HIROM and LINEAR addressing types
3. Inserting an old FF4 script into FF4.sfc that I once had success with just to see if it would crash (still works, Atlas inserts it without error)
4. Inserting the script into an untouched FF3us rom as mine has been expanded by FF3usme already. (Also I tried with just the first dialogue block to make sure it wasn't an issue with the rom expansion, but both crash)
5. Deleting some entries from my tbl file
6. Using a CUSTOMPTR

I feel like it could be something really simple, but I also feel like I've tried everything. Anyway, thanks for reading, and I hope all your projects are going better than mine!

Oh, and here's my table file and script:

Code: [Select]
/00=<End>\n\n
01=<Break>\n
13=<Page>\n
15=<Choice>
20=A
21=B
22=C
23=D
24=E
25=F
26=G
27=H
28=I
29=J
2A=K
2B=L
2C=M
2D=N
2E=O
2F=P
30=Q
31=R
32=S
33=T
34=U
35=V
36=W
37=X
38=Y
39=Z
3A=a
3B=b
3C=c
3D=d
3E=e
3F=f
40=g
41=h
42=i
43=j
44=k
45=l
46=m
47=n
48=o
49=p
4A=q
4B=r
4C=s
4D=t
4E=u
4F=v
50=w
51=x
52=y
53=z
54=0
55=1
56=2
57=3
58=4
59=5
5A=6
5B=7
5C=8
5D=9
5E=!
5F=?
60=/
61=:
62="
63='
64=-
65=.
66=,
67=...
68=;
69=#
6A=+
6B=(
6C=)
6D=%
6E=~
6F=*
70=@
71=&
72==
73="
7F=
80=e
81= t
82=:
83=th
84=t
85=he
86=s
87=er
88= a
89=re
8A=in
8B=ou
8C=d
8D= w
8E= s
8F=an
90=o
91= h
92= o
93=r
94=n
95=at
96=to
97= i
98=,
99=ve
9A=ng
9B=ha
9C= m
9D=Th
9E=st
9F=on
A0=yo
A1= b
A2=me
A3=y
A4=en
A5=it
A6=ar
A7=ll
A8=ea
A9=I
AA=ed
AB= f
AC= y
AD=hi
AE=is
AF=es
B0=or
B1=l
B2= c
B3=ne
B4='s
B5=nd
B6=le
B7=se
B8= I
B9=a
BA=te
BB= l
BC=pe
BD=as
BE=ur
BF=u
C0=al
C1= p
C2=g
C3=om
C4= d
C5=f
C6= g
C7=ow
C8=rs
C9=be
CA=ro
CB=us
CC=ri
CD=wa
CE=we
CF=Wh
D0=et
D1= r
D2=nt
D3=m
D4=ma
D5=I'
D6=li
D7=ho
D8=of
D9=Yo
DA=h
DB= n
DC=ee
DD=de
DE=so
DF=gh
E0=ca
E1=ra
E2=n'
E3=ta
E4=ut
E5=el
E6=!
E7=fo
E8=ti
E9=We
EA=lo
EB=e!
EC=ld
ED=no
EE=ac
EF=ce
F0=k 
F1= u
F2=oo
F3=ke
F4=ay
F5=w
F6=!!
F7=ag
F8=il
F9=ly
FA=co
FB=.
FC=ch
FD=go
FE=ge
FF=e...

Code: [Select]
#VAR(dialogue, TABLE)
#ADDTBL("ff3.tbl", dialogue)
#ACTIVETBL(dialogue)

#SMA("HIROM")
#JMP($D0000)

//POINTER #0 @ $CE602 - STRING #0 @ $D0000

#W16($CE602)
Wedge:<Break>
There's the city... <$16><$18><$12><Page>
Biggs:<Break>
Hard to believe an esper's been found frozen there a thousand years after the War of the Magi... <$16><$18><$12><End>

abw

  • Hero Member
  • *****
  • Posts: 530
    • View Profile
Re: Atlas crash on FF3us script insertion
« Reply #1 on: August 27, 2020, 09:34:23 pm »
Hmm, that does sound like a system problem, but in that case it's weird that your FF4 script would still work. I've tried using your provided table file and script and can confirm that Atlas does not crash when inserting it on my system. I have noticed in the past that Atlas sometimes has problems with the % character; does using e.g. 6D=<pct> instead make any difference?

On a related note, you might like using one of the table file collections from https://www.ff6hacking.com/wiki/doku.php?id=ff3:ff3us:doc:text since yours is missing some entries.

screamingtrees

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Atlas crash on FF3us script insertion
« Reply #2 on: August 30, 2020, 12:16:09 pm »
Hey thanks for your reply. I tried changing the 6d=% entry in my tbl, but that didn't help the crash. I also tried those table files from the wiki first, but have since been removing entries to see if that would help as well (always redumping with cartographer with the new tbl file before trying atlas again). If you don't mind, could I see what versions of MS visual c++ distributables you have installed on your system?

abw

  • Hero Member
  • *****
  • Posts: 530
    • View Profile
Re: Atlas crash on FF3us script insertion
« Reply #3 on: August 30, 2020, 03:08:48 pm »
It looks like I've ended up having to install the following over the years:
Microsoft Visual C++ 2005 Redistributable
Microsoft Visual C++ 2008 Redistributable - x64 9.0.21022
Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.6161
Microsoft Visual C++ 2008 Redistributable - x86 9.0.21022
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.4148
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.6161
Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219
Microsoft Visual C++ 2013 Redistributable (x64) - 12.0.30501
Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.30501
Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.24215
Microsoft Visual C++ 2015 Redistributable (x86) - 14.0.24215

See if you can pare down your insert file until you get something that doesn't cause a crash and then compare that with a file that does cause a crash; hopefully the difference between the two files will show you what input is triggering the crash. I know there are some inputs that will cause Atlas to crash (e.g. "#JMP)$0)" instead of "#JMP($0)"), but I don't recall ever seeing anything about msvcr90.dll.

screamingtrees

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Atlas crash on FF3us script insertion
« Reply #4 on: August 31, 2020, 01:09:41 pm »
Hey look at that! It works finally. I believe it was the 69=# tbl entry that was messing things up (my rom hack uses this byte for the beginning-of-line "..." character, I think atlas interprets anything starting with "#" as a command), but I also updated my MSVC++ 2010 libraries to the latest version and started from scratch from one of the tbl files you linked. Thanks for all your help.
« Last Edit: August 31, 2020, 01:26:56 pm by screamingtrees »

abw

  • Hero Member
  • *****
  • Posts: 530
    • View Profile
Re: Atlas crash on FF3us script insertion
« Reply #5 on: August 31, 2020, 06:41:29 pm »
Ah, yes, if you happen to have a "#" character as the first character of a line in your script, that will also cause problems, usually of the crashing variety. In any case, I'm glad you've got it working now!