1
Programming / Re: Can someone help me make sense of these old ASM notes regarding Font Spacing?
« on: June 07, 2017, 10:17:41 pm »
Going to explain this for you. I will try to make it simple but I don't have PS2Dis opened in front of me.
First open PS2Dis and load the main file which you already have done so. Then you should go in the Analyzer file menu and Invoke Analyzer.
Pressing F will open a tiny textbox when you can input the address in hex and jump right there. Since you posted that assembly here , it means you have figured that out.
PS2Dis does come with a small document explaining some basic operations I think.
To make changes you click on the instruction lines and press enter, edit the lines with the new opcodes then you press simply press enter again. At the moment that edit box has been closed and you see the new edited line in the main window, the change is already made. You can close PSDis and rebuild the iso and test to see if it works. Do you know how to properly deal with PS2 image replacement/generation?
Now, the ASM from that team notes is not an edited version. In fact it's from the game. In case you are wondering how that it is possible, it because the team used IDA Pro to dissamble , and it displays things a bit different. I know for sure that it is from IDA Pro because of that var_ that you are having problems to update.
In the PS2Dis that you posted, it' almost the same code. Other members can prove it!
I will take only one line:
In IDA:
In the PSDis for this line we have:
See? It's the same thing for every line despite the fact that it looks different.
If the team notes are correct and the v0 is the text size which is always 0x14 then all you have to do is to go to the address of each
li $v0 , 0x14 of the different section of the notes an you will of course see:
Addiu $v0 , zero , 0x14
Pres Enter on that line and change the "14". Leave the 0x as it is. This way you are changing the text size (if that is really text size and the previous translation team managed to reverse it successfully.) Obviosly , the value is in hex.
I would recommend setting the value to 0x12 , or 0x13 , values near the original value and see what happens.
Regards,
June 09, 2017, 03:56:06 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Hi, I finslly had some free time and been dealing all day with this.
Tried editing in PS2Dis but for some reason it just won't save up the changes.
So.. went straight to IDA Pro, made some changes and boom:
Normal :

Smaller size , 0x10:

Changing colour:

Smaller text with new colour printed at lower than the image box:

