Fix Sprite Viewer Copy Tile function only give the first half if it is a large sprites
This commit is contained in:
parent
2d0468eff5
commit
c56edc9f92
2 changed files with 584 additions and 555 deletions
1090
GUI.NET/Debugger/Controls/ctrlSpriteViewer.Designer.cs
generated
1090
GUI.NET/Debugger/Controls/ctrlSpriteViewer.Designer.cs
generated
File diff suppressed because it is too large
Load diff
|
@ -390,10 +390,21 @@ namespace Mesen.GUI.Debugger.Controls
|
||||||
}
|
}
|
||||||
|
|
||||||
_contextMenuSpriteIndex = _selectedSprite;
|
_contextMenuSpriteIndex = _selectedSprite;
|
||||||
_copyData = ToHdPackFormat(_selectedSprite);
|
|
||||||
|
if (_largeSprites)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.AppendLine(ToHdPackFormat(_selectedSprite, false));
|
||||||
|
sb.AppendLine(ToHdPackFormat(_selectedSprite, true));
|
||||||
|
_copyData = sb.ToString();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_copyData = ToHdPackFormat(_selectedSprite, false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private string ToHdPackFormat(int spriteIndex)
|
private string ToHdPackFormat(int spriteIndex, bool isLargeSpriteSecondHalf)
|
||||||
{
|
{
|
||||||
int ramAddr = spriteIndex * 4;
|
int ramAddr = spriteIndex * 4;
|
||||||
int tileIndex = _spriteRam[ramAddr + 1];
|
int tileIndex = _spriteRam[ramAddr + 1];
|
||||||
|
@ -401,7 +412,7 @@ namespace Mesen.GUI.Debugger.Controls
|
||||||
|
|
||||||
int tileAddr;
|
int tileAddr;
|
||||||
if(_largeSprites) {
|
if(_largeSprites) {
|
||||||
tileAddr = ((tileIndex & 0x01) == 0x01 ? 0x1000 : 0x0000) + ((tileIndex & 0xFE) << 4);
|
tileAddr = ((tileIndex & 0x01) == 0x01 ? 0x1000 : 0x0000) + (((tileIndex & 0xFE) + (isLargeSpriteSecondHalf ? 1 : 0)) << 4);
|
||||||
} else {
|
} else {
|
||||||
tileAddr = _spritePatternAddr + (tileIndex << 4);
|
tileAddr = _spritePatternAddr + (tileIndex << 4);
|
||||||
}
|
}
|
||||||
|
@ -544,13 +555,31 @@ namespace Mesen.GUI.Debugger.Controls
|
||||||
bool verticalMirror = (attributes & 0x80) == 0x80;
|
bool verticalMirror = (attributes & 0x80) == 0x80;
|
||||||
|
|
||||||
if(spriteY >= 0 && spriteY < 240) {
|
if(spriteY >= 0 && spriteY < 240) {
|
||||||
sb.AppendLine(
|
if (_largeSprites){
|
||||||
ToHdPackFormat(i) + "," +
|
sb.AppendLine(
|
||||||
spriteX.ToString() + "," +
|
ToHdPackFormat(i, verticalMirror) + "," +
|
||||||
spriteY.ToString() + "," +
|
spriteX.ToString() + "," +
|
||||||
(horizontalMirror ? "Y" : "N") + "," +
|
spriteY.ToString() + "," +
|
||||||
(verticalMirror ? "Y" : "N")
|
(horizontalMirror ? "Y" : "N") + "," +
|
||||||
);
|
(verticalMirror ? "Y" : "N")
|
||||||
|
);
|
||||||
|
sb.AppendLine(
|
||||||
|
ToHdPackFormat(i, !verticalMirror) + "," +
|
||||||
|
spriteX.ToString() + "," +
|
||||||
|
(spriteY + 8).ToString() + "," +
|
||||||
|
(horizontalMirror ? "Y" : "N") + "," +
|
||||||
|
(verticalMirror ? "Y" : "N")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
sb.AppendLine(
|
||||||
|
ToHdPackFormat(i, false) + "," +
|
||||||
|
spriteX.ToString() + "," +
|
||||||
|
spriteY.ToString() + "," +
|
||||||
|
(horizontalMirror ? "Y" : "N") + "," +
|
||||||
|
(verticalMirror ? "Y" : "N")
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(sb.Length > 0) {
|
if(sb.Length > 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue