Skip to content

Commit

Permalink
Updated cmake for windows build, altered main.c to use 'XML_SUCCESS' …
Browse files Browse the repository at this point in the history
…instead of 'XML_NO_ERROR' as the later is not defined in some versions of tinyXML
  • Loading branch information
sparkletron committed Oct 15, 2016
1 parent 5b7ffd5 commit 5e905bb
Show file tree
Hide file tree
Showing 14 changed files with 3,214 additions and 3,175 deletions.
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/bin*/
/CMakeFiles/
Makefile
*.cmake
*.txt
*.cdp
*.layout
/bin*/
/CMakeFiles/
Makefile
CMakeCache.txt
*.cmake
*.cdp
*.layout
39 changes: 39 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
cmake_minimum_required(VERSION 2.8.4)
include(FindPkgConfig)

#set global exe name
set(MAIN "mkpsxiso")

project(${MAIN})
#include directory, same for all build types
include_directories(include)

file(GLOB SOURCES "src/*.cpp")

find_package(PkgConfig REQUIRED)

pkg_search_module(TINYXML REQUIRED tinyxml2)

#include sources that are platform specific
if(MINGW OR MSYS OR CYGWIN OR MSVC)
message(STATUS "WINDOWS BUILD")

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin_win)

elseif(APPLE OR WATCOM OR BORLAND)
message(FATAL_ERROR "CAN NOT BUILD FOR APPLE, WATCOM, BORLAND")

elseif(UNIX)
message(STATUS "LINUX BUILD")

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin_nix)

else()
message(FATAL_ERROR "NO BUILD TARGET MATCH")

endif()


add_executable(${MAIN} ${SOURCES})

target_link_libraries(${MAIN} ${TINYXML_LIBRARIES})
678 changes: 339 additions & 339 deletions LICENSE.md

Large diffs are not rendered by default.

76 changes: 38 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# MKPSXISO
Basically a modern clone of BUILDCD that came included with the PsyQ SDK for generating ISO disc images used for developing PlayStation software (usually homebrew nowadays). The problem with BUILDCD however is that it's an old real-mode DOS program and will not work on 64-bit versions of Windows without a DOS emulator. Also, BUILDCD only produces CD images in an unusual image format used by early CD writers which must be converted to a usable ISO format using a separate tool, making the already slow ISO generation process even slower.

While other ISO generator tools such as the popular MKISOFS may work, most do not let you control the order of the files by LBA (which is very important when optimizing file orders to speed up seek times) and all do not support mixed-mode XA file integration for streaming files such as XA audio and MDEC STR video... Thus, MKPSXISO was made to replace BUILDCD to aid PlayStation homebrew development on modern systems.

MKPSXISO more or less replicates BUILDCD's functionality but better, the most notable difference is that MKPSXISO produces ISO images in either iso or bin format so that generated images can immediately be loaded to an emulator or burned to a CD. The image files may also be paired with an optional cue sheet for images containing multiple tracks (usually CD audio tracks).

Another notable difference is that MKPSXISO injects the Sony license data correctly into the disc image. However, the license data is not provided with the program so one must have a copy of the PsyQ SDK (which can be found in www.psxdev.net) for the license data. This is to avoid possible legal problems when including Sony's license data into open source programs and it's better to be safe than sorry... Besides, there already exists disc patcher tools to inject license data if you don't use the PsyQ SDK anyway.

## Features
* Outputs in iso/bin format with cue sheet for multi-track ISO projects.
* Injects license data correctly.
* Manual file ordering to allow file order optimization.
* Supports mixed-mode XA file integration for CD-XA streams such as XA audio and STR video.
* Supports injecting CD-DA audio tracks into the generated ISO file.
* Uses XML for ISO project scripting.

## Binary Download
The latest precompiled Win32 binary of this program can be downloaded here:
[mkpsxiso-1.04.zip](http://lameguy64.github.io/mkpsxiso/mkpsxiso-1.04.zip)

Older versions:
[mkpsxiso-1.00.zip](http://lameguy64.github.io/mkpsxiso/mkpsxiso-1.00.zip)

## Compiling
This tool requires tinyxml2 to compile.

To compile for Windows, simply open the CodeBlocks project file within the CodeBlocks IDE then compile. You must use the MinGW GCC compiler (usually included with CodeBlocks) as the source code uses linux specific functions that are not present in Visual C.

Compiling this program in a Linux environment is not tested yet.

## Changelog
**Version 1.04**
* Fixed a bug where you'll get a 'Data track must only be on first track' error when creating an ISO image with more than 2 tracks even when the extra tracks are CD audio.
* Duplicate file and directory entries are no longer possible to add (it'll result to weird problems anyway).

**Version 1.00**
* Initial release.
# MKPSXISO
Basically a modern clone of BUILDCD that came included with the PsyQ SDK for generating ISO disc images used for developing PlayStation software (usually homebrew nowadays). The problem with BUILDCD however is that it's an old real-mode DOS program and will not work on 64-bit versions of Windows without a DOS emulator. Also, BUILDCD only produces CD images in an unusual image format used by early CD writers which must be converted to a usable ISO format using a separate tool, making the already slow ISO generation process even slower.

While other ISO generator tools such as the popular MKISOFS may work, most do not let you control the order of the files by LBA (which is very important when optimizing file orders to speed up seek times) and all do not support mixed-mode XA file integration for streaming files such as XA audio and MDEC STR video... Thus, MKPSXISO was made to replace BUILDCD to aid PlayStation homebrew development on modern systems.

MKPSXISO more or less replicates BUILDCD's functionality but better, the most notable difference is that MKPSXISO produces ISO images in either iso or bin format so that generated images can immediately be loaded to an emulator or burned to a CD. The image files may also be paired with an optional cue sheet for images containing multiple tracks (usually CD audio tracks).

Another notable difference is that MKPSXISO injects the Sony license data correctly into the disc image. However, the license data is not provided with the program so one must have a copy of the PsyQ SDK (which can be found in www.psxdev.net) for the license data. This is to avoid possible legal problems when including Sony's license data into open source programs and it's better to be safe than sorry... Besides, there already exists disc patcher tools to inject license data if you don't use the PsyQ SDK anyway.

## Features
* Outputs in iso/bin format with cue sheet for multi-track ISO projects.
* Injects license data correctly.
* Manual file ordering to allow file order optimization.
* Supports mixed-mode XA file integration for CD-XA streams such as XA audio and STR video.
* Supports injecting CD-DA audio tracks into the generated ISO file.
* Uses XML for ISO project scripting.

## Binary Download
The latest precompiled Win32 binary of this program can be downloaded here:
[mkpsxiso-1.04.zip](http://lameguy64.github.io/mkpsxiso/mkpsxiso-1.04.zip)

Older versions:
[mkpsxiso-1.00.zip](http://lameguy64.github.io/mkpsxiso/mkpsxiso-1.00.zip)

## Compiling
This tool requires tinyxml2 to compile.

To compile for Windows, simply open the CodeBlocks project file within the CodeBlocks IDE then compile. You must use the MinGW GCC compiler (usually included with CodeBlocks) as the source code uses linux specific functions that are not present in Visual C.

Compiling this program in a Linux environment is not tested yet.

## Changelog
**Version 1.04**
* Fixed a bug where you'll get a 'Data track must only be on first track' error when creating an ISO image with more than 2 tracks even when the extra tracks are CD audio.
* Duplicate file and directory entries are no longer possible to add (it'll result to weird problems anyway).

**Version 1.00**
* Initial release.
240 changes: 120 additions & 120 deletions examples/example.xml
Original file line number Diff line number Diff line change
@@ -1,121 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- MKPSXISO example XML script -->

<!-- <iso_project>
Starts an ISO image project to build. Multiple <iso_project> elements may be
specified within the same xml script which useful for multi-disc projects.
<iso_project> elements must contain at least one <track> element.
Attributes:
image_name - File name of the ISO image file to generate.
cue_sheet - Optional, file name of the cue sheet for the image file
(required if more than one track is specified).
-->
<iso_project image_name="myimage.bin" cue_sheet="myimage.cue">

<!-- <track>
Specifies a track to the ISO project. This example element creates a data
track for storing data files and CD-XA/STR streams.
Only one data track is allowed and data tracks must only be specified as the
first track in the ISO image and cannot be specified after an audio track.
Attributes:
type - Track type (either data or audio).
source - For audio tracks only, specifies the file name of a wav audio
file to use for the audio track.
-->
<track type="data">

<!-- <identifiers>
Optional, Specifies the identifier strings to use for the data track.
Attributes:
system - Optional, specifies the system identifier (PLAYSTATION if unspecified).
application - Optional, specifies the application identifier (PLAYSTATION if unspecified).
volume - Optional, specifies the volume identifier.
volume_set - Optional, specifies the volume set identifier.
publisher - Optional, specifies the publisher identifier.
data_preparer - Optional, specifies the data preparer identifier. If unspecified, MKPSXISO
will fill it with lengthy text telling that the image file was generated
using MKPSXISO.
-->
<identifiers
system ="PLAYSTATION"
application ="PLAYSTATION"
volume ="MYDISC"
volume_set ="MYDISC"
publisher ="MYPUBLISHER"
data_preparer ="MKPSXISO"
/>

<!-- <license>
Optional, specifies the license file to use, the format of the license file must be in
raw 2336 byte sector format, like the ones included with the PsyQ SDK in psyq\cdgen\LCNSFILE.
License data is not included within the MKPSXISO program to avoid possible legal problems
in the open source environment... Better be safe than sorry.
Attributes:
file - Specifies the license file to inject into the ISO image.
-->
<license file="licensea.dat"/>

<!-- <directory_tree>
Specifies and contains the directory structure for the data track.
Attributes:
None.
-->
<directory_tree>

<!-- <file>
Specifies a file in the directory tree.
Attributes:
name - File name to use in the directory tree (can be used for renaming).
type - Optional, type of file (data for regular files and is the default, xa for
XA audio and str for MDEC video).
source - File name of the source file.
-->
<!-- Stores system.txt as system.cnf -->
<file name="system.cnf" type="data" source="system.txt"/>
<file name="myexec.exe" type="data" source="myexec.exe"/>

<!-- <dir>
Specifies a directory in the directory tree. <file> and <dir> elements inside the element
will be inside the specified directory.
-->
<dir name="mydir">

<!-- All <file> and <dir> elements here will be inside mydir -->

<file name="myfile.dat" type="data" source="myfile.dat"/>

<!-- Specifies a directory inside mydir -->
<dir name="mystreams">

<!-- Specifies a file as XA audio -->
<file name="mymusic.xa" type="xa" source="mymusic.xa"/>
<!-- Specifies a file as STR MDEC video -->
<file name="mymovie.str" type="str" source="mymovie.str"/>

</dir>

</dir>

</directory_tree>

</track>

<!-- Specifies CD-DA audio tracks
WAV files must be of Microsoft format, uncompressed, 44100KHz 16-bit stereo.
-->
<track type="audio" source="mytrack2.wav"/>
<track type="audio" source="mytrack3.wav"/>

<?xml version="1.0" encoding="UTF-8"?>

<!-- MKPSXISO example XML script -->

<!-- <iso_project>
Starts an ISO image project to build. Multiple <iso_project> elements may be
specified within the same xml script which useful for multi-disc projects.
<iso_project> elements must contain at least one <track> element.
Attributes:
image_name - File name of the ISO image file to generate.
cue_sheet - Optional, file name of the cue sheet for the image file
(required if more than one track is specified).
-->
<iso_project image_name="myimage.bin" cue_sheet="myimage.cue">

<!-- <track>
Specifies a track to the ISO project. This example element creates a data
track for storing data files and CD-XA/STR streams.
Only one data track is allowed and data tracks must only be specified as the
first track in the ISO image and cannot be specified after an audio track.
Attributes:
type - Track type (either data or audio).
source - For audio tracks only, specifies the file name of a wav audio
file to use for the audio track.
-->
<track type="data">

<!-- <identifiers>
Optional, Specifies the identifier strings to use for the data track.
Attributes:
system - Optional, specifies the system identifier (PLAYSTATION if unspecified).
application - Optional, specifies the application identifier (PLAYSTATION if unspecified).
volume - Optional, specifies the volume identifier.
volume_set - Optional, specifies the volume set identifier.
publisher - Optional, specifies the publisher identifier.
data_preparer - Optional, specifies the data preparer identifier. If unspecified, MKPSXISO
will fill it with lengthy text telling that the image file was generated
using MKPSXISO.
-->
<identifiers
system ="PLAYSTATION"
application ="PLAYSTATION"
volume ="MYDISC"
volume_set ="MYDISC"
publisher ="MYPUBLISHER"
data_preparer ="MKPSXISO"
/>

<!-- <license>
Optional, specifies the license file to use, the format of the license file must be in
raw 2336 byte sector format, like the ones included with the PsyQ SDK in psyq\cdgen\LCNSFILE.
License data is not included within the MKPSXISO program to avoid possible legal problems
in the open source environment... Better be safe than sorry.
Attributes:
file - Specifies the license file to inject into the ISO image.
-->
<license file="licensea.dat"/>

<!-- <directory_tree>
Specifies and contains the directory structure for the data track.
Attributes:
None.
-->
<directory_tree>

<!-- <file>
Specifies a file in the directory tree.
Attributes:
name - File name to use in the directory tree (can be used for renaming).
type - Optional, type of file (data for regular files and is the default, xa for
XA audio and str for MDEC video).
source - File name of the source file.
-->
<!-- Stores system.txt as system.cnf -->
<file name="system.cnf" type="data" source="system.txt"/>
<file name="myexec.exe" type="data" source="myexec.exe"/>

<!-- <dir>
Specifies a directory in the directory tree. <file> and <dir> elements inside the element
will be inside the specified directory.
-->
<dir name="mydir">

<!-- All <file> and <dir> elements here will be inside mydir -->

<file name="myfile.dat" type="data" source="myfile.dat"/>

<!-- Specifies a directory inside mydir -->
<dir name="mystreams">

<!-- Specifies a file as XA audio -->
<file name="mymusic.xa" type="xa" source="mymusic.xa"/>
<!-- Specifies a file as STR MDEC video -->
<file name="mymovie.str" type="str" source="mymovie.str"/>

</dir>

</dir>

</directory_tree>

</track>

<!-- Specifies CD-DA audio tracks
WAV files must be of Microsoft format, uncompressed, 44100KHz 16-bit stereo.
-->
<track type="audio" source="mytrack2.wav"/>
<track type="audio" source="mytrack3.wav"/>

</iso_project>
Loading

0 comments on commit 5e905bb

Please sign in to comment.