News:

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

Main Menu

[SMILE][SM] Samus' Ship layer priority

Started by dewhi100, June 06, 2017, 11:39:56 PM

Previous topic - Next topic

dewhi100

Despite setting the layer priority of Samus' ship to $05, it stubbornly sits above my tile graphics. The tiles render in front of Samus as they should, and changing the ship pieces to a different enemy will correctly put them behind the tiles. What's the solution?

Smiley

The ship's layer priority is set in its tilemaps, so you'll have to find them and edit accordingly.

This guide by Scyzer explains how to do that.

dewhi100

I'm embarrassed to say I'm stuck/confused fairly early in the tutorial. Looking at $0F92 in RAM yielded #1AA6. Looking in SMILE give bank A2 as Samus' Ship location (I used the "AI  Bank" field). That means I can find the tilemap at... A2:A61A, or 11261A in a hex editor. At that location, I should find two bytes telling the duration of the animation followed by two more pointing to the tilemap. I found 2F 81 01 00. That FIRST value looks like a pointer, and I'm following up on it. But this data isn't laid out the way the tutorial states, so I'm here looking for confirmation.

Tutorial says enemy you're looking at should be 0 in the enemies list... Samus' ship pieces are the only enemies in the room, right?

And on a bit Of a tangent, why are there two bottom pieces for Samus' ship?

Smiley

2F 81 01 00 is correct, however, I need to explain something.

2F 81 is indeed a pointer. However, because it's not preceded by a timer (a value less than 8000), it's not a pointer to a tilemap; it's a pointer to code. $812F is an instruction that tells the game to use that same location as the next instruction for the enemy, effectively looping the animation forever.

01 00 is then a timer because it's less than 8000, and it's followed by a pointer, DD AD. Therefore, you can find the actual tilemap at $A2:ADDD.

I have no idea why there are two bottom pieces though. ¯\_(ツ)_/¯