Ok, thanks.I think now I understand what you mean by "slot". I think you're refering to the function map_first_slot().
I don't know about map_path_by_slot(). Maybe you modified map_first_slot() to make it generic using index instead of [0].
The function map_first_slot(). was introduced in PS3HEN, probably by Habib or Joonie. There is not a "slot" system at all for map_paths.
Backup managers (like multiMAN or IRISMAN) clear all mapped paths when they start and can break the XMB menus.
map_first_slot() was added to prevent the deletion of the first mapped path, which is for hfw_settings.xml.
I added a similar system to Mamba and Cobra 8.3, keeping the same syscall 35 parameters: if the target path starts with /./ the path is not deleted by the backup managers when syscall(35, NULL, NULL) is called.
So that map_first_slot() is just an internal function of PS3HEN, that does not exist in Cobra or Mamba.
The function get_map_path() is also a new function introduced in Cobra 8.1 or 8.2.
I haven't seen any application using it yet. If you have a working version without changes, that's very good.
In regards to the priority system, it's a good idea. I hope it doesn't require a new syscall or break compatibility with existing apps.
That's why I implemented the "shadow path" and "protected path" using // or /./ respectively as prefix of the target path, instead of using a new parameter.
For now the workaround for the priority is deleting the existing mappings, and creating the new mappings in order (subdirectories first, then the parent directory).
@esc0rtd3w I updated payload/scsi.h and payload/storage_ext.c to add support for .sbi files and improve the performance seeking the custom subchannels. I attached the full project with compiled binaries, but you can take only these 2 files.
In my tests with .sbi (that format doesn't include the crc-16 data) I found that the PSX games work fine without calculating that hash. It looks like it's calculated internally by the SCSI driver. So I commented the function calculate_subq_crc() and the vector q_crc_lut[256]. It should be tested on HEN in case it behaves different.
I think Cobra and HEN should really be just one project with separate Makefile targets.
We would avoid all this confusion between functions that are here and not there..
I left get_map_path queries by index as it was, it is still valid as it can loop through the new linked list as it did with the old array.
There will be no changes to the syscalls, no legacy breaking, however I have had to introduce 2 new flags for folder mapping and priority mapping.
map_path can now remap folders properly. Once a mapping is applied, map_path reenters a loop of the mappings list to see if another mapping can be applied etc... so in theory a path can go through remapping multiple times before finally the resulting path string from the hook gets processed by the open_path function.
The maximum amount of mappings has been removed, we will soon test how the system performs with numerous mappings, say 100 or 1000...
The open_path hook doesn't seem to process all system file queries, it looks like only certain folders/file types in /dev_flash are accessed via open_path, I dunno how the other ones are handled.
If I had to guess, I would probably bet on an xmb/xcb server running at kernel level taking care of its own IO access without using the open_path function, if so, without a new kernel hook (still to be determined), remappings of many dev_flash based paths will remain impossible through map_path.
Last edited:
