[pspplayer commit] r584 - in trunk: Dependencies/Be.Windows.Forms.HexBox Noxa.Emulation.Psp.Player Noxa.Emulation.Ps...

0 views
Skip to first unread message

codesite...@google.com

unread,
Mar 23, 2008, 1:17:34 PM3/23/08
to psppla...@googlegroups.com
Author: ben.vanik
Date: Sun Mar 23 10:16:52 2008
New Revision: 584

Added:
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/RegistersControl.Designer.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/RegistersControl.cs
Removed:
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/RegistersTool.Designer.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/RegistersTool.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/RegistersTool.resx
Modified:
trunk/Dependencies/Be.Windows.Forms.HexBox/HexBox.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Model/RegisterBanks.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeTool.Designer.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeTool.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/MemoryTool.Designer.cs
trunk/Noxa.Emulation.Psp.Player/Noxa.Emulation.Psp.Player.csproj

Log:
simple read only registers display - for now, it's good enough

Modified: trunk/Dependencies/Be.Windows.Forms.HexBox/HexBox.cs
==============================================================================
--- trunk/Dependencies/Be.Windows.Forms.HexBox/HexBox.cs (original)
+++ trunk/Dependencies/Be.Windows.Forms.HexBox/HexBox.cs Sun Mar 23 10:16:52 2008
@@ -2257,6 +2257,8 @@
{
base.OnPaint( e );

+ e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
+
if( _byteProvider == null )
return;

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.cs Sun Mar 23 10:16:52 2008
@@ -33,7 +33,6 @@
public readonly LogTool LogTool;
public readonly MemoryTool MemoryTool;
public readonly ModulesTool ModulesTool;
- public readonly RegistersTool RegistersTool;
public readonly StatisticsTool StatisticsTool;
public readonly StringsTool StringsTool;
public readonly SyscallsTool SyscallsTool;
@@ -68,15 +67,15 @@
this.Tools.Add( this.LogTool );
this.MemoryTool = new MemoryTool( this );
this.Tools.Add( this.MemoryTool );
- this.RegistersTool = new RegistersTool( this );
- this.Tools.Add( this.RegistersTool );
this.StatisticsTool = new StatisticsTool( this );
this.Tools.Add( this.StatisticsTool );
// ...

this.Window.Show();
foreach( DebuggerTool tool in this.Tools )
+ {
tool.Show( this.Window.DockPanel );
+ }

this.Host.Debugger.Activate( this, Environment.MachineName, Environment.UserName, "InprocDebugger 1.0" );

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Model/RegisterBanks.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/Model/RegisterBanks.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Model/RegisterBanks.cs Sun Mar 23 10:16:52 2008
@@ -70,9 +70,9 @@

static class RegisterBanks
{
- public static RegisterBank General;
- public static RegisterBank Fpu;
- public static RegisterBank Vfpu;
+ public readonly static RegisterBank General;
+ public readonly static RegisterBank Fpu;
+ public readonly static RegisterBank Vfpu;

static RegisterBanks()
{

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeTool.Designer.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeTool.Designer.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeTool.Designer.cs Sun Mar 23 10:16:52 2008
@@ -28,53 +28,77 @@
/// </summary>
private void InitializeComponent()
{
- this.disassemblyControl = new Noxa.Emulation.Psp.Player.Debugger.Tools.DisassemblyControl();
+ this.splitContainer = new System.Windows.Forms.SplitContainer();
this.codeView = new Noxa.Emulation.Psp.Player.Debugger.Tools.CodeViewControl();
+ this.registersControl = new Noxa.Emulation.Psp.Player.Debugger.Tools.RegistersControl();
+ this.splitContainer.Panel1.SuspendLayout();
+ this.splitContainer.Panel2.SuspendLayout();
+ this.splitContainer.SuspendLayout();
this.SuspendLayout();
//
- // disassemblyControl
+ // splitContainer
//
- this.disassemblyControl.Anchor = ( ( System.Windows.Forms.AnchorStyles )( ( ( ( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom )
+ this.splitContainer.Anchor = ( ( System.Windows.Forms.AnchorStyles )( ( ( ( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom )
| System.Windows.Forms.AnchorStyles.Left )
| System.Windows.Forms.AnchorStyles.Right ) ) );
- this.disassemblyControl.DisplayHex = true;
- this.disassemblyControl.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
- this.disassemblyControl.FormattingEnabled = true;
- this.disassemblyControl.Location = new System.Drawing.Point( 12, 12 );
- this.disassemblyControl.Name = "disassemblyControl";
- this.disassemblyControl.ScrollAlwaysVisible = true;
- this.disassemblyControl.Size = new System.Drawing.Size( 672, 186 );
- this.disassemblyControl.TabIndex = 0;
+ this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
+ this.splitContainer.IsSplitterFixed = true;
+ this.splitContainer.Location = new System.Drawing.Point( 4, 4 );
+ this.splitContainer.Name = "splitContainer";
+ //
+ // splitContainer.Panel1
+ //
+ this.splitContainer.Panel1.Controls.Add( this.codeView );
+ this.splitContainer.Panel1MinSize = 300;
+ //
+ // splitContainer.Panel2
+ //
+ this.splitContainer.Panel2.Controls.Add( this.registersControl );
+ this.splitContainer.Size = new System.Drawing.Size( 688, 503 );
+ this.splitContainer.SplitterDistance = 600;
+ this.splitContainer.TabIndex = 2;
+ //
+ // codeView
+ //
+ this.codeView.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.codeView.Location = new System.Drawing.Point( 0, 0 );
+ this.codeView.Name = "codeView";
+ this.codeView.Size = new System.Drawing.Size( 600, 503 );
+ this.codeView.TabIndex = 2;
+ this.codeView.Text = "codeView";
+ this.codeView.UseHex = false;
//
- // codeViewControl1
+ // registersControl
//
- this.codeView.Anchor = ( ( System.Windows.Forms.AnchorStyles )( ( ( ( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom )
- | System.Windows.Forms.AnchorStyles.Left )
- | System.Windows.Forms.AnchorStyles.Right ) ) );
- this.codeView.Location = new System.Drawing.Point( 12, 204 );
- this.codeView.Name = "codeViewControl1";
- this.codeView.Size = new System.Drawing.Size( 672, 295 );
- this.codeView.TabIndex = 1;
- this.codeView.Text = "codeView";
+ this.registersControl.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.registersControl.Location = new System.Drawing.Point( 0, 0 );
+ this.registersControl.Name = "registersControl";
+ this.registersControl.Size = new System.Drawing.Size( 84, 503 );
+ this.registersControl.TabIndex = 3;
+ this.registersControl.Text = "registersControl1";
//
// CodeTool
//
this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F );
this.ClientSize = new System.Drawing.Size( 696, 511 );
this.CloseButton = false;
- this.Controls.Add( this.codeView );
- this.Controls.Add( this.disassemblyControl );
+ this.Controls.Add( this.splitContainer );
this.DockAreas = ( ( WeifenLuo.WinFormsUI.Docking.DockAreas )( ( WeifenLuo.WinFormsUI.Docking.DockAreas.Float | WeifenLuo.WinFormsUI.Docking.DockAreas.Document ) ) );
this.Name = "CodeTool";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Document;
this.TabText = "Disassembly";
+ this.splitContainer.Panel1.ResumeLayout( false );
+ this.splitContainer.Panel2.ResumeLayout( false );
+ this.splitContainer.ResumeLayout( false );
this.ResumeLayout( false );

}

#endregion

- private DisassemblyControl disassemblyControl;
+ private System.Windows.Forms.SplitContainer splitContainer;
private CodeViewControl codeView;
+ private RegistersControl registersControl;
+
}
}

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeTool.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeTool.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeTool.cs Sun Mar 23 10:16:52 2008
@@ -33,12 +33,10 @@
Bitmap image = Properties.Resources.DisassemblyIcon as Bitmap;
this.Icon = Icon.FromHandle( image.GetHicon() );

- this.disassemblyControl.Debugger = debugger;
- //this.disassemblyControl.RegisterValueChanged += new EventHandler( disassemblyControl_RegisterValueChanged );
-
this.Disable();

this.codeView.Setup( debugger );
+ this.registersControl.Setup( debugger );

// TODO: bind to button
this.codeView.UseHex = true;
@@ -47,69 +45,22 @@
public void InvalidateAll()
{
this.codeView.InvalidateAll();
+ this.registersControl.Invalidate();
}

public void Disable()
{
- this.disassemblyControl.Enabled = false;
- this.disassemblyControl.ClearAddress();
this.codeView.Enabled = false;
+ this.registersControl.Enabled = false;
+ this.registersControl.Invalidate();
}

public void SetAddress( uint address, bool isCurrentStatement )
{
this.codeView.Enabled = true;
this.codeView.SetAddress( address );
-
-
- this.disassemblyControl.Enabled = true;
-
- IDebugDatabase db = this.Debugger.DebugHost.Database;
- Debug.Assert( db != null );
-
- Method method = db.FindSymbol( address ) as Method;
- Debug.Assert( method != null );
-
- if( ( this.disassemblyControl.Enabled == true ) &&
- ( this.disassemblyControl.MethodBody != null ) &&
- ( this.disassemblyControl.MethodBody.Address == method.Address ) )
- {
- if( isCurrentStatement == true )
- this.disassemblyControl.SetCurrentAddress( address );
- else
- this.disassemblyControl.SetAddress( address );
- }
- else
- {
- MethodBody methodBody = this.BuildMethodBody( method );
- Debug.Assert( methodBody != null );
-
- this.disassemblyControl.SetMethod( methodBody );
- if( isCurrentStatement == true )
- this.disassemblyControl.SetCurrentAddress( address );
- else
- this.disassemblyControl.SetAddress( address );
-
- //this.ShowRegisters( this.CurrentRegisterSet );
- }
- }
-
- private MethodBody BuildMethodBody( Method method )
- {
- Debug.Assert( this.Debugger.DebugHost.CpuHook != null );
- uint[] codes = this.Debugger.DebugHost.CpuHook.GetMethodBody( method );
-
- uint instrAddress = method.Address;
- List<Instruction> instrs = new List<Instruction>( ( int )method.Length / 4 );
- for( int n = 0; n < codes.Length; n++ )
- {
- Instruction instr = new Instruction( instrAddress, codes[ n ] );
- instrs.Add( instr );
- instrAddress += 4;
- }
- MethodBody methodBody = new MethodBody( method.Address, 4 * ( uint )method.Length, instrs.ToArray() );
-
- return methodBody;
+ this.codeView.Focus();
+ this.registersControl.Invalidate();
}

public void ShowNextStatement()
@@ -221,56 +172,5 @@
//}

#endregion
-
- //private void TestData()
- //{
- // uint[] codes = new uint[]{
- // 0x49170001,
- // 0xde00083f,
- // 0x10400004,
- // 0xcba80002,
- // 0xd0070068,
- // 0x64484828,
- // 0xdc08f096,
- // 0xd0008484,
- // 0xdc07f918,
- // 0xd0008585,
- // 0x64482808,
- // 0xdc00f004,
- // 0xd0008686,
- // 0xdc00f001,
- // 0xd0008787,
- // 0xf188a489,
- // 0xf189a08a,
- // 0xe88a0000,
- // 0xe88a0005,
- // 0xe88a000a,
- // 0x03e00008,
- // 0x27bd0010,
- // 0x00801021,
- // 0x44086000,
- // 0x48e80001,
- // 0xc8a00000,
- // 0xc8a00005,
- // 0xc8a0000a,
- // 0x65018000,
- // };
-
- // uint address = 0x08010000;
- // List<Instruction> instrs = new List<Instruction>();
- // for( int m = 0; m < 10; m++ )
- // {
- // for( int n = 0; n < codes.Length; n++ )
- // {
- // Instruction instr = new Instruction( address, codes[ n ] );
- // instrs.Add( instr );
-
- // address += 4;
- // }
- // }
- // MethodBody b = new MethodBody( address, 4 * ( uint )instrs.Count, instrs.ToArray() );
-
- // this.disassemblyControl.SetMethod( b );
- //}
}
}

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/MemoryTool.Designer.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/MemoryTool.Designer.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/MemoryTool.Designer.cs Sun Mar 23 10:16:52 2008
@@ -42,11 +42,12 @@
this.hexBox.Font = new System.Drawing.Font( "Courier New", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ( ( byte )( 0 ) ) );
this.hexBox.LineInfoForeColor = System.Drawing.Color.Empty;
this.hexBox.LineInfoVisible = true;
- this.hexBox.Location = new System.Drawing.Point( 12, 33 );
+ this.hexBox.Location = new System.Drawing.Point( 4, 33 );
this.hexBox.Name = "hexBox";
this.hexBox.SelectionBackColor = System.Drawing.SystemColors.Highlight;
this.hexBox.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- this.hexBox.Size = new System.Drawing.Size( 489, 540 );
+ this.hexBox.ShadowSelectionColor = System.Drawing.Color.FromArgb( ( ( int )( ( ( byte )( 100 ) ) ) ), ( ( int )( ( ( byte )( 60 ) ) ) ), ( ( int )( ( ( byte )( 188 ) ) ) ), ( ( int )( ( ( byte )( 255 ) ) ) ) );
+ this.hexBox.Size = new System.Drawing.Size( 505, 548 );
this.hexBox.StringViewVisible = true;
this.hexBox.TabIndex = 0;
this.hexBox.UseFixedBytesPerLine = true;

Added: trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/RegistersControl.Designer.cs
==============================================================================
--- (empty file)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/RegistersControl.Designer.cs Sun Mar 23 10:16:52 2008
@@ -0,0 +1,36 @@
+namespace Noxa.Emulation.Psp.Player.Debugger.Tools
+{
+ partial class RegistersControl
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing && ( components != null ) )
+ {
+ components.Dispose();
+ }
+ base.Dispose( disposing );
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ components = new System.ComponentModel.Container();
+ }
+
+ #endregion
+ }
+}

