Skip to content

Commit

Permalink
- Added support to rebuild ripped game into Clone CD (ccd) fromat by …
Browse files Browse the repository at this point in the history
…BizHawk.Emulation.DiscSystem.dll
  • Loading branch information
Speedvicio committed Dec 30, 2018
1 parent d305eaf commit 4ce0276
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 14 deletions.
Binary file added Laziass/BizHawk.Common.dll
Binary file not shown.
Binary file added Laziass/BizHawk.Emulation.DiscSystem.dll
Binary file not shown.
9 changes: 9 additions & 0 deletions Laziass/LazyAss.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Laziass/LazyAss.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@
<metadata name="BackgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ToolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>180, 17</value>
</metadata>
<metadata name="SaveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>436, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>47</value>
</metadata>
Expand Down
52 changes: 49 additions & 3 deletions Laziass/LazyAss.vb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Imports System.ComponentModel
Imports System.IO
Imports DiscTools
Imports BizHawk.Emulation.DiscSystem

Public Class LazyAss

Expand All @@ -12,6 +13,34 @@ Public Class LazyAss

Public Declare Function OpenDrawerCD Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Private Sub MakeCCD()
Try
SaveFileDialog1.InitialDirectory = OutputPath.Text & RippedName.Text
SaveFileDialog1.FileName = Path.GetFileNameWithoutExtension(dtl_iso)

If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
Dim basename As String = Path.Combine(OutputPath.Text & RippedName.Text, Path.GetFileNameWithoutExtension(dtl_iso))
Dim job = New DiscMountJob With {.IN_FromPath = basename & ".cue"}
job.Run()
Dim disc = job.OUT_Disc

If job.OUT_ErrorLevel Then
MsgBox(job.OUT_Log, "Error loading CUE", vbOK + vbCritical)
Exit Sub
End If

'Dim outfile As String = basename & ".ccd"
CCD_Format.Dump(disc, SaveFileDialog1.FileName)
'MsgBox("Virtual CCD image created!", vbOKOnly + MsgBoxStyle.Information, "CCD image created!")
Else
Exit Sub
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try

End Sub

Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SelectImage.Click
task = 0
Dim mnt_iso As OpenFileDialog = New OpenFileDialog()
Expand Down Expand Up @@ -288,11 +317,13 @@ Public Class LazyAss
Dim ExFileOnFolder As IO.FileInfo
ExFile = ExPath.GetFiles("*" & ExtRip)

Dim ExtractAudioFromCue As String = CueExtInside(dtl_iso)

Try
For Each ExFileOnFolder In ExFile
If ExtRip = ".*" Then
Dim filetypeonfolder = LCase(ExFileOnFolder.Extension)
If filetypeonfolder = CueExtInside(dtl_iso) Or filetypeonfolder = ".iso" Then
If filetypeonfolder = ExtractAudioFromCue Or filetypeonfolder = ".iso" And filetypeonfolder <> ".bin" Then
ListAddsFile.Items.Add(ExFileOnFolder.Name)
End If
Else
Expand All @@ -316,7 +347,7 @@ Public Class LazyAss
End Sub

Private Function CueExtInside(pathcue As String)
Dim righe As String() = File.ReadAllLines(dtl_iso)
Dim righe As String() = File.ReadAllLines(pathcue)
Dim result() As String
For i = 0 To 10
If UCase(righe(i)).Contains("FILE ") Then
Expand All @@ -326,7 +357,8 @@ Public Class LazyAss
result = righe(i).Split(" ")
End If
Dim cueext = LCase(Path.GetExtension(Replace(result(1).Trim, """", "")))
If cueext <> ".iso" Or cueext <> ".bin" Then
If cueext = ".iso" Then 'Or cueext = ".bin"
Else
Return (cueext)
Exit For
End If
Expand Down Expand Up @@ -733,6 +765,10 @@ Public Class LazyAss
End If
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs)
MakeCCD()
End Sub

Private Sub EjectUnmountDriveToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EjectUnmountDriveToolStripMenuItem.Click
Try
If DVDBrand.Contains("DiscSoft Virtual") Then
Expand Down Expand Up @@ -1078,6 +1114,16 @@ Public Class LazyAss

If ErrorAbort > 1 Then Exit Sub

If RebuildCUE.Checked = True Then
Select Case CueExtInside(OutputPath.Text & RippedName.Text & "\" & Path.GetFileName(dtl_iso))
Case ".wav", ".bin"
Dim MCCD = MsgBox("Do you want do create a ccd/img/sub?", vbYesNo + MsgBoxStyle.Information, "Make a CCD?")
If MCCD = vbYes Then
MakeCCD()
End If
End Select
End If

TSound = "Yoolaiyoleihee"
PlayRandom()
MsgBox("Conversion Done!", vbInformation + MsgBoxStyle.OkOnly)
Expand Down
8 changes: 7 additions & 1 deletion Laziass/LazyAss.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<AssemblyName>LazyAss</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>WindowsForms</MyType>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<OptionExplicit>On</OptionExplicit>
<OptionCompare>Binary</OptionCompare>
<OptionStrict>Off</OptionStrict>
Expand Down Expand Up @@ -49,6 +49,7 @@
<DocumentationFile>LazyAss.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -58,11 +59,16 @@
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>LazyAss.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\Icons\cockroach.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="BizHawk.Emulation.DiscSystem, Version=2.3.0.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\BizHawk.Emulation.DiscSystem.dll</HintPath>
</Reference>
<Reference Include="DiscTools">
<HintPath>.\DiscTools.dll</HintPath>
</Reference>
Expand Down
4 changes: 2 additions & 2 deletions Laziass/My Project/Application.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Laziass/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("LazyAss Cd Image Ripper")>
<Assembly: AssemblyCopyright("Copyright © 2016")>
<Assembly: AssemblyCopyright("")>
<Assembly: AssemblyTrademark("")>

<Assembly: ComVisible(False)>
Expand Down
4 changes: 2 additions & 2 deletions Laziass/My Project/Settings.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Laziass/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
<!-- Questa sezione definisce la configurazione di registrazione per My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog" />
<add name="FileLog"/>
<!-- Per scrivere nel log eventi dell'applicazione, rimuovere il commento dalla sezione sottostante -->
<!--<add name="EventLog" />-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
<add name="DefaultSwitch" value="Information"/>
</switches>
<sharedListeners>
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter" />
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
<!-- Per scrivere nel log eventi dell'applicazione, rimuovere il commento dalla sezione sottostante e sostituire APPLICATION_NAME con il nome dell'applicazione -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME" /> -->
</sharedListeners>
</system.diagnostics>
<startup>

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup>
</configuration>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup>
</configuration>

0 comments on commit 4ce0276

Please sign in to comment.