pgmfi.org

Hacking up Honda's ECU
It is currently Fri Apr 19, 2024 6:17 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 45 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Any Visual Basic advice?
PostPosted: Wed Mar 12, 2003 4:58 pm 
I don't expect much of a reply to this thread, but...

I'm not a programmer by trade and I'm trying to pick up Visual Basic as my first 'real' language. I want to make a GhettoDyneish application except for us poor OBDI guys. I want it to be free just like GhD.

Can anyone give me advice on writing a basic rom editing software or maybe a few code snips or something to look at to start off with. I have leanred how to change like 1 byte blocks etc (which will be useful for turning on/off features in the roms).

I guess I'm just in over my head and looking for some advice more than anything.

I spoke with xtensive and he didn't want people to make GhD into a commercial application so he never released the source, which is fine and it totally his call.

I want mine to be totally open source and may even start a SourceForge project for it so other people can contribute.

The way I see it: If you're going to try and make a buck off it.. you're gunna do it one way or another... why stay up @ night over it.


Top
  
Reply with quote  
PostPosted: Thu Mar 13, 2003 12:51 am 
hmm, you should speak to xtensive for info about opening the rom, and read the obd1 dev forum to find convertion formulas for fuel and timing and rpm. they,re all there.. (excel spread sheet).

the only thing you have to worry is to find a way of loading the .bin file into memory and modify it and then spitting it out in a bin file.

Nico has done a software too, might ask him.

as for myself, I never tried to open and manipulate bin files.


Top
  
Reply with quote  
PostPosted: Thu Mar 13, 2003 1:18 am 
I will certainly help in any way I can, including code snippets, etc. Manipulating .bin files is so 80's... :-)

Mike


Top
  
Reply with quote  
PostPosted: Thu Mar 13, 2003 2:10 am 
Thank you Mike :)

Attached is the layout of the VERY VERY basic OBDI ... now known from here on:

The Gimpy OBDI ROM Editor

Obviously, nothing works.. but gives you an idea of what I hope it to look like. I hope to have a semi-working program in the next week.


You do not have the required permissions to view the files attached to this post.


Top
  
Reply with quote  
 Post subject: Bin File Reading in VB
PostPosted: Thu Mar 13, 2003 9:46 am 
Open the bin with an OPEN statement... open it as binary mode...
then you can access each byte of the bin file.

To read the file use GET and PUT to read and write the file...

Declare a variable to read bytes into such as

DIM bBuffer AS BYTE

For Example:

Private Sub cmdOpen()

' Setup the cancel error code
On Error GoTo CancelError

' Tell the dialog window to throw an error when the cancel button is pressed
commonDialog.CancelError = True

' Setup the common dialog box
commonDialog.DialogTitle = "Open Tuner Bin File"
commonDialog.DefaultExt = "bin"
commonDialog.Filter = "Binary (*.bin)|*.bin|All Files (*.*)|*.*"

' Show the dialog
commonDialog.ShowOpen

' Get the file name
strBinFileName = commonDialog.FileName

' Close the old file if it is open
If (FileIsOpen) Then Close #FileHandle

' Get a new handle
FileHandle = FreeFile

' Open the file
Open strBinFileName For Binary As #FileHandle

' If the file successfully opened then

' Get the file size
FileSize = FileLen(strBinFileName)

' Set file open flag
FileIsOpen = True

' Set the label caption
lblFile.Caption = commonDialog.FileTitle

' Call a routine to open put the contents of the file on the screen
Call RefreshTheScreen

' Get out of here...
Exit Sub

' Error handler...
CancelError:

' Cancel error is Error# 32755
If (Err.Number = 32755) Then
' For right now do nothing
Exit Sub
End If

' Ooops... we got an error that wasn't a cancel button being pressed
' Close the file...
FileIsOpen = False
Close #FileHandle

' Print out the error
MsgBox ("There was an error: " & Error(Err.Number))

End Sub

' Of course you have to have a common dialog box control named
' commonDialog in order for the above to work.

Private Sub RefreshTheScreen()

' Make sure the file has been opened first...
If (FileIsOpen) Then

' Get the first byte...
FileOffset = 1

Get #File1Handle, FileOffset, FileBuffer

' Print out the hex value for the first byte we just loaded
lblFirstByte.Caption = Hex(FileBuffer)

End If

End Sub

-------------------------

Don't forget to close the file on program exit...

I hope this helps... everyone...

You Have Questions... I have answers (and so does alot of other people)


Top
  
Reply with quote  
PostPosted: Thu Mar 13, 2003 10:54 am 
Offline
Senior Developer

Joined: Tue Jul 27, 2004 2:09 am
Posts: 4383
Location: Cincinnati, Ohio
Collaboration rules!

[%sig%]


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 13, 2003 4:10 pm 
Thanks for that bit of code to look at!!!

I'm thinking of setting up a sourceforge project for this tonight. I want a project to evolve that everyone feels like they have some ownership of. I think that will drive away people whos motives are ultimatly commercial uses.

I don't mind commercial users really, everyone has to make a living somehow. I however don't like to hear about people who've smuggled sourcecode and put a different name on that, and this wont be tollerated. I will look into GPL licensing so that if you modify the source, you should share with the rest and that the name of the "Product" must stay the same with disclaimers that its FREE.

Thats way in the future though, but those are some of my thoughts on the matter.


Top
  
Reply with quote  
PostPosted: Thu Mar 13, 2003 11:17 pm 
Hehe, I already sent code to andrew..

my little applet, open the bin in memory, it changes anybyte and then save it back to any file wanted..


Mike : you should do that too so you can have a Save As... :)))))


Top
  
Reply with quote  
PostPosted: Fri Mar 14, 2003 1:52 am 
this thread is nice, all i'v been able to get my program to edit has been hex files. now i'll have to make it open bolth.

[%sig%]


Top
  
Reply with quote  
PostPosted: Fri Mar 14, 2003 2:24 am 
Well, heres what it looks like on day 2.

Thanks to coding help from both Nick & Chris and a lot of figuring out shit on my own (RTFM!!!) heres what it can do:

The Bit Writer feature works. This is a silly lil feature (thanks to nick) that will allow you to just make simple changes to your rom.

The only other thing working right now is im able to pull RPM and VTEC X-Over RPM's out of the rom. It only works with the rom I've included in the .ZIP right now.

So anyway, enjoy and have a good chuckle at my lack of programming skill and it can only get better from here on.. right?

Blundar is talking about making a PGMFI SourceForce umbrella for all projects like this. Until hes decided on that I'm holding off on that, but if you wanna see my lame source code you're more than welcome.. just ask and I'll post.


You do not have the required permissions to view the files attached to this post.


Top
  
Reply with quote  
PostPosted: Fri Mar 14, 2003 2:28 am 
and yes.. i know bit writer is actually writing BYTES .. but I think Byte Writer sounds lame.


Top
  
Reply with quote  
PostPosted: Fri Mar 14, 2003 9:42 am 
Any other coding questions?

We have answers...


Top
  
Reply with quote  
PostPosted: Fri Mar 14, 2003 11:20 am 
Yes,

you know how some apps you can flip pages with a tab... how is that done?


Top
  
Reply with quote  
PostPosted: Sat Mar 15, 2003 8:42 pm 
like this.....

[%sig%]


You do not have the required permissions to view the files attached to this post.


Top
  
Reply with quote  
PostPosted: Sat Mar 15, 2003 11:33 pm 
A better explaination is needed Evan!!!

Goto your toolbox on the left side of the screen. Right click and select "components". Then scroll down and find "MicroSoft Tabbed Dialog Control (SP5)", select it, hit "ok", and Voila! You now have a tab option from your toolbox.

Mike


Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 45 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group