|
Hi. Here I am with a million questions again. Sorry if its quite bothersome ^_^ . If you're wondering how I come up with so many questions, or why I seem incoherent in some places, that's because I type this thing up at home, offline, and add a question whenever something comes to mind.
******************** SPRITE QUESTIONS: ********************
How does sprite #0 hit detection work in detail? I know that it the bit is set when a non-transparent pixel of sprite #0 is drawn on a non-transparent BG-pixel, but what happens when:
1) Sprite #0 is drawn on another sprite (collision with another sprite, not the BG). Assuming the sprite is ON TOP of the BG.
2) Sprite #0 collides with a sprite BEHIND the BG.
3) Sprite #0 is the 9th sprite on the line. i.e. it was never drawn, but a BG collision would've occured if it had been drawn.
4) Same as 1) and 2), except that the background is turned off (sprite collides with another sprite, but no BG)
5) Same as 1) and 2), except that Sprite #0 collides with a "NOT DRAWN" sprite (9th sprite on the scanline)
6) Either sprites or BG are turned off, but a collision would've occured had they been turned on. And also what would happen if both were turned off.
And is the sprite #0 hit bit cleared when $2002 is read? The only doc I read that says that it should is Marat's nes.doc .
Also, in what order are sprites drawn? I know they're prioritized 63->0, what I meant is that, Y0shi's nestech doc says that the sprites behind the BG are drawn first, then the BG, and then the sprites that are on top of the BG. What will happen if 8 sprites (behind the BG) [but are on the right half of the screen], are on the same scanline as another 8 sprites (on top of the BG) [which are on the left half of the screen]?
Here's a visual representation:
.....oooooooo....xxxxxxxx.....
Legend : .... = current scanline o = a sprite on top of the BG x = a sprite BEHIND the BG
If I follow the drawing order low_priority_sprite -> BG -> hi-priority sprite then the sprites "xxxxxxxx" will be drawn first, and "oooooooo" will not be drawn since the 8 max sprites are maxed out. However, if I follow a left-to-right pixel draw order, "oooooooo" will be drawn first, and "xxxxxxxx" will not be drawn. Does anyone know which is which?
Also, when reading PPU memory, there is always a "garbage" read before the real data (i.e. pipelined), right? Is this also true for the Sprite RAM, or is the data available immediately? Same question goes for the palette data.
And if they share that behavior, do they also share the same pipeline?
******************** MID-FRAME/SCANLINE QUESTIONS: ********************
Reading Chris Covell's nestech faq, I read that turning off the BG, changing color emphasis and/or switching to mono can be reflected in the middle of a scanline. Having written my render routine as scanline-based, this presents a great problem. Does any emulator actually emulate this PPU feature?
Also, by how much does a color emphasis bit darken the un-emphasized color? i.e. if I emphasize red, what percentage should I multiply the green and blue components?
I read in Brad's PPU addressing doc and loopy's scrolling doc that the vram address is not updated from the temporary 15-bit latch(?) when rendering is disabled. Does this mean that if BG is enabled but sprites are disabled, then the vram address won't be updated? What if sprites are enabled, but BG is disabled? (i.e. do updates NOT happen when some rendering is turned off, or only when ALL rendering is turned off?)
Are the speed benefits of using a single scanline buffer (instead of a whole screen buffer) very huge? I'm planning to implement this, but it seems like my emulator would have to lose the "VSync" feature.
******************** SOUND QUESTIONS: ********************
Where do I start ? I just want to hear the 2 square wave channels first, and I think I can work it up from there. What do I need to do to emulate it (no other channels, and if not needed, no IRQs either, yet.) ? I'm just totally lost in Brad's NESSOUND doc.
And I'm just wondering about the wavelength being 11-bit. Not really a question ^_^ .
Also, I was looking NESticle's "view wave output" (more like staring at it for several hours, actually). What's a good way of doing this?
Der Wille zur Macht Chikara e no Ishi "The Will To Power"
|