logo
 drop

Main

Community

Submissions

Help

Author Topic: Can someone help me make sense of these old ASM notes regarding Font Spacing?  (Read 222 times)

Choppasmith

  • Newbie
  • *
  • Posts: 6
    • View Profile
Hi there! So I'm working on giving MoxHyPa's translation of Itadaki Street Special on PS2 a much needed facelift. I'm nearly finished, doing graphics now, and should have a patch up by the end of the month.

I've been using some old project notes and translations by DQ Translations released by them in and old forum thread here. I originally used their graphic templates to add English graphics for ISS Portable.

Anyhoo, they had some notes regarding font spacing and seemed to have it figured out. There's a bit of text I've compiled into a pastebin here:
https://pastebin.com/1EZC9f88

They also had a couple screenshots





I know begging is frowned upon, but I was kinda hoping someone could look at this and tell me how I could utilize it (like if it's a simple matter of editing some values in a Hex Editor) since having more room for names and such would be a GODSEND.

There's also some stuff about Pointers but I think it's because they made a custom inserting program. If not, hey cool, I'll still release my patch as is. Still very playable and MUCH better than the old one.

flame

  • Full Member
  • ***
  • Posts: 128
    • View Profile
I can help you a little bit.

FPR = Floating Point Register
20 = 14
That's because
20 really DOES equal 0x14

Raymond Hettinger of Python likes to say he's a young man in hex because he's 0x3? years old.

I don't know how to read the instruction: (don't know what sd means and don't know what var_170($sp) means
seg000:001EC89C   sd $v0, 0x170+var_170($sp)

I'm not great at reading assembly. Maybe it is adjusting the size on each pass based on the current character. That's what it looks like.

krat0s

  • Jr. Member
  • **
  • Posts: 45
    • View Profile
I am not that good at assembly but here is a try.
From what I see , the notes contains parts of setting up printing parameters for different parts of the game and then calling up the main printing function.  I have made a C version of just one of those example, they all seem to be almost the same, just that they set different value and then jump to what appears to be the main printing function. Note, I can be completely wrong here!

a0, a1, a2,a3 , tX registers are used for arguments.
sd instruction stores a doubleword at the speciffied address.Not sure what it is doing there, perhaps storing value to the stack, or to an array/structure.
Code: [Select]
seg000:001EC898   li $v0, 0x14                                v0 = 0x14 text size
seg000:001EC89C   sd $v0, 0x170+var_170($sp)                  0x170+var170(sp)  = v0 = 0x14
seg000:001EC8A0   daddu $a0, $s1, $0                          a0 =  s1;
seg000:001EC8A4   sd $v0, 0x170+var_168($sp)                  0x170+var_168($sp) = v0;
seg000:001EC8A8   daddu $a1, $s0, $0                          a1= s0
seg000:001EC8AC   li $a2, 0x41                                a2 = 0x41
seg000:001EC8B0   li $a3, 0xFFFFFFFF                          a3= 0xFFFFFFFF
seg000:001EC8B4   sd $v1, 0x170+var_160($sp)                  0x170+var_160($sp) = v1
seg000:001EC8B8   li $t0, 0x26                                t0 = 0x26
seg000:001EC8BC   li $t1, 0x16A                               t1 = 0x16A
seg000:001EC8C0   li $t2, 0x200                               t2 = 0x200
seg000:001EC8C4   jal sub_1E6410                             
seg000:001EC8C8   li $t3, 0x1C0                               t3 = 0x1c0

Code: [Select]
//         a0 , a1 , a2 , a3 ,      t0 ,       t1 ,         t2     t3;
int size , a0 , a1 , a2 , a3 , StartPoint ,StartPoint2 , char_nr , t3;
long unk1;   // 0x170+var170(sp)
long unk2    // 0x170+var_160($sp)
long unk3    //0x170+var_160($sp)

size = 0x14;
unknown1 = size;    // = 0x14
a0 = s1;  //No idea what s1 contains.
unk2 = s0;

unk2 =  size     // = 0x14
a1 = s0;
a2 = 0x41;
a3 = 0xFFFFFFFF;
unk3 = v1;
StartPoint = 0x26;
StartPoint2 = 0x16A
char_nr = 0x200
t3 = 0x1c0

// Sub_1E6410(a0, a1, a2 , a3 , t0, t1 , t2 , t3);

//  Sub_1E6410(a0, a1, a2 , a3 , StartPoint , StartPoint2 , char_nr , t3);

Sub_1E6410(s1, s0, 0x41 , 0xFFFFFFFF , 0x26  , 0x16A , 0x200 , 0x1C0);

The question is: what do you want to do?
If you want to do something simple, like changing the number of max characters before newline you can easily do that with changing the value of the $t2 register. Takes like 2 seconds in PS2Dis.
I am not sure what the StartingPoint, and StartingPoint2 are how are they used.
Regards,
« Last Edit: May 17, 2017, 01:03:34 pm by krat0s »

Choppasmith

  • Newbie
  • *
  • Posts: 6
    • View Profile
Thanks for the info guys!  :)


The question is: what do you want to do?
If you want to do something simple, like changing the number of max characters before newline you can easily do that with changing the value of the $t2 register. Takes like 2 seconds in PS2Dis.
I am not sure what the StartingPoint, and StartingPoint2 are how are they used.
Regards,

Well I figure if I can make the game look like those test screenshots and fix the spacing between letters, then I could edit in a new, more condensed font to fix the overlap with bigger letters then I would be golden. That should easily give me room for things like character and Sphere names (currently limited to 5 and 8 letters respectively, FYI, Spheres are essentially powerups that are named after various DQ and FF Abilities and Items so the more visual space I could get the better). Are you saying editing the characters per line value affects the spacing or do you think that's a different value? Even better if I can find this subroutine that's used for Shop and Area names and use it for other strings like Character names and Spheres




At the time I thought I was clever and seeing that all the Shop and Area names had the value of 80 at the end, but then I realized I think all I did was type "half" of a Japanese letter which is enough for the routine to kick in (I've been using the 1 byte letters easily picked up in a hex editor, but I think a lot of this stuff relies on 2 bytes per letter)