PSPx форум

PSPx форум (https://www.pspx.ru/forum/index.php)
-   Тюнинг интерфейса PS3 (https://www.pspx.ru/forum/forumdisplay.php?f=477)
-   -   Rcomage v1.1.2 - редактор RCO (https://www.pspx.ru/forum/showthread.php?t=108509)

in1975 04.06.2010 11:56

Rcomage v1.1.2 - редактор RCO
 
Вложений: 1
Rcomage 1.1.2 от ZiNgA BuRgA

Дополнение к RCOEditor для работы с *.RCO файлами


https://www.pspx.ru/forum/attachment...achmentid=9842

Readme
quote=ZiNgA BuRgA (This post was last modified: 10/01/2011 05:19 AM by ZiNgA BuRgA.)
old junk
Firstly I apologise for taking so long to get this out. I know some of you may have seen some themes created using this tool for quite a while; I originally had planned to release this months ago, however I got hit with more than expected workload this semester and had really little time to actually work on this.
I had some free time recently, so I thought I'd take the opportunity to try to push out a release. Unfortunately it lacks many things I wanted to have in a public release, but I guess that doesn't matter too much, maybe...

Anyway, since this is a bit of a rushed release, there's a number of "suboptimal" things done here, such as me not really checking stuff (so if you find issues, please report so I can fix :P). Sanity checking in the code really sucks, so it should be easy to stuff up the program too, but please still report these so that I know where to prioritise checks xD.


About
Rcomage is a general RCO manipulation/creation tool, which I hope, will replace RCO Editor (and potentially rcotool in the future).
It's a CLI (command-line interface) however I've provided a simple Windows GUI to save you from remembering commands (though you may need to trawl through an XML file).

It currently only has two main functions - "dump" (dumps contents of an RCO) and "compile" (compiles an RCO from a dump).
For modifying an RCO, you would dump it, modify the dump, then compile it.
A dump will consist of an XML file, which contains all the metadata of the RCO (basically, it's structure) as well as various resources, such as images, sounds etc.


How to use
Well, as mentioned above, basically dump and compile is the only thing you can do.
As for information on the XML structure, I don't really have the time to write a good guide, so I guess you'll probably just dump various RCOs to get an idea of how it works. (I'd be willing to assist if someone would write a guide for me :P)
A quick idea of the structure is shown in the readme.

!! I strongly suggest that you don't use Notepad to edit the XML files. Suggested applications include Notepad++ and Notepad2 (or your favourite text editor; most should overcome the deficiencies of Notepad).


Notes
Because I was silly when writing RCO Editor, it doesn't put in adler32 checksums for compressed images, etc, and thus, anything modified with it will generate a warning in Rcomage. Otherwise, should work fine.
Also, Sony's GimConv, which is used to convert GIM images, is a little slow, so if you choose to perform the conversion (affects both dumping and compiling), expect to wait some time...


Unknown values
If you go through dumped XML structures, you may notice a number of "unknown" labels for various objects (and some anim entries). Finding out what these values do is, unfortunately, a little time consuming and I don't really have that much time to test what each thing does. It would be great if people would volunteer to play around with these values to see what effect they have, and I can add the definitions to Rcomage. (thanks in advance :) )


Благодарности:
- highboy за пример кода преобразования WAV <-> VAG
- Z33 за пример кода работы с GIM и различные программы для работы с RCO; также за изучение и исследование различных форматов файлов
- создателей 7-zip за их изумительную реализацию deflate алгоритма
- всех, кто причастен к libxml2, iconv и zlib
- geohot за помощь с поддержкой PS3 RCO
- альфа-тестерам, за поиск недоработок и поддержку в создании тем
- всем, кто относится к кастомизации и написании программ для PSP (слишком много, чтобы перечислить поимённо)
- всем, кого я забыл =)

Исходный код:
Обратите внимание на форк от KaKaRoTo - Там находится модифицированная/доработанная v1.1.1

changelog

v1.1.1 (2nd June, 2010)
- Add --ini-dir option to allow specifying INI directory for the CLI
- Add version tag 0x97 as a valid PS3 tag (fixes some issues with dumping RCOs from older PS3 firmwares) [thanks to Mr Shizzy for the samples]
- Export animtable tag constants to .ini file; also fix up PS3's special MoveTo animation
- Minor modification to WAV parser - will now skip bytes if header specifies it
- Remove UTF-8 BOMs from dumped XML before the text values - seems to cause issues on some machines (and I don't think it's exactly valid anyway)
- Strip nulls from text (RCO Editor may add them)
- Replace the various "unknownInt1" name with "accelMode" - thanks to Vegetano1 for the find

v1.1.0 (3rd Apr, 2010)
- Minor message output changes
- Fixed bug where rcomage may have tried to convert non-GIM images through gimconv when dumping
- Fixed minor issue if Image/Sound/Text tree contained no subentries
- Removed option to select compression for PNG/JPG/TIF/GIF resources in GUI as it's mostly useless and may break the RCO if changed
- Add UMDFlag attribute to RcoFile tag
- Reduce the use of CDATA sections in the dumped text XML file
- Add basic VSMX decoder/encoder; add corresponding option when dumping/compiling in CLI and GUI, as well as vsmxdec and vsmxenc functions in the CLI
- Add experimental VSMX -> Javascript decompiler. This will most likely crash, but if you're lucky, it might go through and give half-readable output. Only use this if you're really interested; can only be accessed via the CLI using the --decompile option of vsmxdec
- Export some internal constants to .ini files
- Add support for UTF8 and UTF32 text in RCOs (found in PS3 RCOs); also fixed some potential character encoding issues
- Add support for Fontstyle entries (used in the sysconf PS3 RCO)
- Greatly improve handling PS3 RCO object structures (thanks goes to geohot for RCO samples)
- Add support for writing PS3 RCOs; also modify GimConv to add PS3 configuration option

v1.0.2 (7th Dec, 2009)
- statically link all libraries; also now built with MinGW so MSVC runtime no longer required
- include required DLLs with GimConv
- fixed bug in GUI where it didn't chdir across drives
- partially removed annoying auto-fill for dumping RCOs for GUI
- fixed crash where bad label reference was supplied
- add like two additional warnings
- add ability to select zlib compression options from CLI
- partial support for reading big-endian (PS3?) RCOs; it's "partial" as there are still issues - mainly object handling is mostly stuffed up
- fix regression in earlier update which broke VSMX dumping
- minor changes to XML format
- apply hack which hopefully fixes up GimConv converting from some GIMs
- and if the above still causes GimConv to freeze, added a timeout to try to not cause Rcomage to lock up as well
- added "vagenc" and "vagdec" functions if you happen to want to convert a .vag file
- added "extract" function (not 100% complete)

v1.0.1 (28th Oct, 2009)
- fix crash with WAV -> VAG conversion
- fix sound clipping issues with WAV -> VAG conversion (fix appears to work, but I really haven't looked at it much)
- added ability for compile function to read from stdin
- use \ for directory separators on Windows
- slight speedup with gimconv (no longer invokes the cmd shell)
- '--xml-only' switch for dumping removed, use '--resdir -' instead
- fix bugs relating to handling XML files with resource dumping disabled
- minor changes to messages
- GUI will attempt to use relative paths instead of always relying on absolute paths
- fix folder creation bug in GUI

Оригинальный источник: Zinga Burga | Исходный код (мод): :github: kakaroto/RCOMage ->

Скачать: :download: Гайд

ErikPshat 24.06.2022 07:33

Вложений: 1
Graphic Image Map (GIM)

Карта графического изображения GIM - это формат изображения, который допускает множество различных настроек, что приводит к большому количеству разных файлов GIM, имеющих разную структуру, строго говоря, формат GIM всегда один и тот же, но в целом можно сказать, что эти разные «Форматы GIM». Количество форматов GIM, поддерживаемых консолями PlayStation, ограничено графической средой, библиотеками и т. д.. Файлы GIM были обнаружены в прошивках PSP и PS3 внутри файлов Resource Container (RCO), файлов тем PlayStation 3 (P3T) и т.д.

Вложение 18256

ПозицияДлинаДанныеОписаниеПримечание
0x000x04.GIMВолшебная меткаBig Endian
0x040x041.00Версия формата
0x080x04PSPОбычно всегда PSP
0x0C0x0400 00 00 00Не используется
0x100x0200 02block_id
0x120x0200 00block_unk
0x140x0400 02 E0 10block_size
0x180x0400 00 00 10block_header_next
0x1C0x0400 00 00 10block_data_offset
0x200x0200 03block_id
0x220x0200 00block_unk
0x240x0400 02 E0 00block_size
0x280x0400 00 00 10block_header_next
0x2C0x0400 00 00 10block_data_offset
0x300x0200 04block_id
0x320x0200 00block_unk
0x340x0400 02 DF F0block_size
0x380x0400 02 DF F0block_header_next
0x3C0x0400 00 00 10block_data_offset
0x400x0200 30block_data_lenghtРазмер блока данных. Указывает относительное смещение области, расположенной сразу после frame_count
0x420x0200 00b45_unk1Игнорируется
0x440x0200 030000 = rgba5650 (16 bit no alpha)
0001 = rgba5551 (16 bit sharp alpha)
0002 = rgba4444 (16 bit gradient alpha)
0003 = rgba8888 (32 bit gradient alpha)
0004 = index4 (16 colors)
0005 = index8 (256 colors)
0006 = index16 (16 colors with alpha)
0007 = index32 (256 colors with alpha)
0008 = dxt1 (no alpha)
0009 = dxt3 (sharp alpha)
000A = dxt5 (gradient alpha)
0108 = dxt1ext
0109 = dxt3ext
010A = dxt5ext
Настраивается через image_format в GimConv.cfg
0x460x0200 00pixel_order0x00 = normal (default)
0x01 = faster
0x480x0201 A9ШиринаШирина изображения/палитры в пикселях. Ограничено limit_image_width в GimConv.cfg
0x4A0x0200 6EВысотаВысота изображения/палитры в пикселях. Ограничено limit_image_height в GimConv.cfg
0x4C0x0200 20bpp_alignВыравнивание изображения/палитры BPP
0x4E0x0200 10pitch_alignВыравнивание изображения/палитры X
0x500x0200 01height_alignВыравнивание изображения/палитры Y
0x520x0200 02b45_unk2Игнорируется
0x540x0400 00 00 00b45_unk3Игнорируется
0x580x0400 00 00 30index_startОтносительное смещение начала индекса.
0x5C0x0400 00 00 40pixels_startНачальное смещение относительно первой плоскости/уровня/кадра
0x600x0400 00 00 60pixels_endПоследнее смещение относительно конца плоскости/уровня/кадра
0x640x0400 00 00 00plane_maskУказывает цвет (для альфа-маски?)
0x680x0200 01level_type0x00 = Illegal
0x01 = MIPMAP
0x02 = MIPMAP2 (used for palettes)
0x6A0x0200 01level_countКоличество мипмапов. Ограничено limit_level_count в GimConv.cfg (по умолчанию максимум 8)
0x6C0x0200 03frame_type0x00 = Illegal ?
0x01 = Illegal ?
0x02 = Illegal ?
0x03 = SEQUENCE
0x6E0x0200 01frame_countКоличество кадров. Ограничено limit_frame_count в GimConv.cfg (по умолчанию без ограничений)
0x700x0400 00 00 40frame_n_offsetГде <n> — номер кадра. Эта запись повторяется один раз для каждого level_count или frame_count.
0x740x0C00 00 00 ...paddingЗаполнение нулями, чтобы выровнять блок по 16 байт

in1975 08.07.2022 08:10

Графический rcomagegui.exe конвертирует из png в gim некорректно (без учета в каком формате был оригинал, что приводит к неправильному отображению, то есть к "квадратикам")

в позиции 0х44 смотрим значение и на основе этого конвертируем с опциями (пример):

0x03 = rgba8888:
Код:

gimconv.exe custom.png -o 1stMostCommonInPS3.gim -ps3rgba8888
0x0A = dxt5:
Код:

gimconv.exe custom.png -o 2ndMostCommonInPS3.gim -ps3dxt5
0x09 = dxt3:
Код:

gimconv.exe custom.png -o 3rdMostCommonInPS3.gim -ps3dxt3



В основном этих опций хватает.

Последний (1.1.2) умеет такие опции (взято из конфига, обратите внимание, версия 1.1.1 такие опции не знает):

расшифровка опций

Код:

//--------------------------------------------------------
//  custom options PS3
//--------------------------------------------------------

option -ps3rgba5650 {
        format_endian = big
        format_style = psp
        image_format = rgba5650
        pixel_order = normal
        pixel_channel = rgba
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3rgba5551 {
        format_endian = big
        format_style = psp
        image_format = rgba5551
        pixel_order = normal
        pixel_channel = rgba
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3rgba4444 {
        format_endian = big
        format_style = psp
        image_format = rgba4444
        pixel_order = normal
        pixel_channel = rgba
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3rgba8888 {
        format_endian = big
        format_style = psp
        image_format = rgba8888
        pixel_order = normal
        pixel_channel = rgba
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3index4 {
        format_endian = big
        format_style = psp
        image_format = index4
        pixel_order = normal
        pixel_channel = rgba
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3index8 {
        format_endian = big
        format_style = psp
        image_format = index8
        pixel_order = normal
        pixel_channel = rgba
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3index16 {
        format_endian = big
        format_style = psp
        image_format = index16
        pixel_order = normal
        pixel_channel = rgba
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3index32 {
        format_endian = big
        format_style = psp
        image_format = index32
        pixel_order = normal
        pixel_channel = rgba
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3dxt1 {
        format_endian = big
        format_style = psp
        image_format = dxt1
        pixel_order = normal
        pixel_channel = default
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3dxt3 {
        format_endian = big
        format_style = psp
        image_format = dxt3
        pixel_order = normal
        pixel_channel = default
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3dxt5 {
        format_endian = big
        format_style = psp
        image_format = dxt5
        pixel_order = normal
        pixel_channel = default
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3dxt1ext {
        format_endian = big
        format_style = psp
        image_format = dxt1ext
        pixel_order = normal
        pixel_channel = default
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3dxt3ext {
        format_endian = big
        format_style = psp
        image_format = dxt3ext
        pixel_order = normal
        pixel_channel = default
        limit_image_width = 4096
        limit_image_height = 4096
}

option -ps3dxt5ext {
        format_endian = big
        format_style = psp
        image_format = dxt5ext
        pixel_order = normal
        pixel_channel = default
        limit_image_width = 4096
        limit_image_height = 4096
}


in1975 08.07.2022 15:33

Сделал консольную модификацию.

Инструкция:
  1. Кладете нужный rco в папку rcofile
  2. Запускаете extr.bat - он распакует, сконвертирует и запишет нужные данные в папку rcofile
  3. Меняйте файлы по мере необходимости (файл list.txt в папке img не трогайте!)
  4. Пакуйте обратно с помощью pack.bat и забирайте из папки NEW_RCO

Прикладываю rcofile\sysconf_plugin.rco для примера, как видно, если ничего не менять, новый rco будет с таким же md5 как и старый

ErikPshat 09.07.2022 01:49

in1975, ага, в примере по умолчанию почти все файлы в формате ps3rgba8888.

Интересно, что у троих разные форматы, видимо картинкам с тенями канал Альфа не нужен:

tex_arrow_anim-ps3dxt10008 - dxt1 (no alpha)
tex_arrow_anim_shadow-ps3dxt10008 - dxt1 (no alpha)
tex_sce_logo -ps3dxt30009 - dxt3 (sharp alpha)

in1975 09.07.2022 07:43

ErikPshat, Как я и говорил ранее, у каждой картинки может быть свой формат, даже в одном rco, поэтому распаковка/паковка с опциями по умолчанию ведет к проблемам. Мои батники эту проблему исправили :)

Спасибо за табличку ;)

ErikPshat 09.07.2022 07:48

in1975, зачем тогда у других картинок с тенями формат ps3rgba8888? Так они более тяжёлые с ненужным Альфа-каналом.

in1975 09.07.2022 07:51

ErikPshat, Вопрос к разработчикам, не ко мне :)


Текущее время: 14:35. Часовой пояс GMT +3.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc. Перевод: zCarot
PSPx Forum - Сообщество фанатов игровых консолей.