tokumaru wrote:
There's a sprite evaluation bug in the PPU that can result in false positives and false negatives, unless you use 9 high priority (i.e. lower OAM indices) sprites. This means that no other sprites can be displayed in the same scanlines.
Yes, I've read about this bug. My intention was to use the first 10 sprites anyway: Sprite 0 for the parallax scrolling in the middle of the screen. And sprite 1-9 for the overflow. This will work, right?
My game will be designed in a way that no sprite from the actual game scenery will ever be able to touch the status bar.
tokumaru wrote:
It's as simple as you described. The only complication is that you have to use different values for PAL and NTSC/DENDY, so you need to detect the type of the console during the initialization or build different ROMs for different regions.
I was actually hoping that I just have to program the game for NTSC. If someone plays PAL, he either has to live with the slower speed or get himself a
real NES.
But if something like that actually
breaks the game when played in PAL (and I've seen that it actually does in "Choplifter") then I probably won't use the timing code. (Because either I implement a
true PAL conversion or I program for NTSC only and let it run in PAL unaltered. But having just this one single check to prevent glitches in PAL while the rest is still slower, that's just a half ass work.) So, it's the nine sprites for me.
tepples wrote:
But you can use those 9 sprites as part of the status bar itself, so it isn't a total loss.
Sure, but what do I gain? I mean, if I have a status bar like in "Super Mario Bros.", of what use would it be if the score was created with the help of the nine sprites while the rest of the status values are still part of the background?
I mean, it's not that I could use the background tiles otherwise. Either the nine sprites are blank or a portion of the status bar in the background stays blank. What's the advantage to actually use the sprites for something in the status bar instead of leaving them invisible?
There is one disadvantage, though: If I use the nine sprites for the status bar, I have to put the number tiles into the sprite pattern table as well, wasting 10 of my 256 graphics items.
tokumaru wrote:
In a status bar it's not so bad that you can't have other sprites sharing the same scanlines. The only drawback is having to time the split from the top of the sprites, which are placed completely inside the status bar to avoid making sprites in the gameplay area.
I'm not sure if I understood this correctly. Are you talking about the fact that when this is my status bar and the magenta square represents my nine sprites:
that the sprite overflow hits as soon as the
first scanline of sprites is drawn and I therefore still have to calculate the time it takes to reach the
last pixel of the status bar before I can change the scrolling position?
If yes, then I already thought about that:
I will have one blank row of eight pixels between the status bar and the highest gameplay point.
So, instead of something like this:
I would have this:
Therefore, I could change the scrolling position as soon as the sprite overflow hits. Because there is always one row of tiles that only consists of a blank background, so the graphics don't get garbled when I change the scrolling position in the middle of that one row.
Then, when it comes to the actual parallax scrolling in the middle of the screen, which is done with sprite 0, I'll do this:
Since the sprite 0 flag unfortunately only hits at non-transparent pixels, my sprite 0 would be a single dot and I would put it in the rightmost location of the screen so that the dot is at X position 255. (I would hide it behind an actual background element that is completely opaque from left to right in this scanline, like a wall of fog or something.)
The Y position of the dot would be exactly the lowest vertical point of the upper background.
This way, I can change the scrolling position for the lower background immediately when sprite 0 hits since the last pixel of the old scrolling area was just drawn in this very moment.
Would you say that my plans will work?