+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Cardcaptor Sakura hacking problems
Pages: 1 2 [3] 4 5 ... 12
Author Topic: Cardcaptor Sakura hacking problems  (Read 9751 times)
Normmatt
Guest
« Reply #30 on: December 08, 2006, 07:07:28 pm »

Just to save someone some time I've located the routine which updates the OAM data (X/Y Location, etc) and it can be found by setting a breakpoint at 08066892(this is where the original X value is loaded into).

In this routine R4 is where the Y-Loc is stored and R5 is where the X-Loc is stored

EDIT: Ok, I was bored so i took another look and tracked down the exact offset for where it sets the character width and it is located here 08065360 ( mov r0, 0Ch )
« Last Edit: December 09, 2006, 01:31:56 am by Normmatt »
rmco2003
Guest
« Reply #31 on: December 10, 2006, 02:22:37 pm »

have you been able to make any headway labmaster?
labmaster
Guest
« Reply #32 on: December 11, 2006, 10:50:56 pm »

Didn't get around to it , but Normatt seems to have it covered off. What you'll want to do is replace the bit where it adds the fixed offset to the X-location (the mov opcode @ 08065360) with a branch to your own routine that looks up a width table.

If you haven't used Goldroad before and/or aren't too familiar with THUMB then you might struggle a bit, but I think it would make a good first project. Sing out if you have any difficulties.
rmco2003
Guest
« Reply #33 on: December 12, 2006, 01:33:32 am »

Well I don't know the first thing about ASM yet alone how to code a routine like that... Sad
labmaster
Guest
« Reply #34 on: December 12, 2006, 01:53:40 am »

Okay.... so not a good start. Any programming experience at all? THUMB is pretty easy to jump into. If not, (and unless anyone's done it already), I'll take this as an opportunity to write up some documentation on how to get a VWF into these types of games.
Spikeman
Guest
« Reply #35 on: December 12, 2006, 01:57:20 am »

My first asm hack was a DTE hack. There is a document somewhere about making one for the NES or SNES.. I just applied the same principals to THUMB. But then again, I did have some experience with ASM for the TI-83+ in the past. I would recommend trying a DTE hack first. They are fairly easy and a good way to wet you feet in ASM. Wink
rmco2003
Guest
« Reply #36 on: December 12, 2006, 09:13:43 am »

I know Visual Basic, that's about it.
KaioShin
Guest
« Reply #37 on: December 12, 2006, 01:30:19 pm »

Quote from: labmaster on December 12, 2006, 01:53:40 am
Okay.... so not a good start. Any programming experience at all? THUMB is pretty easy to jump into. If not, (and unless anyone's done it already), I'll take this as an opportunity to write up some documentation on how to get a VWF into these types of games.

Do it, that would be awesome. While I have a vwf for DQM planned out I haven't actually implemented it yet.
Spikeman
Guest
« Reply #38 on: December 12, 2006, 07:38:22 pm »

I was bored and wanted to try implementing a VWF font for this game so I went and tried. There was almost no empty space in the ROM so I had to make a really complicated jumping routine (any tips on this for the future labmaster?). So I have that part of the code relocated. The only problem, one I realized by setting a breakpoint on my code, is that it that part of the code sets the width for the entire string displayed on that page, not each character.

My only idea on how to fix it is this: The code stores 0C in two locations. Find the code where it loads from that location for each character and change that to loading from the width table.

I'm going to work on finding and doing that, Rhys if you read this could you PM me with a patch for the font and width table you want to use?

Edit: I found the place where it loads it (0806688C). Now it's time to program the VWF. Smiley Oh, and I also found that it is also setting the height. I know it would be completely pointless to have a VHF, but if you want a different height, it is possible.
« Last Edit: December 12, 2006, 07:51:04 pm by Spikeman »
Normmatt
Guest
« Reply #39 on: December 12, 2006, 07:57:35 pm »

Quote from: Spikeman on December 12, 2006, 07:38:22 pm
I was bored and wanted to try implementing a VWF font for this game so I went and tried. There was almost no empty space in the ROM so I had to make a really complicated jumping routine (any tips on this for the future labmaster?). So I have that part of the code relocated. The only problem, one I realized by setting a breakpoint on my code, is that it that part of the code sets the width for the entire string displayed on that page, not each character.

My only idea on how to fix it is this: The code stores 0C in two locations. Find the code where it loads from that location for each character and change that to loading from the width table.

I'm going to work on finding and doing that, Rhys if you read this could you PM me with a patch for the font and width table you want to use?

Edit: I found the place where it loads it (0806688C). Now it's time to program the VWF. Smiley Oh, and I also found that it is also setting the height. I know it would be completely pointless to have a VHF, but if you want a different height, it is possible.

The solution i came up with was in the routine which reads each byte into ram, make it store the current byte to a specific address in ram and in the drawing routine make it load a byte from say 0x02003040+character(hex) as the width. Though i'm not sure that would work as at the moment i cant even get the original routine which reads each byte into ram to branch to my new code near the end of the rom without switching into arm mode Sad

So hopefully you have better luck
Spikeman
Guest
« Reply #40 on: December 12, 2006, 08:04:18 pm »

I think I've almost got it working. I found the place it loads the width from, all I have to do is make it load it from a width table. I'll post my source code when I'm done so you can see how I did it. Here's the code I use to jump to my routine (probably could be better *cough labmaster cough tips? cough*):

Code:
@thumb
@textarea 0x0806688C

push {r2,lr}
ldr r2, [jumpadr+2]
mov lr,pc
bx r2
pop {r2}
mov lr,r2
pop {r2}
b after

jumpadr
@dcd #0x08FCEF10|1

after

@endarea

Edit: I'm trying to find the RAM location the current character is stored. Have you found this Normmatt?
« Last Edit: December 12, 2006, 08:17:25 pm by Spikeman »
Normmatt
Guest
« Reply #41 on: December 12, 2006, 08:25:39 pm »

Nope i haven't thats why i was modifying the original routine to store it in an area of ram on my choosing Tongue
Spikeman
Guest
« Reply #42 on: December 12, 2006, 08:31:22 pm »

I found it! 2036EAC.

And just an idea for Rhys, since the game uses 2-byte characters, you could hack the text routine (once you get some experience) to only use one byte and have plenty of space to put in the English script. And I'm going to make the VWF only care about the first byte, or the width table would be REALLY big.

Edit: I kind of got the VWF working, it loads from a width table and all. The only problem is the game redraws ALL the characters after each new one is added, and the value I've been modifying is the width for ALL these characters. So I'll need to find a different value to modify.

Edit Again: I've almost got the VWF working completely, I just need to fix one small problem and then it should work. Once it's finished I'll upload an IPS.
« Last Edit: December 12, 2006, 11:17:43 pm by Spikeman »
rmco2003
Guest
« Reply #43 on: December 12, 2006, 11:25:56 pm »

Cool! Grin

It's awesome you've been able to help me make this much progress!
Will this patch already contain a VWF font, or should I make one?
Spikeman
Guest
« Reply #44 on: December 13, 2006, 02:33:08 am »

Actually that was one thing I was hoping you would make. Also if you wouldn't mind making the width table. Just one byte with the width of every character (with padding I think).
Pages: 1 2 [3] 4 5 ... 12  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC