ROM Hack Text Character Limit Issue in Translation

Blazer

Well-Known Member
OP
Member
Joined
Aug 10, 2008
Messages
281
Trophies
0
XP
470
Country
United States
Yo, I'm having this rather annoying issue where text gets cut-off due to a character limit and I'm unable to get a working fix for it. If anyone could help a bro out, it'd be appreciated. Note that I have little to no ASM skills myself and just make use of the programs other people make, really, so I'm not a great hacker or anything. :\


So to start... the problem I'm referring to is for the game Fire Emblem: Heroes of Light and Shadow, blog at http://www.heroesofshadow.net. To quote the original problem:

A slightly more pressing problem is this:

"2. Maybe less important, but it would be nice to expand the amount of text available in the text rewind. 39 symbols in a line isn't actually a lot. I checked the NA/EU version of FE11 and their text rewind has more space available. Perhaps you could work some magic like how you increased the text buffer space?

If not, I guess we could make do with a cut-off text rewind, as I'd rather not force the text into 39 characters per line. "

The text rewind is this part of the game: http://dl.dropbox.co...text_rewind.png

Happens in the dialog of a chapter when you press the... R button, I believe. The limit for that text is 39 characters (or so my fellow team-member says, I don't know if it depends on the actual pixel width of the characters themselves), so it gets cut-off, but that's really annoying since the graphical character limit in the actual text is greater and we'd like it to match. I honestly have no idea where to start here, but it'd be lame if we had to cut-off text to only use like 60% of the width of the box because of this.

Someone else (Nagato) then helped me but it wasn't completely fixed. Here's the patch source which was simply enough even for me to decipher:

Code:
; Game: Fire Emblem 12
;

.nds
.open "arm9.bin", "arm9-2.bin", 0x02004000

.org 0x02044A44
.db 0x37
.org 0x02044A58
.db 0x38
.org 0x02044B54
.db 0x38
.org 0x02044970
.db 0x38

So it has a base and then edits the data of the arm9.bin file at an offset calculated by essentially subtracting the base from the offset... knowing that it just changes 4 values to something higher, i.e. it adds 0x10 to each character limit (0x27-0x37, 0x28-0x38, thus increasing the limit by 16 characters). Supposedly it worked but upon loading the script a little bit past the first cutscene in the prologue, graphical and then game-freezing glitches appear. It should be obvious if you play it with Desmume but if you wish for me to make a video or screenshot it just let me know.

Thus I'm led to believe that something else is... interfering? Given that any value above the original value glitches the game, I'd say there might be data being overwritten or something, but I'm no hacker, just a guy with basic logic skills.

So the character limit itself seems to be fixed but in return a game-breaking graphical glitch appears. The higher the character limit, the earlier that text glitch appears, sadly: only at the default value of 0x27 (39) does it stop/work right. :(

Any help here? Here are the files necessary to play the beginning of the game (at least they should be): http://dl.dropbox.co...iles_021812.zip It's not the latest arm9.bin file but I can easily mimic it to the latest one after the problem here is fixed (I only made a small change between the old version and the new version and I'm not on my home computer or else I'd just post everything straight up). Thanks to anyone who takes the time out to read this or comment!
 

StorMyu

"I'm way too old for this"
Member
Joined
Jan 2, 2010
Messages
943
Trophies
1
Age
97
XP
1,093
Country
France
Increasing this limit is probably reserving space on the Vram, if you take too much Vram, you'll have graphical glitch that's unavoidable.
The only trick here would be to find some more space in Vram to send all your text to that another place.

That may not be helpful to you, but that's the only explanation that came to my mind.
Maybe Nagato could help if he already started, but it's as he wish ^^

Because you can't really fix that problem without any proper knowledge.
 

Foxi4

Endless Trash
Global Moderator
Joined
Sep 13, 2009
Messages
30,824
Trophies
3
Location
Gaming Grotto
XP
29,817
Country
Poland
If the text is tiled then the character limit should not matter as the amount of tiles in VRAM should not change - the tileset remains the same, this patch only increases the area of the map that can be altered to show text.

My guess is that you're leaking memory somewhere - the increased map does not fully flush, ending up with chars stacking up in RAM, but I'm no hacker so I can only give you this suggestion as it makes sense to me.

I suggest checking the RAM and VRAM and OAM contents while the crashes and glitches occur, perhaps two tilesets overlap in space that should be reserved for something else, messing up other maps or causing them to in out-of-bounds due to lack of flushing.
 

StorMyu

"I'm way too old for this"
Member
Joined
Jan 2, 2010
Messages
943
Trophies
1
Age
97
XP
1,093
Country
France
If the text is tiled then the character limit should not matter as the amount of tiles in VRAM should not change - the tileset remains the same, this patch only increases the area of the map that can be altered to show text.

My guess is that you're leaking memory somewhere - the increased map does not fully flush, ending up with chars stacking up in RAM, but I'm no hacker so I can only give you this suggestion as it makes sense to me.

I suggest checking the RAM and VRAM and OAM contents while the crashes and glitches occur, perhaps two tilesets overlap in space that should be reserved for something else, messing up other maps or causing them to in out-of-bounds due to lack of flushing.
Leaking memory somewhere... ? Ram data "can't" technically causes graphical glitch as you have to load stuff from RAM then to Vram and if by any luck, the graphic is loaded before the text and THEN being overlap because you're "pre-loading" it, that's a really bad way of coding imho.
OAM data posess their own Ram adress which is not related to any of the Main User Ram, there's no way a bug between the text and the graphics can occur here.

About the game freezing one, yeah your argument make sense, the amount of text in RAM is probably overlapping something important. but if it's not a text problem (easy to check, just have to test without the little asm hack) then you'll have to debug why it's causing this glitch by looking what's happening before the freeze.
The only left is (as I said) the Vram,
 

Foxi4

Endless Trash
Global Moderator
Joined
Sep 13, 2009
Messages
30,824
Trophies
3
Location
Gaming Grotto
XP
29,817
Country
Poland
Except the data in VRAM has to be loaded from somewhere. The graphics first go through RAM and if a particular section of RAM is locked out by data when the engine does not expect it, it may not overwrite memory in the address that was previously allocated and transfer the contents to VRAM as they are. :)
 

Blazer

Well-Known Member
OP
Member
Joined
Aug 10, 2008
Messages
281
Trophies
0
XP
470
Country
United States
tl;dr it's a big problem and not fun

and the solution seems to repoint something--I'm not sure what because between my lack of understanding of some of the grammar and lack of understanding of some of the hacking talk,I simply don't understand it--to space where the data won't overwrite anything. Meaning I need A) to find the pointer to this place and B) a new place in the... VRAM? to actually put it, which will be hard to find

so is anyone actually willing to help me or at least guide me? I'm always willing to put in the effort, but effort alone doesn't make up for knowledge, ability, or the talent to learn that knowledge and put it to use, which if I had I wouldn't be asking for help XP
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Xdqwerty @ Xdqwerty:
    also gonna install twilight menu in my r4 flashcard
  • Psionic Roshambo @ Psionic Roshambo:
    One thing that just occurred to me.... The sound on the 2600 sucked less back then the harsh sound we hear now is from infinitely better speakers we have now, back when the 2600 was new speakers produced a almost muffled sound, like CRTs made old graphics look slightly better.
  • Psionic Roshambo @ Psionic Roshambo:
    I wonder if I could recommend that to some emulation devs that perhaps the sound could use some smoothing out to simulate those old TVs
  • Psionic Roshambo @ Psionic Roshambo:
    I think a few of the early systems could benefit from that, at least up to the 8 bit generation, by the 16 bit generation I think TVs had gotten a lot better in almost every way
  • Xdqwerty @ Xdqwerty:
    i dont have an sd card adapter but I have an usb sd card adapter
  • K3Nv2 @ K3Nv2:
    Old people games
  • Xdqwerty @ Xdqwerty:
    its not the one that comes with the r4
  • Xdqwerty @ Xdqwerty:
    doesnt work (my flashcard is from r4isdhc.com)
  • Xdqwerty @ Xdqwerty:
    might install ysmenu first
  • Psionic Roshambo @ Psionic Roshambo:
    Try Wood firmware
  • Psionic Roshambo @ Psionic Roshambo:
    For your R4
  • Psionic Roshambo @ Psionic Roshambo:
    It's old but it's the best firmware out for DS stuff
  • Xdqwerty @ Xdqwerty:
    it says it only works for the original R4, R4i Gold (r4ids.cn), R4iDSN (r4idsn.com) and Acekard R.P.G.
  • Xdqwerty @ Xdqwerty:
    nvm it does support mine
  • Xdqwerty @ Xdqwerty:
    but why choose it over ysmenu @Psionic Roshambo?
  • Xdqwerty @ Xdqwerty:
    bc im stupid?
  • Xdqwerty @ Xdqwerty:
    yea ik im stupid
  • Xdqwerty @ Xdqwerty:
    good night
  • Psionic Roshambo @ Psionic Roshambo:
    Just give it a try, but honestly if you have a 3DS you can play DS games without a card just off the internal SD card
  • Psionic Roshambo @ Psionic Roshambo:
    Slightly slower loading but a bit more convenient
  • BakerMan @ BakerMan:
    guys, my fuckin headphones have an out of place speaker
  • K3Nv2 @ K3Nv2:
    Did you try wearing them?
    K3Nv2 @ K3Nv2: https://youtube.com/shorts/eJV6GaIEgd4?si=ciLPnlhfd7XcrxQn