DAIKOUKAI JIDAI III: COSTA DEL SOL (Mac) - MP3 PATCH 1.0, THE SOURCE

The tools that make KOEI's Japanese Macintosh game (1997, version 1.2) start
without its CD and play its music from MP3 files in place of the CD's audio.
This archive holds no game code, data or music.

extract.py               cuts the CD audio tracks out of the disc image
                         (Daemon Tools MDX) into WAV files
nocd/patch.py            the no-CD patch: one PowerPC instruction in the
                         sound set-up's check of the disc's name
mp3/music.c              QuickTime playback of Music:trackNN.mp3, in place of
                         the game's seven CD-audio routines
mp3/build.py             compiles music.c and appends it to the game's code
nocd/build-install.py    builds the install image: the CD's game folder with
                         the patched application, Movie and Music

How the MP3 patch works:
- music.c is compiled by GNU PowerPC gcc for the classic Mac's calling
  convention (-mcall-aixdesc) and appended to the application's PEF code
  section. A state area is appended to the data section, and five QuickTime
  imports are added at the end of QuickTimeLib's range.
- Each of the game's CD-audio routines (start, stop at the end, play, stop
  with a fade, pause, resume, "is it playing") now branches to the new code.
- The import stubs of WaitNextEvent, GetNextEvent and TickCount give QuickTime
  its time. That code also repeats a track at its end, and pauses it while
  the game is in the background.
- The method is the MP3 patch for Romance of the Three Kingdoms V on the
  classic Mac (rotk5.v2core.com), fitted to this game.

The build scripts expect that project's PowerPC cross compiler, its PEF
reader (pef.py) and its machfs and macresources Python modules.

https://dai3.v2core.com
