Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#26 2011-01-18 19:26:31

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 442/3,578

Re: Tileset Header Editing

I'm sorry, are you wanting help designing map blocks, or having problems with graphics insertion still?

Offline

#27 2011-01-18 22:21:42

Cloud
Member
Registered: 2010-12-18
Post 52/302

Re: Tileset Header Editing

I mean designing map blocks for map border. Because the tree i use is odd looking.

Offline

#28 2011-01-18 22:23:13

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 444/3,578

Re: Tileset Header Editing

Well how have you got the tree set up? post a pic and I'll see what I can tell you would be better

Offline

#29 2011-01-19 01:08:00

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 445/3,578

Re: Tileset Header Editing

What you would want to do is have the border tile have the base part of the tree, with the overlapping tops on it. Like this: borderr.png

Offline

#30 2011-01-19 04:03:48

Cloud
Member
Registered: 2010-12-18
Post 54/302

Re: Tileset Header Editing

Oh, thanks. Your tileset is really good,you know? Thanks again

Offline

#31 2011-01-19 04:22:22

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 446/3,578

Re: Tileset Header Editing

Thanks man. And no problem

Offline

#32 2011-01-23 10:48:21

Cloud
Member
Registered: 2010-12-18
Post 61/302

Re: Tileset Header Editing

Mateo wrote:

Well to do that you would have to repoint the table of tileset headers and add your new ones to the end.

What do you mean by "the table of tileset header"? It is not a table file,right?

Last edited by Cloud (2011-01-23 10:49:23)

Offline

#33 2011-01-23 11:34:32

Miksy91
Member
Registered: 2010-10-16
Post 265/2,339

Re: Tileset Header Editing

No, mateo meant a pointer table (=a list of pointers).
Pointer tables in G/S/C are of 2-bytes so you'd have to repoint the location of the pointer table and re-form it in some other bank.

Offline

#34 2011-01-23 11:39:29

Cloud
Member
Registered: 2010-12-18
Post 63/302

Re: Tileset Header Editing

Oh,okay. Thanks. I'm glad you come to this board again.

Offline

#35 2011-02-12 05:25:18

Cloud
Member
Registered: 2010-12-18
Post 113/302

Re: Tileset Header Editing

Looks like what a table in hex editor? I'm confused.

Offline

#36 2011-02-12 07:43:24

Miksy91
Member
Registered: 2010-10-16
Post 277/2,339

Re: Tileset Header Editing

Well, this isn't one of the easiest things to do.
Do you know how pointers work ?
In case you don't, read GB/C Pointer Tutorial that I've written.

http://mew3.net/forums/showthread.php?2 … r-Tutorial


The table I meant is a pointer table; it has nothing to do with table files.
There is some code that tells the game to load a pointer table which could look like this:
41 63 4D 63 60 63... in which each of these 41 63, 4D 63 and 60 63 are 2-byte pointers.

The game is also told where the pointer table is located and so you can repoint the location of it.

Last edited by Miksy91 (2011-02-12 07:44:27)

Offline

#37 2011-02-12 08:48:10

Cloud
Member
Registered: 2010-12-18
Post 114/302

Re: Tileset Header Editing

Miksy91 wrote:

The table I meant is a pointer table; it has nothing to do with table files. There is some code that tells the game to load a pointer table which could look like this: 41 63 4D 63 60 63... in which each of these 41 63, 4D 63 and 60 63 are 2-byte pointers. The game is also told where the pointer table is located and so you can repoint the location of it.

So, the table will always like this = 41 63 4D 63 XX YY ,then followed by 2-byte pointer?

Offline

#38 2011-02-12 09:16:53

Miksy91
Member
Registered: 2010-10-16
Post 279/2,339

Re: Tileset Header Editing

No, each of those are 2-byte pointers.
Here is a better example, a real pointer table from Pokemon Gold (U) ROM.
Take a look at this part of Koolboyman's ROM Map.

42790- Pointer to Pointer table to Pokemon Moves/Evol Data
427BD-429B2 Pointers to Pokemon Moves/Evolution Data
429B3-43E56 Pokemon Moves/Evolution Data
43E57-43FFF Blank Data

A 2-byte pointer in offset $42790 tells the game that the pointer table to "Pokemon Moves/Evolution Data" is located between offsets $427BD and $429B2. For example the pointer in $427BD is B3 69 which leads to offset $429B3 because:

1) The start of the bank is offset $40000
2) Pointed offset: [Bank] + [Pointer (MOD) - 0x4000] = 0x40000 + 0x69B3 - 0x4000 = 0x429B3

Then again, with the same logic, the pointer in offset $427BF (which is CE 69) leads to offset $429CE.

Last edited by Miksy91 (2011-02-12 09:17:39)

Offline

#39 2011-02-12 09:56:11

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 474/3,578

Re: Tileset Header Editing

If I remember though, I think the there is just the one pointer that points to where the headers start, and so you would just copy the existing headers to new space, write your new headers immediately following the old ones, and then change the pointer to point to the start of the new data. I might be wrong, I'll check for real tomorrow when I'm on the laptop where my notes are.

Offline

#40 2011-02-12 15:29:28

Cloud
Member
Registered: 2010-12-18
Post 116/302

Re: Tileset Header Editing

I'm so stupid...

Miksy91 wrote:

Pointed offset: [Bank] + [Pointer (MOD) - 0x4000] = 0x40000 + 0x69B3 - 0x4000 = 0x429B3

What do you mean by pointer MOD there?? What i know about pointer just 2-byte for point to same bank and 3-byte to anywhere in the ROM. I don't know anything about pointer MOD :(

Mateo wrote:

If I remember though, I think the there is just the one pointer that points to where the headers start, and so you would just copy the existing headers to new space

What is the meaning of header exactly??

Offline

#41 2011-02-12 19:49:49

Miksy91
Member
Registered: 2010-10-16
Post 280/2,339

Re: Tileset Header Editing

Kinda means that you rotate the bytes around.
For example, text (in G/S) is loaded by a script which is form 4C XX YY.
XX YY is the 2-byte pointer which points to the text data which is located in the same bank as the pointer.

If in rom (=checked with a hex editor), this would be written 4C A0 56, text data would be in the same bank in offset:
[Bank * 0x4000] + 0x56A0 - 0x4000

Pointer (MOD) meant that in case the pointer is A0 56, you count the pointed offset with 56A0.

Offline

#42 2011-02-12 20:40:48

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 475/3,578

Re: Tileset Header Editing

A header is the information used to make a tileset, the data that is explained in the first post.

Offline

#43 2011-02-12 23:27:21

Cloud
Member
Registered: 2010-12-18
Post 118/302

Re: Tileset Header Editing

Now, it makes sense. Thank you very much you two.

Offline

#44 2011-02-13 07:18:50

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 476/3,578

Re: Tileset Header Editing

No problem, glad to help

Offline

#45 2011-03-30 16:46:24

Naomi
New member
Registered: 2011-03-30
Post 1/1

Re: Tileset Header Editing

Hey, I'm new here and need some help with editing tilesets.  I have repointed tileset #5, but for some reason the last two lines of blocks don't seem to show up and in game they are replaced with random tiles.  Any way to fix this?

Offline

#46 2011-03-30 19:34:44

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 521/3,578

Re: Tileset Header Editing

Can you attach a picture of the tile viewer? If I can see how it is messing up it might help diagnose what went wrong.

Offline

#47 2011-04-03 12:50:15

Miksy91
Member
Registered: 2010-10-16
Post 316/2,339

Re: Tileset Header Editing

This has nothing to do with the subject itself but a person at Romhacking asked where to find the graphics of the animations of the flowers in pokemon gold. Here is what another person answered and I found it helpful myself so thought of posting the answer here too.

To find the tile, you must check the tile viewer. Then find your tile and check the address which is 9030 in the RAM. Enter the code you found in the RAM into your hex editor's search engine and it will be at the address FC3A7.

Offline

#48 2011-04-03 14:57:35

Cloud
Member
Registered: 2010-12-18
Post 179/302

Re: Tileset Header Editing

Miksy91 wrote:

This has nothing to do with the subject itself but a person at Romhacking asked where to find the graphics of the animations of the flowers in pokemon gold.

Yeah, if you have not edit the animation frames, the game will still show you the flower/water animation whatever you do.

Offline

#49 2011-05-06 07:36:19

Miksy91
Member
Registered: 2010-10-16
Post 350/2,339

Re: Tileset Header Editing

Does this say anything to you?

"To recompress, you're gonna have to do it manually. For each 32 bytes, insert the byte 0x1F. This is the compression code for "The following X bytes are raw data". So it would look like "1F 00 11 22 33 44 etc..." and when you've added the 32 bytes, add the 0x1F and continue. Here's JohtoMap's actual decompression for the type if you don't understand.


Code: [Select]
   
    firstbyte = gb.ReadByte();
    byte control = (byte)(firstbyte & 0xE0);
    x = (firstbyte & 0x1F);
   
    thingy:
        switch (control)
        {
            case 0: // Read X bytes
                byte[] buffer = gb.ReadBytes(x + 1);
                foreach (byte b in buffer)
                // Shame there's no *.Add(byte[])...
                // Could've just gone with a regular for loop, but nah,
                // let's be sloppy about it.
                bytes.Add(b);
                break;
Hope I helped."

I thought of changing the graphics of tileset 9 and the graphics of it are stored in $20AB1 in the rom but are compressed.
Any idea where byte 1F should be written into ?

Besides, I noticed that the graphics data of tilesets 1 and 2 both begin with bytes E3 FF and the graphics data of each tile follows it.
The graphics data of other tilesets are compressed and don't begin with those bytes.

Last edited by Miksy91 (2011-05-06 07:44:41)

Offline

#50 2011-05-06 15:47:21

190/703

Re: Tileset Header Editing

Miksy91 wrote:

Does this say anything to you?

"To recompress, you're gonna have to do it manually. For each 32 bytes, insert the byte 0x1F. This is the compression code for "The following X bytes are raw data". So it would look like "1F 00 11 22 33 44 etc..." and when you've added the 32 bytes, add the 0x1F and continue. Here's JohtoMap's actual decompression for the type if you don't understand.


Code: [Select]
   
    firstbyte = gb.ReadByte();
    byte control = (byte)(firstbyte & 0xE0);
    x = (firstbyte & 0x1F);
   
    thingy:
        switch (control)
        {
            case 0: // Read X bytes
                byte[] buffer = gb.ReadBytes(x + 1);
                foreach (byte b in buffer)
                // Shame there's no *.Add(byte[])...
                // Could've just gone with a regular for loop, but nah,
                // let's be sloppy about it.
                bytes.Add(b);
                break;
Hope I helped."

I thought of changing the graphics of tileset 9 and the graphics of it are stored in $20AB1 in the rom but are compressed.
Any idea where byte 1F should be written into ?

It seems clear to me: to “compress” the data (that is, not really compress but instead tell the decompression routine that it’s uncompressed), intersperse it with 0x1F. So if you had data that looked like this:

00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 01 12 23 34 45…

the “compressed” version would be:

1F 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 1F 01 12 23 34 45…

Board footer

Powered by FluxBB