small amount of work on NES Sprite viewer, added nesasm.pdf to NES docs
This commit is contained in:
parent
b1abe27bfc
commit
7445ff887c
Binary file not shown.
|
@ -117,6 +117,31 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
PatternView.pattern.UnlockBits(bmpdata);
|
PatternView.pattern.UnlockBits(bmpdata);
|
||||||
PatternView.Refresh();
|
PatternView.Refresh();
|
||||||
|
|
||||||
|
int SpriteNum, TileNum, Attr, MemAddr;
|
||||||
|
|
||||||
|
//Sprite Viewer
|
||||||
|
for (int y = 0; y < 4; y++)
|
||||||
|
{
|
||||||
|
for (int x = 0; x < 16; x++)
|
||||||
|
{
|
||||||
|
SpriteNum = (y << 4) | x;
|
||||||
|
TileNum = 0; //TODO
|
||||||
|
Attr = 0; //TODO
|
||||||
|
if (((int)Nes.ppu.reg_2000.Value & (int)0x20) > 0) //TODO why is C# being retarded about using & with a byte?
|
||||||
|
{
|
||||||
|
MemAddr = ((TileNum & 0xFE) << 4) | ((TileNum & 0x01) << 12);
|
||||||
|
//DrawTile(SprArray + y * 24 * D_SPR_W + x * 16, MemAddr, 4 | (Attr & 3), D_SPR_W);
|
||||||
|
//DrawTile(SprArray + y * 24 * D_SPR_W + x * 16 + 8 * D_SPR_W, MemAddr + 16, 4 | (Attr & 3), D_SPR_W);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MemAddr = (TileNum << 4) | ((Nes.ppu.reg_2000.Value & (byte)0x08) << 9);
|
||||||
|
//DrawTile(SprArray + y * 24 * D_SPR_W + x * 16, MemAddr, 4 | (Attr & 3), D_SPR_W);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe void UpdateValues()
|
public unsafe void UpdateValues()
|
||||||
|
|
|
@ -11,12 +11,12 @@ namespace BizHawk.MultiClient
|
||||||
public class SpriteViewer : Control
|
public class SpriteViewer : Control
|
||||||
{
|
{
|
||||||
Size pSize;
|
Size pSize;
|
||||||
public Bitmap pattern;
|
public Bitmap sprites;
|
||||||
|
|
||||||
public SpriteViewer()
|
public SpriteViewer()
|
||||||
{
|
{
|
||||||
pSize = new Size(256, 128);
|
pSize = new Size(256, 128);
|
||||||
pattern = new Bitmap(pSize.Width, pSize.Height);
|
sprites = new Bitmap(pSize.Width, pSize.Height);
|
||||||
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||||
SetStyle(ControlStyles.UserPaint, true);
|
SetStyle(ControlStyles.UserPaint, true);
|
||||||
SetStyle(ControlStyles.DoubleBuffer, true);
|
SetStyle(ControlStyles.DoubleBuffer, true);
|
||||||
|
@ -29,7 +29,7 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
unchecked
|
unchecked
|
||||||
{
|
{
|
||||||
g.DrawImage(pattern, 1, 1);
|
g.DrawImage(sprites, 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue