Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Tiny3d, ps3soundlibs e libfont #38

Open
crystalct opened this issue Jun 24, 2020 · 42 comments
Open

Missing Tiny3d, ps3soundlibs e libfont #38

crystalct opened this issue Jun 24, 2020 · 42 comments

Comments

@crystalct
Copy link

This is not a real issue but a proposal.
For anyone who installs ps3toolchain, the next step is to search tiny3d and instal it. So why not officially insert it here?
Me and @bucanero have adjusted sources and samples from @wargio and @Estwald works to compile them with gcc 7.2.0.
My work is here: https://github.com/crystalct/tiny3D_ps3soundlib but i think that a ps3dev repository is more appropriate.
What do you think?

@wargio
Copy link

wargio commented Jun 24, 2020

@crystalct can you make a PR on mine repo? there are plenty of libs that are not in the ps3dev repo. but you can make a PR here to add the missing script like i did with NoRSX

@crystalct
Copy link
Author

@wargio: Of course. If you have time take a look at https://github.com/crystalct/tiny3D_ps3soundlib and tell me if there are something that i have added you dont like.

@bucanero
Copy link

bucanero commented Jun 25, 2020

I guess that a clean option would be to:

  • submit all the Tiny3d gcc-7.2 changes as PR to @wargio 's repo
  • create another repo for ps3soundlib
  • when both repositories are updated and ready, submit a PR to ps3libraries repo, adding a single script to install both

Since Tiny3d is used in many homebrews, I think it will be a nice addition.

Feel free to share your feedback

@miigotu
Copy link
Member

miigotu commented Jun 25, 2020

Im going to start working on using submodules to easily include changes into ps3dev. (I got my laptop working, bad sodimm slot smhso im stuck at 8gb ram)

@crystalct
Copy link
Author

I made a pull request to @wargio Tiny3D, so we will see.....

@wargio
Copy link

wargio commented Jun 25, 2020

I guess that a clean option would be to:

* submit all the Tiny3d gcc-7.2 changes as PR to @wargio 's repo

* create another repo for `ps3soundlib`

* when both repositories are updated and ready, submit a PR to `ps3libraries` repo, adding a single script to install both

Since Tiny3d is used in many homebrews, I think it will be a nice addition.

Feel free to share your feedback

actually i also have https://github.com/wargio/ps3soundlib
also for @crystalct

@crystalct
Copy link
Author

PR just made !

bitmoji

@wargio
Copy link

wargio commented Jun 25, 2020

i added a review. please check the requested changes.

@wargio
Copy link

wargio commented Jun 25, 2020

@crystalct merged both.

@bucanero
Copy link

bucanero commented Jun 25, 2020

PR just made !

I've added a small comment about raw2h on the Tiny3d makefiles, as it looks hardcoded for Windows (raw2h.exe)

@wargio
Copy link

wargio commented Jun 25, 2020

PR just made !

I've added a small comment about raw2h on the Tiny3d makefiles, as it looks hardcoded for Windows (raw2h.exe)

fixed. please test this again since for me is a blind fix.

@miigotu
Copy link
Member

miigotu commented Jun 26, 2020

ps3dev/PSL1GHT@e573ba2

@bucanero
Copy link

bucanero commented Jul 3, 2020

Now that we have solved the Tiny3D build with gcc7, should we un-freeze this topic? 😄

@crystalct
Copy link
Author

crystalct commented Jul 3, 2020

To build ps3soundlib must be present raw2h command tool.
Yes, now there is. ^_^
PR done.

@crystalct
Copy link
Author

What do you think to put all samples (PSL1GHT, tiny3d and others) somewhere?
/usr/src/ps3dev/PSL1GHT_samples or
/usr/src/PSL1GHT/samples or
/usr/src/ps3dev/PSL1GHT/samples

@bucanero
Copy link

bucanero commented Jul 3, 2020

To build ps3soundlib must be present raw2h command tool.

raw2h was added to the ps3toolchain (and updated the makefiles), so it should be available to build the soundlib.

What do you think to put all samples (PSL1GHT, tiny3d and others) somewhere?
/usr/src/ps3dev/PSL1GHT_samples or
/usr/src/PSL1GHT/samples or
/usr/src/ps3dev/PSL1GHT/samples

mmm... good question! the easiest option is to leave the tiny3d samples as part of the tiny3d library.

If I had to choose, I'd leave them on the tiny3d library, and only add the fireworks3D sample to the PSL1GHT repository. (e.g. /samples/graphics/tiny3d/fireworks3d/)

Fireworks3d uses tiny3d and the soundlib, so I guess it's a nice example to test everything. The rest can stay on the source library repository.

I'd like to hear feedback from other devs too 😄

@wargio
Copy link

wargio commented Jul 7, 2020

i agree on having the sample on the PSL1GHT repository.

@bucanero
Copy link

bucanero commented Jul 7, 2020

i agree on having the sample on the PSL1GHT repository.

alright, so if everyone agrees:

  • we remove the fireworks3D example from tiny3d / ps3soundlib repositories
  • we add fireworks3d to the PSL1GHT/samples/graphics/ folder
  • the rest of the samples remain on the tiny3d repo

(of course this should happen when tiny3d+soundlib are added to ps3libraries so they're part of PSL1GHT)

@wargio
Copy link

wargio commented Jul 7, 2020

i agree on this. (i can make the PR on both repos)

@bucanero
Copy link

bucanero commented Jul 7, 2020

i agree on this. (i can make the PR on both repos)

great! 👍 then @wargio will take care of the PRs

thanks for the help!

@bucanero
Copy link

bucanero commented Jul 13, 2020

@crystalct , some changes have been implemented in rsxInit() (as mentioned in ps3dev/PSL1GHT#106 )

I think that Tiny3D will need to be adjusted too, right?

@crystalct
Copy link
Author

I compiled and installed new PSL1GHT (not entire ps3toolchain) and after wargio/Tiny3D.
Tiny3D was compiled but with warning:

glue.c
/home/scristaldi/tiny3D/lib/source/glue.c: In function 'rsxtiny_Init':
/home/scristaldi/tiny3D/lib/source/glue.c:30:24: warning: passing argument 1 of 'gcmInitBody' from incompatible pointer type [-Wincompatible-pointer-types]
  s32 ret = gcmInitBody(&contextPointer, cmdSize, ioSize, ioAddress);
                        ^
In file included from /usr/local/ps3dev/psl1ght/ppu/include/rsx/rsx.h:81:0,
                 from /home/scristaldi/tiny3D/lib/source/rsxtiny.h:7,
                 from /home/scristaldi/tiny3D/lib/source/glue.c:1:
/usr/local/ps3dev/psl1ght/ppu/include/rsx/gcm_sys.h:1137:5: note: expected 'gcmContextData ** {aka struct _gcmCtxData **}' but argument is of type 'gcmContextData ** {aka struct _gcmCtxData **}'
 s32 gcmInitBody(gcmContextData **ctx,const u32 cmdSize,const u32 ioSize,const void *ioAddress);

Tiny3d doesn't use rsxInit but rsxtiny_Init calling gcmInitBody and not gcmInitBodyEx.
Anyway... all tiny3d samples don't work on RPCS3 emulator.
PSL1GHT graphics samples are full of errors.

I don't know if i need to install ps3toolchain from start...

@wargio
Copy link

wargio commented Jul 13, 2020

yes, there was some changes made by @shagkur

@shagkur
Copy link
Member

shagkur commented Jul 13, 2020

@crystalct "PSL1GHT graphics samples are full of errors." -> you mean rsxtest sample for instance?

@crystalct
Copy link
Author

crystalct commented Jul 13, 2020

Blitting and videoTest.
cairo only known problem of libcairo.a link, but it's another thing.
msgdialog and osk samples (sys).
ps3load (network).
New spumars sample doesn't work for me

@shagkur
Copy link
Member

shagkur commented Jul 13, 2020

So cairo never worked? will have a look at blitting and videoTest (perhaps i missed them to refactor to the changes)
For tiny3D i made changes to get it compile. You don't need to use gcmInitBodyExt (there's gcm_wrapper.c which holds gcmInitBody as a wrapper method). The changes i made there were to get rid of ATTIBUTE_PRXPTR in the argument list aswell as having the implementing application to declare the context variable with this macro.
As a small side note: I'd strongly recommend to refactor tiny3D to make full use of the rsx API

@shagkur
Copy link
Member

shagkur commented Jul 13, 2020

can you try, tiny3D, from my fork: https://github.com/shagkur/tiny3D

@crystalct
Copy link
Author

crystalct commented Jul 13, 2020

So cairo never worked?

(ps3dev/ps3toolchain#87)
When i compile cairo samples i got:
linking ... cairo.elf

main.o: In function `.drawFrame':
main.c:(.text.drawFrame+0x84): undefined reference to `.cairo_image_surface_create_for_data'
main.c:(.text.drawFrame+0x98): undefined reference to `.cairo_create'
main.c:(.text.drawFrame+0xc8): undefined reference to `.cairo_set_source_rgb'
main.c:(.text.drawFrame+0xd4): undefined reference to `.cairo_paint'
main.c:(.text.drawFrame+0xe0): undefined reference to `.cairo_save'
main.c:(.text.drawFrame+0xec): undefined reference to `.cairo_new_path'
main.c:(.text.drawFrame+0x130): undefined reference to `.cairo_translate'
main.c:(.text.drawFrame+0x160): undefined reference to `.cairo_rotate'
main.c:(.text.drawFrame+0x170): undefined reference to `.cairo_set_antialias'
main.c:(.text.drawFrame+0x18c): undefined reference to `.cairo_line_to'
main.c:(.text.drawFrame+0x1a8): undefined reference to `.cairo_line_to'
main.c:(.text.drawFrame+0x1bc): undefined reference to `.cairo_line_to'
main.c:(.text.drawFrame+0x1d0): undefined reference to `.cairo_line_to'
main.c:(.text.drawFrame+0x1dc): undefined reference to `.cairo_close_path'
main.c:(.text.drawFrame+0x26c): undefined reference to `.cairo_set_source_rgb'
main.c:(.text.drawFrame+0x278): undefined reference to `.cairo_fill_preserve'
main.c:(.text.drawFrame+0x290): undefined reference to `.cairo_set_source_rgb'
main.c:(.text.drawFrame+0x29c): undefined reference to `.cairo_stroke'
main.c:(.text.drawFrame+0x2a8): undefined reference to `.cairo_identity_matrix'
main.c:(.text.drawFrame+0x2c0): undefined reference to `.cairo_set_source_rgb'
main.c:(.text.drawFrame+0x2d8): undefined reference to `.cairo_select_font_face'
main.c:(.text.drawFrame+0x2ec): undefined reference to `.cairo_set_font_size'
main.c:(.text.drawFrame+0x304): undefined reference to `.cairo_move_to'
main.c:(.text.drawFrame+0x334): undefined reference to `.cairo_show_text'
main.c:(.text.drawFrame+0x340): undefined reference to `.cairo_destroy'
main.c:(.text.drawFrame+0x350): undefined reference to `.cairo_surface_finish'
main.c:(.text.drawFrame+0x35c): undefined reference to `.cairo_surface_destroy'
collect2: error: ld returned 1 exit status

But if i compile libcairo using -flto -ffat-lto-objects CFLAGS, compilation & link is done.

@crystalct
Copy link
Author

https://github.com/shagkur/tiny3D

Compilation done without warnings....
Samples working (on RPCS3 emulator. my PS3 is at home :-)

@wargio
Copy link

wargio commented Jul 13, 2020

can you try, tiny3D, from my fork: https://github.com/shagkur/tiny3D

Can you open a PR again? XD

@zeldin
Copy link
Member

zeldin commented Jul 13, 2020

@crystalct The LTO issue with cairo was fixed in cairo 1.14. I backported the fix to 1.10. (The fix was simply removing -flto 😄)

@shagkur
Copy link
Member

shagkur commented Jul 13, 2020

@wargio PR already createded

@shagkur
Copy link
Member

shagkur commented Jul 13, 2020

@crystalct samples/blitting should be fixed now (works on my real PS3 tho)

@shagkur
Copy link
Member

shagkur commented Jul 13, 2020

Blitting and videoTest.
cairo only known problem of libcairo.a link, but it's another thing.
msgdialog and osk samples (sys).
ps3load (network).
New spumars sample doesn't work for me

you test them all on the emulator, right? I assume spumars (which is an opensource (initial) version of SPURS) doesn't play well with an emulator
for the others i've to look.
samples/videoTest should work now too.

@wargio
Copy link

wargio commented Jul 13, 2020

cool. good job!

@shagkur
Copy link
Member

shagkur commented Jul 13, 2020

@crystalct all the mentioned samples should compile and work now.

@crystalct
Copy link
Author

crystalct commented Jul 13, 2020

I confirm it. OK.
But a little tuning of spu samples, could be done.
spurs sample: missing memalign header and Makefile has -Os CFLAG (internal compiler error: in rs6000_savres_routine_name, at config/rs6000/rs6000.c:2866)
spumars sample: missing data folder cause copy error (../../data/spu.bin': No such file or directory), with data folder first make cause error (/home/crystal/PSL1GHT/samples/spu/spumars/source/main.c:14:10: fatal error: spu_bin.h: No such file or directory #include "spu_bin.h"), second make OK

@shagkur
Copy link
Member

shagkur commented Jul 13, 2020 via email

@shagkur
Copy link
Member

shagkur commented Jul 13, 2020 via email

@wargio
Copy link

wargio commented Jul 13, 2020

I confirm it. OK.
But a little tuning of spu samples, could be done.
spurs sample: missing memalign header and Makefile has -Os CFLAG (internal compiler error: in rs6000_savres_routine_name, at config/rs6000/rs6000.c:2866)
spumars sample: missing data folder cause copy error (../../data/spu.bin': No such file or directory), with data folder first make cause error (/home/crystal/PSL1GHT/samples/spu/spumars/source/main.c:14:10: fatal error: spu_bin.h: No such file or directory #include "spu_bin.h"), second make OK

try to change -0s to -02

@shagkur
Copy link
Member

shagkur commented Jul 14, 2020

@crystalct changed/fixed the spu samples

@humbertodias
Copy link

tiny3d and ps3soundlib added #64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants