How to get the current tileset

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: How to get the current tileset

Post by D3thAdd3r » Tue Jun 19, 2018 12:23 am

nicksen782 wrote:
Mon Jun 18, 2018 2:34 pm
I considered putting font data into ram tiles but in my actual use case I will only have 8 ram tiles left
Ah, yeah in that case it is probably not too useful an approach. Really I only found uses for it in title screens, menus, etc. where there is minimal sprite usage. Columns is a pretty serious nightmare of ram tile juggling if you ever care to check it out...it is a slippery slope that can suck up tons of development time. If you have some title screen with several unique tiles, and you already have 2 level tile sets sandwiching the font set, you might get irritated if you have to store another font set because the title tiles are out of reach to the font(because of 256-RAM_TILES_COUNT unique values). In that case, since you are already storing them somewhere else, it is probably more space efficient to write code to put that in ram tiles. MegaBomber shows probably the most efficient way to do that which can be pretty small code space. You can't do the Columns 1bpp way if you need to directly display them as tiles, in the case you describe where you don't have many ram tiles free and also need arbitrary text on screen.
nicksen782 wrote:
Mon Jun 18, 2018 2:34 pm
I'm not sure that I know how to implement your suggestion but it is interesting if I could somehow "split" a ram tile.
Unfortunately there is no way to do it. If you used 2 similar colors and overlayed multiple characters onto the same ram tiles, and twiddled the fader just right each frame, and only needed 1 half of the characters per frame, and could live with the color loss and the headache of implementing....yeah no practical way that I see :roll:

User avatar
Jubatian
Posts: 1355
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: How to get the current tileset

Post by Jubatian » Tue Jun 19, 2018 5:22 am

nicksen782 wrote:
Mon Jun 18, 2018 2:34 pm
I'm not sure that I know how to implement your suggestion but it is interesting if I could somehow "split" a ram tile. If I had 16 then I wouldn't have as much of a problem.
A bit OFF, just an interesting edge case: In palettized modes allowing swapping the palette, this can actually be done.

For example Mode 52, which is 2 bits per pixel, and you wanted to display a large 1bpp image from RAM. Set up the top half's palette like black-white-black-white, and each RAM tile pixel's low bit will encode the visible pixel. Set up the bottom half's palette like black-black-white-white, and the RAM tile pixel's high bit will encode the visible pixel. So one RAM tile this way stores two actual tiles.

In Mode 13 (no palette swapping within the frame) you could only use this to save ROM for low-color images as you could store two different images over each other.

It is not possible to add such a capability (except for Lee's suggestion above) to Mode 3 as these tricks rely on the video frame driver outputting the pixels by a palette, and Mode 3 has no such.

User avatar
nicksen782
Posts: 667
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: How to get the current tileset

Post by nicksen782 » Mon Dec 10, 2018 7:29 pm

I made a pull request for this.

https://github.com/Uzebox/uzebox/pull/96

This is a minor change. Technically a typo-fix. A typo which coincidentally also works as intended.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests