Easy Rom Manager ~DSROM管理ツール~
 
DSのROMを管理するツール(EasyRomManager)の部屋です。おまけでDS ROM LISTもあります。
 


アイコン吸出し

本ソフトではdsrom.dllを利用して以下のように吸い出しています。
DSROMのファイルフォーマットは「DS ROM フォーマット」などとググって下さい。
-------------------------------------------------------------

'DSのROM情報(DLL用)
Private Type DS_INFO_DLL
rom_code(0 To 3) As Byte
Title(0 To 127) As Integer
maker(0 To 127) As Integer
crc As Integer
End Type


'ROMの情報取得
Private Declare Function getDSRomInfo Lib "dsrom.dll" _
(ByVal path As String, ByRef info As DS_INFO_DLL) As Integer

'アイコンデータ作成
Private Declare Function creDSRomIcon Lib "dsrom.dll" _
(ByVal path As String, ByVal icon_path As String) As Integer

'-----------------------------------------
' ROM情報取得サンプルコード
'-----------------------------------------

Private Sub test_info()
Dim path As String
Dim info As DS_INFO

path = "C:\NDS\TEST.nds"

If GetDsInfo(path, info) = False Then
'エラー処理
End If
End Sub

'-----------------------------------------
' アイコン吸出しサンプルコード
'-----------------------------------------

Private Sub test_cre()
Dim path As String
Dim icon_path As String
Dim ret As Integer

path = "C:\NDS\TEST.nds"
icon_path = "C:\NDS\TEST.gif"

If CreDSIcon(path, icon_path) = False Then
'エラー処理
End If

End Sub

'-----------------------------------------
' Rom情報を取得する
'-----------------------------------------

Public Function GetDsInfo(path As String, info As DS_INFO) As Boolean
Dim ret As Integer
Dim bRet As Boolean
Dim work As String
Dim getInfo As DS_INFO_DLL

ret = getDSRomInfo(path, getInfo) 'DLL API Call

If ret = 0 Then
bRet = False
Else
'RomCode
Call chgAryToString(work, getInfo.rom_code)
info.rom_code = Trim(work)
'タイトル名
Call chgAryToString(work, getInfo.Title)
info.Title = Trim(work)
'メーカー名
Call chgAryToString(work, getInfo.maker)
info.maker = Trim(work)
'CRC
info.crc = getInfo.crc
bRet = True
End If

GetDsInfo = bRet
End Function

'-----------------------------------------
' Iconを作成する
'-----------------------------------------

Public Function CreDSIcon(path As String, icon_path As String) As Boolean

Dim ret As Integer
Dim bRet As Boolean

ret = creDSRomIcon(path, icon_path) 'DLL API Call
If ret = 0 Then
bRet = False
Else
bRet = True
End If

CreDSIcon = bRet

End Function

'-----------------------------------------
' 配列の文字列をString型にする
'-----------------------------------------

Private Sub chgAryToString(dst As String, src As Variant)
Dim i As Integer
Dim sWork As String
Dim max As Long
Dim up As Long, down As Long
Dim u As Long, d

dst = ""
For i = 0 To UBound(src)
If (src(i) = 0) Then
Exit For
End If

dst = dst + Chr(src(i))
Next

End Sub






8月24日(月)22:31 | よくある質問 | 管理

この記事へのコメント投稿はできない設定になっています
コメントはありません。


(1/1ページ)