[pspplayer commit] r608 - in trunk: . Noxa.Emulation.Psp.Bios.ManagedHLE Noxa.Emulation.Psp.Bios.ManagedHLE/Modules ...

1 view
Skip to first unread message

codesite...@google.com

unread,
Mar 30, 2008, 10:45:57 AM3/30/08
to psppla...@googlegroups.com
Author: ben.vanik
Date: Sun Mar 30 07:45:22 2008
New Revision: 608

Modified:
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/BiosDebugHook.cs
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Loader.cs
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/IoFileMgrForUser.Directories.cs
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/IoFileMgrForUser.Files.cs
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/IoFileMgrForUser.cs
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ModuleMgrForUser.cs
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ThreadManForUser.MsgBoxes.cs
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ThreadManForUser.MsgPipes.cs
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ThreadManForUser.Threads.cs
trunk/Noxa.Emulation.Psp.Cpu.R4000Ultra/R4000Generator_Special.cpp
trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/DelayThreadDialog.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/JumpToAddressDialog.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/JumpToMethodDialog.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/RenameDialog.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/LogControl.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/LogTool.cs
trunk/Noxa.Emulation.sln

Log:
Made thread ID prints consistently hex
Log now displays thread IDs before each line of output - this makes it
very easy to track what's going on

Modified: trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/BiosDebugHook.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/BiosDebugHook.cs (original)
+++ trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/BiosDebugHook.cs Sun Mar
30 07:45:22 2008
@@ -30,7 +30,10 @@
get
{
Kernel kernel = this.Bios._kernel;
- return ( uint )kernel.ActiveThread.UID;
+ if( kernel.ActiveThread == null )
+ return 0;
+ else
+ return ( uint )kernel.ActiveThread.UID;
}
}


Modified: trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Loader.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Loader.cs (original)
+++ trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Loader.cs Sun Mar 30
07:45:22 2008
@@ -923,7 +923,7 @@
// Setup handler so that we get the callback when the thread
ends and we can kill it
cpu.SetContextSafetyCallback( thread.ContextID, new
ContextSafetyDelegate( this.KmoduleThreadEnd ), ( int )thread.UID );

