News: 11 March 2016 - Forum Rules

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - matthewn4444

Pages: [1] 2
1
Programming / Re: Assembly help with Prepatch roms
« on: May 23, 2012, 10:22:18 pm »
I changed cmp to cmps and it still fails (as in the game ignores the status counter altogether).

2
Programming / Assembly help with Prepatch roms
« on: May 23, 2012, 07:00:30 am »
I am trying to translate 7th Dragon (again after the hiatus) and I quickly wanted to see if I can find a location to place my code for prepatched games. My supercard rumble requires the nds game to be patched in order to be played on. I do know assembly enough to apply my code and debug it in No$gba. So far I wrote something very quick to see if I can code in the game.

This is the code snippet I last tried and put it in the text drawing routine:

Code: [Select]
mov r0, #0x0
mov r1, #0x0
cmp r1,r0
bne continue
loop:
    b loop
continue:
    [more code]

Here I wanted the program to fail when it hits here. After applying my patch to the game and running on No$gba, it does fail when getting to the loading sign and stays in the loop as it should be. I get the same behaviour with Acekard but not Supercard Rumble. Supercard would just continue the game as if the comparison was ignored. I then tried this:

Code: [Select]
mov r0, #0x0
mov r1, #0x0
loop:
    b loop
continue:
    [more code]

And as expected, no$gba, Acekard and Supercard falls into the loop and hangs.

My speculation is that "cmp" is ignored or "bne" (same goes with "beq") is ignored (even if the game is filled with those). Also 7th dragon patched is fully playable on my Supercard Rumble. I doubt the patch does anything because this code is patched when the game starts (meaning that the game will override the code on execute) and it still falls into the infinite loop.

I am not sure what I should do about this but I am probably dropping all support of prepatched cards unless I can figure out a way to get this to work. For now Acekard seems like the best bet to code towards. If you need anymore information I can provide it.

3
Newcomer's Board / Re: NDS text positioning help
« on: December 02, 2011, 08:51:44 pm »
Thanks Auryn, I will look into it more later (exams are coming up :D ).

On a side note to what Normmatt said earlier, I just tried it out on my sc rumble microsd and (obviously) it did not work. I haven't looked into it yet, but how do most flashcards patch games? The game runs up to a point and freezes at the time text is shown (up to where I start to jump to my code). Before that it would copy my code to a place in memory (0x23fa000) and I am assuming it's not copying my code that was appended to the arm7.bin file. Any suggestions how I can avoid this?

4
Newcomer's Board / Re: NDS text positioning help
« on: December 02, 2011, 06:35:29 pm »
I am still new to rom hacking as I am still learning but I discovered the font through the debugger looking at addresses and such changing the tile format till the image is shown (2bpp). Anyways the main process that I can see so far is that it first copies character's pixels to an area of memory until the word or phrase is finished. Once the phrase is complete, the entire section of pixels is then copied to another place in memory as a sprite (probably when looking at the memory dump) and then gets composed to the screen (which I still have not yet found, might not be necessary).

The first location is held at width X 10px (in this instance) so when it copies (have not found yet) it only copies 10 px of height (I may have to find where it copies). After that I am unsure about the other 2.

Again, this is my first time doing vwf so I have no idea how it was done for other games but the x and y positions are not inside these routines (as far as I know of).

On a side note, how do you guys use CrystalTile2 so fast to find images? Usually it takes me a while and random configurations to see images (especially finding the palettes :S)

5
Newcomer's Board / Re: NDS text positioning help
« on: December 01, 2011, 11:30:17 am »

Have you tried the simple solution of simply moving your font tiles down 2 pixels?

As mentioned before, the text is 10px by 10px and so when the game copies text, moving it 2px down will get clipped off. If you meant to move each character 2px down in its bounding box, then 'g' would be cut off.

6
Newcomer's Board / Re: NDS text positioning help
« on: November 30, 2011, 07:40:39 pm »
I was wondering why you write that the font is a 10x10 when the font I see in the game is a 16x8  :o


This game has tons of fonts (haven't found that one yet, thanks, leaves me with less work now) so I have to write vwf to accommodate all of them. Anyways the font I am talking about is 10X10 (in the game, it is drawn 12X10)


12X12 font (which is for story and system text) is:


These fonts are nice looking because they are the ones I put in the game.

7
Newcomer's Board / Re: NDS text positioning help
« on: November 30, 2011, 12:40:09 am »
Well I know for certain acekard shouldn't work along with the major players, scsd1/scds2/r4/ez5i/cyclods/edge/etc all use that memory for the patches to do to commercial games to make them run from the sd. Is it not possible to tweak the original font drawing code to take in a width? or was it coded by retards?

Another person ahead of me (that has given up translating this game) had trouble with the font so he tried doing dual encoding (which I thought of in the past but probably not the best idea). The font in 7th Dragon has no "width counter". Anyways, it calculates the offset from the start at each time it draws a character (so it may have a counter?). Another issue I had was if the character has an odd width (like letter 'a' has 7px), you cant just copy source to destination directly, this causes me to decode 2 digits into 4 pixels, append it to the last set, then push 4 out, encode it and write etc. This made me do another 100 lines of code. I do have a supercard micro sd (not with me right now) but haven't tested with that.

Though 2 months ago I was thinking of overwriting over 0x2380000 after the game is initialized but have no idea if that parts gets recalled later on.

8
Newcomer's Board / Re: NDS text positioning help
« on: November 30, 2011, 12:26:03 am »
How are many line does vwf usually take? (I have absolutely no idea). I'm not sure about how other games draw characters but I found that 7th dragon somewhat compresses pixels (which is guess is normal). So all flashcards won't work or just if they enable cheats? I know I placed the code near the end of memory.

9
Newcomer's Board / Re: NDS text positioning help
« on: November 30, 2011, 12:15:34 am »
Really? I only test on Acekard so I am not sure. I can't find another place in memory to put it in, any suggestions? (I had this trouble 2 months ago =___=).

10
Newcomer's Board / Re: NDS text positioning help
« on: November 29, 2011, 11:35:04 pm »
I hook at a few locations. For this font set, I analyze the character at 0x203BA78 and jump to my code here; this gets the character (eg. 81FA = a) and looks it up in a table i have in the assembly file. Places that width in memory for later use. The character drawing routine starts at 0x203B1DA.

In this game, each hex digit represents 2 pixels (backwards, forgot the technical term) horizontally. The character tile is 10px X 10px, so then then in memory, it has 5 hex digits making that 3 bytes of hex (or 3 pairs of digits; probably using the wrong terminology). Anyways, my routine essentially reads the x-offset or current length and redraws the character into memory after finding the correct address to draw to. Then add to make the new current length and move on to the next character. I recently found that (when inside the skills menu) the skills are presented in text at location around 0x2B12300. That is the location where the x and y locations are kept I believe (did some random number changing and stuff happened). Right now I am busy with school so I come back to this once in a while.

I open sourced it to keep track of the changes: http://code.google.com/p/7th-dragon-translation/
It's probably horrible asm code since this is my first project using arm asm. (Don't worry, I have comments).

11
Newcomer's Board / Re: NDS text positioning help
« on: November 29, 2011, 09:14:39 pm »
Assuming you actually implemented a VWF and not just used a built in one you should have more than enough skill to fix this most simple of problems.

That's what you think. :P I am still learning the ways of asm and nds hacking. This is my first vwf (probably this game is easier than others). I am slowly learning how to fix this. However I am looking into the memory dump and seeing if I can find the x, y positions of those sprites and start working backwards.

12
Newcomer's Board / Re: NDS text positioning help
« on: November 28, 2011, 03:04:02 pm »
If I am not wrong. if you press the + on the right plane of No$GBA, and click the item that will appear there, your left plane will contain the X and Y coordinates... that Y coordinate is the one you are looking for.

Maybe try to make a memory dump with Desmume and search if you can find that screen in the memory...that could help you as well.

If you have asm basic, you could maybe try to cheat the game to believe it has an 10x12 font and not a 10x10.

How would you search for the screen in memory?
Also I am guessing I have to find the routine to change the height from 10->12?

13
Newcomer's Board / Re: NDS text positioning help
« on: November 27, 2011, 06:13:28 pm »
Hmm... I see, I guess I will have to look that up (hopefully not too hard to find XD) or if anyone else on this board knows how to do it that would be great. XD
Thanks for your help Ryusui. I am doing this because I think it looks kind of wierd being too high in that box surrounding the text. I mean I will probably do this after I finish inserting the font and the fully implementing vwf (on all fonts, there are a few in this game).

14
Newcomer's Board / Re: NDS text positioning help
« on: November 27, 2011, 05:22:19 pm »
I think it is sprite based.

Above is a screenshot of no$gba and it shows the location for that text. I think because it is displayed like this, it is a sprite (and I guess 3D?). How does one reposition the sprite by changing the OAM data? Oh and by the way, I have no idea how to use this window in no$gba, I mainly use the dissembly tools and memory, if this window helps me with the addresses and repositioning, I would love to have more detail of this.

Edit:

I took a screenshot of the OAM (don't know if this is correct) but it looks like there nothing there. I also have the memory starting at the 0x700000h address showing the OAM contents. Are those images based off sprites?

Image: http://imageshack.us/photo/my-images/573/captureoh.jpg/


15
Newcomer's Board / Re: NDS text positioning help
« on: November 27, 2011, 04:36:38 pm »
I am not sure what you mean by printing routine. I know that there is a place in the code where the font tiles are drawn to (this is where my WVF works in). These areas are tailored to 10px height (so trying to draw below or above this limit is ignored). Do you think that there could be another drawing routine that specifies where these bunch of font characters gets placed to?

It does some funky stuff with it after, I am sure, probably to redraw it in another location (I have to do more investigation). However I believe if the text is being drawn, it should be drawn to some location larger than 0x400000 or something? I looked around a few weeks ago and found my self nowhere :\

16
Newcomer's Board / Re: NDS text positioning help
« on: November 27, 2011, 03:18:51 pm »
The game does not support NFTR fonts or has an English font inside (or else someone would have translated it already). I already placed in some font bitmaps and implemented variable width font (as mentioned earlier) because those don't exist.

The image above is the same image but shows if I replaced the "W" with a "g". You can see that I made the capital letters that high (eg. "P" and "O") because the "g". "p", "q", "j", "y" characters need to be below the baseline so that the characters look "normal" since the font tile is 10px by 10px, the font has to look like that. I am sure that there is a pointer or some sort of value that specifies the font x and y position. I was wondering if that is hardcoded in the files or any common standard place that devs put it to point me in the right direction to bring the font down.

17
Newcomer's Board / NDS text positioning help
« on: November 27, 2011, 02:43:25 pm »
Hello, I have been working on a translation hack for 7th Dragon for over about 2 months and I got the basis of variable width font almost complete. I am placing fixing up and inserting font bitmaps currently but I hit a problem.

The image above shows a screenshot of the skills menu. Because each font tile is 10px X 10px, my font would appear to be 2px higher than everything else (not that the end result would keep the Japanese text) but the English font (in this case "POW") seems way to high in the image. I was wondering if there was a way to move the text down. I do know basic assembly (as I did implement variable width font) but I do not know how text can be placed on the screen at an x and y position (that I am assuming is somewhere in memory). no$gba shows that the top screen is rendered through 3D (so I guess that is for translating and rotating the images/text easier).

18
Newcomer's Board / Re: Implementing a hack
« on: August 14, 2011, 09:29:46 pm »
Ok thanks, so I thought so... I guess there is no guarantee to find an address the game never touches without luck XD. I placed my code near the end of the ram address and hopefully it will stay there (so far looks promising but you never know). The other options I think are placing the code writing over arm9 or arm7 code that runs on start up and never again, though I haven't look at that, it may seem that there maybe very little room.

19
Newcomer's Board / Re: Implementing a hack
« on: August 14, 2011, 08:10:30 pm »
If I add padding that means the max I can read is 0x2400000 correct? I could already read up to 23fffff and anything after that fails, so I am guessing padding the arm7 does nothing?

20
Newcomer's Board / Re: Implementing a hack
« on: August 14, 2011, 05:53:09 pm »
I hear expanding the arm7 file would increase memory capacity but I haven't had luck with that (so most likely I am doing it wrong).

Pages: [1] 2