I'm working on implementing OTP and well... I'm just not sure of a lot of the details.
I've read through https://wiki.superfamicom.org/backgrounds, Book1.pdf (of the official docs), and even found this forum thread: viewtopic.php?f=12&t=12396. They've all provided some insight, but still there are things I am unsure of.
When we combine the vertical/horizontal offset, does it replace the vertical/horizontal scroll (from the background scroll registers) for that tile or is it added to it?
If the left most tile is ignored/doesn't use OTP, does that mean the 0'th entry in BG3 is also ignored? Or does it correspond to the 1st tile (skipping the 0th tile)?
If the BG being offset and BG3 are different tile sizes what happens (like when BG1 is 8x8 and BG3 is 16x16, or when BG1 is 16x16 and BG3 is 8x8)?
AWJ says that BG3 can be scrolled using the usual background scroll registers, if they aren't scrolled by a multiple of 8/16 (depending on tile size) what happens? Round down? Up?
If BG3 is scrolled off the 'end' does it wrap?
The official docs say (pg. 208):
In the case of H-OFFSET, the data (D0 ~ D2) will be invalid.
In the case of the character (16x16), "D3" is effective every 3rd.
Ermm... WTF are they trying to say?
Offset Per Tile
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
Re: Offset Per Tile
Added.
The latter.If the left most tile is ignored/doesn't use OTP, does that mean the 0'th entry in BG3 is also ignored? Or does it correspond to the 1st tile (skipping the 0th tile)?
Down (i.e. truncated)AWJ says that BG3 can be scrolled using the usual background scroll registers, if they aren't scrolled by a multiple of 8/16 (depending on tile size) what happens? Round down? Up?
Only left/right. The OPT nametable doesn't advance vertically.If BG3 is scrolled off the 'end' does it wrap?
The horizontal OPT mode can only scroll a tile to "whole tile" quanta; there's no fine X scrolling every 8 pixels.In the case of H-OFFSET, the data (D0 ~ D2) will be invalid.
You may also find my OPT demo: viewtopic.php?p=174494#p174494
and my photo of hardware: viewtopic.php?p=240256#p240256
useful reference.
The actual purpose was demonstrating modes 0-6, and I only demonstrated vertical OPT in modes 2,4,6. Also note that I changed the locations of the (unmoving) sprites; you can ignore them.
Re: Offset Per Tile
Very much appreciated.
Any thoughts on what happens when the backgrounds are difference tile sizes?
In the thread I linked AWJ says:
Any thoughts on what happens when the backgrounds are difference tile sizes?
So we ignore BG vertical scroll when using OPT?Only left/right. The OPT nametable doesn't advance vertically.
In the thread I linked AWJ says:
It is a tilemap in most respects; the PPU just ignores the electron beam position when deciding what row of it to read. Other than that, it is affected by all the registers that affect BG3. If you set BG3 to use 16x16 tiles then the scroll columns will have 16-pixel granularity instead of 8-pixel (for all the use that is...). Changing the BG3 scroll registers changes exactly where in VRAM the table gets fetched from (this is how you do raster splits; you can't overwrite the offset table in mid-frame because it's in VRAM and the CPU can't access VRAM outside of VBlank, but you can upload several tables during VBlank and then switch between them by HDMAing to the BG3 scroll registers)
Re: Offset Per Tile
No, it sets the row containing the OPT data (or the top of the two rows containing OPT data). The demo I made and linked uses HDMA to change the starting Y to be able to use the same nametable for modes 2 and 6 (which have two rows of OPT data: one horizontal and one vertical) and mode 4 (which only has one row of OPT data). This is exactly what AWJ was talking about:
you can upload several tables during VBlank and then switch between them by HDMAing to the BG3 scroll registers)
Re: Offset Per Tile
I think I found the relevant info in the anomie docs.
*edit: And thank you for the clarification
*edit: And thank you for the clarification