Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

NDS Rom Renamer (free app from me) ....

Thread Tools
 
Search this Thread
 
Old 21 December 2007, 05:27 PM
  #1  
ChefDude
Scooby Regular
Thread Starter
 
ChefDude's Avatar
 
Join Date: Aug 2005
Posts: 4,290
Likes: 0
Received 0 Likes on 0 Posts
Default NDS Rom Renamer (free app from me) ....

if you put the exe in c:\ and dbl-click the add_to.reg file you will be able to right click on a NDS rom and rename the file to whatever name the game has within the rom



http://www.reefbeasties.com/mt/NDSROMRen.exec
http://www.reefbeasties.com/mt/add_to.reg

not sure why you can't right click on multiple files, but you *can* drag multiple files onto the exe and it will do all of them (don't do more than about 10 at once though.

Merry Christmas NDS'ers

Here's the code for the interested:

Private Declare Function MoveFileEx Lib "kernel32" Alias "MoveFileExA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal dwFlags As Long) As Long

Sub Main()
Dim sROMS$(), p&, sCMD$, bQuoteON As Boolean
sCMD = Command()
If InStr(sCMD, Chr(34)) > 0 Then 'some filenames have spaces
For p = 1 To Len(sCMD)
If Mid$(sCMD, p, 1) = Space(1) Then
If Not bQuoteON Then
Mid(sCMD, p, 1) = "~"
End If
ElseIf Mid$(sCMD, p, 1) = Chr(34) Then
bQuoteON = Not bQuoteON
End If
Next
sCMD = Replace(sCMD, Chr(34), "")
sROMS = Split(sCMD, "~")
Else
sROMS = Split(sCMD, Space(1))
End If

For p = 0 To UBound(sROMS)
If Len(Trim(sROMS(p))) > 0 Then
RenameRom (Trim(sROMS(p)))
End If
Next

End Sub
Sub RenameRom(sROM$)
Dim bF() As Byte, n&, f$, fl&, p$, bStart As Boolean, m$

If (GetAttr(sROM) And vbDirectory) <> 0 Then
MsgBox "Could not identify file; too many selected?" & vbCrLf & vbCrLf & "Exiting", vbExclamation, "NDS Rom rename"
End
End If

If LCase(Right$(sROM, 4)) <> ".nds" Then
MsgBox "Not an nds file" & vbCrLf & vbCrLf & "Exiting", vbExclamation, "NDS Rom rename"
End
End If

p = Left(sROM, InStrRev(sROM, "\"))
Open sROM For Binary Access Read As #77
fl = LOF(77)
ReDim bF(1024): Get #77, , bF()
n = 0: f = "": m = ""

'(bF(&H0 + n)
'00 38 18 00
'&H 18 38 00 = &D 1,587,200

n = H2D(ByteToHex(bF(&H6B)) & ByteToHex(bF(&H6A)) & ByteToHex(bF(&H69)) & ByteToHex(bF(&H68))) + &H240
ReDim bF(1024)
Get #77, n + 1, bF()

Close #77

n = 0

f = ""
Do
f = f & Chr(bF(n))
n = n + 2
Loop Until bF(n) < &HB Or n > 1024

f = Replace(f, Space(1), "_")
f = Replace(f, ":", "")
f = Replace(f, ";", "")

If Len(f) <= 2 Then
MsgBox "No valid nds title" & vbCrLf & vbCrLf & "Exiting", vbExclamation, "NDS Rom rename"
End
Else
f = p & f & ".nds"
End If
'MsgBox f
MoveFileEx sROM, f, &H1

End Sub
Private Function ByteToHex$(b As Byte) 'for testing purposes
Dim d$(1), n&(1), i%
ByteToHex = Space$(2): n(0) = b \ 16: n(1) = b Mod 16
For i = 0 To 1
If n(i) > 9 Then
d(i) = Chr(55 + n(i))
Else
d(i) = Chr(48 + n(i))
End If
Mid$(ByteToHex, i + 1, 1) = d(i)
Next
End Function
Function H2D&(h$)
Dim n&, t&
H2D = 0: h = UCase(h)
For n = Len(h) To 1 Step -1
t = Asc(Mid$(h, n, 1)) - 48
If t > 9 Then t = t - 7
H2D = H2D + (t * (16 ^ (Len(h) - n)))
Next
End Function
Old 21 December 2007, 06:11 PM
  #2  
DJ Dunk
Moderator
Support Scoobynet!
iTrader: (5)
 
DJ Dunk's Avatar
 
Join Date: Nov 2001
Location: Not all those who wander are lost
Posts: 17,864
Received 0 Likes on 0 Posts
Default

Works a treat, thanks

Can it automatically replace underscores with spaces too?
Old 21 December 2007, 09:48 PM
  #3  
Pumpkin
Scooby Senior
 
Pumpkin's Avatar
 
Join Date: Mar 1999
Location: Norwich
Posts: 1,835
Likes: 0
Received 0 Likes on 0 Posts
Default

cool
Old 21 December 2007, 10:05 PM
  #4  
stevem2k
Scooby Regular
 
stevem2k's Avatar
 
Join Date: Sep 2001
Location: Kingston ( Surrey, not Jamaica )
Posts: 4,670
Likes: 0
Received 0 Likes on 0 Posts
Default

found the password then

Cheers

Steve
Old 24 December 2007, 11:56 PM
  #5  
boxst
Scooby Regular
 
boxst's Avatar
 
Join Date: Nov 1998
Posts: 11,905
Likes: 0
Received 0 Likes on 0 Posts
Default

Thank you, that's cool.

Steve
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
JimBowen
ICE
5
02 July 2023 01:54 PM
Sam Witwicky
Engine Management and ECU Remapping
17
13 November 2015 10:49 AM
XRS
Computer & Technology Related
18
16 October 2015 01:38 PM
Wurzel
Computer & Technology Related
10
28 September 2015 12:28 PM
Littleted
Computer & Technology Related
4
25 September 2015 09:55 PM



Quick Reply: NDS Rom Renamer (free app from me) ....



All times are GMT +1. The time now is 02:25 AM.