This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Some (probably fundamental) Graphics Questions

Some (probably fundamental) Graphics Questions
by on (#52320)
Apologies in advance, I have very little knowledge of graphics.

I'm trying to do a nibble character set but obviously that would use up all 256 tiles, which is no good.

Is it possible to display more than one Pattern Table on screen or are you limited to just the 256 tiles of the one table?

If not, has anyone got any clever ideas to achieve this?

by on (#52321)
You can show more than one pattern table on the screen by changing the pattern table content on a specific scanline. Once on that scanline the pattern is changed, the rest of the screen will be shown with that pattern table. This is often used in games that requires to show a status bar and game content at the same time. This is done too in game like Ninja gaiden to show the cut scene and the text at the bottom.

It can be done with CHR-ROM. For CHR-RAM, I would say by guessing that it is not really possible.

by on (#52322)
I probably should've read more before posting.

I was hoping there was a way to access two Pattern Tables at the same time when writing to the screen. Obviously I know that being 8 bit, you can only store the number 0-255 at each character location on the screen but I thought that through some combination of bits of the attributes (or something) that maybe there was a way to point the character to one Pattern Table or another but I see that the only function of the attributes is palette/colour.

Hmmmmm.....back to the drawing board :(

by on (#52324)
It's possible to have up to 512 tiles by tweaiking $2000.4 in real time to select if the left or right pattern table is displayed.

That way it's possible to change table mid-frame, and even mid-scanline (but it requires at least 2 tiles or "margin" which are shared between both tables, as I've done it here).

Maybe if you were telling us what exactly you're trying to do we could help more.

by on (#52325)
I'm trying to redesign the screen layout for my NES tracker and I thought of having two hex digits per character so that my 8-bit hex numbers can be represented in one column instead of two.

But as that takes the entire character set I wondered if I could've had one Pattern Table for the hex digits and then a second table for text etc. but be able to display characters from both sets at the same time.

by on (#52327)
You could use bit #0 of the tiles for hex digits and bit #1 for text etc (for 1bpp graphics) but given the unfortunate 16x16 attribute area (16x8 if you switch nametable every 8 scanlines) that doesn't solve the problem completely. But with some other trickery and clever layout it could be useful to know. Just throwing it out there. :)

by on (#52328)
Thanks, not sure I want to be getting into switching pattern tables though, that could end up a real mess :)

I figured that if I limited the size of my tables to 128 entries I'd only need to use 00-7F so only half of the character set. It doesn't solve everything but it gets me a few columns back here and there.

by on (#52346)
Banshaku wrote:
[Bankswitching CHR] can be done with CHR-ROM. For CHR-RAM, I would say by guessing that it is not really possible.

Qix and Who's Cuter use both the first and second pattern tables, as Bregalad pointed out. Videomation has extra CHR RAM and a discrete mapper to switch it.

neilbaldwin wrote:
I thought that through some combination of bits of the attributes (or something) that maybe there was a way to point the character to one Pattern Table or another

MMC5 has ExGrafix. Game Boy Color has two pattern tables. Both have a separate attribute table allowing switching between pattern tables on a tile-by-tile basis.

One thing you can do for a tracker is make a font with two sets of the hexadecimal nibbles 0-9 and A-F slightly narrower than normal, with one set biased to the right and one biased to the left. Then you can fit distinct columns of two digits into adjacent pairs of tiles.

Image Image

So with 64 tiles, you can vastly increase the tracker screen's info density.

by on (#52385)
Ah, I see what you mean now Tepples.

While it doesn't save me column space (as much as my other fantasy method would have), I might nick the idea as I was going to use colours to separate the columns but I like your idea better.

I also downloaded your "ted" and "name" tools. Exactly what I need right now, thanks for sharing those. :)

(Though I did try to build osx/unix versions of them from the source and had a horrible time with Allegro. I managed to eventually build/install Allegro but building your tools seems to fail at linking stage; comes up with a lot of undefined symbol errors in the .o files. I gave up in the end as I can begrudgingly run them in Parallels Desktop but if you've any advice or can build them for me or know someone who's build them on osx/X11 then I'd be very grateful.)