Save Game Editor help

Discussion in 'NDS - ROM Hacking and Translations' started by omarrrio, Oct 8, 2010.

  1. omarrrio
    OP

    omarrrio GBAtemp Advanced Fan

    Member
    3
    Feb 18, 2010
    Macau
    nowhere
    hi, i need some help, it's for a save game editor i'm making, for an NDS game, but i don't know these things:

    1- how to open the save file in decimal for a special adress
    2- how to save the changes on the same .sav file (already open) without opening a dialog window (File browser)

    i use: visual studio (especially Visual Basic)

    thank you
     
  2. BlueFlame90

    BlueFlame90 GBAtemp Regular

    Member
    2
    Aug 7, 2008
    Gambia, The
    I never used vb before but it should be similar to C#.
    So here is the answer of you first question:

    This is for opening a file to write in it!
    Code:
    '// First the filestream
    Dim fs As FileStream = File.Create("C:\testfile.bin")
    Dim utf8 As New UTF8Encoding() '// The encoding (can be change if needed)
    
    '// now open the filestream with binarywriter
    Dim bw As New BinaryWriter(fs, utf8)
    Next go to a specefic position!
    Code:
    '// Using the seek() method to go to the position (in this case 500d)
    bw.Seek(500, SeekOrigin.Current)

    Parameters of Seek(): Seek(offset, origin)

    offset
    Type: System.Int32
    A byte offset relative to origin.

    origin
    Type: System.IO.SeekOrigin
    A field of SeekOrigin indicating the reference point from which the new position is to be obtained.


    I hope this helps you, if you have questions feel free to ask.
     
  3. omarrrio
    OP

    omarrrio GBAtemp Advanced Fan

    Member
    3
    Feb 18, 2010
    Macau
    nowhere
    woow thnx but i don't quite understund this, can you write just the codes plz, thank you.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice