Giter Site home page Giter Site logo

williamblair / psn00bsdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lameguy64/psn00bsdk

0.0 1.0 0.0 628 KB

Open-source PS1 SDK project that aims to be as close to the official SDK as possible.

License: Mozilla Public License 2.0

C 45.26% C++ 20.55% Objective-C 1.34% Makefile 3.53% Assembly 24.22% Python 5.09%

psn00bsdk's Introduction

PSn00bSDK

PSn00bSDK is a 100% free and open source SDK project for the original Sony PlayStation for developing homebrew applications and games for the console 100% freely. This SDK can be used for freeware, commercial, and open source homebrew projects.

The SDK is composed mainly of libraries (libpsn00b) and some utilities that provide a basic framework for developing software for the PlayStation hardware, the compiler is separate (GCC) and should be acquired from GNU. The library API is intentionally written to resemble the library API of the official libraries as closely as possible. This design decision is not only for familiarity reasons and so that existing sample code and tutorials would still apply, but to also make porting existing homebrew originally made with official SDKs to PSn00bSDK easier with few modifications.

PSn00bSDK is currently a work in progress and cannot really be considered production ready, but what is currently implemented should be enough to produce some interesting homebrew with the SDK, especially with extensive support for the GPU and GTE hardware. There's no reason not to fully support the hardware features of the target platform when they have been fully documented for years (nocash's PSX specs document in this case).

Most of libpsn00b is written mostly in MIPS assembly, more so functions that interface with hardware. Many of the standard C functions are implemented in custom MIPS assembly instead of equivalents found in the BIOS ROM for performance reasons.

Notable features

As of libpsn00b run-time library v0.10b

  • Extensive GPU support with polygon primitives, high-speed DMA VRAM transfers and DMA ordering table processing. All video modes for both NTSC and PAL standards also supported with fully adjustable display area and automatic video standard detection based on last GPU mode, no BIOS ROM string checks used.

  • Extensive GTE support with rotate, translate, perspective correction and lighting through assembly macros (for both C and ASM) and high performance matrix and vector functions, all calculations performed in fixed point integer math.

  • Stable and easy to use interrupt service routine with callback system for simplified handling of hardware and DMA interrupts, no crude event handlers or kernel hacks used and should be compatible with HLE BIOS implementations and homebrew loaders and menus.

  • Complete Serial I/O support with SIOCONS driver for tty console access through serial interface.

  • BIOS controller functions for polling controller input work as intended thanks to proper interrupt handling, no crude manual polling of controllers in your main loop.

  • BIOS CD-ROM support with a custom initialization function that doesn't clear other DMA channel settings (such as GPU and SPU DMA) for easier initialization.

  • Uses Sony SDK library syntax for familiarity to experienced programmers and to make porting existing homebrew to PSn00bSDK easier.

  • Works on real hardware and most popular emulators.

Obtaining PSn00bSDK

Because PSn00bSDK is updated semi-regularly due to this project being in a work-in-progress state, it is better to obtain this SDK from source by building it yourself in the long run. Prepared packages containing precompiled libpsn00b libraries, the toolchain and additional utilities not included in this repository for Windows users are planned, though some arrangements would need to be made first. Perhaps once PSn00bSDK is considered halfway production ready.

A precompiled copy of the GCC 7.2.0 toolchain for Windows is available in lameguy64's website (http://lameguy64.tk) in the PSn00bSDK page. This should make building PSn00bSDK under Windows a bit easier as building the toolchain is the hardest part of building PSn00bSDK as its more difficult to get it to compile correctly under Windows than on Linux and BSDs.

Building the SDK

Windows (needs work/testing):

  1. Download the following:
  • MinGW GCC (32-bit or 64-bit whichever you prefer)
  • MSys2 (32-bit or 64-bit whichever you prefer)
  • tinyxml2 (for lzpack and smxlink)
  • GCC 7.2.0 for mipsel-unknown-elf (download from Lameguy64's website)
  1. Install MSys2 and MinGW GCC.
  2. Extract GCC 7.2.0 for mipsel-unknown-elf to the root of your C drive.
  3. Update your PATH environment variable to point to the bin directories of GCC 7.2.0 for mipsel-unknown-elf, MSys2 and MinGW GCC. Make sure you can access gcc, mipsel-unknown-elf-gcc and make from any directory in the command prompt.
  4. Build tinyxml2 with MinGW GCC through MSys2's shell (./configure then make).
  5. Clone/download PSn00bSDK source files.
  6. Enter libpsn00b directory and run make.
  7. Enter tools directory and run make, then 'make install' to consolidate the executables to a bin directory. Add this directory to your PATH environment variable and make sure elf2x is accessible from any directory.
  8. Compile the example programs to test if the SDK is set up correctly. Update directory paths in sdk-common.mk when necessary.

Linux and Unix-likes:

  1. Build and install the GNU GCC toolchain configured for mipsel-unknown-elf (see toolchain.txt for details).
  2. Update your PATH environment variable to point to the bin directory of the toolchain. Make sure the toolchain executables are accessible from any directory in the terminal.
  3. Install the following (development) package:
  • tinyxml2
  1. Clone/download PSn00bSDK source files.
  2. Enter the libpsn00b directory and run make.
  3. Enter the tools directory and run make, then 'make install' to consolidate the executables to a bin directory. Add this directory to your PATH variable and make sure elf2x is accessible from any directory.
  4. Compile the example programs to test if the SDK is set up correctly. Update directory paths in sdk-common.mk when necessary.

Examples

There are a few examples and complete source code of n00bdemo included in the examples directory. More example programs may be added in the future and contributed example programs are welcome.

To-do List

  • libc: C++ support (getting classes, new and delete working is enough) and better sprintf() (one from PSXSDK is slow due to unnecessary usage of int64 and somewhat a bit buggy) yet to be implemented. More standard C library stuff also yet to be implemented.

  • psxgpu: VRAM download and VRAM move functions, some more primitives and macros yet to be implemented.

  • psxgte: Higher level GTE rotate translate and perspective functions yet to be implemented.

  • psxspu: Lots of work to do.

  • psxapi: Plenty of BIOS function calls yet to be added.

  • psxetc: Text stream stuff (FntOpen(), FntPrint(), FndFlush()) for debug purposes yet to be implemented.

  • Libraries yet to be made: psxcd (for better CD-ROM support) and psxmdec (MDEC support).

Usage terms

PSn00bSDK falls under the terms and conditions of the Mozilla Public License. A quick summary of this license is that PSn00bSDK can be used freely in both free and open source projects and commercial closed source projects as projects using PSn00bSDK does not necessarily have to follow the MPL as well.

If modifications to the SDK were made as part of the development of such projects that enhance its functionality, such changes must be contributed back in return.

Credits

Main developer:

  • Lameguy64

References used:

psn00bsdk's People

Contributors

lameguy64 avatar qbradq avatar root670 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.