Page 1 of 1

Blaze Union VWF Development

Posted: Tue Jul 02, 2019 4:30 am
by flamethrower
https://datacrystal.romhacking.net/wiki/Blaze_Union

So you see under RAM map that:
1) Loading the text at 0x088A2A6C
2) Loading something about the spacing at 0x088A3858

Setting breakpoints at those two locations:
#1 gets called only once for each letter. It is converting the letter into some sort of drawing data.
#2 gets called once for each letter that's currently on the screen. But only when the screen contents change.

I noticed that character names and descriptions are in a larger font than the main text. 24 pixels for this versus 20 pixels for text in the box. The font itself is 24 pixel squares. Can I change the font size? Each type has a 2-pixel overlap.

It's going to take a lot of work to convert this to VWF. Normally in games, it reads letters the same number of times as it draws letters. But this game doesn't. It reads letters a lot less than it draws them. Also unusual is that this game has letters on multiple pages (there's more than one font page).

Image
Image
Image
Here we go.
The branch at 0x88A3844 seems to be taken most of the time.
In case it wasn't clear, mflo is reading the result of the previous multiplication.
Pay careful attention to the multiplies. This is a fixed with algorithm. You would never multiply anything regarding the x-direction for a variable width font!

The first order of business is to change it to avoid the multiplication in the x-direction. The y multiplication can be kept because it's not hurting anything. What to put instead of multiplication? Let's try the following subroutine, written in human language. Later I'll try converting it to assembly.

If the character x position is zero, the answer is the x position offset. It's getting read at 0x88A3874 above.
If the character position is not zero, the answer is the position at the right of the previous character box minus 2. Minus 2 just to preserve the way it currently looks.
...
When finished drawing the current character, record in memory the position at the right of the current character.

The vwf part goes in the ... in the above pseudo code. Basically we need to try to detect what character it is and then adjust the "minus" in the above pseudocode based on the character, or just use -2 if none of our characters are detected.

Re: Blaze Union VWF Development

Posted: Sun Jul 21, 2019 9:00 pm
by NightWolve
PSP Assembly code, yikes! Looking like you're having fun there!