MinPSP 11.2

This is the second build of 2011, in this build there are only a few changes, i changed the build of oslib to build with its internal libs (do not rely on the SDK ones), DEB files for Debian/Ubuntu have been reduced from 150Mb to 32Mb (Changed from the standard compression to LZMA). On linux there is no mpfr/gmp dependency it caused problems with different versions of Ubuntu.

From the community i added a couple of patches, one that adds a pack to the SceModule struct and sync with the gentoo scripts for build fixes and better support on other environments.

Enjoy and happy coding :) get it here!

5

MinPSP Eclipse Plugin @ Google Code

I've been using the MinPSP Eclipse plugin for a while and several people have downloaded it. I see that people are interested in the plugin and I get also requests for new features, such as project templates and better GDB support with the latest Eclipse. Since I don't have much time to work on this myself, I've open sourced the source code of the plugin.

You can get the source code here: minpsp-eclipse-plugin.

If you want to participate and make this plugin better just request it on the project site and I will work out a way for you to help.

4

New MinPSP plugin 1.0.0

A total refactoring of the plugin is complete, this time the plugin can discover compiler flags and default includes, in order to get it working properly, make sure your minpsp installation is on the path. On windows the installer does this automatically but for other platforms you need to do it yourself.

Once you do this and create a MinPSP lib project/or Makefile project, you will see that default includes get automatically indexed and it can compile out of the box lib projects.

Also a nice addition is that MinPSP debugger gets listed automatically on the debuggers panel.

I will plan to write a new tutorial with the new plugin soon :)

As usual get the plugin from the update site: http://www.jetdrone.com/static/eclipse/update

10

MinPSP Eclipse Plugin 0.0.1

In order to make your game development environment even more friendly with Eclipse, I am pleased to announce the initial release of the MinPSP Eclipse Plugin. This plugin will allow you to create:

  • Executable Projects
  • Static Library Projects
  • Makefile Projects

It is still very primitive and depends on having the Eclipse C/C++ Development Tools installed. To get started install the plugin by going to its update site:

You should be seeing something like this:

Eclipse Plugin Update Site

Once the install process completes and Eclipse is restarted you can start creating your projects:

Create new C Project

8

MinPSPW 0.11 is out for Windows Linux and Mac

New release is out, not so many features this time:

  • openTRI engine devpak
  • reverted binutils to 2.16 since 2.18 generates bad assembly for Daedalus
  • supports Mac as a development platform thanks to autilio
  • Fixed pspsh on win32 when run inside eclipse
  • added PRXTool 

Thanks for the bug reports and enjoy.

8

binutils 2.18 are broken :(

There is a subtle bug on the binutils 2.18 it is possible to reproduce if you build for example Daedalus PSP emulator, with the current SDK it fails to run, but with the old 0.9.5 or downgraded binutils the generated binary works... This is a very obscure bug that i will try to isolate but if any of the users of MinPSPW can help it would be welcome :)

newlib patches

Lately i have been looking into newlib, although there is again a new release 1.19 i am still looking at 1.18. What is so interesting about it? Well, i have noticed that the pspsdk is using integer math for all it's floating point operations, after studying the documentation is was simple to enable hardware floating point math just by using a configuration flag: --enable-newlib-hw-fp. After this point i've noticed that using the -fast-math with gcc does nothing, why? Apparently newlib only has support (or so it seems to me) for NEC processors, so after a couple of hacking i added basic support for fast math function replacements. I did not add all functions but just some basic ones:

  • sinf(float x)
  • cosf(float x)
  • asinf(float x)
  • acosf(float x)
  • atanf(float x)
  • absf(float x)
  • sqrtf(float x)
  • expef(float x)
  • logef(float x)

The idea here is that just by enabling the -fast-math flag you can benefit from some performance improvement. It is obvious to say that this is all experimental stuff it might work or not with your code, we need to test and see how it behaves. Now, It may be already lots of changes, but something that has been puzzling me for a while is why does ODE (Open Dynamics Engine) work on the PSP, after changing some mails on the ODE mailing list i got some info that NaNs and Infs do not work as expected, so i decided to patch again new lib for that too. Now here is a thing that is more complicated than it sounds. Newlib floating point math has several implementations, ISO, IEEE, X... so which one to change? i opted for the default one, math.h defines 2 functions:

  • isnan
  • isinf

These were functions that were changed and remained on math.h as macros, that expand to fpclassify comparisons, however there are 2 extra functions:

  • __isnanf
  • __isinff

These ones are real implementations, so i patched these 2 to use the PSP fpu processor to check if a number is NaN or INF. I will be testing this changes but if some of the users of minpsp, you for example :) would like to help to test just build the toolchain and try it out or let me know and i will build a test toolchain for alpha testers.

1

MinPSP is comming to Mac OS X

Well, people who know me know that Mac's are really not my thing, i am not a fan of Apple products, i never found my iPod easy to use or even iTunes, they always do what Apple wants, not me... anyway this is no reason for ignore the platform and now with help of a very patient ps2dev community we are getting MinPSP also running on that platform. As of today the same toolchain script can build the binutils, gcc, newlib, sdk, gdb and is stopping on usbpsplink, once we solve this devpaks are next and we are done...

Checking the availability of input on stdin

