+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Help me through my first DTE...
Pages: [1]
Author Topic: Help me through my first DTE...  (Read 2 times)
Rai
Guest
« on: April 13, 2008, 09:10:22 pm »

Okay so I started on KingMike's DTE tutorial and I'll tell you guys where I get stuck and such...

So I'm passed step 1... found that the line of text ends at 21FD3. I subtract 10 from that and get 21FC3.

Second section about rom banks kinda confused me. Fire Emblem has 16KB RAM banks. So I assumed the ROM bank started a 20000, since that's what I assumed it was closest too. Someone correct me on this if I'm wrong, which I probably am. So I took away 20000 from 21FC3 and got 1FC3. I also got confused on the we'll be looking for "[HexValue] + 8000" or "[HexValue + C000]".

Now I'm stuck here. I searched the Memory for 1FC3, C31F, 9FC3, C39F and all the like, but found nothing in memory.
KingMike
Guest
« Reply #1 on: April 13, 2008, 10:22:30 pm »

If I remember, Fire Emblem has 16KB ROM banks.
Unless it's in the last 16KB of PRG-ROM ($3C010-4000F in the ROM file), the pointer will always be between $8000-$BFFF. So, if your ROM address is $21FC3, your pointer would be $9FC3.
ROM address - header = $21FC3.
Nearest bank starts at $20000.
So $21FC3 - $20000 = $1FC3. That is the position relative to the start of the bank.
$8000 + Relative position = $9FC3.

If the text is between $3C010-4000F (the last bank of the program ROM),
then your pointer is simpler: ROM address - header, then drop the leading 3.

Remember, most dialouge in Fire Emblem has a bunch of formatting control codes mixed within the text.
There is likely some formatting codes preceeding the text, and the pointer is probably pointing to one of those formatting codes.

Also, as I remember, every dialouge block in FE has a seperate routine for loading the text into RAM. Which would mean you'd need to add DTE to each routine.
Or you could add DTE to the routine that reads the text from RAM to the screen, but I think that could be above your level (I'm starting to hate mucking with the NES PPU, after having to optimize some of the original code in Dragon Scroll, and even then, I was never great at making PPU-related NES ASM hacks)
Rai
Guest
« Reply #2 on: April 14, 2008, 01:00:41 pm »

Quote from: KingMike on April 13, 2008, 10:22:30 pm
If I remember, Fire Emblem has 16KB ROM banks.
Unless it's in the last 16KB of PRG-ROM ($3C010-4000F in the ROM file), the pointer will always be between $8000-$BFFF. So, if your ROM address is $21FC3, your pointer would be $9FC3.
ROM address - header = $21FC3.
Nearest bank starts at $20000.
So $21FC3 - $20000 = $1FC3. That is the position relative to the start of the bank.
$8000 + Relative position = $9FC3.

If the text is between $3C010-4000F (the last bank of the program ROM),
then your pointer is simpler: ROM address - header, then drop the leading 3.

Remember, most dialouge in Fire Emblem has a bunch of formatting control codes mixed within the text.
There is likely some formatting codes preceeding the text, and the pointer is probably pointing to one of those formatting codes.

Also, as I remember, every dialouge block in FE has a seperate routine for loading the text into RAM. Which would mean you'd need to add DTE to each routine.
Or you could add DTE to the routine that reads the text from RAM to the screen, but I think that could be above your level (I'm starting to hate mucking with the NES PPU, after having to optimize some of the original code in Dragon Scroll, and even then, I was never great at making PPU-related NES ASM hacks)
Thanks man. Even though it may be beyond my level though, I'm going to try adding a DTE to the routine that reads text from the RAM. How would I do that though? If you have any advice on that that would be great. However, this DTE thing WOULD probably work on menu text, names and the like.
KingMike
Guest
« Reply #3 on: April 14, 2008, 04:12:11 pm »

I know that the RAM area that the text gets written to is used for all text. Probably also windows. I am not sure if it is used for anything else. But there could be problems if it is.
Alexcalibur
Guest
« Reply #4 on: April 15, 2008, 11:59:00 pm »

Okay, I totally spent about 15 minutes making a really detailed post to help (since I'm working on the same game and just got past that), but then my internet restarted and I lost it.

I sent you a PM, but it didn't explain it in detail.  Maybe I'll edit in my post in the morning.  I'm just posting this to let you know that I'm actually working on this game (with the same tutorial, wonderfully written might I add), and that sadly, it won't work.  Not by any fault of KingMike, just that FE is different and needs something else.  But I have written my own code that works, know why his didn't in this case, and can explain that later (since now I sleep)
syntax error
Guest
« Reply #5 on: April 19, 2008, 09:34:04 am »

There is a nice data compressor called pucrunch for c64 at http://www.cs.tut.fi/~albert/Dev/pucrunch/
Maybe this can get much more free space to your ROM.
tomaitheous
Guest
« Reply #6 on: April 19, 2008, 10:52:03 am »

Quote from: syntax error on April 19, 2008, 09:34:04 am
There is a nice data compressor called pucrunch for c64 at http://www.cs.tut.fi/~albert/Dev/pucrunch/
Maybe this can get much more free space to your ROM.

 That would be even *harder* to implement. It would require a second pointer system to point into the uncompressed *chunk* as well as which chunk to decompress. LZ doesn't lend itself very well to a few lines of text, it's usually in larger sections of text at a time. And you have to find space in RAM for this. DTE offers instant decompression on the fly and a small LUT - very fast. Delta compression is another. There's also the method of most occurring instance (byte, word, whatever) set to a mask compression - requires no LUT and even better if you combine bit packing your ascii text as 7bit or smaller.

Small note: I modified the standalone pucrunch decompressor for TG16/CD... though it's really only viable for original dev projects.
syntax error
Guest
« Reply #7 on: April 21, 2008, 09:30:42 am »

Hi thomaitheous,
you are right that LZ on NES is better for full game development,because of RAM limits.I
thought that I know of much text intensive games which store text in blocks.On the
fly decompression is a good thing for FE.
Pages: [1]  


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