wavelength 1.0.0
Loading...
Searching...
No Matches
Amplitude

C++ GitHub tag (with filter) License GitHub commits since latest release (by SemVer including pre-releases) Dependabot pages-build-deployment Stargazers pre-commit.ci status CMake Prettier

@Tatsh Buy Me A Coffee Libera.Chat Mastodon Follow Patreon

Reconstructed source code for Amplitude, the 2003 PlayStation 2 rhythm game developed by Harmonix Music Systems and published by Sony Computer Entertainment.

No copyrighted material is in this repository. You must provide your own disc image of the game for its assets. Building this source alone will not result in a playable game.

Status

Much like the real source, this source is a fork of FreQuency, the predecessor of Amplitude.

North American release

Every routine of the North American release (SCUS_972.58) has source here, and none is a stub. The rebuilt disc image boots and plays. These parts were tested in an emulator:

  • the boot path with no controller input;
  • the basic, advanced, and remix tutorials, played to completion;
  • solo game and remix modes;
  • multiplayer and duel modes for 2 to 4 players with a multitap;
  • FreqMaker, the options, the credits, the jukebox, the attract demo, and the cheats;
  • saving to and loading from a memory card.

European release

The European release (SCES_517.06) is built from the same tree with VIDEO_STANDARD set to PAL. The rebuilt disc image boots in English, French, German, Italian, and Spanish (the language follows the console's language setting), saves to a memory card, and plays songs. PROGRESS.md measures how many European routines have source.

For online play, the European release adds DNAS2 authentication, made of Sony's libdnas2 and its RCOM cryptography library (about 1,490 routines). libdnas2 decrypts parts of its own code at runtime. This project does not recover libdnas2 or RCOM. The four libdnas2 routines the game calls are stubs that print a fixme:dnas2: line and fail, so the European build shows the DNAS error when going online.

Online play

The online services of both releases were shut down long ago. The online code is reconstructed for preservation and is not expected to work.

Patches

The ENABLE_PATCHES option (on by default) includes code that is not in the original game:

  • the title screen shows the repository URL, the Git revision, and the build time;
  • console text is written to the serial port when no DECI2 host is present.

Set ENABLE_PATCHES to OFF to build the game without deviations in behaviour.

Building

The build uses the ps2dev cross compilers for the Emotion Engine and the IOP, their C and C++ runtime, and the IRX fixup tool (srxfixup). It does not use ps2sdk. Every Sony library routine the game calls is reconstructed under sce/, and sce/ee/runtime connects the compiler's runtime to the reconstructed kernel.

cmake -B build -G Ninja -DCMAKE_TOOLCHAIN_FILE=cmake/ps2-ee-toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DWAVELENGTH_DISC_IMAGE=/path/to/Amplitude.iso
cmake --build build --target image

Set CMAKE_BUILD_TYPE to Release unless you want debug symbols. For a debugger, use Debug or RelWithDebInfo, and a Debug build also puts the executable with its debug information on the image.

The image target writes build/wavelength.iso, an ISO image of the DVD, with the built executable and IOP modules in place of the originals. The original is an ISO image of the North American release (SCUS_972.58) or the European release (SCES_517.06). Without WAVELENGTH_DISC_IMAGE, the build produces the executable and the IOP modules only. Add -DVIDEO_STANDARD=PAL to build the European release, with the European disc image. File names on the disc are matched without regard to case, and each name must be unique once case is ignored.

WAVELENGTH_DISC_IMAGE may also be the disc root, the directory with SYSTEM.CNF. A copy of the disc files lacks the boot logo that the original disc stores in its system area, the first 16 sectors of the ISO image. A console may refuse a disc without the boot logo. Set WAVELENGTH_DISC_SYSTEM_AREA to a file with the first 32768 bytes of the original ISO image to include the boot logo.

IOP modules

The game's own IOP modules are rebuilt from src/iop, one directory per module, with the IOP toolchain (mipsel-none-elf) from PS2DEV. Each module is registered in src/iop/CMakeLists.txt with one line that lists its sources in link order:

wavelength_add_irx(softfx_s softfx.cpp lock.cpp periodictimer.cpp effects.cpp ringbuffer.cpp
streambuffer.cpp imports.S)

The function builds build/iop/<module>/<module>.irx, and the image target puts it on the disc in place of the module with the same name in IOP. A module lists its import tables in an assembler source with the macros of sce/iop/include/iopimports.s, and a module with C++ sources also links the runtime in src/iop/runtime. The iop_modules target builds every module. Builds for PAL define VIDEO_STANDARD_PAL for the modules that differ between the releases.

Provenance and licence

This is an independent reverse-engineering effort for preservation and study. It includes no code and no assets copied from the game. Amplitude and its assets remain the property of their respective rights holders, and this project is not affiliated with or endorsed by Harmonix or Sony Interactive Entertainment.

Third-party code (Expat, gzip, and LibTomCrypt) remains under its licence and is identified as such under 3rdparty/.