Added: trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/RegistersControl.cs
==============================================================================
--- (empty file)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/RegistersControl.cs Sun Mar 23 10:16:52 2008
@@ -0,0 +1,221 @@
+// ----------------------------------------------------------------------------
+// PSP Player Emulation Suite
+// Copyright (C) 2008 Ben Vanik (noxa)
+// Licensed under the LGPL - see License.txt in the project root for details
+// ----------------------------------------------------------------------------
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Windows.Forms.VisualStyles;
+using Noxa.Emulation.Psp.Debugging.DebugModel;
+using Noxa.Emulation.Psp.Player.Debugger.Model;
+
+namespace Noxa.Emulation.Psp.Player.Debugger.Tools
+{
+ partial class RegistersControl : Control
+ {
+ private InprocDebugger _debugger;
+
+ public RegistersControl()
+ {
+ this.InitializeComponent();
+
+ this.SetStyle( ControlStyles.UserPaint, true );
+ this.SetStyle( ControlStyles.AllPaintingInWmPaint, true );
+ this.SetStyle( ControlStyles.ResizeRedraw, true );
+ this.SetStyle( ControlStyles.Opaque, true );
+ this.SetStyle( ControlStyles.OptimizedDoubleBuffer, true );
+
+ this.SetupGraphics();
+ }
+
+ public void Setup( InprocDebugger debugger )
+ {
+ _debugger = debugger;
+ }
+
+ #region Painting
+
+ internal Font _font = new Font( "Courier New", 8.0f, FontStyle.Regular );
+ //internal Font _font = new Font( "Consolas", 8.0f, FontStyle.Bold );
+ internal Brush _labelFontBrush = Brushes.Blue;
+ internal Brush _valueFontBrush = SystemBrushes.ControlText;
+ internal Brush _disabledFontBrush = SystemBrushes.GrayText;
+
+ private StringFormat _stringFormat;
+ private SizeF _charSize;
+ private int _lineSpacing;
+ private int _lineHeight;
+
+ private Pen _vertGridPen;
+ private Brush _labelBrush;
+ private Brush _valueBrush;
+ private Brush _disabledBrush;
+
+ private int _labelWidth = 100;
+
+ private void SetupGraphics()
+ {
+ using( Graphics g = Graphics.FromHwnd( this.Handle ) )
+ {
+ g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
+ _charSize = g.MeasureString( "00000000", _font, 100, _stringFormat );
+ }
+ _charSize.Width /= 8.0f;
+
+ _stringFormat = new StringFormat( StringFormat.GenericTypographic );
+ _stringFormat.FormatFlags = StringFormatFlags.MeasureTrailingSpaces;
+ _lineSpacing = 0;
+ _lineHeight = ( int )( _charSize.Height + _lineSpacing + 0.5f );
+
+ _vertGridPen = SystemPens.ControlLight;
+
+ Color c = SystemColors.ControlLight;
+ Color lightest = Color.FromArgb(
+ Math.Min( c.R + 20, 255 ),
+ Math.Min( c.G + 20, 255 ),
+ Math.Min( c.B + 20, 255 ) );
+ Color light = Color.FromArgb(
+ Math.Min( c.R + 25, 255 ),
+ Math.Min( c.G + 25, 255 ),
+ Math.Min( c.B + 25, 255 ) );
+ _labelBrush = new SolidBrush( light );
+ _valueBrush = SystemBrushes.Window;
+ _disabledBrush = new SolidBrush( light );
+
+ _labelWidth = ( int )( _charSize.Width * 3 + 2 + 0.5f );
+ }
+
+ protected override void OnPaintBackground( PaintEventArgs e )
+ {
+ Brush backBrush = ( this.Enabled == true ) ? _valueBrush : _disabledBrush;
+
+ if( TextBoxRenderer.IsSupported )
+ {
+ VisualStyleElement state = ( this.Enabled == true ) ? VisualStyleElement.TextBox.TextEdit.Normal : VisualStyleElement.TextBox.TextEdit.Disabled;
+ VisualStyleRenderer vsr = new VisualStyleRenderer( state );
+ vsr.DrawBackground( e.Graphics, this.ClientRectangle );
+
+ Rectangle rectContent = vsr.GetBackgroundContentRectangle( e.Graphics, this.ClientRectangle );
+ e.Graphics.FillRectangle( backBrush, rectContent );
+ this.DrawShared( e );
+ }
+ else
+ {
+ e.Graphics.FillRectangle( backBrush, this.ClientRectangle );
+ this.DrawShared( e );
+
+ ControlPaint.DrawBorder3D( e.Graphics, this.ClientRectangle, Border3DStyle.Sunken );
+ }
+ }
+
+ private void DrawShared( PaintEventArgs e )
+ {
+ // Label
+ e.Graphics.FillRectangle( _labelBrush, 2, 2, _labelWidth, this.ClientRectangle.Height - 4 );
+ e.Graphics.DrawLine( _vertGridPen,
+ 2 + _labelWidth, 2,
+ 2 + _labelWidth, this.ClientRectangle.Height - 3 );
+ }
+
+ protected override void OnPaint( PaintEventArgs e )
+ {
+ this.OnPaintBackground( e );
+ if( _debugger == null )
+ return;
+
+ e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
+
+ int x = 2;
+ int y = 2;
+
+ Brush labelBrush = ( this.Enabled == true ) ? _labelFontBrush : _disabledFontBrush;
+ Brush valueBrush = ( this.Enabled == true ) ? _valueFontBrush : _disabledFontBrush;
+
+ CoreState state = _debugger.DebugHost.CpuHook.GetCoreState( 0 );
+
+ // PC
+ e.Graphics.DrawString( "PC", _font, labelBrush, x, y, _stringFormat );
+ e.Graphics.DrawString( state.ProgramCounter.ToString( "X8" ), _font, valueBrush, x + _labelWidth + 3, y, _stringFormat );
+ y += _lineHeight;
+
+ DrawMode mode = DrawMode.General;
+ switch( mode )
+ {
+ case DrawMode.General:
+ {
+ RegisterBank bank = RegisterBanks.General;
+ for( int n = 1; n < 32; n++ )
+ {
+ Register reg = bank.Registers[ n ];
+
+ // Label
+ e.Graphics.DrawString( reg.Name, _font, labelBrush, x, y, _stringFormat );
+
+ // Value
+ string value = state.GeneralRegisters[ n ].ToString( "X8" );
+ e.Graphics.DrawString( value, _font, valueBrush, x + _labelWidth + 3, y, _stringFormat );
+
+ y += _lineHeight;
+ }
+
+ // LO
+ e.Graphics.DrawString( "$lo", _font, labelBrush, x, y, _stringFormat );
+ e.Graphics.DrawString( state.Lo.ToString( "X8" ), _font, valueBrush, x + _labelWidth + 3, y, _stringFormat );
+ y += _lineHeight;
+
+ // HI
+ e.Graphics.DrawString( "$hi", _font, labelBrush, x, y, _stringFormat );
+ e.Graphics.DrawString( state.Hi.ToString( "X8" ), _font, valueBrush, x + _labelWidth + 3, y, _stringFormat );
+ y += _lineHeight;
+ }
+ break;
+ case DrawMode.Fpu:
+ {
+ // Control register
+ e.Graphics.DrawString( "fcr", _font, labelBrush, x, y, _stringFormat );
+ e.Graphics.DrawString( state.FpuControlRegister.ToString( "X8" ), _font, valueBrush, x + _labelWidth + 3, y, _stringFormat );
+ y += _lineHeight;
+
+ // Condition bit
+ e.Graphics.DrawString( "fc", _font, labelBrush, x, y, _stringFormat );
+ e.Graphics.DrawString( state.FpuConditionBit.ToString(), _font, valueBrush, x + _labelWidth + 3, y, _stringFormat );
+ y += _lineHeight;
+
+ // Registers
+ RegisterBank bank = RegisterBanks.Fpu;
+ for( int n = 0; n < 32; n++ )
+ {
+ Register reg = bank.Registers[ n ];
+
+ // Label
+ e.Graphics.DrawString( reg.Name, _font, labelBrush, x, y, _stringFormat );
+
+ // Value
+ string value = state.FpuRegisters[ n ].ToString();
+ e.Graphics.DrawString( value, _font, valueBrush, x + _labelWidth + 3, y, _stringFormat );
+
+ y += _lineHeight;
+ }
+ }
+ break;
+ case DrawMode.Vfpu:
+ break;
+ }
+ }
+
+ enum DrawMode
+ {
+ General,
+ Fpu,
+ Vfpu,
+ }
+
+ #endregion
+ }
+}

