Skip to content
forked from hozuki/libcgss

libcgss is a helper library for THE iDOLM@STER Cinderella Girls Starlight Stage (CGSS/DereSute/デレステ). It currently supports HCA audio decoding and ACB exploring. It also applies to other games like THE iDOLM@STER Million Live! Theater Days (MLTD/MiriShita/ミリシタ).

License

Notifications You must be signed in to change notification settings

esterTion/libcgss

 
 

Repository files navigation

libcgss

libcgss is a helper library for THE iDOLM@STER Cinderella Girls Starlight Stage (CGSS). It provides both C and C++ API for HCA audio manipulation. ACB archive support is in progress.

The project consists of a library (libcgss) and several other applications.

This project has a sister project DereTore. However the strength of C API is better interoperability with other libraries. The pure C# version of hcaenc and hcacc can be found in DereTore as applications.

[1] Download ADX2LE from here, and use the DLL located at tools\hcaenc_lite.dll.

Example

A quick example, from hca2wav:

#include "cgss_api.h"

int main() {
    cgss::CHcaDecoderConfig decoderConfig;
    decoderConfig.decodeFunc = cgss::CDefaultWaveGenerator::Decode16BitS;
    decoderConfig.waveHeaderEnabled = TRUE;
    decoderConfig.cipherConfig.keyParts.key1 = 0x12345678;
    decoderConfig.cipherConfig.keyParts.key2 = 0x90abcdef;
    
    try {
        cgss::CFileStream fileIn(HCA_FILE_NAME, cgss::FileMode::OpenExisting, cgss::FileAccess::Read),
            fileOut(WAV_FILE_NAME, cgss::FileMode::Create, cgss::FileAccess::Write);
        cgss::CHcaDecoder hcaDecoder(&fileIn, decoderConfig);
    
        uint32_t read = 1;
        static const uint32_t bufferSize = 1024;
        uint8_t buffer[bufferSize];
        while (read > 0) {
            read = hcaDecoder.Read(buffer, bufferSize, 0, bufferSize);
            if (read > 0) {
                fileOut.Write(buffer, bufferSize, 0, read);
            }
        }
    } catch (const cgss::CException &ex) {
        cerr << "Exception: " << ex.GetExceptionMessage() << ", code=" << ex.GetOpResult() << endl;
        return ex.GetOpResult();
    }
    return 0;
}

Building

Requirements:

  • General:
    • CMake (>=3.2)
  • Windows:
    • MSVC (>=19.0, VC++ 2015) or Cygwin/GCC (>=5.0) or MinGW/GCC (>=5.0)
  • macOS and Linux:
    • GCC (>=5.0)

For Windows users, please use CMake GUI (supplied with CMake) to generate a Visual Studio solution.

For macOS and Linux users, you can simply invoke the script build.sh.

Remarks:

  1. I personally recommend you to use Cygwin rather than MinGW. The latter seems to lack support of properly handling try...catch statements.
  2. Linux build is tested on Windows Subsystem for Linux (WSL) using GCC 6.2.0.

API & Manual

API definition can be found at docs/api/cgss-api.md.

User manual can be found at docs/manual/user-manual.md.

License

MIT License. See LICENSE.md.

Disclaimer

See DISCLAIMER.md.

Notes

More tech details can be found in Behind the Scenes.

About

libcgss is a helper library for THE iDOLM@STER Cinderella Girls Starlight Stage (CGSS/DereSute/デレステ). It currently supports HCA audio decoding and ACB exploring. It also applies to other games like THE iDOLM@STER Million Live! Theater Days (MLTD/MiriShita/ミリシタ).

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • C++ 84.2%
  • C 8.8%
  • Java 3.6%
  • CMake 3.2%
  • Shell 0.2%