PS3 PKGi PS3 beta release

Discussion in 'Homebrew Development' started by bucanero, Dec 3, 2019.

  1. 205
    155
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    205
    Likes Received:
    155
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    The thing is that I've already sorted out most errors and the compiler keeps doing the same, it's really weird :dejection:
     
  2. 205
    155
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    205
    Likes Received:
    155
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    Just an update, I satarted to change the code and fixing every error, now pkgi.c compiles alright, now the problem residen on pkgi_config.c, but I guess I'll eventually sort it out. If you want I can upload the modified code when I finish so you can take a look at it, maybe upload a "Windows" version, idk.

    Edit: Changed the code, now it compiles alright. I'll upload the code in a few minutes.
    Edit 2: I can also submit those changes to your GitHub if you want to have it all in one place, just tell me which one you prefer
     
    Last edited: Dec 5, 2019
    sandungas, DeViL303 and bucanero like this.
  3. 12
    1
    7
    Diux97

    Diux97 Forum Noob

    Joined:
    Nov 30, 2019
    Messages:
    12
    Likes Received:
    1
    Trophy Points:
    7
    Gender:
    Male
    Can you play pkg games online? mica "hen" from problems to the psn?
     
  4. 200
    294
    97
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    200
    Likes Received:
    294
    Trophy Points:
    97
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    oh that's great news! :encouragement:
    for sure, let's try to add your code updates

    if you can: fork my GitHub repo, then you can add your changes in your fork, and when it's ready submit a pull request to my repo.

    Then I can review your changes and include them on the original branch, so for the next release the code can be compiled by windows users too. :D

    cheers
     
    DeViL303 and blckbear_ like this.
  5. 6,542
    6,205
    622
    sandungas

    sandungas Moderator Developer

    Joined:
    Dec 31, 2014
    Messages:
    6,542
    Likes Received:
    6,205
    Trophy Points:
    622
    Location:
    Babylon 20xxE series
    How are you doing the screenshots @bucanero ?, with the official screenshot feature (unlocked in rebug firmwares and others), by using custom code ?, or with a video capture card ?... etc ?
    I noticed all your screenshots have black bands at top and left borders... and im wondering if is related with tiny3d (but im looking at pkgi source code and i dont see any reference to tiny3d though)
     
    bucanero likes this.
  6. 205
    155
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    205
    Likes Received:
    155
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    The black borders are part of the app per se, It seems that there's an offset that moves the screen. The app is also rendering a smaller resolution than the Vita, if you set the Vita's full resolution the app goes out of the screen
     
  7. 6,542
    6,205
    622
    sandungas

    sandungas Moderator Developer

    Joined:
    Dec 31, 2014
    Messages:
    6,542
    Likes Received:
    6,205
    Trophy Points:
    622
    Location:
    Babylon 20xxE series
    Ok are part of the app, im asking because incase of using tiny3d there must be a point where initializes tiny3d like this
    Code:
    int tiny3d_Init(int vertex_buff_size);
    By default it initializes in 2D mode, anyway, inmediatly after it there should be something like
    Code:
    void tiny3d_Project2D();
    And after that there are some values to scale the screen (and i guess to move it too)

    https://github.com/Estwald/PSDK3v2/blob/master/libraries-src/Tiny3D/lib/include/tiny3d.h

    I was taking a peek at the source code trying to find some lines like that, but i dont see anything o_O
     
  8. 205
    155
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    205
    Likes Received:
    155
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    Oh I see, so tiny3d takes care of image rendering, kind of, I guess.
    I looked at the code and I tried messing with the Vita values, being the screen size, some main screen drawing and object placement, but I could never get rid of the black bars, I could scale the screen larger, but with that same offset
     
  9. 6,542
    6,205
    622
    sandungas

    sandungas Moderator Developer

    Joined:
    Dec 31, 2014
    Messages:
    6,542
    Likes Received:
    6,205
    Trophy Points:
    622
    Location:
    Babylon 20xxE series
    I think is the function named tiny3d_UserViewport, explained in line #225
    https://github.com/Estwald/PSDK3v2/blob/master/libraries-src/Tiny3D/lib/include/tiny3d.h

    Code:
    /*---------------------------------------------------------------------------------------------------------------------------------------------*/
    /* CHANGE TO 2D/3D                                                                                                                             */
    /*---------------------------------------------------------------------------------------------------------------------------------------------*/
    
    
    /* tiny3d_UserViewPort: change to user ViewPort.
    This function allow to the user to change the viewport X/Y scale for 2D/3D modes and 2D position. You must call before tiny3d_Clear(),
    tiny3d_Project2D(), tiny3d_Project3D() but it is not necessary to call one time per frame (one time can be sufficient).
    You can use Video_Resolution.width and Video_Resolution.height to scale it. For example, in 3D mode by default is used 
    ((float) Video_Resolution.width) / 1920.0f and ((float) Video_Resolution.height) / 1080.0f for the scale.
    For 2D mode it can be ((float) Video_Resolution.width) / 848.0f and ((float) Video_Resolution.height) / 512.0f and pos_x = pos_y = 0.0f
    to support virtual 8x48x512 2D screen
    if you HDTV support complete screen (some HDTV loses part of visible frame buffer area), you can use this method for the video output, but some 
    HDTV (me HDTV) can be configured for "video" or "PC" the DVI (HDMI) port. By default, Tiny3D is adjusted for my  HDTV "video" mode, so if you can
    see a black border in some samples, you can use tiny3d_UserViewPort() to adjust correctly it 
    The onoff param is provide to switch to the internal (with 0) or user (not 0) viewports.
    See userviewport sample.
    */
    
    void tiny3d_UserViewport(int onoff, float pos_x, float pos_y, float scale2D_x, float scale2D_y, float scale3D_x, float scale3D_y);
    
     
    bucanero likes this.
  10. 200
    294
    97
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    200
    Likes Received:
    294
    Trophy Points:
    97
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    about the screenshots, I'm using custom code from my dbglogger lib dumping the video buffer to a .png file.

    about the black bars and stuff: the app is using tiny3D , but through a simplified lib called YA2D from xerpi, so that's why you probably didn't see any direct reference to tiny3D.
    (now, why I used that lib... well, mostly because it was my first attempt on a PS3 app and I wanted to simplify the learning curve. Probably the most optimized code would be to use tiny3d directly)

    I was having the black bar on my TV too, so what I did is a quick hack to draw the background a bit out of the screen to compensate:
    Code:
    pkgi_draw_texture(background, -20, -10);
    
    In my TV now it looks fine, but it might still bring issues on different TVs. I guess the right way to fix it would be to adjust it with tiny3d_UserViewport(...)

    Anyways, I didn't want to spend too much time on the "visual" side, at least until I complete all the features I wish to implement (like text Search and background download)
     
    sandungas likes this.
  11. 131
    12
    27
    Lion_4K

    Lion_4K Member

    Joined:
    Apr 22, 2019
    Messages:
    131
    Likes Received:
    12
    Trophy Points:
    27
    Gender:
    Male
    Sorry, I don't understand what PKGi does.
    It downloads stuff?
     
  12. 205
    155
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    205
    Likes Received:
    155
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    Let's say it's a download manager. Think of it as a store, where you donwload PKGs. You need to give it a txt file with links for those PKGs and PKGi shows them and lets you download them.
     
    bucanero and Lion_4K like this.
  13. 131
    12
    27
    Lion_4K

    Lion_4K Member

    Joined:
    Apr 22, 2019
    Messages:
    131
    Likes Received:
    12
    Trophy Points:
    27
    Gender:
    Male
    Interesting.

    And it can work with lists from NPS or ***PlayStation Store*** for example?
     
  14. 9,225
    9,467
    1,172
    STLcardsWS

    STLcardsWS Administrator

    Joined:
    Sep 18, 2014
    Messages:
    9,225
    Likes Received:
    9,467
    Trophy Points:
    1,172
    Interesting, guess what you just got yourself banned. Congrats
    Seems you were inquiring about piracy and i seen the site censor
    Changed your piracy app into ****PlayStation Store**** ( I still love that :) )

    I don't have patients with members who been here awhile and know the rules.
    well new members either as they are sent them when activating their accounts.

    our rules will be respected or you can move along.

     
    Last edited: Dec 7, 2019
    Lion_4K likes this.
  15. 200
    294
    97
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    200
    Likes Received:
    294
    Trophy Points:
    97
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    just a quick update:
    I've completed the "Search" feature (you can now input a string with the on-screen keyboard) and filter the list with it

    I'm now working on @pink1 's code and see if I can add a background download to the app. Then if everything works, I need to clean up the source code again, 'cuz it gets quite dirty every time I add new stuff :D

    @blckbear_ , I didn't forget about the pull request, it's in the queue after the new features ;)
     
    blckbear_ likes this.
  16. 200
    294
    97
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    200
    Likes Received:
    294
    Trophy Points:
    97
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    well, I added @pink1 's code, but I'm not sure if I did it right or not:
    my code creates a folder on /dev_hdd0/vsh/task/10000002
    then makes a dummy .PKG file, and finally creates a d0.pdb

    the thing is that after creating everything, the download task is not shown on the XMB. It only shows up after you reboot the PS3. :ambivalence:
    At first I thought my code was wrong, but after a reboot (when the task shows up) you can download the .pkg in the background and install it from XMB without issues.

    Now I'm wondering if there's any solution or fix for this, or maybe there's a different method to add a background download and avoid the "required reboot". I'll have to ask the more experienced ps3 devs.
     
  17. 205
    155
    97
    blckbear_

    blckbear_ Member

    Joined:
    Oct 25, 2018
    Messages:
    205
    Likes Received:
    155
    Trophy Points:
    97
    Gender:
    Male
    Occupation:
    Electrical engineering student
    Have you tried refreshing the XMB without rebooting by going to Remote Play and then exiting? Maybe it just needs that and not a full reboot.
    Well, I guess the XMB is refreshed when exiting PKGi anyways, idk. Just brainstorming.
     
    bucanero likes this.
  18. 6,542
    6,205
    622
    sandungas

    sandungas Moderator Developer

    Joined:
    Dec 31, 2014
    Messages:
    6,542
    Likes Received:
    6,205
    Trophy Points:
    622
    Location:
    Babylon 20xxE series
    Hmmm, i guess is needed to index the .pdb file into the databases of the PS3
    Im saying "databases" (in plural) because the PS3 uses several, as far i know are the files located under path dev_hdd0/mms/
    metadata_db_hdd <--- this file stores info about all installed games/apps, game updates, videos, and photos (maybe something more)
    There are others, but right now i dont remember the contents of each

    Maybe @pink1 knows better how it works ?

    --------
    Dunno, but it looks the .pdb file you created by custom means needs to be "indexed" in other file... so probably is one of that databases
    The bad news is we are not able to "update" that databases (to add our custom entry)... for sure there should be some official functions or syscalls to update the databases (to add our custom entry), but are unknown, needs research, reversing, etc...

    What we could do is to "edit" an entry that already exists... this way we are not modifying the internal structure of the database... it would be just a matter of replacing a few bytes
     
    bucanero likes this.
  19. 1,754
    1,884
    297
    pink1

    pink1 Moderator Developer

    Joined:
    Feb 25, 2015
    Messages:
    1,754
    Likes Received:
    1,884
    Trophy Points:
    297
    Gender:
    Male
    I had forgotten about them not showing up until after a reboot. I was thinking we had found a way to refresh the xmb and get them working but I’m not finding anything.
     
    bucanero likes this.
  20. 12,394
    4,993
    497
    pinky

    pinky Retired Developer

    Joined:
    Mar 8, 2015
    Messages:
    12,394
    Likes Received:
    4,993
    Trophy Points:
    497
    Gender:
    Male
    Location:
    The Great Gig in the Sky
    afaik, you only need the PARAM.SFO to be indexed. some games (i.e. little big planet) have tens of thousands of files, so when you read how much space it's taking up, it can take a while. to avoid that from happening, sony used an indexer. I think all of the current gen systems use an indexer. last gen - I don't think the 360 used one, which is why it takes so long to scan your internal hdd on the official system menu. though, I have a lot of indie games, and it no longer takes forever as it did in the past. if you're scanning the size in dashlaunch or something, it takes forever again. anyway, afaik, it's only the PARAM.SFO that's important. I modified the PARAM.SFO to alphabetize everything on my system. however, I did find something odd in how the PARAM.SFO editor lists the game name (possibly other things), because a few things wouldn't change unless I hex edited. the final fantasy xiii sequels were like that.
     
    bucanero likes this.

Share This Page