PSONE sdk

Discussion in 'Sony Programming and Development' started by Kronus980, Nov 23, 2010.

  1. Kronus980

    Kronus980 Member

    Joined:
    Nov 23, 2010
    Messages:
    10
    Likes Received:
    0
    Hmm... I think I can post this o_O Does anyone know a tutorial to set up the psone sdk with msys or mingw or cygwin or whatever? I'd prefer an IDE, but is there any link or tut?
     
  2. PERF

    PERF Member

    Joined:
    Nov 6, 2010
    Messages:
    15
    Likes Received:
    0
  3. Kronus980

    Kronus980 Member

    Joined:
    Nov 23, 2010
    Messages:
    10
    Likes Received:
    0
    Ooh.. Uhmm.. Nope. Official? Or can I not discuss that here? :(
     
  4. tails92

    tails92 Spirited Member

    Joined:
    Sep 29, 2008
    Messages:
    197
    Likes Received:
    3
    The official PlayStation SDK is illegal, and often cryptic. Also it seems to be based on a very old GCC version (2.8.1), and I don't think it will integrate with MSYS or Cygwin well.

    My PSXSDK has a precompiled Cygwin toolchain. Read readme.txt inside the archive, it should explain you how to install it.
    Basically this is it:
    1) Download setup.exe from www.cygwin.com, and install Cygwin using it.
    2) Extract my archive to C:
    3) Now start the Cygwin shell, and execute:
    PATH=$PATH:/cygdrive/c/psxsdk/bin

    4) Now to compile an executable for the PlayStation, use psx-gcc. Example:
    psx-gcc -o my_game my_game.c

    -lpsx is automatically included so you don't have to include it.
    An ELF format executable for the MIPS R3000 processor is output.
    The PlayStation can't read this executable format, so you will have to convert it to PS-X EXE format, which is its executable format.

    5) Now to convert your executable to PS-X EXE format:
    elf2exe my_game my_game.exe

    6) You can load my_game.exe on your PlayStation in the way you like.
    CDROM, Caetla (should work, but never tried), etc.

    To generate a CDROM image that you can burn on your PlayStation,
    read the instructions (readme.txt) in the PSXSDK source code.
    In few words, you first have to make a normal ISO image with mkisofs,
    and then you must license it with mkpsxiso. mkpsxiso outputs a .cue/.bin image,
    ready to be burned and which will work either with the swap trick or a modchip.
    Read the full instruction in readme.txt anyway.

    You have to install mkisofs on cygwin (I don't remember if it is contained in cdrtools or it is separate..)

    The license files are in C:\psxsdk\share\licenses
    infousa.dat is the USA license, infoeur.dat is the EUR license and infojpn.dat is the JPN license. A normal ISO won't work on the PlayStation, it lacks license information.

    I hope you enjoy it. If you meet big bugs, maybe they're fixed in the next version. In any case let me know if you want the not-released-yet version. The version I'm developing has SPU support and even a modplayer.
    The only documentation is for now, headers, source code and the examples (PSXPaint and PSXSnake).

    I think you can discuss any PSX software development kit, be it official or homebrew.
     
    Last edited: Nov 23, 2010
  5. Kronus980

    Kronus980 Member

    Joined:
    Nov 23, 2010
    Messages:
    10
    Likes Received:
    0
    Omg? Exactly what I was looking for. Thanks man. And is there anyway I can get any examples? Like of a make file? I hate makefiles.. -.- How did you learn to do this, if you don't mind me asking?
     
    Last edited: Nov 23, 2010
  6. tails92

    tails92 Spirited Member

    Joined:
    Sep 29, 2008
    Messages:
    197
    Likes Received:
    3
    Actually I learned to do this with a lot of dedication. I first learned C, but I didn't understand it very well, then I learned the workings of assembler and machine code, did some ROM hacks, and after this I learned how C really worked.

    With the experience gained with that, I was able to do this SDK.
    I got the information about programming the hardware either from Padua's documentation or from emulators, and then I adapted it with my own hardware reverse engineering (the available information about hardware is rarely totally clear and if you don't care about some bits stuff will not work on the real hardware).

    I am not very good at makefiles, either :p Makefile dependencies work this way; the target is, for example, "test", and the source code file you want to compile is called test.c

    test: test.c
    gcc -o test test.c

    Put a TAB (separator) before gcc in the real Makefile.

    If the file test doesn't exist, or is older than test.c, the target "test" is run.
    Otherwise if test is newer than test.c, nothing is done.
    This is used to compile the source code file only when it has changed.

    In my earlier post there was an error. I have fixed it, it wasn't /c/psxsdk but /cygdrive/c/psxsdk
     
    Last edited: Nov 23, 2010
  7. Kronus980

    Kronus980 Member

    Joined:
    Nov 23, 2010
    Messages:
    10
    Likes Received:
    0
    Ooh compiled snake haha. I gots it now. Muwahhaha. I mean, I understand makefiles, I just don't get the flags, etc etc. Thanks though. And with the making of this sdk, how was it done? Is it like, direct communication with the hardware? Or..?
     
    Last edited: Nov 23, 2010
  8. tails92

    tails92 Spirited Member

    Joined:
    Sep 29, 2008
    Messages:
    197
    Likes Received:
    3
    A mix of both: direct communication with the hardware and calling the BIOS.
    For example the GPU code for example communicates totally directly, while the functions that handle files (like fopen(), etc.) at some point call the BIOS to do the real work.
    If you want my WIP version of the SDK, feel free to PM me.
     
    Last edited: Nov 24, 2010
  9. MottZilla

    MottZilla Champion of the Forum

    Joined:
    Feb 1, 2006
    Messages:
    5,066
    Likes Received:
    102
    So is your goal to have a totally free/legal PS1 SDK that supports all you need to atleast make your own 2D programs/games? I.E. CDROM Access for loading data and playing music, controller input, graphics, sound effects, etc? I've always been curious if someone had made or was ever going to make essentially a SDK complete with a library or atleast examples of all you need to build or port a game to PS1. On the PC I'm used to using Allegro which handles all the input, graphics, and sound interaction with the hardware and I like that. If such a thing existed for PS1 that would be really cool.
     
  10. tails92

    tails92 Spirited Member

    Joined:
    Sep 29, 2008
    Messages:
    197
    Likes Received:
    3
    Yes, my goal is essentially that.
     
  11. Kronus980

    Kronus980 Member

    Joined:
    Nov 23, 2010
    Messages:
    10
    Likes Received:
    0
    So... that fopen() function, the PS1 already understands it? And what's the difference in the WIP version?
     
    Last edited: Nov 25, 2010
  12. tails92

    tails92 Spirited Member

    Joined:
    Sep 29, 2008
    Messages:
    197
    Likes Received:
    3
    Many changes and many bug fixes.
     
  13. MottZilla

    MottZilla Champion of the Forum

    Joined:
    Feb 1, 2006
    Messages:
    5,066
    Likes Received:
    102
    Awesome. I'll have to keep an eye on your progress.
     
  14. tails92

    tails92 Spirited Member

    Joined:
    Sep 29, 2008
    Messages:
    197
    Likes Received:
    3
    Last edited: Dec 2, 2010
  15. n64coder

    n64coder Robust Member

    Joined:
    Mar 25, 2009
    Messages:
    248
    Likes Received:
    1
    @tails92, very impressive work that you're doing here. Kudos to you for taking on such a big task.
     
  16. Disjaukifa

    Disjaukifa Intrepid Member

    Joined:
    Dec 6, 2010
    Messages:
    618
    Likes Received:
    3
    Good job, I'm going to have to download this and get a shot at trying to making some simple games for the PSOne.

    -Disjaukifa
     
  17. Shendo

    Shendo Rapidly Rising Member

    Joined:
    Aug 2, 2008
    Messages:
    77
    Likes Received:
    1
    I just sucesfully compiled PSXSnake after setting everything up (Windows, Cygwin).
    And I must say, tails92 you are the man.
    I'll start working on the new BIOS dumper this femtosecond.
    Games are hopefully to follow :p

    One thing bothers me though... Are the licence.dats legal?
     
    Last edited: Jan 3, 2011
  18. tails92

    tails92 Spirited Member

    Joined:
    Sep 29, 2008
    Messages:
    197
    Likes Received:
    3
    I'm not sure of the legality of the license files, but nowadays nobody cares about that and Sony suspended the "licensing" program a lot of time ago.
    If one is going to sell a game he made and he's really worried about this, the next release will come with a tool which will be able modify the license file to change its logo and writing (it is called lictool, the current SVN code for it can only change the logo FYI). The writing and the logo of the license file are displayed during the PlayStation bootscreen. "Licensed by Sony, etc. etc." is actually a changeable writing.
     
    Last edited: Jan 4, 2011
  19. Shendo

    Shendo Rapidly Rising Member

    Joined:
    Aug 2, 2008
    Messages:
    77
    Likes Received:
    1
    Ok, here it is. It's been tested on the real hardware (as well as on emulators)
    and as far as I can see it works fine.

    Dumper image 1.png
    Dumper image 2.png
    Dumper image 3.png
     

    Attached Files:

    Last edited: Jan 16, 2011
  20. MottZilla

    MottZilla Champion of the Forum

    Joined:
    Feb 1, 2006
    Messages:
    5,066
    Likes Received:
    102
    Tails92, any news on your PS1SDK? Do you plan on any basic getting started tutorials for setting up the compiler tools and demonstrating a basic program?
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page