the cutting room mirror

Development:Devil May Cry 2

This article has a talk page!
view on tcrf.net

This page contains notes for the game Development:Devil May Cry 2.

This article is a work in progress.
...Well, all the articles here are, in a way. But this one moreso, and the article may contain incomplete information and editor's notes.

This is an in-progress notes page documenting how to compile Devil May Cry 2 from the source code.

To do:
Figure out what else is needed to get test mode working post-compilation.

Repository Setup#

General#

The source repository is commonly distributed in the form of four ISOs which, when all extracted, form the full repository. These are:

  1. china, cri, cw, cygwin, sce, si
  2. devil2 (core source code)
  3. devil2 (miscellaneous game source files e.g. documents, music)
  4. devil2 (movie)

The repository contains many files with Japanese names, so you will need a program capable of extracting ISOs containing files named in Shift-JIS encoding.

WinRAR is one such program: after opening one of the ISOs, click Options -> Name encoding -> 932 (ANSI/OEM - Japanese Shift-JIS). This will allow Japanese names in any extracted file to be correctly named, preventing them coming out with garbled names (mojibake).

When the source repository is fully extracted, it should look like this:

Directory

Description

china

Some files for the Chinese release of the game.

cri

CRIWARE SDK files.

cw

MetroWerks CodeWarrior for PlayStation 2 R3.03J installer.

cygwin

Contains a copy of Cygwin 2.78.2.3.

devil2

Devil May Cry 2 game source code directory.

sce

Sony Computer Entertainment. Contains libraries for building the game for PlayStation 2.

si

SoftImage XSI assets directory. Contains assets used for creating both real-time and pre-rendered cinematics.

readme.txt

Very brief Japanese descriptions of the above source directories.

SCE SDK#

Before you can build the source code, you must first set up the SCE SDK libraries.

Go to the sce directory. There will be a series of .tgz files, which themselves contain .tar files, which then contain a folder. Sort the directory by ascending alphabetical order (A-Z). This is especially important for extracting the tlib libraries, which must have each version extracted over the last.

Extract the contents of each of these folders to the sce directory in the source repository. If you are prompted to replace existing files, always click Yes.

You should end up with an sce folder structure something like this:

CodeWarrior Setup#

Japanese Display#

The version of CodeWarrior included with the source repository only displays in Japanese, and contains no option to change the display language. The Japanese text may not display correctly on non-Japanese Windows systems. Using Google Translate helps!

To correct this on Windows 11, first open the Settings app and go to Time & language -> Language & region, and ensure Language for non-Unicode programs is set to Japanese (Japan) (do not check "Beta: Use Unicode UTF-8 for world-wide language support".) You will also need to use Locale Emulator.

Installation#

Run the CodeWarrior installer through Locale Emulator. Locale Emulator may also be used to run CodeWarrior itself. Note: for legibility, this tutorial will use the English descriptors for UI options. You may wish to install MetroWerks CodeWarrior for PlayStation 2 R3.04 in a different directory and use it to cross-reference the Japanese options and their English counterparts.

Once CodeWarrior is installed, you will need to use the license check bypass available for R3.04. Replace license.dat and every instance of lmgr326b.dll in the installation directory.

Adding SCE SDK Path#

If you attempt to compile DMC2 after completing the previous steps, you will likely encounter numerous red hand errors due to the SCE SDK path not being set. To fix this, navigate to: Edit → Preferences → General Settings → Source Tree. Then add the SCE SDK path. It should appear as shown below once configured correctly:

Note: You need to have 0 red hand errors for the game to even compile at all. Even a single red hand error will stop the game from compiling.

Test Mode#

The source files need some modification to allow the Test Mode to be opened.

personal.h#

The configuration file devil2/prog/personal.h will need to be modified to enable the game to play from loose files, instead of from an ISO:

  • The line #define NO_TEST_MODE needs to be commented out (prefix the line with //.)
  • #define PACK_FILE_USE needs to be changed from 1 to 0.

To do:
A script to generate these files would be nice.

datfile#

There are two lists in different formats, datfile.h and datfile.tbl, present in devil2/prog. These are lists of the files present in data.afs.

datfile.h is an enumeration of each file.

datfile.tbl simply lists all file names in quotes in alphabetical order.

The issue is that the Test Mode requires loose data files in the data directory, and this folder contains a lot more files than are actually present on the lists. This means the lists are not accurate for that directory, and they need to be updated.

Linked here are a pre-updated datfile.h and datfile.tbl. Attempting to proceed without these two files will give you 831-832 errors in CodeWarrior.

Both files can be overwritten although it's recommended that you back up the originals just in case. Once the prerequisite steps have been carried out, the Test Mode menu can be displayed by holding R1 + L1 (R1 first.)

Compiling#

To do:
Could there simply be compiler settings that need to be changed for the game to compile properly with R3.04?

The Devil May Cry 2 source code will only compile properly with the version of CodeWarrior included in the leaked repository (R3.03). While it will compile with R3.04, the resulting executable will be highly unstable and prone to crashing.

The project file for the Devil May Cry 2 source code can be found in devil2/project/project.mcp. You can open this in CodeWarrior with CTRL+O.

Upon hitting the Run button (green play button) you may get a single error, stating that ee-dvp-as.exe cannot be located. Go to Edit -> Preferences, and in the GNU Environment tab, check the correct Path for GNU Environment is set. This will be at bin/dvpasm in whatever directory you installed CodeWarrior to.

Clicking the drop down menu gives you the option to either compile the game for a debug, or release version.