mirror of https://github.com/AxioDL/nod.git
Update README.md
This commit is contained in:
parent
6302acfce4
commit
a98927d4a0
26
README.md
26
README.md
|
@ -1,23 +1,23 @@
|
||||||
### NODLib
|
### NOD
|
||||||
|
|
||||||
**NODLib** is a library and utility (`nodtool`) for traversing, dumping, and authoring
|
**NOD** is a library and utility (`nodtool`) for traversing, dumping, and authoring
|
||||||
*GameCube* and *Wii* optical disc images.
|
*GameCube* and *Wii* optical disc images.
|
||||||
|
|
||||||
#### Library
|
#### Library
|
||||||
|
|
||||||
The primary motivation of NODLib is to supply a *uniform C++11 API* for accessing data
|
The primary motivation of NOD is to supply a *uniform C++11 API* for accessing data
|
||||||
from image files directly. `NOD::DiscBase` provides a common interface for traversing partitions
|
from image files directly. `nod::DiscBase` provides a common interface for traversing partitions
|
||||||
and individual files. Files may be individually streamed, or the whole partition may be extracted
|
and individual files. Files may be individually streamed, or the whole partition may be extracted
|
||||||
to the user's filesystem. Raw *ISO* and *WBFS* images are supported read sources.
|
to the user's filesystem. Raw *ISO* and *WBFS* images are supported read sources.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
bool isWii; /* Set by reference next line */
|
bool isWii; /* Set by reference next line */
|
||||||
std::unique_ptr<NOD::DiscBase> disc = NOD::OpenDiscFromImage(path, isWii);
|
std::unique_ptr<nod::DiscBase> disc = nod::OpenDiscFromImage(path, isWii);
|
||||||
if (!disc)
|
if (!disc)
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
|
|
||||||
/* Access first data-partition on Wii, or full GameCube disc */
|
/* Access first data-partition on Wii, or full GameCube disc */
|
||||||
NOD::Partition* dataPart = disc->getDataPartition();
|
nod::Partition* dataPart = disc->getDataPartition();
|
||||||
if (!dataPart)
|
if (!dataPart)
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
|
|
||||||
|
@ -29,33 +29,33 @@ return SUCCESS;
|
||||||
```
|
```
|
||||||
|
|
||||||
*Image authoring* is always done from the user's filesystem and may be integrated into
|
*Image authoring* is always done from the user's filesystem and may be integrated into
|
||||||
a content pipeline using the `NOD::DiscBuilderBase` interface.
|
a content pipeline using the `nod::DiscBuilderBase` interface.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
/* Sample logging lambda for progress feedback */
|
/* Sample logging lambda for progress feedback */
|
||||||
size_t lastIdx = -1;
|
size_t lastIdx = -1;
|
||||||
auto progFunc = [&](size_t idx, const NOD::SystemString& name, size_t bytes)
|
auto progFunc = [&](size_t idx, const nod::SystemString& name, size_t bytes)
|
||||||
{
|
{
|
||||||
if (idx != lastIdx)
|
if (idx != lastIdx)
|
||||||
{
|
{
|
||||||
lastIdx = idx;
|
lastIdx = idx;
|
||||||
/* NOD provides I/O wrappers using wchar_t on Windows;
|
/* NOD provides I/O wrappers using wchar_t on Windows;
|
||||||
* _S() conditionally makes string-literals wide */
|
* _S() conditionally makes string-literals wide */
|
||||||
NOD::Printf(_S("\n"));
|
nod::Printf(_S("\n"));
|
||||||
}
|
}
|
||||||
if (bytes != -1)
|
if (bytes != -1)
|
||||||
NOD::Printf(_S("\r%s %" PRISize " B"), name.c_str(), bytes);
|
nod::Printf(_S("\r%s %" PRISize " B"), name.c_str(), bytes);
|
||||||
else
|
else
|
||||||
NOD::Printf(_S("\r%s"), name.c_str());
|
nod::Printf(_S("\r%s"), name.c_str());
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Making a GCN image */
|
/* Making a GCN image */
|
||||||
NOD::DiscBuilderGCN b(isoOutPath, gameID, gameTitle, dolLoadAddress, progFunc);
|
nod::DiscBuilderGCN b(isoOutPath, gameID, gameTitle, dolLoadAddress, progFunc);
|
||||||
ret = b.buildFromDirectory(fsRootDirPath, bootDolPath, apploaderPath);
|
ret = b.buildFromDirectory(fsRootDirPath, bootDolPath, apploaderPath);
|
||||||
|
|
||||||
/* Making a Wii image */
|
/* Making a Wii image */
|
||||||
NOD::DiscBuilderWii b(isoOutPath, gameID, gameTitle, dualLayer, progFunc);
|
nod::DiscBuilderWii b(isoOutPath, gameID, gameTitle, dualLayer, progFunc);
|
||||||
ret = b.buildFromDirectory(fsRootDirPath, bootDolPath, apploaderPath, partitionHeadPath);
|
ret = b.buildFromDirectory(fsRootDirPath, bootDolPath, apploaderPath, partitionHeadPath);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue