News:

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

Main Menu

[SM] [Question] Landing site doors.

Started by Benki, February 19, 2013, 12:44:58 AM

Previous topic - Next topic

Benki

I have a room connecting to the landing site that wasn't originally supposed to. Now when I exit that room to the landing site the BG gets all glitched. Any fixes would be helpful.

personitis

Bloop!
Basic questions, fourth down. It's a pretty stupid thing.

Quietus


Benki

Quote from: person701 on February 19, 2013, 02:11:16 AM
Bloop!
Basic questions, fourth down. It's a pretty stupid thing.
I don't want to remove the sky scrolling. From my understanding there are 4 rooms that can connect to the landing site with no errors. How would I make another room compatible?

Quietus


Crashtour99

Providing the entire background doesn't glitch (only the first scroll screen when you come through the door) you can get around it with creative use of layering and level design.

As for why the glitch happens, iirc there is a bit of data that tells the game which background screen to load when coming through a specific door.  When you change the door connections that data is no longer accurate so the game gets confused (can't remember if it's just a table or if it's lines of code).  Perfect solution is to find that data and correct it, but I can no longer remember what it is or where it's at.

P.JBoy

#6
It's all to do with the BG_Data of the scrolling sky rooms, here's the landing site's for example:

000E 8A12 8AC180 4800 0800      ; Copy 800h bytes from $8A:C180 to $4800 if current DDB is 8A12
000E 8AEA 8AD980 4800 0800      ; Copy 800h bytes from $8A:D980 to $4800 if current DDB is 8AEA
000E A18C 8AB980 4C00 0800      ; Copy 800h bytes from $8A:B980 to $4C00 if current DDB is A18C
000E A1B0 8AD980 4800 0800      ; Copy 800h bytes from $8A:D980 to $4800 if current DDB is A1B0
000E A1E0 8AB180 4800 0800      ; Copy 800h bytes from $8A:B180 to $4800 if current DDB is A1E0
000E A300 8AC980 4C00 0800      ; Copy 800h bytes from $8A:C980 to $4C00 if current DDB is A300
0000                            ; End of BG_Data

The 000E is specifying to use this method of background loading, the 0000 is specifying the end of the BG_Data.
The second column is the DDB, that is the ID of the door Samus is currently travelling through.
The third column is from where to load the background from, in this case the background can be loaded part-way through.
The fourth column is where in the VRAM to load the background to, I've never really looked into why it needs to do this, but it certainly does
The fifth column is simply the size of the background

If you change where the doors are or which doors lead to a scrolling sky room you gotta change some of these entries, like so:
As far as I know, SMILE won't give you the DDB value of a door, so you have to go the room linking to the scrolling-sky room and find out its DoorOut pointer, what SMILE does tell you is which door in the list of doors in the DoorOut data the one you want is, the door transition blocks have a number in them (or blank if it's door 0), so you double this number and add it to the DoorOut pointer, go to that address in a hex editor and that will be the relevant DDB, use this as the second column.

The third column is determined by what row of scrolls the door is in (within the scrolling-sky room). If the door is in one of the scrolls at the top of the room, then its in row 0, if it's one scroll down then it's in row 1 etc.. For this room, the background starts at $8AB180; multiply the scroll-row it's in by 0x800 and add it to $8AB180, that's your third column.

If the scroll-row was 1 or 3, then the fourth column is 4C00, else it's 4800. ¯\_(ツ)_/¯

For more information, see Black Telomeres's FAQ (CtrlF for Rakki), and the source code for my patch
...