Jump to content

Recommended Posts

  • Replies 89
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 weeks later...

Been a while since I posted eh? Glad to let you know it's going well so far, it's displaying all the info I want and exporting data to a text file. Also some other nice features such as a web browser.

Anyways, the reason I'm back is because I thought, this program isn't all that useful right now. It doesn't do enough things. I thought about what else I could offer and I decided that some checking would be great. I saw the legality checker and I thought, if I could program that, or some of what it does, it would be awesome. I tried looking for stuff on trash bytes, but I couldn't really understand it. I then tried to look at the stuff about the algorithm, wild or normal NDS/GBA, uncommon GBA and all of that stuff, but I couldn't find any information regarding programming it in any way. And I have no idea in respect to checksum checking.

Any more help for little old me? lol =P.

Link to comment
Share on other sites

And I have no idea in respect to checksum checking.

You're not alone. If I knew, there would be a Mystery Dungeon 2 save editor that does more than edit the team name.

I tried looking for stuff on trash bytes, but I couldn't really understand it.

What didn't you understand about it? Did you not understand how to read/edit it, or do you just not understand what each trashbyte means?

Link to comment
Share on other sites

Haha, funny guy. Sabresite understands the .pkm file checksum, or at least his program checks it.

http://projectpokemon.org/wiki/Trash_Bytes

I understand all of the introduction. I get the terminators, I get that there's two trash byte sections and where, and I know that there's three types and what trash bytes represent.

Then I go and look at when they start to explain them.

Migrated to English DP

18 20 0D 02 42 00 00 00 00 00 00 00 48 A1 0C 02 E0 FF

05 00 00 00 <random> <8E - 96> 27 02 <random> <D1 or D2> 26 02 E9 9A 06 02 00 00

All I understand from that is that it's talking about trash bytes when parked to English DP. I don't get the rest of it. Is it supposed to be proper values or specific values or what?

Also, a buddy of mine who programs suggested that I include code in my program that basically runs Legal.exe within the program. I actually think it might not be a bad idea, I could output the data to a text file according to him, so I would be able to manipulate it.

Oh, and I presume you don't know algorithm stuff since you didn't talk about it.

Link to comment
Share on other sites

Thanks but that guide did not help me. I already have some knowledge in the hidden hex values for Platinum migration. I specifically need information regarding trash bytes. I may look into launching the program from within my program.

I started to program launching it from within. I got as far as to load the .pkm file with Legal and display the information, but then I got to a rut. I posted for help on the VB forums that helped me in the past, so hopefully I can get the help I need there.

Edited by greentea
Link to comment
Share on other sites

You should PM damio regarding trash bytes, as he is the resident expert.

As for verifying the checksum, all you really need to do is take a Pokémon, calculated the checksum, and compare it to the one that is already there. The checksum algorithm for Pokémon data is, of course, detailed in the Pokémon NDS Structure page on our wiki.

And for IV / PID relationships and generation "methods", you should take a gander at the article X-Act posted on Smogon. He doesn't detail programming methods, but it's easy enough to replicate the step-by-step details in your own functions (although going from IVs to PID is a difficult task, and technically I didn't do it right at all, THANKS AGAIN MINGOT!).

Details on the specific methods (patterns of RNG calls) are on that article as well.

Link to comment
Share on other sites

Thanks codemonkey, you're always here when I need you, and on the ball.

I'm going out soon and a few things to do today, but I will definitely be checking out what you've posted when I go to program. A thing or two within the program I want to do first, like set the .initial directory to use the last used directory instead of the default. Do you by any chance know how to do the directory thing? I tried storing the directory in a variable but it wouldn't work, I'm not allowed to store it as a string.

Edited by greentea
Link to comment
Share on other sites

If counter > 0 Then
                   .InitialDirectory = My.Computer.FileSystem.GetFileInfo(FileName).Directory
               Else
                   .InitialDirectory = "D:\Documents and Settings\owner\Desktop\Pokemon"
                   counter += 1
               End If

Basically, the initial directory is set to my Pokemon folder and the next times through, it will use what should be the current FileName directory. However the error message is "Value of the type 'System.IO.DirectoryInfo' cannot be converted to 'string'". This method worked when I added the value in the list box. I realize I may need to change the place I assign it now that I think about it, but lets worry about the error code first, I can just copy and paste and store to a variable (gives me same error on the variable assignment too though).

And I'm not a VB wiz, I've only been using it for a year, but I saw some code on storing stuff when searching up this. I may consider it.

Link to comment
Share on other sites

I tried it but it still didn't work. For some strange reason, .InitialDirectory seems to stay the first assigned one instead of the last one. Destructive read-in doesn't seem to work. However, I just removed the initial assignment of initial directory. It seems to store the value in long-term memory as well.

Link to comment
Share on other sites

damio suggested that you send the source code to his trash byte program. He has offered to help me with my trash byte concerns, but feels it is best that I see the code first. Please tell me how you wish to send the source code. I'll check it out once I have it and go from there, who knows, maybe I'll understand better from seeing some coding of it.

Link to comment
Share on other sites

Can you please help me figure out what is wrong with this code? My head is spinning because it SHOULD be working. I've done error testing and what I found is that during the if statement whether it checks if the SelectedItem is found in the array, it doesn't find it. However, from checking the assignment earlier on, it DOES INDEED assign it.

'If its checked, it will open the selected item from the list box instead.
       If CheckBox1.Checked = True Then

           'for all the indexies of the saved location record of array, if the selected item is found, then open that file
           For counter = 0 To SavedLocations.GetUpperBound(0)
           'does not seem to find the variable at this point
               If lstFiles.SelectedItem = SavedLocations(counter).Name Then
                   Filename2 = SavedLocations(counter).Full
               Else
                   'this displays the same as txtTest displayed earlier
                   txtTest.text = lstFiles.SelectedItem
               End If
           Next


           Clipboard.SetText(Filename2)

           ReadFileBytes(Filename2)

       Else


           With FileOpenDialog1


               'makes the default directory the last directory used
               'goes to My Documents if the directory does not exist
               .InitialDirectory = LastDirectory

               If .ShowDialog = DialogResult.OK Then

                   FileName = .FileName()

                   'stores in a public variable for use later on in program
                   FileLocation = FileName

                   LastDirectory = My.Computer.FileSystem.GetFileInfo(FileName).Directory.FullName

                   Clipboard.SetText(FileName)

                   ReadFileBytes(FileName)


                   For Each FileName In .FileNames
                       'adds the File's name to the list box for easy open later
                       lstFiles.Items.Add(My.Computer.FileSystem.GetFileInfo(FileName).Name)

                       'lstFiles.Items.Add(FileName)

                       'stores in a public variable for use later on in program
                       NameFileName = My.Computer.FileSystem.GetFileInfo(FileName).Name

                       'stores the current file information in an array of records so we can access the specific data later
                       SavedLocations(counter2).Name = My.Computer.FileSystem.GetFileInfo(FileName).Name
                       SavedLocations(counter2).Location = My.Computer.FileSystem.GetFileInfo(FileName).Directory.FullName
                       SavedLocations(counter2).Full = FileName
                       'displays the correct Name
                       txtTest.text = SavedLocations(counter2).Name
                       counter2 += 1
                   Next
               End If

           End With
       End If

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...