Modified: trunk/Noxa.Emulation.Psp.Player/Noxa.Emulation.Psp.Player.csproj
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Noxa.Emulation.Psp.Player.csproj (original)
+++ trunk/Noxa.Emulation.Psp.Player/Noxa.Emulation.Psp.Player.csproj Sun Mar 23 10:16:52 2008
@@ -176,11 +176,11 @@
<Compile Include="Debugger\Tools\ModulesTool.Designer.cs">
<DependentUpon>ModulesTool.cs</DependentUpon>
</Compile>
- <Compile Include="Debugger\Tools\RegistersTool.cs">
- <SubType>Form</SubType>
+ <Compile Include="Debugger\Tools\RegistersControl.cs">
+ <SubType>Component</SubType>
</Compile>
- <Compile Include="Debugger\Tools\RegistersTool.Designer.cs">
- <DependentUpon>RegistersTool.cs</DependentUpon>
+ <Compile Include="Debugger\Tools\RegistersControl.Designer.cs">
+ <DependentUpon>RegistersControl.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\Tools\StatisticsTool.cs">
<SubType>Form</SubType>
@@ -293,10 +293,6 @@
</EmbeddedResource>
<EmbeddedResource Include="Debugger\Tools\MemoryTool.resx">
<DependentUpon>MemoryTool.cs</DependentUpon>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- <EmbeddedResource Include="Debugger\Tools\RegistersTool.resx">
- <DependentUpon>RegistersTool.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\Tools\StatisticsTool.resx">

Reply all
Reply to author
Forward
0 new messages