Skip to content

Commit

Permalink
repair discohawk and cleanup. remember to re-add CCD exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
zeromus committed Jul 11, 2015
1 parent 4f978cc commit 962b567
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 235 deletions.
4 changes: 2 additions & 2 deletions BizHawk.Client.DiscoHawk/AudioExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public static void Extract(Disc disc, string path, string filebase)
var tracks = disc.Structure.Sessions[0].Tracks;
foreach (var track in tracks)
{
if (track.TrackType != DiscStructure.ETrackType.Audio)
if (!track.IsAudio)
continue;

var waveData = new byte[track.Length * 2352];
int startLba = track.Indexes[1].LBA;
int startLba = track.LBA;
for (int sector = 0; sector < track.Length; sector++)
dsr.ReadLBA_2352(startLba + sector, waveData, sector * 2352);

Expand Down
9 changes: 0 additions & 9 deletions BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@
<Compile Include="MainDiscoForm.Designer.cs">
<DependentUpon>MainDiscoForm.cs</DependentUpon>
</Compile>
<Compile Include="ProgressDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ProgressDialog.Designer.cs">
<DependentUpon>ProgressDialog.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand All @@ -131,9 +125,6 @@
<DependentUpon>MainDiscoForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ProgressDialog.resx">
<DependentUpon>ProgressDialog.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
Expand Down
189 changes: 0 additions & 189 deletions BizHawk.Client.DiscoHawk/MednadiscTester.cs

This file was deleted.

13 changes: 0 additions & 13 deletions BizHawk.Emulation.DiscSystem/API/Disc.API.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@ public DiscReferenceException(string fname, string extrainfo)
}
}

/// <summary>
/// this is junk
/// </summary>
public class ProgressReport
{
public string Message;
public bool InfoPresent;
public double ProgressEstimate;
public double ProgressCurrent;
public int TaskCount;
public int TaskCurrent;
public bool CancelSignal;
}


sealed public partial class Disc
Expand Down
45 changes: 23 additions & 22 deletions BizHawk.Emulation.DiscSystem/CCD_format.cs
Original file line number Diff line number Diff line change
Expand Up @@ -417,31 +417,32 @@ public static void Dump(Disc disc, string path)

}

//TODO - actually re-add
//dump the img and sub
//TODO - acquire disk size first
string imgPath = Path.ChangeExtension(path, ".img");
string subPath = Path.ChangeExtension(path, ".sub");
var buffer = new byte[2352];
using (var s = File.OpenWrite(imgPath))
{
DiscSectorReader dsr = new DiscSectorReader(disc);
//string imgPath = Path.ChangeExtension(path, ".img");
//string subPath = Path.ChangeExtension(path, ".sub");
//var buffer = new byte[2352];
//using (var s = File.OpenWrite(imgPath))
//{
// DiscSectorReader dsr = new DiscSectorReader(disc);

//TODO - dont write leadout sectors, if they exist!
for (int aba = 150; aba < disc.Sectors.Count; aba++)
{
dsr.ReadLBA_2352(aba - 150, buffer, 0);
s.Write(buffer, 0, 2352);
}
}
using (var s = File.OpenWrite(subPath))
{
//TODO - dont write leadout sectors, if they exist!
for (int aba = 150; aba < disc.Sectors.Count; aba++)
{
disc.ReadLBA_SectorEntry(aba - 150).SubcodeSector.ReadSubcodeDeinterleaved(buffer, 0);
s.Write(buffer, 0, 96);
}
}
// //TODO - dont write leadout sectors, if they exist!
// for (int aba = 150; aba < disc.Sectors.Count; aba++)
// {
// dsr.ReadLBA_2352(aba - 150, buffer, 0);
// s.Write(buffer, 0, 2352);
// }
//}
//using (var s = File.OpenWrite(subPath))
//{
// //TODO - dont write leadout sectors, if they exist!
// for (int aba = 150; aba < disc.Sectors.Count; aba++)
// {
// disc.ReadLBA_SectorEntry(aba - 150).SubcodeSector.ReadSubcodeDeinterleaved(buffer, 0);
// s.Write(buffer, 0, 96);
// }
//}
}

class SS_CCD : ISectorSynthJob2448
Expand Down

0 comments on commit 962b567

Please sign in to comment.