One of the things MinPSP is looking for, is native port of the homebrew SDK for their respective native platforms, so on Windows we have Windows native executables, on Linux we have Linux native executables, on Linux 64bit... you got the idea... One of the annoying things about this is that not all OSes are POSIX, and not all OSes are from Redmond, so there are quite some quirks that need to be fixed with the crancky #ifdef preprocessor statement. In my last revisit to the MinPSP code I tried to work around the lack of select on file descriptors on windows and converted the pspsh.exe binary from a cygwin binary to a 100% windows native. I isolated all socket code, sockets use select to verify the data availability and for the stdin i assumed that using _kbhit() would be enough. And it has been enough for me since for my tests i always used it from the command prompt, however a long time ago i wrote a small booklet explaining how to plug Eclipse IDE with MinPSP to make it easier to fully develop homebrew applications and there i showed how to invoke pspsh.exe from the eclipse tools. So what was the problem with Eclipse and MinPSP pspsh.exe? Well... i totally forgot that eclipse will just start the process and communicate with it via pipes!!! When you have pipes the _kbhit() function will never return a value other than 0. Having this in mind pspsh would never read anything from stdin since all I/O in the application is non blocking. So after long time of googling and testing i found this piece of code:

static int is_pipe = 0;
static HANDLE input_handle = 0;
int input_available()
{
  DWORD nchars;
  /* When using Standard C input functions, also check if there
   is anything in the buffer. After a call to such functions,
   the input waiting in the pipe will be copied to the buffer,
   and the call to PeekNamedPipe can indicate no input available.
   Setting stdin to unbuffered was not enough, IIRC */
  if (stdin->_cnt > 0)
    return 1;
  if (is_pipe)
  {
    /* When running under a GUI, you will end here. */
    if (!PeekNamedPipe(input_handle, NULL, 0, NULL, &nchars, NULL))
      /* Something went wrong. Probably the parent program exited.
         Could call exit() here. Returning 1 will make the next call
         to the input function return EOF, where this should be
         catched then. */
      return 1;

    return (nchars != 0);
  }
  else
    return _kbhit() != 0; /* In "text-mode" without GUI */
}

Amazingly this code works for me, and lets me pool stdin from pipe for data available to be read. The only thing missing here is how is the is_pipe variable initialized. I've found 2 ways one using the function _isatty( _fileno(stdin)) or using Win32 API, I've chosen this way:

  DWORD dw;
  input_handle = GetStdHandle(STD_INPUT_HANDLE);
  is_pipe = !GetConsoleMode(input_handle, &dw);

And that was it, now you can handle non blocking input from console and from pipes!!! Hurray!!!

2

Allegro 4.4 will be on the next MinPSPW release

You can start porting your allegro games to the PSP, allegro 4.4.1.1 will be part of the next MinPSPW release, although AllegroGL is not included.

MinPSPW has gone to Mars

Long time ago it was possible to write homebrew code for the PlayStation Portable using the D Programming Language, however with the upgrade of GCC to the 4.1, 4.2 and later on to 4.3 the patch didn't work anymore. During the last month I've been studying the GDC bitbucket project and trying to port it back to the MinPSPW toolchain. Although it seemed trivial, because the new GDC project has updated the patch for GCC 4.3 it proven not practical for the cross toolchain. After patching a lot of stuff I finally have a build for now only on Linux that can compile and link a simple Hello World example.

So for now on it will be possible to write code such as:

// imports
// extern (C) allows D to call C functions directly, no need to wrap
extern (C) void pspDebugScreenInit();
extern (C) void pspDebugScreenPrintf(char*,...);
extern (C) int SetupCallbacks();
extern (C) int sceKernelSleepThread();

import std.string;

class HelloPsp
{
public:
    void sayHello()
    {
        pspDebugScreenPrintf(toStringz(m_msg));
    }
    char[] m_msg = "Hello D on Psp\n";
}

int main()
{
    SetupCallbacks();

    pspDebugScreenInit();
    
    auto hello = new HelloPsp();
    hello.sayHello();

    sceKernelSleepThread();
    return 0;
}

So why D? D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python. Special attention is given to the needs of quality assurance, documentation, management, portability and reliability.

The D language is statically typed and compiles directly to machine code. It's multiparadigm, supporting many programming styles: imperative, object oriented, and metaprogramming. It's a member of the C syntax family, and its appearance is very similar to that of C++.

I am planning to update the toolchain and start testing with Windows to be released once the new Ubuntu version is out.

MinPSPW project update

It has been a long while since the last update to the MinPSPW. I haven't stop it, although if you really want to start an indy game studio you can subscribe to the PSP minis. But for the kick and for the people who are just amateurs you can use the Homebrew SDK. The upcoming release 0.9.6 will contain:

  • pspsh does not depend on cygwin and is native
  • remotejoy SDL is also included as a native binary (no cygwin)
  • win32 dependencies updated
  • zlib 1.2.5
  • SDL 1.2.14
  • readline 5.1 (same as gdb)
  • libiconv 1.13.1
  • pthreads 2.8.0
  • updated the fpulib trig functions can use the FPU processor but we either use vfpu or software impl using libm. This can help to make a bit faster code if we do not need vectors.
  • Updated newlib to 1.18
  • wide-char enhancements
  • long double math routines added for platforms where LDBL == DBL
  • long long math routines added
  • math cleanup
  • major locale charset overhaul including added charsets
  • various cleanups
  • various bug fixes
  • Updated the dev environment to build under Windows Vista and Windows 7
  • Updated binutils to 2.18 (for better integration with gcc 4.3.x)
  • removed the patch that defines long as 64bit back to 32bit. This can lead to faster code but breaks old compiled libraries
  • Disabled CDT-5.0.x bug fix
  • gcov builds properly but not fully tested if works as expected
  • added fixes from Luqman Aden in TinyXML
  • added libmpeg2 devpak
  • added bullet physics devpak
  • windows tools are linked against pthreads, if thereads are used it can improved performance on the development side.

This has been an incredible exercise since I've learned a lot of the win32 API while porting the network code from pspsh and remotejoy to windows. I still need time or help to port the psplinkusb_pc to use winusb API.