News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

[SM] Repointing CRE tile table & GFX (solved)

Started by BigDomino, September 20, 2011, 08:58:12 PM

Previous topic - Next topic

BigDomino

Hi guys,

This is my first intervention here and I thank you, by advance, to apologize the awkwardness of my English speaking (I write with the dictionary...).
Firstly, I want to thank all the peoples of this forum for the impressive amount of work put into the tutorials, documentation and resources.
I cannot imagine the hell that would have be to begin using Smile without this helpful information.

I discovered SMILE about two years ago and started working on a SM hack who grow and evolve with the time and as my knowledge dictate (at this time 65 rooms, ie, about 20% of the planned map...).
I recently investigate about GFX modifications and come into a few problems who are, sadly, beyond my knowledge:

My objective is to modify the CRE GFX tiles (8x8) in order to create custom CRE tiles (16x16).
As the 8x8 tiles & 16x16 table are compressed data, I planned to repoint both of them into free space that I added at the end of the Rom, in order to avoid any overwriting problems.

Following and adapting Squishy_Ichigo's "repointing GFX guide" I moved these data as mentioned below:

A) CRE GFX 8x8 tiles :
- Address of the pointer, pointing to the 8x8 CRE sheet:   $01:6415 (PC)*
- Original three byte pointer:   B9 (85 48 A9) 00 80 -> reversed: $B9:8000 (loRom) i.e. $1C:8000 (PC)
- Modified three byte pointer:   FD (85 48 A9) 00 80 -> reversed: $FD:8000 (LoRom) i.e. $3E:8000 (PC)
- The GFX data stored from  $1C:8000 (PC) to $1C:A09C (PC)  where copied and past-written at the end
  of the Rom in bank FD, at the new address: $3E:8000 (PC)  [-> 209D bytes of data pasted].

B) CRE tile-table data (16x16) :
- Address of the pointer, pointing to the 16x16 CRE tile-table:   $01:683D (PC)*
- Original three byte pointer:   B9 (85 48 A9) 9D A0 -> reversed: $B9:A09D (loRom) i.e. $1C:A09D (PC)
- Modified three byte pointer:   FF (85 48 A9) 00 80 -> reversed: $FF:8000 (LoRom) i.e. $3F:8000 (PC)
- The TTB data stored from  $1C:A09D (PC) to $1C:A633 (PC)  where copied and past-written at the end
  of the Rom in bank FF, at the new address: $3F:8000 (PC)  [-> 597 bytes of data pasted].

* The addresses of these pointers where given by Jathys, as they are not displayed in Smile Graphic editor's "pointer pop-up"

At this point, the tiles and tile-table, at their new places, can be edited in Smile Graphic editor and are fully and correctly displayed in both Level editor and tile table windows, however.... the game persist to load the ancient tiles when played.... ?!?

My first idea about this problem was that another couple of pointers, located elsewhere in the Rom, have to be changed too.

So, I made a research with [B9 85 48 A9 00 80] and [B9 85 48 A9 9D A0] (->  the old pointers) and find another occurrence for each of them, at respectively :   $01:6797 (PC) and  $01:6AED (PC).
I tried to change the values like previously but without effect.

I still think that other pointers are hidden somewhere but my HEX editor is unable to apply a research excluding the 3 bytes (85 48 A9) intercalated between the bank pointer and the rest of the address.
Moreover, I don't know the meaning of these 3 bytes...

Have someone any idea how to fix that ?  :?:

I have a second question, but It depend of the success of this fix so l'll ask you subsequently.

I thank you for your interest and, by advance, for any answer or explanation you could provide about the problem above.

Best regards.

BigDomino.

PS:
I take the opportunity of this message to let you know that I elaborated some documentation who, maybe, can help people interested into complex elevator combinations or the functioning of the Maridia "scrolling tube":

In detail:
a) The process to make possible a fully functional "multiple room elevator" without modifying anything to the original Rom or making custom enemies) i.e. an elevator who start in room "A", go through rooms "B", "C", "D", etc... and end in room "N".

b) How to use the "Maridia scrolling tube" effect in any vertical room (Special door scroll pointer, FX2 pointer, distance from door, etc...)

c) How to intercalate a room with "maridia scrolling tube effect" inside an elevator * (but the elevator enemy is not displayed during the scrolling effect). * Please, note that the original concept of this is from UltimateF4lcon.
(I highly suggest anybody to check his youtube channel to see his incredible stuff and amazing level design).

d) How to give the illusion of an ascending elevator and a descending elevator, both in the same room, and visible at the same time (require some tricky scroll PLM and door scroll asm).

Some of my notes are handwritten but I can quickly re-write them in a .txt  file.
All is written in English.
Just let me know if anybody is interested.

Scyzer

You're english is very good, though quite formal, which strangly makes it harder to read. It's very good language though, congrats :D

As for your CRE problem, I'm guessing this is only a QUICKMET problem, and the CRE displays correctly when you play the game normally?
If that is the case, there is nothing wrong with your game, the problem is with SMILE. This is fixable. SMILE creates a modified rom when you QUICKMET into a room, which is hardcoded to use the original CRE locations.
Open your hex editor and locate the file QUICKMET.bin in SMILE's testroom folder.

$3C is the bank for the table
$40 is the address for the table
$53 is the bank for the tiles
$57 is the address for the tiles

Just edit these addresses to reflect your new location for the CRE, and it should work fine. =)

Jathys

Quote from: Scyzer on September 21, 2011, 03:44:01 AM
SMILE creates a modified rom when you QUICKMET into a room, which is hardcoded to use the original CRE locations.
Hahaha... Hadn't thought of that before. Because quickmet needs to force the CRE open. I should see about changing it so that the room itself does this. An update to quickmet is planned, so I'll fix this along with a few other things.

BigDomino

Hi there,
Thank you for your fast reply :)
I unfortunally cannot acces to my personal PC this evening, but will try to apply your fix tommorow after my work.
I'm pretty sure you are right in your diagnostic but, in any case, will tell you what happen.

Thanks again.  :^_^:

BigDomino

It works perfectly!

I never questionned me about this Quickmet.bin file and how the testroom option was able to load all the room properties without the door transition initialisation sequence... now I understand.
At this time, I didn't try to repoint Scenery GFX & ttb.
Would the Quickmet editing be necessary for scenery tiles too?
If it's the case, it could be helpfull to mention this additional step in Squishy-Ichigo's guide.

Be that as it may, I thank you very much for your help.

See ya.

BigDomino

- Sorry for triple post -

Hummm...

I have some complementary information to provide here :

The Quickmet.bin repointing procedure mentioned above have indeed fixed the problem of graphics through the testroom function, BUT...

The game still not display properly the new repointed graphics (c.f. first post of this tread).

Actually, there are two other pointers (pointing to both gfx & ttb) who need to be changed :
they are located at $01:6797 (PC) for the CRE gfx [8x8 tiles] and at $01:6AED (PC) for the CRE tile table [16x16 tiles].

To recapitulate, there are :
- two pointers for the gfx [8x8] at :  $01:6797 (PC)  and  $01:6415 (PC)
and
- two pointers for the ttb [16x16] at :  $01:6AED (PC) and  $01:683D (PC)

Both four pointers have to be changed in order the game to read the gfx data an ttb data at their new location.

These 2 pointers should be added in Squishy_Ichigo "GFX pointer (appendix C)" document.

It's weird that nobody pointed that out before...?

By the way (and it could be an usefull addition to the various exportation option available in the Graphic editor) does anybody know where are stored the custom BTS default values you can apply to any tile by double-clic (in tile table scrolling windows) ?
It appear that these data are omited during the tile table exportation process and all the setting has to be re-do.

It could be nice to know how to get back these informations.

Black Soldier

#6
I'm having problems displaying my repointed GFX properly when I run my game, and I changed the appropriate four GFX pointers in my ROM so that they point to their new locations (as well as adjusting my Quickmet.bin file accordingly with changed pointers).

Edit: Is there anything else I had to do?