Hi! We see you’re using an ad-blocker. We’re fine with that and won’t stop you visiting the site.
But as we’re losing ad-revenue from this then why not make a donation towards website running costs?. Or you could disable your ad-blocker for this site. We think you’ll find our adverts are not overbearing!
Dim g As Long
Dim b As Byte
Dim bt As Byte
Dim Maxfiles
Maxfiles = 30
'this folder holds the original data.chk file N.B. Following line modified by TomTomTim
folder = "C:\TomTom\"
'identifier of the data.chk version. complete file name is identifier.data.chk
fname = "419"
'the OGG files need to be in the subfolder specified by cell C1
fnum = FreeFile
Open folder & fname & ".data.chk" For Binary Access Read As #fnum
flen = FileLen(folder & fname & ".data.chk")
g = get_long
Debug.Print fname; " Number of modules: "; g; " File size: "; flen
If (g <> 102) And (g <> 120) And (g <> 123) And (g <> 136) Then
a = MsgBox("Not a good DATA.CHK file. Please report your build version of the TomTom program to lutz@pocketgpsworld.com", vbOKCancel, "Error - wrong file version")
Close
Exit Sub
End If
'get offsets
If g = 102 Then Maxfiles = 12
ReDim entry(g + 1)
For i = 1 To g + 1
entry(i).offset = get_long
entry(i).sourceoffset = entry(i).offset
If i > 1 Then entry(i - 1).length = entry(i).offset - entry(i - 1).offset
Next
'confirm file size
If entry(g + 1).offset = flen Then
Debug.Print "File size confirmed"
Else
Debug.Print "File size mismatch! Reported:" & Hex(entry(g + 1).offset) & " Actual:" & flen
End If
'calculating new offsets etc
Debug.Print "Calculating new parameters"
i = 2
For f = g - Maxfiles To g
If (Cells(i, 3) > vbNullString) And (f < g) Then 'new file
Debug.Print "Verifying "; Cells(i, 3)
flen = FileLen(folder & Cells(1, 3) & "\" & Cells(i, 3))
entry(f).ogglength = flen
pad = 0
While flen Mod 4 <> 0
flen = flen + 1
pad = pad + 1
Wend
entry(f).blocks = (flen + 12) / 4
entry(f).length = flen + 16
End If
i = i + 1
Next
'recalculate header
Debug.Print "Recalculating header ";
For i = g - Maxfiles To g + 1
entry(i).offset = entry(i - 1).offset + entry(i - 1).length
Next
Debug.Print "- new File Size is "; entry(g + 1).offset
'write output file
Debug.Print "Writing CHK file "
On Error Resume Next
Kill folder & Cells(1, 3) & "\" & fname & "_new.data.chk"
On Error GoTo 0
fnum2 = FreeFile
Open folder & Cells(1, 3) & "\" & fname & "_new.data.chk" For Binary Access Write As #fnum2
'write header
'number of segments
put_long (g)
'offsets
For i = 1 To g + 1
put_long (entry(i).offset)
Next
'non-voice files
'position pointer
Get #fnum, entry(1).offset, b
h = entry(g - Maxfiles).offset - entry(1).offset
For i = 1 To h
Get #fnum, , b
Put #fnum2, , b
DoEvents
Next
'write sound files, either from source or from new OGG
Debug.Print "Writing CHK file - Sounds"
i = 2
For f = g - Maxfiles To g
If (Cells(i, 3) > vbNullString) And (f < g) Then 'read new file
Debug.Print "Including "; Cells(i, 3); " for "; Cells(i, 1)
'recreate header
b = 1
Put #fnum2, , b
b = 0
Put #fnum2, , b
b = entry(f).blocks \ 256
Put #fnum2, , b
b = entry(f).blocks And 255
Put #fnum2, , b
put_long (1)
put_long (8)
put_long (entry(f).ogglength)
fout = FreeFile
Open folder & Cells(1, 3) & "\" & Cells(i, 3) For Binary Access Read As #fout
For h = 1 To entry(f).ogglength
Get #fout, , b
Put #fnum2, , b
DoEvents
Next
'padding
b = 0
flen = entry(f).ogglength
While flen Mod 4 <> 0
Put #fnum2, , b
flen = flen + 1
Wend
Close (fout)
Else 'read from source
'position pointer
Get #fnum, entry(f).sourceoffset, b
For h = 1 To entry(f).length
Get #fnum, , b
Put #fnum2, , b
DoEvents
Next
End If
i = i + 1
Next
Close
Beep
MsgBox ("Done - real new file size is " & FileLen(folder & Cells(1, 3) & "\" & fname & "_new.data.chk"))
End Sub
'required because of the little endian storage of long values
Function get_long() As Long
Dim b As Byte
l = 0
For h = 1 To 4
Get #fnum, , b
l = l * 256 + b
Next
get_long = l
End Function
Sub put_long(ByVal l As Long)
Dim b(4) As Byte
For h = 1 To 4
b(h) = l And 255
l = l \ 256
Next
For h = 4 To 1 Step -1
Put #fnum2, , b(h)
Next
End Sub
Private Sub CommandButton1_Click()
data_chk_reload
End Sub
_________________ Gunnar Nystul, Forum Admin, TomTom Forum Norway and Nystul Navigasjon
Public fnum
Public fnum2
Type CHKentry
offset As Long
sourceoffset As Long
length As Long
tag As Byte
packtype As Byte
blocks As Integer
ogglength As Long
End Type
Public entry() As CHKentry
_________________ Gunnar Nystul, Forum Admin, TomTom Forum Norway and Nystul Navigasjon
Thanks -- but no changes, and nothing more will show about whats missing. _________________ Gunnar Nystul, Forum Admin, TomTom Forum Norway and Nystul Navigasjon
If (Cells(i, 3) > vbNullString) And (f < g) Then 'new file
To:
Code:
If (Cells(i, 17) > vbNullString) And (f < g) Then 'new file
changed: 3 ---> 17
This was just an idea because my spreadshheet lines starts in cell C17.
I have actually no idea what im doin...
Then it works and I get this message:
Done - new real file size is:
986286 _________________ Gunnar Nystul, Forum Admin, TomTom Forum Norway and Nystul Navigasjon
Hi
Ive loaded the safety camera data base to my tom tom go 300 and I am very pleased with the result. Great work guys! I then tried loading the voice files. My go 300 has app 5.000 and so I downloaded the 2852_new.data.chk file and renamed it data.chk then exchanged the data.chk file as instructed. The result was the unit would lock up on the logo screen during boot up. The only way I could do anything was to reset and replace the data.chk file with the original, the go 300 then worked perfectly. Has anyone any idea what im doing wrong or have I tripped over a bug?
regards Jenny
Thanks Gunnar.
I can see where I was going wrong now. Well I am Blonde I was misreading the instructions for loading the files. I will load the 4109 file when I get the chance.
Best regards Jenny
I used the data.chk 4109 as you suggested but the sounds I am getting after the installation of 4109 into my map directory are just the standard sounds that come with the Tom Tom Prog.
I would appreciate your comments.
laurie0236 wrote:
I received my new updated UK maps today and they are working ok, together with the safety camera database. I am now wishing to use the spoken sounds intead of the bells & whistles.
I have app 5.000 (4102/050329). Will I be able to use the file that is showing for V5 update. The version indicated for the download is 4109 but I have 4102.
Hi I am interested in making my own poi warnings but don't really know where to start. I know Tom Tom Tim did an excellent feature on this but I am a beginner and have no experience with the codes or the programs which are needed to do this and find it hard to follow.
I was wondering if there was a BASIC step by step guide available to us so we can start adding our own warnings to the ttg or if anybody could help.
I know that quite a few more members would also appreciate this
Im running a ttg classic on version 5 with the map upgrade
App 5.000(4102/50329)os:721
map v571
Joined: 02/11/2002 22:41:59 Posts: 11878 Location: Massachusetts, USA
Posted: Tue May 17, 2005 5:21 pm Post subject:
Sorry, we can't help there. We have made the source code available. Ask one of your friends who can use that code to create what you need. _________________ Lutz
Posted: Today Post subject: Pocket GPS Advertising
We see you’re using an ad-blocker. We’re fine with that and won’t stop you visiting the site.
Have you considered making a donation towards website running costs?. Or you could disable your ad-blocker for this site. We think you’ll find our adverts are not overbearing!
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 vote in polls in this forum
Or you could disable your ad-blocker for this site. We think you’ll find our adverts are not overbearing!
Hi! We see you’re using an ad-blocker. We’re fine with that and won’t stop you visiting the site.
But as we’re losing ad-revenue from this then why not make a donation towards website running costs?. Or you could disable your ad-blocker for this site. We think you’ll find our adverts are not overbearing!