PS3 PKGi PS3 beta release

Discussion in 'Homebrew Development' started by bucanero, Dec 3, 2019 at 3:01 PM.

  1. 87
    115
    57
    bucanero

    bucanero Member

    Joined:
    Jun 29, 2019
    Messages:
    87
    Likes Received:
    115
    Trophy Points:
    57
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    Hello,

    Here's a first beta release of my PS3 port of PKGi. Please keep in mind that it's an early release and it could have many speed/optimization improvements.

    screenshot_2019_12_02_00_17_22.png

    First things first, download link:
    https://github.com/bucanero/pkgi-ps3/releases/tag/v0.0.1-beta

    after install, you'll need to create a "pkgi.txt" file on /dev_hdd0/game/NP00PKGI3/USRDIR

    The file should contain the list of PKG files (URLs) that you'd like to list in the app.
    The file is simply a CSV (comma separated value) text file with the following format (each line means one item in the list):

    Code:
    contentid,flags,name,name2,rap,url,size,checksum
    
    where:
    • contentid is full content id of item, for example: UP0000-NPHA99999_00-0000112223333000.
    • flags is currently unused number, set it to 0.
    • name is arbitrary string to display for name.
    • name2 is currently unused alternative name, leave it empty.
    • rap is the 16 hex bytes of the RAP file, if needed by the pkg (.rap will be created on hdd0/exdata). Leave empty for no rap file.
    • url is http url where to download the content PKG.
    • size is size of pkg in bytes, or 0 if not known.
    • checksum is sha256 digest of pkg as 32 hex bytes to make sure pkg is not tampered with. Leave empty to skip the check.

    For example, the pkgi.txt could be something as:

    Code:
    EP0000-NP9999999_00-0AB00A00FR000000,0,My PKG Test,,dac109e963294de6cd6f6faf3f045fe9,http://192.168.1.1/html/mypackage.pkg,2715513,afb545c6e71bd95f77994ab4a659efbb8df32208f601214156ad89b1922e73c3
    UP0001-NP00PKGI3_00-0000000000000000,0,PKGi PS3 v0.1.0,,,http://bucanero.heliohost.org/pkgi.pkg,284848,3dc8de2ed94c0f9efeafa81df9b7d58f8c169e2875133d6d2649a7d477c1ae13
    
    Notes:
    text search is not ready yet, so don't worry about it
    pkg file download supports resume, so you can stop at any point with O (circle) and then continue later.
    (I'd like to support background download but that's something I need to research first, to see if it's even possible)

    feel free to share you comments and suggestions, I'll try to clean up the source code and share it on GitHub soon.

    I hope to bring some more new stuff to the PS3 in the future! :D
    cheers
     
    Last edited: Dec 4, 2019 at 7:01 PM
  2. 1,606
    1,730
    297
    pink1

    pink1 Moderator Developer

    Joined:
    Feb 25, 2015
    Messages:
    1,606
    Likes Received:
    1,730
    Trophy Points:
    297
    Gender:
    Male
    I have a little info on setting up background downloads. I didn't mess with it much once I got it working but maybe you could use parts of it to make something cool. Let me know if you're interested and I'll send you what I have.
     
    bucanero likes this.
  3. 87
    115
    57
    bucanero

    bucanero Member

    Joined:
    Jun 29, 2019
    Messages:
    87
    Likes Received:
    115
    Trophy Points:
    57
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    for sure, I'd be glad to check your code and see if I can recycle (?) and use it here.

    I did some research, and I did found a few examples, but all the background downloads I saw are running from a SPRX plugin (for example webman mod, and ps3hen). I couldn't find any example of it running from a regular PS3 homebrew app.
    (so I was actually wondering if there's any limitation to run such kind of plugin from a regular app or not)

    anyways, thanks in advance for your help! :encouragement:
     
    pink1 likes this.
  4. 200
    150
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    200
    Likes Received:
    150
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    If I'm not mistaken, the only way is by using sprx plugins, as when you exit a PS3 game/app the process is ended, and doesn't run in background. You'll need a plugin that can be run in background and usually sprx plugins do that
     
  5. 87
    115
    57
    bucanero

    bucanero Member

    Joined:
    Jun 29, 2019
    Messages:
    87
    Likes Received:
    115
    Trophy Points:
    57
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    yes, the original firmware has a "download_plugin" sprx already, that it's in charge of doing background downloads. My basic idea (if it's possible) would be to load that .sprx plugin from the PKGi app, add a download to the queue, and then let the plugin handle it. Then if you exit the app, the background download keeps doing it's job.
     
  6. 200
    150
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    200
    Likes Received:
    150
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    In that case I'd say yes, you can do that, I don't know any software that does exactly that other than PS Store itself. I guess it can't be used as an example as there's no code publicly available.
    I'm not an expert in any way so I can't help in programming this stuff.

    I'll take this opportunity to say good job for the PKGi port, I really like it :encouragement:
     
    bucanero likes this.
  7. 1,606
    1,730
    297
    pink1

    pink1 Moderator Developer

    Joined:
    Feb 25, 2015
    Messages:
    1,606
    Likes Received:
    1,730
    Trophy Points:
    297
    Gender:
    Male
    DeViL303 and bucanero like this.
  8. 87
    115
    57
    bucanero

    bucanero Member

    Joined:
    Jun 29, 2019
    Messages:
    87
    Likes Received:
    115
    Trophy Points:
    57
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    DeViL303 and pink1 like this.
  9. 200
    150
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    200
    Likes Received:
    150
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    @bucanero I'm trying to compile it but I get this error:
    make[1]: *** [pkgi.o] Error 1
    make: *** [build] Error 2
    I managed to get rid of most warnings and errors, but I keep getting this one. I'll keep trying to fix it, but if you happen to know what the cause is or maybe an idea of what to chek I'd love to hear it.

    FYI, I'm just trying to mess around with some GUI elements dimensions and that stuff.
     
    bucanero likes this.
  10. 87
    115
    57
    bucanero

    bucanero Member

    Joined:
    Jun 29, 2019
    Messages:
    87
    Likes Received:
    115
    Trophy Points:
    57
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    I think that log is missing some information, but I assume some functions or libraries are missing. (and that reminds me that I need to update the README on GitHub so that info is available)

    So, let's try to do a checklist:
    I'd suggest, install the missing libs by running:
    Code:
    make install
    once all the libraries are installed on your PS3 dev environment (you can check your ps3dev/portlibs/ppu/include dir), then try to build the PKGi app again.

    let me know, and if you get more errors try to get the whole compiler logs
     
    blckbear_ likes this.
  11. 200
    150
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    200
    Likes Received:
    150
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    Thanks, I'll try that, I had some missing libraries when compiling SMW too, I guess the windows pre compiled SDK doesn't have everything.
     
    bucanero likes this.
  12. 87
    115
    57
    bucanero

    bucanero Member

    Joined:
    Jun 29, 2019
    Messages:
    87
    Likes Received:
    115
    Trophy Points:
    57
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    IIRC, the precompiled Windows SDK has tiny3D and libfont.
    So in that case, you'd need to get: YA2D and dbglogger

    next time I'll update the source so it can be compiled without debug logging, so the dbglogger lib can be skipped too.
     
  13. 200
    150
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    200
    Likes Received:
    150
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    Yes, they're already in there, just in case I recompiled every library but I get the same error.

    Here's what I get in the terminal when I try to compile PKGi without any modification:
    _CIRCLE.png
    _CROSS.png
    _SQUARE.png
    _TRIANGLE.png
    _background.png
    font-16x32.c
    pkgi.c
    In file included from c:/PSDK3v2/project/PKGi/source/pkgi.c:3:0:
    c:/PSDK3v2/project/PKGi/include/pkgi_menu.h:5:27: error: redefinition of typedef 'pkgi_input'
    c:/PSDK3v2/project/PKGi/include/pkgi.h:35:3: note: previous declaration of 'pkgi_input' was here
    In file included from c:/PSDK3v2/project/PKGi/source/pkgi.c:4:0:
    c:/PSDK3v2/project/PKGi/include/pkgi_config.h:10:3: error: redefinition of typedef 'Config'
    c:/PSDK3v2/project/PKGi/include/pkgi_db.h:59:23: note: previous declaration of 'Config' was here
    In file included from c:/PSDK3v2/project/PKGi/source/pkgi.c:5:0:
    c:/PSDK3v2/project/PKGi/include/pkgi_dialog.h:3:27: error: redefinition of typedef 'pkgi_input'
    c:/PSDK3v2/project/PKGi/include/pkgi_menu.h:5:27: note: previous declaration of 'pkgi_input' was here
    c:/PSDK3v2/project/PKGi/source/pkgi.c: In function 'pkgi_refresh_thread':
    c:/PSDK3v2/project/PKGi/source/pkgi.c:74:5: warning: implicit declaration of function 'sysThreadExit'
    c:/PSDK3v2/project/PKGi/source/pkgi.c: In function 'pkgi_do_main':
    c:/PSDK3v2/project/PKGi/source/pkgi.c:306:5: error: 'for' loop initial declarations are only allowed in C99 mode
    c:/PSDK3v2/project/PKGi/source/pkgi.c:306:5: note: use option -std=c99 or -std=gnu99 to compile your code
    c:/PSDK3v2/project/PKGi/source/pkgi.c: In function 'pkgi_do_tail':
    c:/PSDK3v2/project/PKGi/source/pkgi.c:537:5: warning: implicit declaration of function 'pkgi_draw_text_and_icons'
    c:/PSDK3v2/project/PKGi/source/pkgi.c: In function 'main':
    c:/PSDK3v2/project/PKGi/source/pkgi.c:778:1: warning: control reaches end of non-void function
    make[1]: *** [pkgi.o] Error 1
    make: *** [build] Error 2

    If there's any other way to get a log with more info just tell me, thanks for the help!
     
    Last edited: Dec 7, 2019 at 10:06 AM
    bucanero likes this.
  14. 87
    115
    57
    bucanero

    bucanero Member

    Joined:
    Jun 29, 2019
    Messages:
    87
    Likes Received:
    115
    Trophy Points:
    57
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    oh I see, there are some compiler specific issues, for example on pkgi.c line 306 it doesn't like this syntax:

    Code:
        for (uint32_t i = first_item; i < db_count; i++)
    
    and expects:
    Code:
        uint32_t i;
        for (i = first_item; i < db_count; i++)
    
    then the other errors are about include definitions that are duplicated in different files... it seems your compiler is more strict than mine.

    I'd try to add a -std=c99 or -std=gnu99 to the CFLAGS in the Makefile to see if you can compile it without changing the code.
     
    DeViL303 likes this.
  15. 200
    150
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    200
    Likes Received:
    150
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    I've already tried that, the C99 error disappears but the final error persists. I've also got rid of the duplicate definition errors but also the final error persists.

    Edit: I did not try fixing the implicit declaration warnings
     
  16. 87
    115
    57
    bucanero

    bucanero Member

    Joined:
    Jun 29, 2019
    Messages:
    87
    Likes Received:
    115
    Trophy Points:
    57
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    btw, do you get a "pkgi.o" file in the build folder? if there's no object file, then there's still some error and the compiler is not generating the binary file.

    I still wonder what's the final error, since the log only says "*** [pkgi.o] Error 1".
    I can send you my pkgi.o file if you want to try (it might bring unexpected results)
     
  17. 200
    150
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    200
    Likes Received:
    150
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    Nope, I don't get any pkgi.o file under build folder. I guess I'll try yours and see what happens.
    The thing is that if I try yours, all the changes I made won't be there, so it may help compilation but it will be the same as if I compiled the code as-is
     
  18. 87
    115
    57
    bucanero

    bucanero Member

    Joined:
    Jun 29, 2019
    Messages:
    87
    Likes Received:
    115
    Trophy Points:
    57
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    hello @blckbear_ , find the file attached

    I don't have a Windows environment so I don't know how we could get more information from the compiler to know why it's refusing to compile the code... I still think it's mostly related to syntax, but since I'm on macOS my toolchain is probably way different.
    Perhaps the fellow developers on Win can check and help out
     

    Attached Files:

    blckbear_ likes this.
  19. 200
    150
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    200
    Likes Received:
    150
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    Now it gives the same error but for pkgi_config.o
    I give up hahahaha
    thanks for the help!
     
    bucanero likes this.
  20. 6,083
    5,770
    622
    sandungas

    sandungas Moderator Developer

    Joined:
    Dec 31, 2014
    Messages:
    6,083
    Likes Received:
    5,770
    Trophy Points:
    622
    Location:
    Babylon 20xxE series
    Sounds like progress :D
    It could be because previouslly the compiler was stopping at the first error (so the code after it was not checked)
    Now that the beginning of the code has been standarized a bit the compiler passes that point, but it stops at a later point... so is needed to do the same in other function/s

    This line at the end of the compiler log is just a counter btw, only counts the errors (not the warnings, that are ignored)
    make[1]: *** [pkgi.o] Error 1

    It was complainng about this line
    Code:
    error: 'for' loop initial declarations are only allowed in C99 mode
     
    bucanero likes this.

Share This Page