NES PPU - Sprite Viewer Details - show attribute flags

This commit is contained in:
andres.delikat 2011-08-29 00:19:55 +00:00
parent 033c008a06
commit 83cc883177
1 changed files with 15 additions and 4 deletions

View File

@ -505,11 +505,21 @@ namespace BizHawk.MultiClient
int X = Nes.ppu.OAM[(SpriteNumber * 4) + 3];
int Y = Nes.ppu.OAM[SpriteNumber * 4];
int Color = Nes.ppu.OAM[(SpriteNumber * 4) + 2] & 0x03;
//String flags = ""; //TODO: BG
int Attributes = Nes.ppu.OAM[(SpriteNumber * 4) + 2];
string flags = "Flags: ";
int h = GetBit(Attributes, 6);
int v = GetBit(Attributes, 7);
int priority = GetBit(Attributes, 5);
if (h > 0)
flags += "H ";
if (v > 0)
flags += "V ";
if (priority > 0)
flags += "Behind";
else
flags += "Front";
//TODO: 8/16 View
int Tile = Nes.ppu.OAM[SpriteNumber * 1]; ;
AddressLabel.Text = "Number: " + String.Format("{0:X2}", SpriteNumber);
@ -517,6 +527,7 @@ namespace BizHawk.MultiClient
Value2Label.Text = "Y: " + String.Format("{0:X2}", Y);
Value3Label.Text = "Tile: " + String.Format("{0:X2}", Tile);
Value4Label.Text = "Color: " + Color.ToString();
Value5Label.Text = flags;
ZoomBox.Image = Section(SpriteView.sprites, new Rectangle(new Point((e.X / 8) * 8, (e.Y / 8) * 8), new Size(8, 8)));
}