News: 11 March 2016 - Forum Rules

Author Topic: SMB3 tile layouts  (Read 2222 times)

Hypnotic_rabbit

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
SMB3 tile layouts
« on: October 19, 2015, 04:59:04 pm »
Im working with the smb3 disassembly by southbird and im having a little trouble understanding what this tile layout deal is about. Im not worried about anything after the Tile_Layout_TS1: label right now just the data inside the label(upper left, lower left, upper right, lower right). Can anyone explain this a little better then the brief description already given in the file with more detail plz? Here is a link to the file that has the data im trying to figure out.

http://smb3project.googlecode.com/svn-history/r314/trunk/SMB3/PRG/prg015.asm

Disch

  • Hero Member
  • *****
  • Posts: 2814
  • NES Junkie
    • View Profile
Re: SMB3 tile layouts
« Reply #1 on: October 19, 2015, 05:11:58 pm »
At first glance it looks like a basic TSA table to me.

NES tiles are drawn in 8x8 pixel blocks.  But games often want to use 16x16 blocks -- so "game-tile" consists of a 2x2 arrangement of "pattern-tiles".

So for example, using those tables, game-tile $01 would be drawn with the following pattern-tiles

Code: [Select]
3B | FC
---+---
3A | FC

Hypnotic_rabbit

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
Re: SMB3 tile layouts
« Reply #2 on: October 19, 2015, 05:28:04 pm »
So what you mean is its using these tables it takes 4 pattern tiles and arranging them into 16x16 blocks?

say like small mario is 4 tiles and using these tables somehow create a 16x16 block from these 4 tiles?

or say like

pattern tile 1 | pattern tile 2
                ---+---
pattern tile 3 | pattern tile 4



Can you explain why there are 16 bytes for each set?

Ill definitely look up TSA tables, any links?

Disch

  • Hero Member
  • *****
  • Posts: 2814
  • NES Junkie
    • View Profile
Re: SMB3 tile layouts
« Reply #3 on: October 19, 2015, 05:41:19 pm »
So what you mean is its using these tables it takes 4 pattern tiles and arranging them into 16x16 blocks?

Yes.

Quote
say like small mario is 4 tiles and using these tables somehow create a 16x16 block from these 4 tiles?

Yes, but Mario is a sprite so he wouldn't be represented here.  This would be more for things like [?] blocks -- things in the background.


Quote
Can you explain why there are 16 bytes for each set?

There's not.  There are 4 tables, in each table there is 1 byte for each "block" ("block" = 16x16 game-tile).

256 bytes in each table
256 available blocks.


So say a [?] block is block ID 05.

When the game wants to draw a [?] block, it has to draw 4 tiles (because tiles are 8x8).  So the game will look at entry 05 in each of those four tables, and use the value to draw the appropriate patterns to the screen.

Quote
Ill definitely look up TSA tables, any links?

Nah I don't have any reference links -- but there isn't really much else to it.  I mean any doc you find is pretty much just going to say what I said above and maybe give a few more examples.



EDIT:

Screenshot for reference:



EDIT 2 - messed up tile numbers in image originally -- reuploaded with fix.
« Last Edit: October 19, 2015, 05:50:06 pm by Disch »

Hypnotic_rabbit

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
Re: SMB3 tile layouts
« Reply #4 on: October 19, 2015, 05:54:34 pm »
oh ok i see, its not really 16 bytes its like a palette where there are sixteen bytes but its really 4 sets of 4 all corresponding to the 265 tiles in the tile set.  And you are right about any docs i find, i found this and it does pretty much say what you are saying.

http://www.zophar.net/fileuploads/2/10690nxpfq/AoRH.htm

Thank you, you rock man. I would have gave up on this along time ago if it wasn't for you lol