Gecko dotNET release thread (version 0.65 now!)

Started by Link, January 03, 2010, 01:33:37 PM

Previous topic - Next topic

dcx2

Hi Link,

I looked through the source code and I don't see anything that appears to pin the byte[]'s you're using in GeckoRead and GeckoWrite, so I modified them to pin their byte[]'s down in case the Garbage Collector decides to move the buffers while the driver is using them.

       protected FTDICommand GeckoRead(Byte[] recbyte, UInt32 nobytes)
       {
           UInt32 bytes_read = 0;

           GCHandle bufferPin = GCHandle.Alloc(recbyte, GCHandleType.Pinned);
           FT_STATUS ftStatus = PFTDI.Read(recbyte, nobytes, ref bytes_read);
           bufferPin.Free();

           // etc
       }

       protected FTDICommand GeckoWrite(Byte[] sendbyte, Int32 nobytes)
       {
           UInt32 bytes_written = 0;

           GCHandle bufferPin = GCHandle.Alloc(sendbyte, GCHandleType.Pinned);
           FT_STATUS ftStatus = PFTDI.Write(sendbyte, nobytes, ref bytes_written);
           bufferPin.Free();

           // etc
       }

If I were to continue with any more changes, what is the appropriate way to submit them to you?

Link

Thx, it's okay, just to post the code, I included it.. for the SafeHandle thing.. I wasn't really able to figure that out as all of MS examples always expected to use Safehandle at function which would have a DWORD as output (DWORD File_open(params) ) and not where the DWORD is the result of a pointer ( DWORD Open_Ex(params, DWORD* handle) - other than that.. let's just hope that kinda fixes the known issues..

thanks though!

dcx2

Yeah, the SafeHandle stuff is a bit confusing.  But the good news is that unless the DWORD is being boxed, it's a value-type and not a reference-type, so it won't need to be pinned.  I hope.

Jackal

I am also having freeze when using unknown search, the initial search is fine
but the refine search sometimes freeze the game

Link

http://l0nk.org/gdnb.zip

Version 0.41:

Changes:
-refining should be fixed (spotted the error)
-readme now included
-breakpoint fixes
-dec to hex buttons removed, context menu instead which also provides float to hex and such
-search within memory view added (non-functional yet, it's being prepared right now, the button won't do anything).
-under-the-hood-changes

Sources haven't been updated!

Romaap

Thanks :D your effort is much appreciated.

Panda On Smack


dcx2


Zetta_X

Hi Link,

Whenever I try saving codes in GeckoDotNet I get an error. While I do not have my laptop with me, it gives me a giant paragraph and I believe the keywords (again I do not have my laptop to verify this) code handle exception error.

I am running Windows 7, 64 bit, home premium.

Thanks in advance,
Z

Romaap

Does this only happen on WiiWare/VC?

hetoan2

#70
Thanks for the update Link. Can't wait for the search in memviewer. Hopefully it's faster than WiiRD's :P

Hopefully in the future we can look forward to undo/redo search options and a function to export all the data you have in GeckoDotNET to a notepad.txt would be good too :D


Check out my site with codes obviously...
http://hetoan2.com/

and youtube...
http://youtube.com/hetoan2

Zetta_X

Quote from: Romaap on March 02, 2010, 09:25:19 PM
Does this only happen on WiiWare/VC?

Good eye, it is only happening in VC/WiiWare. I remember that WiiWare and VC games have different organization of Title IDs not isomorphic to the structure of Wii games. That answers everything ;)

Romaap

I just noticed that when you load WiiWare/VC the game id is shown but it is like this: (GAME
It is missing the )
So the game id might not be stored correctly thus causing an error when trying to save to a file with that broken name.

Panda On Smack

#73
It's basically to do with the length of the game id

I just edited the source and changed it to loop through 4 characters instead of 6 and it works fine on a VC game

It errors on the 5th character as it doesn't exist

dcx2

#74
Saweet!  Memory Viewer updates the FP value displayed when auto-updating!  And you can click away from the memory viewer tab, that rocks too!

I added some requests.  When you update the sources, I'll see if I can handle any of them.

EDIT:

Uh-oh!  I got an ftdiusbgecko.eusbgeckoexception while I was trying to set/cancel a breakpoint.

Normally when I get an exception in a .NET app it shows something about the stack trace, but there was no trace, so that's all I have... =(

EDIT2: Got another one. =(  Stack trace this time, woohoo!  USBGecko.peek() gave up the ghost

************** Exception Text **************
FTDIUSBGecko.EUSBGeckoException: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
   at FTDIUSBGecko.USBGecko.peek(UInt32 address)
   at GeckoApp.MemoryViewer.CellSelectionChange(Object sender, EventArgs e)
   at System.Windows.Forms.DataGridView.OnSelectionChanged(EventArgs e)
   at System.Windows.Forms.DataGridView.FlushSelectionChanged()
   at System.Windows.Forms.DataGridView.set_NoSelectionChangeCount(Int32 value)
   at System.Windows.Forms.DataGridView.SetSelectedCellCoreInternal(Int32 columnIndex, Int32 rowIndex, Boolean selected)
   at System.Windows.Forms.DataGridViewCell.set_Selected(Boolean value)
   at GeckoApp.MemoryViewer.CellSelectionChange(Object sender, EventArgs e)
   at System.Windows.Forms.DataGridView.OnSelectionChanged(EventArgs e)
   at System.Windows.Forms.DataGridView.FlushSelectionChanged()
   at System.Windows.Forms.DataGridView.set_NoSelectionChangeCount(Int32 value)
   at System.Windows.Forms.DataGridView.ClearSelection(Int32 columnIndexException, Int32 rowIndexException, Boolean selectExceptionElement)
   at System.Windows.Forms.DataGridView.SetAndSelectCurrentCellAddress(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick, Boolean clearSelection, Boolean forceCurrentCellSelection)
   at System.Windows.Forms.DataGridView.MakeFirstDisplayedCellCurrentCell(Boolean includeNewRow)
   at System.Windows.Forms.DataGridView.OnRowCollectionChanged_PostNotification(Boolean recreateNewRow, Boolean allowSettingCurrentCell, CollectionChangeAction cca, DataGridViewRow dataGridViewRow, Int32 rowIndex)
   at System.Windows.Forms.DataGridViewRowCollection.OnCollectionChanged_PostNotification(CollectionChangeAction cca, Int32 rowIndex, Int32 rowCount, DataGridViewRow dataGridViewRow, Boolean changeIsDeletion, Boolean changeIsInsertion, Boolean recreateNewRow, Point newCurrentCell)
   at System.Windows.Forms.DataGridViewRowCollection.OnCollectionChanged(CollectionChangeEventArgs e, Int32 rowIndex, Int32 rowCount)
   at System.Windows.Forms.DataGridViewRowCollection.AddCopiesPrivate(DataGridViewRow rowTemplate, DataGridViewElementStates rowTemplateState, Int32 count)
   at System.Windows.Forms.DataGridViewRowCollection.Add(Int32 count)
   at GeckoApp.MemoryViewer.Update()
   at GeckoApp.MainForm.MemViewAutoUp_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.CheckBox.OnClick(EventArgs e)
   at System.Windows.Forms.CheckBox.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)