RCOXML Coding

From PS3 Developer wiki
Revision as of 04:59, 30 August 2021 by Sandungas (talk | contribs)
Jump to navigation Jump to search

Description

An RCOXML file is a XML file that represents the contents of a RCO file. This RCOXML files doesnt exists inside the RCO file (are just a representation of it). In the compilation enviroment used officially by sony this RCOXML files "should" work as a "pre-build" layout, contains all the info and settings needed to build an RCO file

Tools like Rcomage generates this RCOXML files that can be used to rebuild the RCO, or to build a custom RCO from scratch, this RCOXML files generated by rcomage "should" be pretty similar to the officials because all the info is based in the TOC area of the RCO that is structured as an XML so the conversion from TOC to XML format is direct (also, rcomage adds some info for rebuilding purposes that is not part of the TOC), see Resource Container (RCO)

RCOXML Structure

This is a not-working example intended to place all together as an overview. Not all nodes below are required, and various object/anim entries are omitted.

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- This XML representation of an RCO structure was generated by Rcomage v1.1.2 -->
<RcoFile UMDFlag="0" rcomageXmlVer="1.1" type="psp" minFirmwareVer="1.5">				<!-- XML root element, generally does not need to be modified -->
	<MainTree name="sample">									<!-- root RCO node from which everything must descend from -->
		<VSMXFile name="main" src="main.vsmx"></VSMXFile>					<!-- attached virtual machine instruction code, only one may exist in an RCO file -->
		<ImageTree>										<!-- parent node from which all image resources descend from -->
			<Image name="texture" src="texture.gim" format="gim" compression="zlib" unknownByte="0" />
		</ImageTree>
		<FontTree>										<!-- parent node from which all fonts descend from -->
			<FontStyle name="fontstyle_default" unknownShort1="0x0" unknownShort2="0x0" unknownInt3="0x0" unknownInt4="0x41600000" />
		</FontTree>
		<TextTree>										<!-- parent node from which all text language resources descend from -->
			<TextLang src="00_Japanese.xml" language="00_Japanese" format="utf16" />
		</TextTree>
		<ModelTree>										<!-- parent node from which all model resources descend from -->
			<Model name="page_model" src="page_model.gmo" format="gmo" compression="zlib" unknownByte="0" />
		</ModelTree>
		<SoundTree>										<!-- parent node from which all sound resources descend from -->
			<Sound name="sound" src="sound.ch*.vag" format="vag" channels="2" />
		</SoundTree>
		<ObjectTree>										<!-- parent node from which all object pages descend from -->
			<Page name="main_page" pageMode="0x111" pageOnInit="event:script:/main/onInitMainPage" pageOnCancel="nothing" pageOnContext="nothing" pageOnActivate="nothing">
				<Plane name="main_page_plane" ...standard object attributes here... planeImage="image:texture" planeResizeMode="0x0">
					<ModelObject name="main_page_model"  ...standard object attributes here...  modelobjectModel="model:page_model"></ModelObject>
					<Action name="go" actionText="text:msg_go"></Action>
				</Plane>
			</Page>
		</ObjectTree>
		<AnimTree>										<!-- parent node from which all animation sequences descend from -->
			<Animation name="main_page_fade">
				<Fade object="object:main_page_plane" duration="100" accelMode="0x0" transparency="1" />
				<FireEvent event="anim:main_page_fade" />
			</Animation>
		</AnimTree>
	</MainTree>
</RcoFile>

MainTree

All RCOXML files starts with the tag:

	<MainTree name="label">

MainTree represents the root of the container, so it seems the label is the name of the .rco container and is working as an identifyer of it

  • Is unknown how this labels works and his purpose, but follows a few rules:
    • The same label can be used by several .rco's that shares functions
    • This label names doesnt appears in the associated .sprx
  • Other .rco files from previous firmwares (not present in latest firmwares) using the MainTree name sample
    • xai_plugin.rco
    • In PSP firmware there are also some .rco files using the MainTree name sample

VSMXFile

None of the PS3 rco's uses a VSMXFile. But some PSP .rco's uses it

  • rough explain of how it works
    • The purpose of this script is to communicate with the associated module/sprx, the code inside the script is PlayStation JavaScript based (see also VSMX format) and it can call functions with parameters from the module/sprx. It works as a simple way to store predefined actions for the .sprx inside the .rco with a bit of code control involved. The RCOXML Objects captures the button presses from the controller and based on them loads the script using the buttons as parameters, then the code inside the script is processed and triggers the .sprx
    • An script can contain several different actions (are actually .js code functions) and his names are the same than the action names used in RCOXML Objects, as example: OnFocusRight (action triggered when moving right in the controller)

ImageTree

FontTree

Only used in PS3, only used in sysconf_plugin.rco and hknw_plugin.rco

TextTree

ModelTree

None of the PS3 rco's uses a ModelTree

SoundTree

ObjectTree

  • in this page under the section "ObjectTree" are explained what seems to be a few golden rules related to:
    • object display priority
    • children objects inherited attributes from parent object

AnimTree