- Log.WriteLine( Verbosity.Verbose, Feature.Loader, "starting
kmodule loading thread with UID {0}", thread.UID );
+ Log.WriteLine( Verbosity.Verbose, Feature.Loader, "starting
kmodule loading thread with UID {0:X}", thread.UID );

// Schedule so that our thread runs
kernel.Schedule();
@@ -1015,7 +1015,7 @@
KThread thread = kernel.GetHandle<KThread>( ( uint )state );
if( thread != null )
{
- Log.WriteLine( Verbosity.Verbose, Feature.Loader, "killing kmodule
loading thread with UID {0}", thread.UID );
+ Log.WriteLine( Verbosity.Verbose, Feature.Loader, "killing kmodule
loading thread with UID {0:X}", thread.UID );

thread.Exit( 0 );
kernel.RemoveHandle( thread.UID );

Modified: trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/IoFileMgrForUser.Directories.cs
==============================================================================
---
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/IoFileMgrForUser.Directories.cs (original)
+++
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/IoFileMgrForUser.Directories.cs
Sun Mar 30 07:45:22 2008
@@ -40,7 +40,7 @@
handle.FolderOffset = -2;
_kernel.AddHandle( handle );

- Log.WriteLine( Verbosity.Verbose, Feature.Bios, "sceIoDopen: opened
{0} with ID {1}", path, handle.UID );
+ Log.WriteLine( Verbosity.Verbose, Feature.Bios, "sceIoDopen: opened
{0} with ID {1:X}", path, handle.UID );

return ( int )handle.UID;
}
@@ -54,7 +54,7 @@
KFile handle = _kernel.GetHandle<KFile>( fd );
if( handle == null )
{
- Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoDread: kernel
dir handle {0} not found", fd );
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoDread: kernel
dir handle {0:X} not found", fd );
return -1;
}


Modified: trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/IoFileMgrForUser.Files.cs
==============================================================================
---
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/IoFileMgrForUser.Files.cs (original)
+++
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/IoFileMgrForUser.Files.cs
Sun Mar 30 07:45:22 2008
@@ -31,7 +31,7 @@
KFile handle = _kernel.GetHandle<KFile>( fd );
if( handle == null )
{
- Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoClose: kernel
file handle not found: {0}", fd );
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoClose: kernel
file handle not found: {0:X}", fd );
return -1;
}

@@ -55,7 +55,7 @@
KFile handle = _kernel.GetHandle<KFile>( fd );
if( handle == null )
{
- Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoCloseAsync:
kernel file handle not found: {0}", fd );
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoCloseAsync:
kernel file handle not found: {0:X}", fd );
return -1;
}

@@ -71,99 +71,99 @@
return 0;
}

- public int realIoOpen(int fileName, int flags, int mode, bool async)
+ public int realIoOpen( int fileName, int flags, int mode, bool async )
{
- string path = _kernel.ReadString((uint)fileName);
- if (string.IsNullOrEmpty(path) == true)
+ string path = _kernel.ReadString( ( uint )fileName );
+ if( string.IsNullOrEmpty( path ) == true )
return -1;
- IMediaItem item = _kernel.FindPath(path);
- if (item is IMediaFolder)
+ IMediaItem item = _kernel.FindPath( path );
+ if( item is IMediaFolder )
{
// Block access?
- Debug.Assert(item.Device is IUmdDevice);
- IUmdDevice umd = (IUmdDevice)item.Device;
+ Debug.Assert( item.Device is IUmdDevice );
+ IUmdDevice umd = ( IUmdDevice )item.Device;
Stream stream = umd.OpenImageStream();
- if (stream == null)
+ if( stream == null )
{
- Log.WriteLine(Verbosity.Normal, Feature.Bios, "sceIoOpen: could
not open image stream '{0}'", path);
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoOpen: could
not open image stream '{0}'", path );

- if (async == true)
+ if( async == true )
{
- KFile fakehandle = new KFile(_kernel, false);
+ KFile fakehandle = new KFile( _kernel, false );
fakehandle.Result = 0x80010002;
fakehandle.PendingClose = true;
- _kernel.AddHandle(fakehandle);
- return (int)fakehandle.UID;
+ _kernel.AddHandle( fakehandle );
+ return ( int )fakehandle.UID;
}

return -1;
}

- KDevice dev = _kernel.FindDevice(umd);
- Debug.Assert(dev != null);
+ KDevice dev = _kernel.FindDevice( umd );
+ Debug.Assert( dev != null );

- KFile handle = new KFile(_kernel, dev, item, stream);
+ KFile handle = new KFile( _kernel, dev, item, stream );
handle.IsBlockAccess = true;
- _kernel.AddHandle(handle);
+ _kernel.AddHandle( handle );

handle.Result = handle.UID;

- Log.WriteLine(Verbosity.Verbose, Feature.Bios, "sceIoOpen: opened
block access on {0} with ID {1}", path, handle.UID);
+ Log.WriteLine( Verbosity.Verbose, Feature.Bios, "sceIoOpen: opened
block access on {0} with ID {1:X}", path, handle.UID );

- return (int)handle.UID;
+ return ( int )handle.UID;
}
else
{
- IMediaFile file = (IMediaFile)item;
- if (file == null)
+ IMediaFile file = ( IMediaFile )item;
+ if( file == null )
{
// Create if needed
- if ((flags & 0x0200) != 0)
+ if( ( flags & 0x0200 ) != 0 )
{
string newName;
IMediaFolder parent;
- if (path.IndexOf('/') >= 0)
+ if( path.IndexOf( '/' ) >= 0 )
{
- string parentPath = path.Substring(0, path.LastIndexOf('/'));
- newName = path.Substring(path.LastIndexOf('/') + 1);
- parent = (IMediaFolder)_kernel.FindPath(parentPath);
+ string parentPath = path.Substring( 0, path.LastIndexOf( '/' ) );
+ newName = path.Substring( path.LastIndexOf( '/' ) + 1 );
+ parent = ( IMediaFolder )_kernel.FindPath( parentPath );
}
else
{
newName = path;
parent = _kernel.CurrentPath;
}
- if (parent == null)
+ if( parent == null )
{
- Log.WriteLine(Verbosity.Normal, Feature.Bios, "sceIoOpen: could
not find parent to create file '{0}' in on open", path);
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoOpen:
could not find parent to create file '{0}' in on open", path );

- if (async == true)
+ if( async == true )
{
- KFile fakehandle = new KFile(_kernel, false);
+ KFile fakehandle = new KFile( _kernel, false );
fakehandle.Result = 0x80010002;
fakehandle.PendingClose = true;
- _kernel.AddHandle(fakehandle);
- return (int)fakehandle.UID;
+ _kernel.AddHandle( fakehandle );
+ return ( int )fakehandle.UID;
}

return -1;
}
- file = parent.CreateFile(newName);
+ file = parent.CreateFile( newName );
}
else
{
- Log.WriteLine(Verbosity.Normal, Feature.Bios, "sceIoOpen: could
not find path '{0}'", path);
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoOpen: could
not find path '{0}'", path );

- if (async == true)
+ if( async == true )
{
- KFile fakehandle = new KFile(_kernel, false);
+ KFile fakehandle = new KFile( _kernel, false );
fakehandle.Result = 0x80010002;
fakehandle.PendingClose = true;
- _kernel.AddHandle(fakehandle);
- return (int)fakehandle.UID;
+ _kernel.AddHandle( fakehandle );
+ return ( int )fakehandle.UID;
}

- return unchecked((int)0x8002012f);
+ return unchecked( ( int )0x8002012f );
}
}
/*
@@ -178,53 +178,53 @@
#define PSP_O_EXCL 0x0800
#define PSP_O_NOWAIT 0x8000*/
MediaFileMode fileMode = MediaFileMode.Normal;
- if ((flags & 0x0100) == 0x0100)
+ if( ( flags & 0x0100 ) == 0x0100 )
fileMode = MediaFileMode.Append;
- if ((flags & 0x0400) == 0x0400)
+ if( ( flags & 0x0400 ) == 0x0400 )
fileMode = MediaFileMode.Truncate;
MediaFileAccess fileAccess = MediaFileAccess.ReadWrite;
- if ((flags & 0x0001) == 0x0001)
+ if( ( flags & 0x0001 ) == 0x0001 )
fileAccess = MediaFileAccess.Read;
- if ((flags & 0x0002) == 0x0002)
+ if( ( flags & 0x0002 ) == 0x0002 )
fileAccess = MediaFileAccess.Write;
- if ((flags & 0x0003) == 0x0003)
+ if( ( flags & 0x0003 ) == 0x0003 )
fileAccess = MediaFileAccess.ReadWrite;

- if ((flags & 0x0800) != 0)
+ if( ( flags & 0x0800 ) != 0 )
{
// Exclusive O_EXCL
//int x = 1;
}
- if ((flags & 0x8000) != 0)
+ if( ( flags & 0x8000 ) != 0 )
{
// Non-blocking O_NOWAIT
//int x = 1;
}
- if ((flags & 0x0004) != 0)
+ if( ( flags & 0x0004 ) != 0 )
{
// ? O_NBLOCK
//int x = 1;
}

- Stream stream = file.Open(fileMode, fileAccess);
- if (stream == null)
+ Stream stream = file.Open( fileMode, fileAccess );
+ if( stream == null )
{
- Log.WriteLine(Verbosity.Normal, Feature.Bios, "sceIoOpen: could
not open stream on file '{0}' for mode {1} access {2}", path, fileMode, fileAccess);
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoOpen: could
not open stream on file '{0}' for mode {1} access {2}", path, fileMode,
fileAccess );
return -1;
}

IMediaDevice device = file.Device;
- KDevice dev = _kernel.FindDevice(file.Device);
- Debug.Assert(dev != null);
+ KDevice dev = _kernel.FindDevice( file.Device );
+ Debug.Assert( dev != null );

- KFile handle = new KFile(_kernel, dev, file, stream);
- _kernel.AddHandle(handle);
+ KFile handle = new KFile( _kernel, dev, file, stream );
+ _kernel.AddHandle( handle );

handle.Result = handle.UID;

- Log.WriteLine(Verbosity.Verbose, Feature.Bios, "sceIoOpen: opened
file {0} with ID {1}", path, handle.UID);
+ Log.WriteLine( Verbosity.Verbose, Feature.Bios, "sceIoOpen: opened
file {0} with ID {1:X}", path, handle.UID );

- return (int)handle.UID;
+ return ( int )handle.UID;
}
}

@@ -234,7 +234,7 @@
// SDK declaration: SceUID sceIoOpen(const char *file, int flags,
SceMode mode);
public int sceIoOpen( int fileName, int flags, int mode )
{
- return realIoOpen(fileName, flags, mode, false);
+ return realIoOpen( fileName, flags, mode, false );
}

[Stateless]
@@ -243,7 +243,7 @@
// SDK declaration: SceUID sceIoOpenAsync(const char *file, int
flags, SceMode mode);
public int sceIoOpenAsync( int file, int flags, int mode )
{
- return realIoOpen(file, flags, mode, true);
+ return realIoOpen( file, flags, mode, true );
}

#if DONTTRACE
@@ -263,7 +263,7 @@
KFile handle = _kernel.GetHandle<KFile>( fd );
if( handle == null )
{
- Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoRead: kernel
file handle not found: {0}", fd );
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoRead: kernel
file handle not found: {0:X}", fd );
return -1;
}

@@ -314,7 +314,7 @@
KFile handle = _kernel.GetHandle<KFile>( fd );
if( handle == null )
{
- Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoWrite: kernel
file handle not found: {0}", fd );
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoWrite: kernel
file handle not found: {0:X}", fd );
return -1;
}

@@ -365,7 +365,7 @@
KFile handle = _kernel.GetHandle<KFile>( fd );
if( handle == null )
{
- Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoLseek: kernel
file handle not found: {0}", fd );
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoLseek: kernel
file handle not found: {0:X}", fd );
return -1;
}

@@ -420,7 +420,7 @@
KFile handle = _kernel.GetHandle<KFile>( fd );
if( handle == null )
{
- Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoLseek32:
kernel file handle not found: {0}", fd );
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoLseek32:
kernel file handle not found: {0:X}", fd );
return -1;
}


Modified: trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/IoFileMgrForUser.cs
==============================================================================
---
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/IoFileMgrForUser.cs (original)
+++
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/IoFileMgrForUser.cs
Sun Mar 30 07:45:22 2008
@@ -81,7 +81,7 @@

if (handle.IsValid == false)
{
- Log.WriteLine(Verbosity.Normal, Feature.Bios, "sceIoPollAsync:
kernel file handle not valid -> {0}, {1:X8}", handle.UID, handle.Result);
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceIoPollAsync:
kernel file handle not valid -> {0:X}, {1:X8}", handle.UID,
handle.Result );
return 0;
}


Modified: trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ModuleMgrForUser.cs
==============================================================================
---
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ModuleMgrForUser.cs (original)
+++
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ModuleMgrForUser.cs
Sun Mar 30 07:45:22 2008
@@ -194,7 +194,7 @@
// Setup handler so that we get the callback when the thread ends
and we can kill it
_kernel.Cpu.SetContextSafetyCallback( thread.ContextID, new
ContextSafetyDelegate( this.KmoduleStartThreadEnd ), ( int )thread.UID );

- Log.WriteLine( Verbosity.Verbose, Feature.Bios, "ModuleMgrForUser:
starting module_start thread with UID {0} for module {1}", thread.UID,
module.Name );
+ Log.WriteLine( Verbosity.Verbose, Feature.Bios, "ModuleMgrForUser:
starting module_start thread with UID {0:X} for module {1}",
thread.UID, module.Name );

// Schedule so that our thread runs
_kernel.Schedule();
@@ -207,7 +207,7 @@
Debug.Assert( thread != null );
if( thread != null )
{
- Log.WriteLine( Verbosity.Verbose, Feature.Bios, "ModuleMgrForUser:
killing module_start thread with UID {0}", thread.UID );
+ Log.WriteLine( Verbosity.Verbose, Feature.Bios, "ModuleMgrForUser:
killing module_start thread with UID {0:X}", thread.UID );

thread.Exit( 0 );
_kernel.RemoveHandle( thread.UID );
@@ -238,7 +238,7 @@
// Setup handler so that we get the callback when the thread ends
and we can kill it
_kernel.Cpu.SetContextSafetyCallback( thread.ContextID, new
ContextSafetyDelegate( this.KmoduleStopThreadEnd ), ( int )thread.UID );

- Log.WriteLine( Verbosity.Verbose, Feature.Bios, "ModuleMgrForUser:
starting module_stop thread with UID {0} for module {1}", thread.UID,
module.Name );
+ Log.WriteLine( Verbosity.Verbose, Feature.Bios, "ModuleMgrForUser:
starting module_stop thread with UID {0:X} for module {1}", thread.UID,
module.Name );

// Schedule so that our thread runs
_kernel.Schedule();
@@ -251,7 +251,7 @@
Debug.Assert( thread != null );
if( thread != null )
{
- Log.WriteLine( Verbosity.Verbose, Feature.Bios, "ModuleMgrForUser:
killing module_stop thread with UID {0}", thread.UID );
+ Log.WriteLine( Verbosity.Verbose, Feature.Bios, "ModuleMgrForUser:
killing module_stop thread with UID {0:X}", thread.UID );

thread.Exit( 0 );
_kernel.RemoveHandle( thread.UID );

Modified: trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ThreadManForUser.MsgBoxes.cs
==============================================================================
---
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ThreadManForUser.MsgBoxes.cs (original)
+++
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ThreadManForUser.MsgBoxes.cs
Sun Mar 30 07:45:22 2008
@@ -42,7 +42,7 @@
KMessageBox handle = new KMessageBox(_kernel, name, attr );
_kernel.AddHandle(handle);

- Log.WriteLine(Verbosity.Normal, Feature.Bios, "sceKernelCreateMbx:
opened box {0} with ID {1}", name, handle.UID);
+ Log.WriteLine( Verbosity.Normal, Feature.Bios, "sceKernelCreateMbx:
opened box {0} with ID {1:X}", name, handle.UID );
return (int)handle.UID;
}


Modified: trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ThreadManForUser.MsgPipes.cs
==============================================================================
---
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ThreadManForUser.MsgPipes.cs (original)
+++
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ThreadManForUser.MsgPipes.cs
Sun Mar 30 07:45:22 2008
@@ -38,7 +38,7 @@
KMessagePipe handle = new KMessagePipe( _kernel, partition, name,
size );
_kernel.AddHandle( handle );

- Log.WriteLine( Verbosity.Normal,
Feature.Bios, "sceKernelCreateMsgPipe: opened pipe {0} with ID {1}, for
partition {2}", name, handle.UID, part );
+ Log.WriteLine( Verbosity.Normal,
Feature.Bios, "sceKernelCreateMsgPipe: opened pipe {0} with ID {1}, for
partition {2:X}", name, handle.UID, part );

return ( int )handle.UID;
}

Modified: trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ThreadManForUser.Threads.cs
==============================================================================
---
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ThreadManForUser.Threads.cs (original)
+++
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Modules/ThreadManForUser.Threads.cs
Sun Mar 30 07:45:22 2008
@@ -92,7 +92,7 @@
// Option unused?
Debug.Assert( option == 0 );

- Log.WriteLine( Verbosity.Normal,
Feature.Bios, "sceKernelCreateThread: created thread {0} {1} with entry
{2:X8}", thread.UID, thread.Name, thread.EntryAddress );
+ Log.WriteLine( Verbosity.Normal,
Feature.Bios, "sceKernelCreateThread: created thread {0:X} {1} with
entry {2:X8}", thread.UID, thread.Name, thread.EntryAddress );

return ( int )thread.UID;
}
@@ -115,11 +115,11 @@
}
if( thread.State != KThreadState.Dead )
{
- Log.WriteLine( Verbosity.Critical,
Feature.Bios, "sceKernelDeleteThread: thread {0} {1} is {2} - it must
be dead to delete it properly!", thread.UID, thread.Name,
thread.StackBlock );
+ Log.WriteLine( Verbosity.Critical,
Feature.Bios, "sceKernelDeleteThread: thread {0:X} {1} is {2} - it must
be dead to delete it properly!", thread.UID, thread.Name,
thread.StackBlock );
return 0;
}

- Log.WriteLine( Verbosity.Normal,
Feature.Bios, "sceKernelDeleteThread: deleting thread {0} {1}",
thread.UID, thread.Name );
+ Log.WriteLine( Verbosity.Normal,
Feature.Bios, "sceKernelDeleteThread: deleting thread {0:X} {1}",
thread.UID, thread.Name );

thread.Delete();
_kernel.RemoveHandle( thread.UID );
@@ -136,7 +136,7 @@
if( thread == null )
return -1;

- Log.WriteLine( Verbosity.Normal,
Feature.Bios, "sceKernelStartThread: starting thread {0} {1}",
thread.UID, thread.Name );
+ Log.WriteLine( Verbosity.Normal,
Feature.Bios, "sceKernelStartThread: starting thread {0:X} {1}",
thread.UID, thread.Name );

thread.Start( ( uint )arglen, ( uint )argp );
_kernel.Schedule();

Modified: trunk/Noxa.Emulation.Psp.Cpu.R4000Ultra/R4000Generator_Special.cpp
==============================================================================
--- trunk/Noxa.Emulation.Psp.Cpu.R4000Ultra/R4000Generator_Special.cpp (original)
+++ trunk/Noxa.Emulation.Psp.Cpu.R4000Ultra/R4000Generator_Special.cpp
Sun Mar 30 07:45:22 2008
@@ -99,13 +99,12 @@
args = "";
break;
}
- String^ log = String::Format( "{5}{0}::{1}({2}) from 0x{3:X8}{4} in {6}",
+ String^ log = String::Format( "{5}{0}::{1}({2}) from 0x{3:X8}{4}",
( function->Module != nullptr ) ? function->Module->Name : "*unknown*",
( function->Name != nullptr ) ? function->Name :
String::Format( "{0:X8}", function->NID ),
args, address - 4,
function->IsImplemented ? "" : " (NI)",
- function->IsMissing ? "(NOT FOUND) " : "",
- _currentTcsId );
+ function->IsMissing ? "(NOT FOUND) " : "" );
Log::WriteLine( Verbosity::Verbose, Feature::Syscall, log );

#if 0

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/DelayThreadDialog.cs
==============================================================================
---
trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/DelayThreadDialog.cs (original)
+++
trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/DelayThreadDialog.cs
Sun Mar 30 07:45:22 2008
@@ -28,6 +28,14 @@
this.timeTextBox.Text = "30000";
}

+ protected override void OnShown( EventArgs e )
+ {
+ base.OnShown( e );
+
+ this.timeTextBox.Focus();
+ this.timeTextBox.SelectAll();
+ }
+
private void delayButton_Click( object sender, EventArgs e )
{
uint time;

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/JumpToAddressDialog.cs
==============================================================================
---
trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/JumpToAddressDialog.cs (original)
+++
trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/JumpToAddressDialog.cs
Sun Mar 30 07:45:22 2008
@@ -44,6 +44,9 @@
this.Text += " - Memory";
break;
}
+
+ this.addressTextBox.Focus();
+ this.addressTextBox.SelectAll();
}

private void jumpButton_Click( object sender, EventArgs e )

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/JumpToMethodDialog.cs
==============================================================================
---
trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/JumpToMethodDialog.cs (original)
+++
trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/JumpToMethodDialog.cs
Sun Mar 30 07:45:22 2008
@@ -51,6 +51,8 @@
}
if( this.Method != null )
this.methodTextBox.Text = this.Method.Name;
+ this.methodTextBox.Focus();
+ this.methodTextBox.SelectAll();
}

private void jumpButton_Click( object sender, EventArgs e )

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/RenameDialog.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/RenameDialog.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Dialogs/RenameDialog.cs
Sun Mar 30 07:45:22 2008
@@ -58,6 +58,8 @@
}

this.nameTextBox.Text = this.Value;
+ this.nameTextBox.Focus();
+ this.nameTextBox.SelectAll();
}

private void renameButton_Click( object sender, EventArgs e )

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.cs
Sun Mar 30 07:45:22 2008
@@ -233,7 +233,7 @@
{
this.ContextMenuStrip = this.gutterContextMenuStrip;
Instruction instr = this.GetHoveredInstruction();
- if( instr.Breakpoint != null )
+ if( ( instr != null ) && ( instr.Breakpoint != null ) )
{
string tipText = "Breakpoint: " + ( instr.Breakpoint.Name ??
instr.Breakpoint.ID.ToString() );
if( this.toolTip.GetToolTip( this ) != tipText )
@@ -1109,6 +1109,7 @@
tag.Value = dialog.Value;
_debugger.UserData.CodeTags.MethodNames.Add( tag );
}
+ _debugger.CodeCache.Version++;
_debugger.UserData.Save();
}
break;
@@ -1132,6 +1133,7 @@
tag.Value = dialog.Value;
_debugger.UserData.CodeTags.LabelNames.Add( tag );
}
+ _debugger.CodeCache.Version++;
_debugger.UserData.Save();
}
break;

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/LogControl.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/LogControl.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/LogControl.cs Sun
Mar 30 07:45:22 2008
@@ -16,21 +16,24 @@

namespace Noxa.Emulation.Psp.Player.Debugger.Tools
{
- public partial class LogControl : Control
+ partial class LogControl : Control
{
class LogLine
{
+ public readonly uint ThreadID;
public readonly Verbosity Verbosity;
public readonly Feature Feature;
public readonly string Value;
- public LogLine( Verbosity verbosity, Feature feature, string value )
+ public LogLine( uint threadId, Verbosity verbosity, Feature
feature, string value )
{
+ this.ThreadID = threadId;
this.Verbosity = verbosity;
this.Feature = feature;
this.Value = value;
}
}

+ public InprocDebugger Debugger;
private VScrollBar _verticalScrollBar;

private readonly string[] _featureNames;
@@ -100,7 +103,8 @@

public void AddLine( Verbosity verbosity, Feature feature, string
value )
{
- LogLine line = new LogLine( verbosity, feature, value );
+ uint threadId = ( this.Debugger.DebugHost.BiosHook != null ) ?
this.Debugger.DebugHost.BiosHook.ActiveThreadID : 0;
+ LogLine line = new LogLine( threadId, verbosity, feature, value );
lock( _lines )
_lines.Add( line );
if( Interlocked.Increment( ref _pendingUpdates ) > 1 )
@@ -310,6 +314,7 @@
private Brush _disabledBrush;

private int _labelWidth = 100;
+ private int _threadWidth = 30;

private void SetupGraphics()
{
@@ -341,6 +346,7 @@
_disabledBrush = new SolidBrush( light );

_labelWidth = ( int )( _charSize.Width * 10 + 2 + 0.5f );
+ _threadWidth = ( int )( _charSize.Width * 3 + 4 + 0.5f );
}

protected override void OnPaintBackground( PaintEventArgs e )
@@ -373,6 +379,11 @@
e.Graphics.DrawLine( _vertGridPen,
2 + _labelWidth, 2,
2 + _labelWidth, this.ClientRectangle.Height - 3 );
+
+ // Thread
+ e.Graphics.DrawLine( _vertGridPen,
+ 2 + _labelWidth + 2 + _threadWidth, 2,
+ 2 + _labelWidth + 2 + _threadWidth, this.ClientRectangle.Height -
3 );
}

protected override void OnPaint( PaintEventArgs e )
@@ -393,8 +404,11 @@
// Label
e.Graphics.DrawString( _featureNames[ ( int )line.Feature ],
_font, _labelFontBrushes[ ( int )line.Verbosity ], x, y, _stringFormat );

+ // Thread ID
+ e.Graphics.DrawString( line.ThreadID.ToString( "X3" ), _font,
valueBrush, x + _labelWidth + 4, y, _stringFormat );
+
// Value
- e.Graphics.DrawString( line.Value, _font, valueBrush, x +
_labelWidth + 4, y, _stringFormat );
+ e.Graphics.DrawString( line.Value, _font, valueBrush, x +
_labelWidth + 4 + _threadWidth + 3, y, _stringFormat );

y += _lineHeight;
}

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/LogTool.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/LogTool.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/LogTool.cs Sun Mar
30 07:45:22 2008
@@ -30,6 +30,8 @@

Bitmap image = Properties.Resources.OutputIcon as Bitmap;
this.Icon = Icon.FromHandle( image.GetHicon() );
+
+ this.logControl.Debugger = debugger;
}

public void WriteLine( Verbosity verbosity, Feature feature, string
value )

Modified: trunk/Noxa.Emulation.sln
==============================================================================
--- trunk/Noxa.Emulation.sln (original)
+++ trunk/Noxa.Emulation.sln Sun Mar 30 07:45:22 2008
@@ -39,8 +39,6 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Noxa.Emulation.Psp.GameTester", "Noxa.Emulation.Psp.GameTester\Noxa.Emulation.Psp.GameTester.csproj", "{950D0FA2-7755-4599-8A31-6DF3CCEA2F25}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Noxa.Emulation.Psp.RemoteDebugger", "Noxa.Emulation.Psp.RemoteDebugger\Noxa.Emulation.Psp.RemoteDebugger.csproj", "{227E2719-42F4-47C3-9637-872CE0594056}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Noxa.Emulation.Psp.Tracer", "Noxa.Emulation.Psp.Tracer\Noxa.Emulation.Psp.Tracer.csproj", "{0A6FFD80-11BE-4396-9403-787A38FEE3B8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Noxa.Emulation.Psp.Video.ManagedGL", "Noxa.Emulation.Psp.Video.ManagedGL\Noxa.Emulation.Psp.Video.ManagedGL.csproj", "{D356A206-81CF-4BCD-871D-521E355BA870}"
@@ -187,15 +185,6 @@
{950D0FA2-7755-4599-8A31-6DF3CCEA2F25}.Release|Mixed
Platforms.ActiveCfg = Release|Any CPU
{950D0FA2-7755-4599-8A31-6DF3CCEA2F25}.Release|Mixed
Platforms.Build.0 = Release|Any CPU
{950D0FA2-7755-4599-8A31-6DF3CCEA2F25}.Release|Win32.ActiveCfg =
Release|Any CPU
- {227E2719-42F4-47C3-9637-872CE0594056}.Debug|Any CPU.ActiveCfg =
Debug|Any CPU
- {227E2719-42F4-47C3-9637-872CE0594056}.Debug|Any CPU.Build.0 = Debug|
Any CPU
- {227E2719-42F4-47C3-9637-872CE0594056}.Debug|Mixed
Platforms.ActiveCfg = Debug|Any CPU
- {227E2719-42F4-47C3-9637-872CE0594056}.Debug|Win32.ActiveCfg = Debug|
Any CPU
- {227E2719-42F4-47C3-9637-872CE0594056}.Release|Any CPU.ActiveCfg =
Release|Any CPU
- {227E2719-42F4-47C3-9637-872CE0594056}.Release|Any CPU.Build.0 =
Release|Any CPU
- {227E2719-42F4-47C3-9637-872CE0594056}.Release|Mixed
Platforms.ActiveCfg = Release|Any CPU
- {227E2719-42F4-47C3-9637-872CE0594056}.Release|Mixed
Platforms.Build.0 = Release|Any CPU
- {227E2719-42F4-47C3-9637-872CE0594056}.Release|Win32.ActiveCfg =
Release|Any CPU
{0A6FFD80-11BE-4396-9403-787A38FEE3B8}.Debug|Any CPU.ActiveCfg =
Debug|Any CPU
{0A6FFD80-11BE-4396-9403-787A38FEE3B8}.Debug|Any CPU.Build.0 = Debug|
Any CPU
{0A6FFD80-11BE-4396-9403-787A38FEE3B8}.Debug|Mixed
Platforms.ActiveCfg = Debug|Any CPU

Reply all
Reply to author
Forward
0 new messages