So far I have:
a0 - seems to be a structure contains the text and some other values. Not important and no need to change.
a1 - Takes the following values: 0x02 , 0x03, 0x04 , 0x07, 0x08, 0x09, 0x0A, 0xc , 0x14 , 0x15 , 0x16 , 0x17, 0x18 , 0x60 , 0x61. They seem like control code but we will find out soon.
Flashing_Icon_value - This is somehow related to that upside done flashing triangle but I don't know excatly how. It is 0x41 and any value bigger than 0x45 causes text corrupted , very strange value. I do not think that you need to deal with this. Leave it as it is. One thing i am sure though, setting it's value to 0 disables the icon and just the text is displayed.
Colour - yes, it's colour , I wonder how I didn't notice it before , all FFs correspond to white and everywhere the text is white. I still have to figure out how we will find correct value to make new colors display properly(the blur color you see in the screeshot above was my second random edot, the first one displayed nothing.)
StartPointX - X position when you want the text to start.
StartPointX - Y position when you want the text to start.
EndPointX - Now this is always 0x200 and that = 512. No need to change this i think. Read below.
EndPointX - Now this always 0x1C0 and that = 448. No need to change this i think. Read below.
Here is the interesting part! Go back to the PCSX2 screenshots and you see the title bar. You will notice 512x448, the resolution!. Now sure what these values do but I don't think there is any need to tamper them.
As for the text size you must change the value in v0.
Since PS2Dis is giving me a headache and getting IDA Pro is too much for you , I will make simple. I will list the hex offsets of the size value for each function so you can edit them.
(The DQT team has 9 section. Through trial and erro I managed to discover that the 9 secton/fragement of code (002EB8B8 - 002EB8E4) handles the main menu printing.) Other routines do other stuff. It is up to you to check what this routines do and I suggest that you edit the size of one of them at a time, making it smaller or bigger and then keep playing the game. After identifying one section give back its original value and change the size for the other section, you get the point.
I am making an editor for you for today I spent too much time and the byte swap is giving me a headache.
So just use any regular editor and as soon as you land in there you will see 14 and change to something small or bigger.
NOTE: To successfully edit the value you must edit 2 bytes, even the one after it. The 00. The byte after 14 is 00 and together they form:
0x1400 , however the bytes are reversed so we get 0x0014 ! This means that unless setting bigger than 255 values (which in this case you certainly don't , even 0x18 is really big), there is no need to mess with the other byte. Just go ahead edit only the 0x14 byte!
That's for now. Got to go, will try to find more details tomorrow.
First open PS2Dis and load the main file which you already have done so. Then you should go in the Analyzer file menu and Invoke Analyzer.
Pressing F will open a tiny textbox when you can input the address in hex and jump right there. Since you posted that assembly here , it means you have figured that out.
PS2Dis does come with a small document explaining some basic operations I think.
To make changes you click on the instruction lines and press enter, edit the lines with the new opcodes then you press simply press enter again. At the moment that edit box has been closed and you see the new edited line in the main window, the change is already made. You can close PSDis and rebuild the iso and test to see if it works. Do you know how to properly deal with PS2 image replacement/generation?
Now, the ASM from that team notes is not an edited version. In fact it's from the game. In case you are wondering how that it is possible, it because the team used IDA Pro to dissamble , and it displays things a bit different. I know for sure that it is from IDA Pro because of that var_ that you are having problems to update.
In the PS2Dis that you posted, it' almost the same code. Other members can prove it!
I will take only one line:
In IDA:
Code: [Select]
li $v0, 0x14 #sets the value of the register v0 to 0x14. V0=0x14
In the PSDis for this line we have:
Code: [Select]
Addiu $v0 , zero , 0x14 # it mea that in v0 will be stored the value of the addition of the zero and 0x14. Zero is an register which always holds the value zero. So v0=0+0x14 =0x14
See? It's the same thing for every line despite the fact that it looks different.
If the team notes are correct and the v0 is the text size which is always 0x14 then all you have to do is to go to the address of each
li $v0 , 0x14 of the different section of the notes an you will of course see:
Addiu $v0 , zero , 0x14
Pres Enter on that line and change the "14". Leave the 0x as it is. This way you are changing the text size (if that is really text size and the previous translation team managed to reverse it successfully.) Obviosly , the value is in hex.
I would recommend setting the value to 0x12 , or 0x13 , values near the original value and see what happens.
Regards,
June 09, 2017, 03:56:06 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Hi, I finslly had some free time and been dealing all day with this.
Tried editing in PS2Dis but for some reason it just won't save up the changes.
So.. went straight to IDA Pro, made some changes and boom:
Normal :

Smaller size , 0x10:

Changing colour:

Smaller text with new colour printed at lower than the image box:

So far I have:
Code: [Select]
// Sub_1E6410(a0, a1, Flashing_Icon_Value , Colour , StartPointX , StartPointY , EndpointX , EndpointY);
a0 - seems to be a structure contains the text and some other values. Not important and no need to change.
a1 - Takes the following values: 0x02 , 0x03, 0x04 , 0x07, 0x08, 0x09, 0x0A, 0xc , 0x14 , 0x15 , 0x16 , 0x17, 0x18 , 0x60 , 0x61. They seem like control code but we will find out soon.
Flashing_Icon_value - This is somehow related to that upside done flashing triangle but I don't know excatly how. It is 0x41 and any value bigger than 0x45 causes text corrupted , very strange value. I do not think that you need to deal with this. Leave it as it is. One thing i am sure though, setting it's value to 0 disables the icon and just the text is displayed.
Colour - yes, it's colour , I wonder how I didn't notice it before , all FFs correspond to white and everywhere the text is white. I still have to figure out how we will find correct value to make new colors display properly(the blur color you see in the screeshot above was my second random edot, the first one displayed nothing.)
StartPointX - X position when you want the text to start.
StartPointX - Y position when you want the text to start.
EndPointX - Now this is always 0x200 and that = 512. No need to change this i think. Read below.
EndPointX - Now this always 0x1C0 and that = 448. No need to change this i think. Read below.
Here is the interesting part! Go back to the PCSX2 screenshots and you see the title bar. You will notice 512x448, the resolution!. Now sure what these values do but I don't think there is any need to tamper them.
As for the text size you must change the value in v0.
Since PS2Dis is giving me a headache and getting IDA Pro is too much for you , I will make simple. I will list the hex offsets of the size value for each function so you can edit them.
(The DQT team has 9 section. Through trial and erro I managed to discover that the 9 secton/fragement of code (002EB8B8 - 002EB8E4) handles the main menu printing.) Other routines do other stuff. It is up to you to check what this routines do and I suggest that you edit the size of one of them at a time, making it smaller or bigger and then keep playing the game. After identifying one section give back its original value and change the size for the other section, you get the point.
I am making an editor for you for today I spent too much time and the byte swap is giving me a headache.
Code: [Select]
Routine ELF hex size address/ try small values(0x10, 0x11 is quite good , even 0x18 is too big)
001EC898 - 001EC8C8 : 0x000EC918
0021F2C8 - 0021F2FC : 0x0011F348
0022DE48 - 0022DE78 : 0x0012DEC8
0022E180 - 0022E1B0 : 0x0012E200
0023B170 - 0023B1A4 : 0x0013B1F0
0023C000 - 0023C03C : //Value is not set directly but loaded from somewhere!
002539F0 - 00253A18 : 0x00153A70
002EB8B8 - 002EB8E4 : 0x001EB938 // Main Menu!!
002F9BA0 - 002F9BCC : 0x001F9C20
So just use any regular editor and as soon as you land in there you will see 14 and change to something small or bigger.
NOTE: To successfully edit the value you must edit 2 bytes, even the one after it. The 00. The byte after 14 is 00 and together they form:
0x1400 , however the bytes are reversed so we get 0x0014 ! This means that unless setting bigger than 255 values (which in this case you certainly don't , even 0x18 is really big), there is no need to mess with the other byte. Just go ahead edit only the 0x14 byte!
That's for now. Got to go, will try to find more details tomorrow.