$2002.5

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
Disch
Posts: 1848
Joined: Wed Nov 10, 2004 6:47 pm

$2002.5

Post by Disch »

I got a few questions with the $2002.5 flag (8 sprite flag). Not really concerned too much with them... but I figure I'd see if I can get my understanding clarified anyway.

1) Is it set when the 8th sprite is found? or the 9th? BT's doc gives the impression it's done on the 9th... but it seems like the 8th would make a whole lot more sense.

2) If Sprite rendering is off... it would never be set, correct?

3) Do any games actually check this flag?

Thanks
J2

Post by J2 »

1) It's on the 9th sprite. The PPU can render 8 sprites on a scanline and if it has to render more than that it get's rid of the lower priorty ones and sets this bit "telling" that it's dropped sprites.

2)Good question. I'd assume that it isn't, but I have no idea.

3)I think that many games check this bit probably for their OAM shuffling routine. When this bit gets set that would let em know to start shuffling their sprites. I guess they could also use it for some sort of tming routine, but that's best suited for the Sprite 0 hit. I've seen some demos that check this bit too.
User avatar
James
Posts: 431
Joined: Sat Jan 22, 2005 8:51 am
Location: Chicago, IL
Contact:

Post by James »

>>3) Do any games actually check this flag?

Not sure, but at least one game relies on only 8 sprites being drawn: Castlevania 2. See this post from the old message board and the follow up post for details.

I just added the option of enabling/disabling the 8 sprite limit in my emulator today for this reason. By default, I draw all sprites, since it eliminates a lot of flickering in some games.

James
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

James wrote:I just added the option of enabling/disabling the 8 sprite limit in my emulator today for this reason. By default, I draw all sprites, since it eliminates a lot of flickering in some games.
At which PPU cycle does your emulator fetch pattern table data for sprites beyond the 8th?
User avatar
James
Posts: 431
Joined: Sat Jan 22, 2005 8:51 am
Location: Chicago, IL
Contact:

Post by James »

>>At which PPU cycle does your emulator...
My PPU emulation is scanline based.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

In a "scanline based" engine, how do you handle MMC2 (Punch-Out!!) or MMC4 (Family War)?
User avatar
James
Posts: 431
Joined: Sat Jan 22, 2005 8:51 am
Location: Chicago, IL
Contact:

Post by James »

tepples wrote:how do you handle MMC2 (Punch-Out!!) or MMC4 (Family War)?
Don't know -- I haven't written the code for those mappers yet.
Hyde
Posts: 101
Joined: Mon Sep 27, 2004 11:51 pm

Post by Hyde »

tepples wrote:In a "scanline based" engine, how do you handle MMC2 (Punch-Out!!) or MMC4 (Family War)?
It is not too hard to get MMC2 going on a scanline-based engine; as for the other game, I really don't know. What the heck does it do that is so special?
Nessie
Posts: 133
Joined: Mon Sep 20, 2004 11:13 am
Location: Sweden
Contact:

Post by Nessie »

Hyde: MMC4 is almost exactly like MMC2. Check the wiki.

I don't believe scanline-based or not should make much difference when emulating MMC2.
Post Reply