You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to see the room mask, something similar to the boxes.
I don't think the mask format is documented yet but I've picked it apart a bit. Let's use room 29 (under the house) as an example since it might be the most complicated mask. The RLE mask data for this room is stored in the rom at 225BA-22618 and gets decoded to ram at 6D7C. (In Mesen's Memory Viewer you can watch the bytes get accessed a column at a time as you walk through the screen.) Ignoring the rows of 0s, the mask is decoded as:
This is bitmap data where each bit corresponds to a single tile, so a single byte covers a row of 8 tiles. A bit value of 1 = masked (background priority), and 0 = unmasked (sprite priority). We can visualize the bits in the above data to reveal the mask for a bunch of pillars under the house.
The only tricky part is that the bits in each byte are first reversed (or read right to left if you prefer). So the first two bytes for example get applied as:
0011 1111 0000 1111
As for the UI, when the mask byte is set (offset stored at 0x0E in the room data) it might make sense to create a separate canvas object that contains a black and white mask image to overlay the main room image (just an idea, maybe there's a better way).
Other rooms with masks are 22, 23, 40, 44, and 46, maybe others.
The text was updated successfully, but these errors were encountered:
Note that the offset at 0x0E will point to a value of 0x00 or 0x01. If the value is 1 then the next byte will be the RLE run length (4 or 8 depending on the room size), followed by the RLE data.
It's stored in the masktable entry. I compared the values for room 29 and they match that you posted.
As for the UI, we can simply use styled <div>, the way the object highlights are done.
It would be nice to be able to see the room mask, something similar to the boxes.
I don't think the mask format is documented yet but I've picked it apart a bit. Let's use room 29 (under the house) as an example since it might be the most complicated mask. The RLE mask data for this room is stored in the rom at
225BA-22618
and gets decoded to ram at6D7C
. (In Mesen's Memory Viewer you can watch the bytes get accessed a column at a time as you walk through the screen.) Ignoring the rows of 0s, the mask is decoded as:This is bitmap data where each bit corresponds to a single tile, so a single byte covers a row of 8 tiles. A bit value of 1 = masked (background priority), and 0 = unmasked (sprite priority). We can visualize the bits in the above data to reveal the mask for a bunch of pillars under the house.
The only tricky part is that the bits in each byte are first reversed (or read right to left if you prefer). So the first two bytes for example get applied as:
0011 1111 0000 1111
As for the UI, when the mask byte is set (offset stored at
0x0E
in the room data) it might make sense to create a separate canvas object that contains a black and white mask image to overlay the main room image (just an idea, maybe there's a better way).Other rooms with masks are 22, 23, 40, 44, and 46, maybe others.
The text was updated successfully, but these errors were encountered: