Doing 14x16 square tiles is possible

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
psycopathicteen
Posts: 2904
Joined: Wed May 19, 2010 6:12 pm

Doing 14x16 square tiles is possible

Post by psycopathicteen » Sun Jul 01, 2018 9:09 pm

aspect ratio corrected tiles.png
aspect ratio corrected tiles.png (1.41 KiB) Viewed 4363 times
You could pull off 14x16 tiles by overlapping 2 layers, and using 2 tile sets. As you can see in the picture above, there is a red layer and a green layer. Each tile comes in a pair, with a "right" side tile, and a "left" side tile.

User avatar
Bregalad
Posts: 7766
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: Doing 14x16 square tiles is possible

Post by Bregalad » Sun Jul 01, 2018 11:43 pm

And why in the world would you want to do this instead of 16x16 ?

TOUKO
Posts: 288
Joined: Mon Mar 30, 2015 10:14 am

Re: Doing 14x16 square tiles is possible

Post by TOUKO » Mon Jul 02, 2018 12:20 am

Bregalad wrote:And why in the world would you want to do this instead of 16x16 ?
Same here, i don't see the usefulness of that,except saying "you can" .

User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2032
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Doing 14x16 square tiles is possible

Post by FrankenGraphics » Mon Jul 02, 2018 12:37 am

Maybe to counter wide pixels?
http://www.frankengraphics.com - personal NES blog

psycopathicteen
Posts: 2904
Joined: Wed May 19, 2010 6:12 pm

Re: Doing 14x16 square tiles is possible

Post by psycopathicteen » Mon Jul 02, 2018 4:21 am

FrankenGraphics wrote:Maybe to counter wide pixels?
Exactly.

tepples
Posts: 21749
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Doing 14x16 square tiles is possible

Post by tepples » Mon Jul 02, 2018 5:07 am

That or if you're porting a block puzzle game designed for a platform without wide pixels, where 8x8 is too small and 16x16 is too big. Puyo Pop for Game Boy Advance uses 2 layers to display 12x12-pixel tiles, as does the homebrew Luminesweeper. Zoop for Super NES uses software rendering for 12x14-pixel tiles.

TOUKO
Posts: 288
Joined: Mon Mar 30, 2015 10:14 am

Re: Doing 14x16 square tiles is possible

Post by TOUKO » Mon Jul 02, 2018 5:31 am

psycopathicteen wrote:
FrankenGraphics wrote:Maybe to counter wide pixels?
Exactly.
Ok, but is it not a bit overkill to sacrifice a layer for that ?

JRoatch
Formerly 43110
Posts: 388
Joined: Wed Feb 05, 2014 7:01 am
Location: us-east
Contact:

Re: Doing 14x16 square tiles is possible

Post by JRoatch » Mon Jul 02, 2018 8:09 am

That's kind of a neat solution.
My first thought would of been to use mode 7 to scale the whole tilemap, but then there would be no other layers available.

TOUKO
Posts: 288
Joined: Mon Mar 30, 2015 10:14 am

Re: Doing 14x16 square tiles is possible

Post by TOUKO » Mon Jul 02, 2018 10:31 am

With mode 7 you are also limited to 256 tiles .

tepples
Posts: 21749
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Doing 14x16 square tiles is possible

Post by tepples » Mon Jul 02, 2018 10:42 am

With 2 tile sets at 14x16, you are still limited to 512 tiles, as you have to store each tile twice in video memory: once offset and once not offset. It's a bit better at (say) 12x12 or 12x14, where you can still use all 1024 tiles, though you're still limited to one 2bpp parallax layer in mode 1.

93143
Posts: 1109
Joined: Fri Jul 04, 2014 9:31 pm

Re: Doing 14x16 square tiles is possible

Post by 93143 » Mon Jul 02, 2018 2:07 pm

Wouldn't you need more than two sets? If you plan to cover a scanline in 7-pixel slivers, packing two 14-pixel metaslivers together lands you halfway through the fourth underlying 8-pixel sliver, so you'd need to do it again (but with three real slivers per metasliver this time) to get back into alignment.

Have I missed something?

tepples
Posts: 21749
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Doing 14x16 square tiles is possible

Post by tepples » Mon Jul 02, 2018 5:19 pm

The tiles would be paired. You'd have one copy of a pair of tiles occupying pixels 0-13 of a pair and a shifted copy of the same pair of tiles occupying pixels 2-15. Then you'd write the tiles to the map in the following order:

2-15 version of tile at position 0
0-13 version of tile at position 1
(3 blank columns)
2-15 version of tile at position 4
0-13 version of tile at position 5
(3 blank columns)
2-15 version of tile at position 8
0-13 version of tile at position 9
(3 blank columns)

Then in the other map, whose scroll is offset by 28 pixels, you'd write

2-15 version of tile at position 2
0-13 version of tile at position 3
(3 blank columns)
2-15 version of tile at position 6
0-13 version of tile at position 7
(3 blank columns)
2-15 version of tile at position 10
0-13 version of tile at position 11
(3 blank columns)

The 2-15 and 0-13 tiles together make 28 consecutive pixels. The two transparent pixels at the right side of a 0-13 pair, three blank tile columns, and the two transparent pixels at the left side of the next 2-15 pair together also make 28 consecutive transparent pixels.

93143
Posts: 1109
Joined: Fri Jul 04, 2014 9:31 pm

Re: Doing 14x16 square tiles is possible

Post by 93143 » Mon Jul 02, 2018 8:43 pm

I think I see that now. I shouldn't have posted; I've been using my brain at pretty much full throttle for the last two weeks and it's worn out. Must sleep...

psycopathicteen
Posts: 2904
Joined: Wed May 19, 2010 6:12 pm

Re: Doing 14x16 square tiles is possible

Post by psycopathicteen » Thu Jul 05, 2018 8:14 pm

I'll attempt to write some code for calculating coordinates.

Code: Select all

lda {x_velocity}
clc
adc {bg1x}
sta {bg1x}
clc
adc #$0004
sta {bg2x}

lda {x_velocity}
clc
adc {fine_scroll}
bpl +
adc #$000e
dec {tile_number}
+;
cmp #$000e
bcc +
sbc #$000e
inc {tile_number}
+;
sta {fine_scroll}

Post Reply