I'm working on a small change for my Zelda 1 hack
which uses two different map cursors, one for the overworld and a different one in dungeons. Why am I making this change? Because the hack also contains automap where a smaller cursor looks great - but the normal cursor looks better in the dungeon.
It has been mostly successful but has introduced a rendering artifact because I'm currently using tile $1C (which seemed unused but actually is). I can't find where the artifact gets written (Mesen shows it's a sprite). Here's a screenshot to clarify the problem:
And here's the patch
. It can be applied on top of my hack or vanilla Zelda 1. The most relevant bits are at $7761 ROM / $7EE1 RAM. I can paste the commented code and related data locations if that's helpful.
Any pointers on how to get rid of this or how to use a different tile from the other pattern table will be appreciated!
April 11, 2020, 02:58:08 am - (Auto Merged - Double Posts are not allowed before 7 days.)
After reading a doc about OAM on nesdev
it was much easier than I thought to change to an unused tile (see part about bit 0 in Byte 1). For example, FCEUX PPU Viewer showed $5C for an empty tile in the right side pattern table so add $1 to make it $5D. Too easy. Here are the relevant RAM locations for anyone wanting to edit the cursors.
0250 Map cursor Y pos (dungeon subscreen)
0251 Map cursor tile (dungeon subscreen)
0252 Map cursor attributes (dungeon subscreen)
0253 Map cursor X pos (dungeon subscreen)
0254 Map cursor Y pos (also used to blink cursor)
0255 Map cursor tile
0256 Map cursor attributes
0257 Map cursor X pos
April 11, 2020, 08:06:29 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Sorry to keep replying to myself but I think this info might be useful to others at some point.
Based on the same OAM document it occurred to me that I could find the original rendering artifact as well. Before I had been searching for $1C $00 (the tile id plus the palette number) which didn't yield what I was looking for. But I had also noted that the sprite was behind the background. That was a clue that bit 5 of the attribute byte would be set. So add $20. Viola, $1C $20 has only one occurrence in RAM and it's what I'm looking for. Once I found that, another solution to my problem could be to add $80 to the attribute byte (bit 7 is flip vertical), making $1C $A0, to effectively hide the sprite behind the background. Fun stuff!