5 Using Multiple NPDRM Packages.
================================
A title can use multiple NPDRM packages. These packages are all installed to the same directory and it is
necessary to make sure that inconsistencies do not occur due to the installation order. For packages
bought from the system software PlayStation®Store, it is also necessary for the packages to be correctly
displayed on the system software regardless of which package is installed first. For this reason,
PARAM.SFO and content information files are included in all packages.
Note on inconsistency arising from the installation order:
----------------------------------------------------------
When including files of the same filename but differing versions, or when a package that requires a file in
another package exists, an inconsistency may occur depending on the installation order.
Overwriting Files of the Same Name at Installation.
---------------------------------------------------
Files in the USRDIR directory are overwritten if files of the same name exist in the packages installed
subsequently. If a package includes files that will overwrite some of the existing files, inconsistencies will
occur if the packages are installed in the incorrect order.
The overwrite attribute of PARAM.SFO and content information files depends on the package type. For
HDD boot game packages, these files are overwritten; for game data packages, these files are not.
Using Game Data Packages of Disc Boot Games.
--------------------------------------------
Considering the case where the game data package may be installed before the disc game is booted, store
PARAM.SFO and content information files for game data in the game data package. These files will not be
overwritten when they are already provided by the game content utility or other packages, and will be
installed only if they are new installations. These installed files can be modified by the game content
utility.
Using Game Data Packages of HDD Boot Games.
-------------------------------------------
Store the PARAM.SFO and content information files for the HDD boot game to the HDD boot game
package. To the game data package, store the PARAM.SFO and content information files for game data.
When the HDD boot game package is installed, the icon is displayed in the Game column of the system
software. If the game data package is then installed, PARAM.SFO and the content information files will
not be overwritten by the new files.
In contrast, if the HDD boot game package is not installed and the game data package is first installed, the
game data package will be displayed as game data on the system software. If the HDD boot game package
is installed at this point, PARAM.SFO and the content information files will be overwritten, after which
the HDD boot game will be displayed in the Game column of the system software.
Game data packages are installed to the same directory as the HDD boot game package; in order to access
them from a program in the HDD boot game package, it is necessary to specify the directory using the
game content utility. For details regarding such accesses, refer to the document "Game Content Utility Overview".
Changing the Attribute for Overwriting Content Information Files.
-----------------------------------------------------------------
Whether or not to overwrite existing content information files can be specified in the configuration file
when creating a package with the make_package_npdrm command. This feature is provided for the
combination of a free trial version (HDD boot game package) and a paid-for key (game data package).
Note:
-----
Only the following overwrite policies are currently available. There are no plans to implement any version
management policies.
Overwrite Content Information Files Using the Game Data Package.
----------------------------------------------------------------
When a game data package is created with "PackageType = Key" specified in the configuration file, all
existing content information files will be overwritten when the package is installed. This kind of package
can be used to update the display of game data on the system software.
Do Not Overwrite Content Information Files with the HDD Boot Game Package.
--------------------------------------------------------------------------
When an HDD boot game package is created with "PackageType = Demo" specified in the configuration
file, the overwrite attribute will be set to "do not overwrite". The content information files of this HDD
boot game package will have a lower priority than the files of the game data package with "PackageType
= Key" specified. In other words, the content information files in the game data package will be displayed
even if the HDD boot game package is installed after the game data package. (However, the PARAM.SFO
file of the HDD boot game package is always prioritized, so the HDD boot game will be displayed in the
Game column of the system software when the HDD boot game package is installed.)
Examples of Titles Using Multiple Packages.
-------------------------------------------
Update Content for Display on the System Software.
--------------------------------------------------
Add "PackageType = Key" to the configuration file to create a package that updates the display on the
system software when installed.
Free Trial Package with Paid Key Package.
-----------------------------------------
Titles consisting of a free trial package with limited functionality (the HDD boot game package) and a key
package with the key (NPDRM EDATA) to undo the restrictions (the game data package) can be created.
Using a combination of "PackageType = Demo" and "PackageType = Key" prioritizes the content
information files in the key package over the files in the trial package for display, so the files can be
displayed with TRIAL in the trial version and without TRIAL after the key is paid for. However, note that
the string in PARAM.SFO cannot be modified.
================================================== ================================================== ============
6 Installing a Package File from the System Software.
================================================== ===
Select "Install Package Files" in the Game column of the Reference Tool or Debugging Station system
software to install package files located on an optical disc, Memory Stick™, USB mass storage device, or
the host machine directly (without accessing the server). For information regarding uploads and
downloads via the development environment, refer to the document "PlayStation®Network Commerce
Programming Guide".
The installation procedure is as follows:
(1) Save the package file(s) to the root directory of the storage media device, or to the root directory of
the host machine.
(2) Insert or connect the storage media device to the Reference Tool.
(3) Select "Install Package Files" in the system software Game column. A list of package files in the
applicable directory will be displayed. Select one of the package files to start installation.
Package files can also be installed all at once. Press the triangle button while "Install Package Files"
is selected and select "Install All Packages" from the menu that appears to start installation.
With "Install All Packages", the installer will search for package files (with a pkg extension) on the
storage media devices in order of optical disc, Memory Stick™, USB mass storage device, and host
machine, and install up to 128 package files located in the root directory of the device/host
machine with the package file (with the extension, "pkg") that is found first.
Please note that given the limitations of the FAT32 file system, the size of a package file must be smaller
than 4GB.
================================================== ================================================== =============
7 Accessing Installed Content.
==============================
This chapter explains how to use the PlayStation®Network commerce service to access content that was
downloaded and installed.
Location of Installed Content.
------------------------------
Since downloaded content is stored on the internal hard disk drive as game data, the game content utility
can be used to get the path name and to confirm that the file exists. For details, refer to the document
"Game Content Utility Overview".
Executing NPDRM PPU SELF.
-------------------------
An NPDRM SELF program is started up by calling sceNpDrmProcessExitSpawn2(), which is a
function designed specifically for NPDRM SELF files. This function is basically exitspawn() with the
added functionality of checking access rights using k_licensee. For details, refer to the document "NP
DRM Reference".
Note:
-----
An NPDRM SELF program cannot be started up directly from the debugger.
It must be started up via a program that calls sceNpDrmProcessExitSpawn2().
Booting from the System Software (HDD Boot Games).
--------------------------------------------------
Content purchased from the PlayStation®Store will be displayed in the Game column of the system
software and can be booted from this menu. For this feature to work, it is necessary to create the NPDRM
package as an HDD boot game package.
Loading NPDRM SPU SELF.
-----------------------
A program in the NPDRM SPU SELF format can be loaded using sys_spu_image_open() after its key
is registered with sceNpDrmIsAvailable(). After the load, it can be used as a normal SPU SELF.
On the other hand, when loading the SPU ELF embedded in an NPDRM PPU program from memory
with sys_spu_image_import(), an access rights check is unnecessary because the program is not
NPDRM SPU SELF (check access rights for the NPDRM PPU program, which carried out the embedding, instead).
Loading NPDRM SPRX.
-------------------
An NPDRM SPRX program is loaded by registering the key with sceNpDrmIsAvailable() and then
calling sys_prx_load_module(). After loading, it can be used like a normal PRX.
Accessing NPDRM EDATA.
----------------------
NPDRM EDATA files are opened by calling sceNpDrmOpen(), which is a function designed specifically
for NPDRM EDATA. Once a file is opened, it can be accessed using normal file access functions (such as
cellFsRead(), cellFsLseek(), cellFsClose(), etc.). For details, refer to the document "NP DRM
Reference".
sceNpDrmOpen() is cellFsOpen() with the added functionality of checking access rights using
k_licensee. When sceNpDrmOpen() is used to open a file, the data is automatically decrypted for
subsequent accesses. Also, compressed NPDRM EDATA is automatically decompressed.
There is no access management for the NPDRM EDATA file itself. It can be opened as a normal file by
using cellFsOpen(), in which case the data is read in its encrypted and compressed state. Note that
data can also be written to the file, but it is possible for the file to become a corrupt NPDRM EDATA file if
some of the data gets overwritten, in which case it may not be possible to decrypt the file.
Note:
-----
NPDRM EDATA encryption is performed immediately before the file is moved to the production
environment. The file is not encrypted during testing, and its content can be read.
As long as it is opened with sceNpDrmOpen(), it can be accessed from an application regardless of its
encryption state. The processing load is also adjusted to be the same.
================================================== ================================================== ============
8 Files with Deleted Rights and Testing of Such Files.
================================================== ====
The NPDRM files in the NPDRM packages purchased from the PlayStation®Store will have access rights
deleted (and become inaccessible) if the PlayStation®3 system is deactivated or the purchaser-user is
deleted or invalidated. In particular, if a title has an HDD boot game package and a game data package, it
is possible for different users to have bought the respective NPDRM packages, and for the rights to just
some of the NPDRM files to be lost. In such cases, the files exist but cannot be accessed. Therefore, when
checking entitlements that have been purchased, check to see that the files exist and that they can be
accessed.
To test this behavior on the Reference Tool and the Debugging Station, specify the --no-entitlement
option for the make_package_npdrm command (see "make_package_npdrm Command Options") to
create an NPDRM package with no rights. This option creates an NPDRM package for debugging that will
return an error if the PlayStation®3 system is deactivated and an NPDRM file for which the user has no
rights is attempted for access. When an NPDRM package for debugging is installed, the files will exist but
cannot be accessed. Access rights can be modified per NPDRM package for testing.
Set any value other than "Off" to NPDRM Debug of Debug Settings in the system software to simplify the
access rights check for packages. This creates a test environment in which access rights to all the NPDRM
files have been lost, except as described below.
The NPDRM files installed from a package with the parameter "DRMType = Free" do not have access
rights to begin with, and so the setting of NPDRM Debug will have no effect. Also, the NPDRM files
installed together with an HDD boot game package (specifically, the NPDRM files with the same content
ID as the HDD boot game in execution) will have access rights enabled, and all other NPDRM files will not.
================================================== ================================================== =============
9 Notes.
========
EBOOT.BIN Startup.
------------------
EBOOT.BIN installed by the HDD boot game package is for startup from system software. It cannot be
started up by sceNpDrmProcessExitSpawn2() from a game process.
In a scheme where the main menu and the game itself consist of separate programs, where they mutually
activate each other, and where communication goes back and forth between the two, you will be unable to
return when EBOOT.BIN handles the main menu. In this case, you will need to start up the main menu
program from EBOOT.BIN and use that as the base.
Release Check Mode.
-------------------
In the system software Settings column, when "Debug Settings" --> "Release Check Mode" is set to
"Release Mode", only the NPDRM files installed in NPDRM packages can be accessed. In this mode, the
behavior of NPDRM files can be tested, including whether or not they were correctly packaged in the
NPDRM package.
When "Release Check Mode" is set to "Development Mode", it is possible to test an NPDRM SELF file
created with the make_fself_npdrm command. (On PlayStation®3, only the NPDRM files installed as
SCE-encrypted NPDRM packages with SCE signatures have rights protection.)
NPDRM Package Name.
-------------------
The filename of the NPDRM package includes the Content ID specified upon file creation. Note that
operation when changing this filename cannot be guaranteed.
Overlap of an Content ID.
-------------------------
The Content ID assigned to each NPDRM package serves as a key for managing access rights
(entitlements) of contents. Thus, a unique value must usually be set per content (package).
Setting the same Content ID to multiple packages of differing DRM types will result in files (with differing
types of access rights) existing upon installation of these packages. Files with differing access right types
may then interfere with each other and prevent proper operation. As a general rule, make sure that
Content IDs do not overlap.
As an exception, it is possible to set the same Content ID and DRM type to multiple packages for the
purpose of managing their access rights all together. An example of this would be an HDD boot game and
its patch packages. By setting the same Content ID and DRM type to them, access rights can be singularly
managed. This will prevent, for example, the startup of a patch when the access right to the game itself
has been deleted.
Files Outside NP DRM Management.
--------------------------------
An NPDRM package can include files other than NPDRM files, but they will not be included under NP
DRM management. When NPDRM packages are created with DRMType set to Free, all files including
NPDRM files are outside NP DRM management. These will not be included in the rights information
check, so make sure that this setting is not used for saleable content whose rights must be protected. In
particular, when distributing for-fee NPDRM packages in the PlayStation®Store, include at least one
NPDRM file and check its entitlement. (The rights of packages of additional for-fee data should be
checked using the NPDRM EDATA format.)
================================================== ================================================== =============[/B]