Option Explicit
Dim sFile As String
___________________________________
Private Sub Command1_Click()
Dim iFileNum As Integer
iFileNum = FreeFile
sFile = frmMain.CommonDialog1.FileName
If cmbPoke.Text = "" Then
MsgBox ("Pick a Pokemon please")
Else
Open sFile For Binary As #iFileNum
Put #iFileNum, &H5FDE, cmbPoke.ListIndex
Close #iFileNum
Unload Me
End If
End Sub
If opt2.Value = True Then
Put #iFileNum, &H5AD5, &H2
Put #iFileNum, &H5AD6, &H0
Put #iFileNum, &H5AD7, &H1
Put #iFileNum, &H5AD8, &HFF
If opt3.Value = True Then
Put #iFileNum, &H5AD9, &O3
Put #iFileNum, &H5ADA, &H0
Put #iFileNum, &H5ADB, &H1
Put #iFileNum, &H5ADC, &H2
Put #iFileNum, &H5ADD, &HFF
If opt4.Value = True Then
Put #iFileNum, &H5ADE, &H4
Put #iFileNum, &H5ADF, &H0
Put #iFileNum, &H5AE0, &H1
Put #iFileNum, &H5AE1, &H2
Put #iFileNum, &H5AE2, &H3
Put #iFileNum, &H5AE3, &HFF
Close #iFileNum
Is this correct to write all these bytes next to each other?
Thanks, by the way!
Code:If opt2.Value = True Then Put #iFileNum, &H5AD5, &H2 Put #iFileNum, &H5AD6, &H0 Put #iFileNum, &H5AD7, &H1 Put #iFileNum, &H5AD8, &HFF If opt3.Value = True Then Put #iFileNum, &H5AD9, &O3 Put #iFileNum, &H5ADA, &H0 Put #iFileNum, &H5ADB, &H1 Put #iFileNum, &H5ADC, &H2 Put #iFileNum, &H5ADD, &HFF If opt4.Value = True Then Put #iFileNum, &H5ADE, &H4 Put #iFileNum, &H5ADF, &H0 Put #iFileNum, &H5AE0, &H1 Put #iFileNum, &H5AE1, &H2 Put #iFileNum, &H5AE2, &H3 Put #iFileNum, &H5AE3, &HFF Close #iFileNum
I'd like to point out, that while your little HEX module is handing it's easily replaceable.
For dealing with hex values
&H
that reverse hex is just declaring the proper variable
dim byte1 as byte'Handles 1 byte
byte1=&H0C
viewing with a hex editor you'll see 0x
dim integer1 as integer'Handles 2 bytes
integer1=&HFF04
viewing with a hexeditor
04 FF
and the one I guess that reversehex is mainly used for
the long
dim long1 as long'4 bytes usually for a pointer
long1=&h8123456
in a hex editor
56 34 12 08
Get it now?
Readhex is simply reduced to
dim byte1 as byte
open filepath for binary as #1
get #1, offset+1,byte1
or
seek #1, offset+1
get #1, ,byte1
close #1
for integers
just change the byte to integer
for long just change integer or byte to long
to write data to a rom use put instead of get
and to extract the address from a long
just take the 8 off so
offset-&h8000000
make sure if you're pointing a pointer into a rom make sure to add the &H8000000
simple.
And not bloated.
I just got into porgramming 4 days ago so I'm new but I already have C++ down. I'm trying to learn VB and I just have a simple question about your tools(I will ask questions in the future since I'm new in this area). Do I have to use VB6 for this becuz it is very out dated and there has been many recent VBs like VB 2008 which is known as VB9? Also, its not possible for you to give us a free download of VB6 is it? (little infringement won't hurt any1) just joking.
@all- If any1 contacts me via email I can help them get one painlessly (sorry for simple spamming and cheapAd)
I also have another question (sorry for the double post if it shows as so and doesn't merge)...
In the second step when entering the pokeballs I don't see where "style" is to put in the number 2. can any1 help? My tool has index, shortcut, help contextId, and negotiate position (it say none, middle, left, right) and the 4 chk offs. There's no style to writee the number 2 in. Also I have no idea as where I'm supposed to insert the list for the pokemon. Like I said before I just started with visual basic and my friend Akido said its the best for programming so here I am.
how do you add the functions in ?You don't need to credit me.. Next time just try and read, k?
And, to answer on your question: ReverseHEX(HEXString) will ^^
So ReverseHEX(08123456) will return 56341208
Good Night (2:30AM !!)
Does anybody know how to insert a file that has been opened with the program into a rom that has been also opened with the program using WriteHEX? Is it possible?
If not, is there any other ways of doing it? Can you please get back to me soon on this as this is the only thing keeping me back from releasing my program.
Thanks, GSH.