Skip to content

Commit

Permalink
V1.3.2 Update
Browse files Browse the repository at this point in the history
Added code to fix bad cuesheet indexes for Audio, since some PSX dumps on ReDump.org contain invalid indexes and crashed SBITools before.
  • Loading branch information
Kippykip committed Jun 19, 2019
1 parent 03f5479 commit 66b00ed
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


# SBITools
SBITools v0.3.1 - http://kippykip.com
SBITools v0.3.2 - http://kippykip.com

**Description:**
This is a small set of conversion tools written in BlitzMax to reconstruct .SUB files using .SBI/.LSD files, and can even convert a full BIN/CUE/SBI emulator setup into a IMG/CCD/SUB setup which can be put into popular CD Burning programs such as CloneCD.
Expand Down Expand Up @@ -64,6 +64,8 @@ I've bundled them all on the [releases page](https://github.com/Kippykip/SBITool

**Version History**

Version 0.3.2
- Modified CUESheet code to detect and fix bad AUDIO indexes. As some ReDump.org PSX dumps contain a single index for some audio tracks.
Version 0.3.1
- Fixed a bug where CD images would not be copied if it was in the same directory as SBITools.
- CUE2CCD.BAT and SINGLETRACK.BAT drag and drop now works if the image was dragged from another drive letter.
Expand Down
28 changes: 27 additions & 1 deletion functions.bmx
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,33 @@ Type CUE
ElseIf(Line.StartsWith("INDEX"))
Local Split:String[] = Line.Split(" ") 'Split the spaces
Local MSF:String[] = Split[2].Split(":") 'Split the colons from the MSF XX:XX:XX
AddListing(CurrentTrack, CurrentTrackType, Int(Split[1]), Int(MSF[0]), Int(MSF[1]), Int(MSF[2]), CurrentTrackFN)

'QUICK HACK TO ADDRESS ISSUE #4 ON GITHUB
'Ok so is there an Index of 1, with 00 00 00 MSF?
'Hmm this COULD be a bad redump.org cuesheet.
'If there's a missing Index 00 then it's def bad, lets check for it
If(CurrentTrackType = "AUDIO" And Int(Split[1]) = 1 And Int(MSF[0]) = 0 And Int(MSF[1]) = 0 And Int(MSF[2]) = 0)
'We'll default the exists flag to false, because the FOR loop won't do anything if it's not found
Local Index0Exists:Byte = False
For Local IndexFixCue:CUE = EachIn CUE.List:TList
If(IndexFixCue.Index = 0 And IndexFixCue.Track = CurrentTrack And IndexFixCue.TrackType = CurrentTrackType)
'Ok there was an index of 00 beforehand for this track
Index0Exists = True
EndIf
Next

'Hmmm, guess I was wrong and there's no leadin or something for this track?
If(Index0Exists)
AddListing(CurrentTrack, CurrentTrackType, Int(Split[1]), Int(MSF[0]), Int(MSF[1]), Int(MSF[2]), CurrentTrackFN)
Else 'Ok confirmed, this is a bad cuesheet. Let's fix it ourselves
Print "WARNING! Bad Index in CueSheet for TRACK '" + CurrentTrack + "'! Repairing..."
Print "If it's a ReDump.org source, you should report the cuesheet!"
AddListing(CurrentTrack, CurrentTrackType, 0, 0, 0, 0, CurrentTrackFN)
AddListing(CurrentTrack, CurrentTrackType, 1, 0, 2, 0, CurrentTrackFN)
EndIf
Else
AddListing(CurrentTrack, CurrentTrackType, Int(Split[1]), Int(MSF[0]), Int(MSF[1]), Int(MSF[2]), CurrentTrackFN)
EndIf
EndIf
Wend
'Done using this file
Expand Down
2 changes: 1 addition & 1 deletion sbitools.bmx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Include "CRC16.bmx"
Include "functions.bmx"

'Main Program
Print "SBITools v0.3.1 - http://kippykip.com"
Print "SBITools v0.3.2 - http://kippykip.com"
Global Prog:Int = 0

'Check for psxt001z.exe
Expand Down

0 comments on commit 66b00ed

Please sign in to comment.