mirror of
https://github.com/SourMesen/Mesen2.git
synced 2025-04-02 10:21:44 -04:00
Debugger: Display the original hex value for snes sprites' X coordinate when the value is negative
This commit is contained in:
parent
1117bfe4c3
commit
7cbb682126
7 changed files with 22 additions and 3 deletions
|
@ -42,6 +42,8 @@ struct DebugSpriteInfo
|
|||
|
||||
int16_t X;
|
||||
int16_t Y;
|
||||
int16_t RawX;
|
||||
int16_t RawY;
|
||||
|
||||
int16_t Bpp;
|
||||
int16_t Palette;
|
||||
|
@ -64,6 +66,8 @@ public:
|
|||
SpriteIndex = -1;
|
||||
X = -1;
|
||||
Y = -1;
|
||||
RawX = -1;
|
||||
RawY = -1;
|
||||
Bpp = 2;
|
||||
Palette = -1;
|
||||
Priority = DebugSpritePriority::Undefined;
|
||||
|
|
|
@ -168,9 +168,12 @@ void GbPpuTools::GetSpriteInfo(DebugSpriteInfo& sprite, uint16_t i, GetSpritePre
|
|||
{
|
||||
sprite.Bpp = 2;
|
||||
sprite.SpriteIndex = i;
|
||||
|
||||
sprite.Y = oamRam[i*4];
|
||||
|
||||
sprite.X = oamRam[i * 4 + 1];
|
||||
sprite.RawY = sprite.Y;
|
||||
sprite.RawX = sprite.X;
|
||||
|
||||
sprite.TileIndex = oamRam[i * 4 + 2];
|
||||
uint8_t attributes = oamRam[i * 4 + 3];
|
||||
|
||||
|
|
|
@ -236,6 +236,8 @@ void NesPpuTools::GetSpriteInfo(DebugSpriteInfo& sprite, uint32_t i, GetSpritePr
|
|||
sprite.SpriteIndex = i;
|
||||
sprite.Y = oamRam[i * 4];
|
||||
sprite.X = oamRam[i * 4 + 3];
|
||||
sprite.RawY = sprite.Y;
|
||||
sprite.RawX = sprite.X;
|
||||
sprite.TileIndex = oamRam[i * 4 + 1];
|
||||
|
||||
uint8_t attributes = oamRam[i * 4 + 2];
|
||||
|
|
|
@ -218,6 +218,8 @@ void SnesPpuTools::GetSpriteInfo(DebugSpriteInfo& sprite, uint16_t spriteIndex,
|
|||
sprite.SpriteIndex = spriteIndex;
|
||||
sprite.X = spriteX;
|
||||
sprite.Y = spriteY;
|
||||
sprite.RawX = sign | oamRam[addr];
|
||||
sprite.RawY = spriteY;
|
||||
sprite.Height = height;
|
||||
sprite.Width = width;
|
||||
sprite.TileIndex = oamRam[addr + 2];
|
||||
|
|
|
@ -467,6 +467,8 @@ namespace Mesen.Debugger.ViewModels
|
|||
[Reactive] public int SpriteIndex { get; set; }
|
||||
[Reactive] public int X { get; set; }
|
||||
[Reactive] public int Y { get; set; }
|
||||
[Reactive] public int RawX { get; set; }
|
||||
[Reactive] public int RawY { get; set; }
|
||||
[Reactive] public int PreviewX { get; set; }
|
||||
[Reactive] public int PreviewY { get; set; }
|
||||
[Reactive] public int Width { get; set; }
|
||||
|
@ -490,10 +492,14 @@ namespace Mesen.Debugger.ViewModels
|
|||
public unsafe void Init(ref DebugSpriteInfo sprite, DebugSpritePreviewInfo previewInfo)
|
||||
{
|
||||
SpriteIndex = sprite.SpriteIndex;
|
||||
|
||||
X = sprite.X;
|
||||
Y = sprite.Y;
|
||||
RawX = sprite.RawX;
|
||||
RawY = sprite.RawY;
|
||||
PreviewX = sprite.X + previewInfo.CoordOffsetX;
|
||||
PreviewY = sprite.Y + previewInfo.CoordOffsetY;
|
||||
|
||||
Width = sprite.Width;
|
||||
Height = sprite.Height;
|
||||
TileIndex = sprite.TileIndex;
|
||||
|
|
|
@ -154,7 +154,7 @@
|
|||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="$" />
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding X, Converter={StaticResource Hex}, ConverterParameter='X2'}" />
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding RawX, Converter={StaticResource Hex}, ConverterParameter='X2'}" />
|
||||
<TextBlock VerticalAlignment="Center" FontSize="10" Foreground="Gray" Text=" (" />
|
||||
<TextBlock VerticalAlignment="Center" FontSize="10" Foreground="Gray" Text="{Binding X}" />
|
||||
<TextBlock VerticalAlignment="Center" FontSize="10" Foreground="Gray" Text=")" />
|
||||
|
@ -165,7 +165,7 @@
|
|||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="$" />
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding Y, Converter={StaticResource Hex}, ConverterParameter='X2'}" />
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding RawY, Converter={StaticResource Hex}, ConverterParameter='X2'}" />
|
||||
<TextBlock VerticalAlignment="Center" FontSize="10" Foreground="Gray" Text=" (" />
|
||||
<TextBlock VerticalAlignment="Center" FontSize="10" Foreground="Gray" Text="{Binding Y}" />
|
||||
<TextBlock VerticalAlignment="Center" FontSize="10" Foreground="Gray" Text=")" />
|
||||
|
|
|
@ -822,6 +822,8 @@ namespace Mesen.Interop
|
|||
|
||||
public Int16 X;
|
||||
public Int16 Y;
|
||||
public Int16 RawX;
|
||||
public Int16 RawY;
|
||||
|
||||
public Int16 Bpp;
|
||||
public Int16 Palette;
|
||||
|
|
Loading…
Add table
Reference in a new issue