Editing Resource Container (RCO)

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
=Description=
=Description=
The file extension in PSP and PS3 is '''RCO''' that seems to be the acronym of '''R'''esource '''C'''ontainer '''O'''bject
'''R'''esource '''Co'''ntainer '''O'''bjet (RCO) are used by [[XMB]] to storage:


The file signature (aka [https://en.wikipedia.org/wiki/Magic_number_(programming) magic number]) from PSP (in little endian) is '''PRF''' that seems to be the acronym of '''P'''laystation '''R'''esource '''F'''ile
*text for all [[Template:XMB_languages|languages]]
*images for icons (named textures)
*sounds for cursor navigation in .vag format, see: [[Multimedia Formats and Tools]]


RCO contents are loaded by other firmware functions as [[XMBML Structure|XMBML]] setting files, and [[XMB]] modules (also known as .sprx plugins), see [[Plugin Interfaces]] and [[VSH]]
xmb modules (or plugins) accesses the .rco files contents, see [[Plugin Interfaces]] and [[VSH]]


==Contents==
=Tools=
*RCO contents (See [[Multimedia Formats and Tools]]): <!--and see rcomage miscmap.ini for a list of the supported formats-->
Text for all [[Template:PlayStation Languages|languages]], textures, sounds (for cursor navigation, trophy unlocking, etc...) and models


{| class="wikitable"
=Mods=
|-
! RCO format !! Embedded code !! Text !! Textures !! Sounds !! Models !! Script
|-
| Generic || [[RCOXML Coding|RCOXML]] || utf8, utf16, utf32 || gim, png, jpg, tif, gif, bmp || vag, unknown0x0 || gmo || [[PlayStation JavaScript]]
|-
| PS3 specific || [[RCOXML Coding|RCOXML]] || utf16 || gim, png, jpg || vag || {{cellcolors|lightgrey}} ''n/a'' || {{cellcolors|lightgrey}} ''n/a''
|}


==Versions==
=Links=
{| class="wikitable" style="font-size:x-small;"
|-
! rowspan="2" | <abbr title="based in the changelog of custom_render_plugin.rco PS3, and rcomage source code">RCO version</abbr> !! rowspan="2" | Firmware !! rowspan="2" | <abbr title="release date of the first firmware using that rco version in format YYYY/MM/DD">Release date</abbr> !! colspan="3"  | RCO format specifications
|-
! Toc trees !! Toc compression !! Other Notes
|-
! 0x55
| {{cellcolors|#cccccc}} {{icon content psp|50px}} 0.6.5 || pre-retail || 9 || none || archaic rco format, header is 16 bytes smaller
|-
! 0x70
| {{cellcolors|#cccccc}} {{icon content psp|50px}} 1.00 || 2004 / 12 / 12 || 10 || none ||
|-
! 0x71
| {{cellcolors|#cccccc}} {{icon content psp|50px}} 1.50~2.50 || 2005 / 3 / 24 || 10 || none ||
|-
! 0x90
| {{cellcolors|#cccccc}} {{icon content psp|50px}} 2.60 || 2005 / 11 / 29 || 10 || zlib ||
|-
! 0x93
| {{cellcolors|#888888}} {{icon content ps3|50px}} <abbr title="pre-retail PS3 DECR firmware 0.82.006 probably same version for all 0.82 firmware series">0.82</abbr> || 2006 / 3 / 31 || 10 || none ||
|-
! 0x94
| {{cellcolors|#888888}} {{icon content ps3|50px}} <abbr title="pre-retail PS3 DECR firmware 0.83.002 probably same version for all 0.83 firmware series">0.83</abbr> || 2006 / 4 / 19 || 10 || none ||
|-
! rowspan="2" | 0x95
| {{cellcolors|#cccccc}} {{icon content psp|50px}} 2.70~2.71 || 2006 / 4 / 25 || 10 || rlz ||
|-
| {{cellcolors|#888888}} {{icon content ps3|50px}} <abbr title="pre-retail PS3 DECR firmware 0.84.001 probably same version for all 0.84 firmware series">0.84</abbr> || 2006 / 5 / 19 || 10 || none ||
|-
! 0x96
| {{cellcolors|#cccccc}} {{icon content psp|50px}} 2.80~3.40 || 2006 / 7 / 27 || 10 || rlz ? || the toc seems to be compressed in parts
|-
! 0x97
| {{cellcolors|#888888}} {{icon content ps3|50px}} <abbr title="pre-retail PS3 DECR firmware 0.85.007 probably same version for all 0.85 firmware series">0.85</abbr>~[[1.54_CEX|1.54]] || 2006 / 11 / 11 || 10 || none ||
|-
! 0x100
| {{cellcolors|#cccccc}} {{icon content psp|50px}} 3.50~6.61 || 2007 / 5 / 31 || 10 || rlz ? ||
|-
! 0x102
| {{cellcolors|#888888}} {{icon content ps3|50px}} [[1.60_CEX|1.60]]~[[1.70_CEX|1.70]] || 2007 / 3 / 22 || 10 || ? ||
|-
! 0x104
| {{cellcolors|#888888}} {{icon content ps3|50px}} [[1.80_CEX|1.80]]~[[1.82_CEX|1.82]] || 2007 / 5 / 24 || 10 || ? ||
|-
! 0x105
| {{cellcolors|#888888}} {{icon content ps3|50px}} [[1.90_CEX|1.90]]~[[1.94_CEX|1.94]] || 2007 / 7 / 24 || 10 || zlib ||
|-
! 0x106
| {{cellcolors|#888888}} {{icon content ps3|50px}} [[2.00_CEX|2.00]]~[[2.17_CEX|2.17]] || 2007 / 11 / 8 || 10 || zlib  ||
|-
! 0x107
| {{cellcolors|#888888}} {{icon content ps3|50px}} [[2.20_CEX|2.20]]~[[2.80_CEX|2.80]] || 2008 / 3 / 25 || 10 || zlib  ||
|-
! 0x108
| {{cellcolors|#888888}} {{icon content ps3|50px}} [[3.00_CEX|3.00]]~[[3.01_CEX|3.01]] || 2009 / 9 / 1 || 10 || zlib  ||
|-
! 0x110
| {{cellcolors|#888888}} {{icon content ps3|50px}} [[3.10_CEX|3.10]]~[[3.74_CEX|3.74]] || 2009 / 11 / 19 || 10 || zlib  ||
|-
! 0x120
| {{cellcolors|#888888}} {{icon content ps3|50px}} [[4.00_CEX|4.00]]~[[4.25_CEX|4.25]] || 2011 / 11 / 29 || 10 || zlib  ||
|-
! 0x130
| {{cellcolors|#888888}} {{icon content ps3|50px}} [[4.30_CEX|4.30]]~[[4.83_CEX|4.83]] || 2012 / 10 / 24 || 10 || zlib  ||
|}


=RCO Structure=
Based on [http://endlessparadigm.com/forum/showthread.php?tid=231 RCO File Format] (outdated) and [https://github.com/zingaburga/RCOMage rcomage source]


==Header==
{| class="wikitable" style="font-size:x-small;"
|-
! Offset !! Length !! Example !! Name !! Notes
|-{{cellcolors|#666666|#ffffff}}
| 0x00 || 0x04 || 46 52 50 00 || '''prf_signature''' || In PS3 is "FRP" (big endian). In PSP is "PRF" (little endian)
|-{{cellcolors|#666666|#ffffff}}
| 0x04 || 0x04 || 00 00 00 97 || '''prf_version''' || See {{talk}} page
|-{{cellcolors|#666666|#ffffff}}
| 0x08 || 0x04 || <abbr title="Always seems to be 0x00000000">00 00 00 00</abbr> || {{cellcolors|#ff7777}} <abbr title="prf_minor_version ?">''prf_unk''</abbr> ||
|-{{cellcolors|#666666|#ffffff}}
| 0x0C || 0x04 || 00 00 00 00 || <abbr title="compress everything except the header and '''dat''' data tables to store files">'''prf_compress'''</abbr> || 0x00=none, 0x10=ZLIB, 0x20=RLZ, see {{talk}} page
|-{{cellcolors|#7777ff}}
| 0x10 || 0x04 || 00 00 00 A4 || '''toc_main_tree_offset''' ||
|-{{cellcolors|#8888ff}}
| 0x14 || 0x04 || FF FF FF FF || '''toc_script_tree_offset''' ||
|-{{cellcolors|#8888ff}}
| 0x18 || 0x04 || FF FF FF FF || '''toc_text_tree_offset''' ||
|-{{cellcolors|#8888ff}}
| 0x1C || 0x04 || FF FF FF FF || '''toc_sound_tree_offset''' ||
|-{{cellcolors|#8888ff}}
| 0x20 || 0x04 || FF FF FF FF || '''toc_model_tree_offset''' ||
|-{{cellcolors|#8888ff}}
| 0x24 || 0x04 || FF FF FF FF || '''toc_image_tree_offset''' ||
|-{{cellcolors|#8888ff}}
| 0x28 || 0x04 || <abbr title="Always seems to be 0xFFFFFFFF">FF FF FF FF</abbr> || {{cellcolors|#ff7777}} <abbr title="toc_unk_tree_offset ?">''toc_unk''</abbr> ||
|-{{cellcolors|#8888ff}}
| 0x2C || 0x04 || FF FF FF FF || '''toc_font_tree_offset''' ||
|-{{cellcolors|#8888ff}}
| 0x30 || 0x04 || 00 00 00 CC || '''toc_object_tree_offset''' ||
|-{{cellcolors|#8888ff}}
| 0x34 || 0x04 || FF FF FF FF || '''toc_anim_tree_offset''' ||
|-{{cellcolors|#66ff66}}
| 0x38 || 0x04 || 00 00 01 D4 || '''str_text_table_offset''' ||
|-{{cellcolors|#66ff66}}
| 0x3C || 0x04 || 00 00 00 00 || '''str_text_table_length''' ||
|-{{cellcolors|#99ff99}}
| 0x40 || 0x04 || 00 00 01 D4 || '''str_label_table_offset''' ||
|-{{cellcolors|#99ff99}}
| 0x44 || 0x04 || 00 00 00 1C || '''str_label_table_length''' ||
|-{{cellcolors|#bbffbb}}
| 0x48 || 0x04 || 00 00 01 F0 || '''str_event_table_offset''' ||
|-{{cellcolors|#bbffbb}}
| 0x4C || 0x04 || 00 00 00 04 || '''str_event_table_length''' ||
|-{{cellcolors|#770077}}
| 0x50 || 0x04 || FF FF FF FF || '''ptr_text_table_offset''' ||
|-{{cellcolors|#770077}}
| 0x54 || 0x04 || 00 00 00 00 || '''ptr_text_table_length''' ||
|-{{cellcolors|#880088}}
| 0x58 || 0x04 || FF FF FF FF || '''ptr_image_table_offset''' ||
|-{{cellcolors|#880088}}
| 0x5C || 0x04 || 00 00 00 00 || '''ptr_image_table_length''' ||
|-{{cellcolors|#990099}}
| 0x60 || 0x04 || FF FF FF FF || '''ptr_model_table_offset''' ||
|-{{cellcolors|#990099}}
| 0x64 || 0x04 || 00 00 00 00 || '''ptr_model_table_length''' ||
|-{{cellcolors|#aa00aa}}
| 0x68 || 0x04 || FF FF FF FF || '''ptr_sound_table_offset''' ||
|-{{cellcolors|#aa00aa}}
| 0x6C || 0x04 || 00 00 00 00 || '''ptr_sound_table_length''' ||
|-{{cellcolors|#bb00bb}}
| 0x70 || 0x04 || 00 00 01 CC || '''ptr_object_table_offset''' ||
|-{{cellcolors|#bb00bb}}
| 0x74 || 0x04 || 00 00 00 08 || '''ptr_object_table_length''' ||
|-{{cellcolors|#cc00cc}}
| 0x78 || 0x04 || FF FF FF FF || '''ptr_anim_table_offset''' ||
|-{{cellcolors|#cc00cc}}
| 0x7C || 0x04 || 00 00 00 00 || '''ptr_anim_table_length''' ||
|-{{cellcolors|#ccaa88}}
| 0x80 || 0x04 || FF FF FF FF || '''dat_image_table_offset''' ||
|-{{cellcolors|#ccaa88}}
| 0x84 || 0x04 || 00 00 00 00 || '''dat_image_table_length''' ||
|-{{cellcolors|#ddbb99}}
| 0x88 || 0x04 || FF FF FF FF || '''dat_sound_table_offset''' ||
|-{{cellcolors|#ddbb99}}
| 0x8C || 0x04 || 00 00 00 00 || '''dat_sound_table_length''' ||
|-{{cellcolors|#eeccaa}}
| 0x90 || 0x04 || FF FF FF FF || '''dat_model_table_offset''' ||
|-{{cellcolors|#eeccaa}}
| 0x94 || 0x04 || 00 00 00 00 || '''dat_model_table_length''' ||
|-{{cellcolors|#ffddbb}}
| 0x98 || 0x0C || <abbr title="Always seems to be 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF">FF FF FF FF .. .</abbr> || {{cellcolors|#ff7777}} ''dat_unk'' ||
|}
*All offsets in the header are absolute
==TOC==
The TOC (table of contents) works as an index of all the .RCO contents, is composed by entries that follows a hierarchy of parent/children/siblings, it can be represented as an .XML file composed by '''elements''' and its '''attributes''' (see [http://www.w3schools.com/xml/xml_tree.asp XML Tree] and  [[RCOXML Coding]])
===Element===
Every entry starts with an area of 0x28 length that represents an XML '''element''', it specifyes the '''entry_type''', a '''label''' identifyer for this entry (optional) and some info related with the TOC internal structure and its hierarchy relationship with other entries. All offset are relative
{| class="wikitable" style="font-size:small;"
|+RCO TOC entry common area {{ed right|RCO TOC entry common area}}
! Offset !! Length !! <abbr title="Data type">Type</abbr> !! Name !! {{icon content psp|50px}} !! {{icon content ps3|50px}} !! Example (TOC) !! Example (XML) !! Notes
|-
| {{RCO TOC entry common area}}
|-
|}
===Attributes===
Attributes are located after the element definition (at entry relative offset 0x28), only exists for the elements that uses attributes, each '''entry_type''' uses different attributes, are explained in detail in other wiki pages
{{RCO TOC entry types}}
Some of the attributes are a '''reference''' to load other entry
{{RCO TOC reference types}}
===Example===
{{Boxframe1|content='''example placeholder'''
*Example here following the other example of the header at top of the page, using color codes like the examples in {{talk}} page
*With '''MainTree-AnimTree-Animation-Fade''' (because i think is the minimal example that shows how trees are made and the entry_type "fade" that uses "standard" and "specific" attributes)
*And '''MainTree-ObjectTree-Page''' (because the animation needs to be linked to an object by using a reference, otherway rcomage will return an error when trying to compile it)
}}
==Pointer tables==
This area works as an external index of the TOC, stores <abbr title="unlike in TOC table that are relative">absolute</abbr> pointers to all the chiildren of the "tree" TOC entries, is composed by 6 tables in this order:
*'''text_tree_pointer_table'''
*'''image_tree_pointer_table'''
*'''model_tree_pointer_table'''
*'''sound_tree_pointer_table'''
*'''object_tree_pointer_table'''
*'''anim_tree_pointer_table'''
*Every pointer is 0x04 bytes length
*The other "trees" children that doesnt uses a pointer table are: MainTree (is not needed because its children are the other "trees"), ScriptTree (because doesnt have children), and FontTree because ?????<!--i cant imagine why but there must be a good reason-->
*The existence of this area with pointers seems to be related with the fact that is posible to use a whole file compression (by setting it in the header at offset 0x0C) that compresses the TOC. Also when loading the .RCO file in the RAM of the console probably is "cropped" in parts, the TOC is decompresed and kept in a memory area with the other TOC's from the other RCO files (for fast selective access to the .RCO contents, and for performance) and is posible to read the relative offsets directlly from the TOC's and deprecate the absolute offsets from the pointers tables<!--or something like that, if someone can explain it please help rewriting this-->
==String tables==
This area stores the text strings used by the TOC entries, is composed by 3 tables in this order:
*'''text_string_table''' (to store localized language texts from TextTree entries)
*'''label_string_table''' (to store the labels of all the entries that uses labels)
*'''event_string_table''' (to store the values of the attributes used by some entries, either "native" or "script" events)
*Strings are null terminated (ends in 0x00)
*Strings are aligned to 4 bytes boundary (padding at the end of every string when needed)
==Data tables==
This area stores files that can be compressed individually (or not) as specifyed by the attributes of some entries in the TOC, is composed by 3 tables in this order:
*'''image_data_table''' (to store the files used by ImageTree entries)
*'''sound_data_table''' (to store the files used by SoundTree entries)
*'''model_data_table''' (to store the files used by ModelTree entries)
*Files are aligned to 4 bytes boundary (padding at the end of every file when needed)
=RCO compression methods=
<!--initially was not compressed, and what is explained here seems to be obsolete, later it was compressed in sections, i guess in separated groups for each "tree" represented in the rcoxml the purpose of this is for the console to access one "tree" of the hierarchy independlly without the need to decompress the whole table, for performance-->
When the TOC table is compressed at beginning there are 3 values related with the compression (otherway if the table is not compressed this 3 values doesnt exists)
{| class="wikitable"
|-
! Offset !! Length !! Name !! Example !! Notes !! Speculation
|-
| 0x00 || 0x04 || '''lenPacked''' ||  || Packed size of all the table sections ||
|-
| 0x04 || 0x04 || '''lenUnpacked''' ||  || Unpacked size of all the table sections ||
|-
| 0x08 || 0x04 || '''lenLongestText''' ||  || length of the longest language's text data (unpacked)<br>if the compressed area doesn't contains any language text the value is 0 ||
|}
=VSH access to RCO contents=
See the [[VSH_Exports#paf "paf" VSH exports]], most of them uses the internal "official" names of lot of stuff related with RCO (i guess there are a lot of names used in this wiki that was taken from rcomage or by deduction that should be replaced by the official names), and can help to understand how the firmware processes and accesses to the internal content of .RCO files (it can help a lot to any tool involved in processing .RCO files to make it most efficient, simple and accurate posible)
*Related with the internal RCO [http://www.w3schools.com/xml/dom_intro.asp | XML DOM structure]
**PAF_Resource_DOMGetNodeChildByID, PAF_Resource_DOMGetNodeChildByPos, PAF_Resource_DOMGetNodeData, PAF_Resource_DOMGetNodeFirstChild, PAF_Resource_DOMGetNodeID, PAF_Resource_DOMGetNodeNext, PAF_Resource_DOMGetNodeType, PAF_Resource_GetPageNodeByID, PAF_Resource_GetWidgetNodeByID, PAF_Resource_ResolveRefNode, PAF_Resource_ResolveRefString, PAF_Resource_ResolveRefWString (It seems some are missing though)
*Related with [[RCOXML Objects]]
**This seems to be the complete list of [[RCOXML Objects]] internal names (It seems some are missing though)
***0x546B3D02 returns "PhWidget", 0x41BBFE5E returns "PhScene", 0x10DEDCC7 returns "PhPlane", 0xE36C18F5 returns "PhPlaneDiv", 0x24A5BD6B returns "PhButton", 0xB7DFCE90 returns "PhText", 0x9207F4 returns "PhScroll", 0xBA6D149A returns "PhLabelPrim", 0xC88CA4B2 returns "PhLevelMeter", 0xE801C345 returns "PhProgress", 0xBF66BF2D returns "PhCheckBox", 0x703117AD returns "PhXmBar", 0x4FF7B8A9 returns "PhXmList", 0xC84FD77B returns "PhXmItem", 0x4C36ABBB returns "PhItemSpin", 0xCA9160F6 returns "PhNumSpin", 0x59A11C82 returns "PhNumSpin", 0xD64EDE7C returns "PhList", 0xF7630798 returns "PhInfoList", 0xA98865F8 returns "PhMenuList", 0x90F4F801 returns "PhCheckBoxList", 0xDDD4ACF6 returns "PhLabelText", 0x545D47A2 returns "PhClock", 0x3806365F returns "PhIPAddr"
**The names of the attributes ordered by groups (there are a lot)
***As example: 0xDEF981C4 _ZN3paf8PhXmList7FocusInEf, 0x814B3D90 _ZN3paf8PhXmList8FocusOutEf this two seems to be the attributes '''FocusOut''' and '''FocusIn''' from the object '''XmList'''


{{File Formats}}
{{File Formats}}
<noinclude>[[Category:Main]]</noinclude>
<noinclude>[[Category:Main]]</noinclude>
Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)