Magic Castle's OST Vinyl release - September 1st!!

Net Yaroze Toolchain options

January 16, 2021, at 12:46 PM by mgarcia in Development, Software (0 comments)

Title: Net Yaroze Toolchain options Author: mgarcia Date: 2021-01-16 12:46 +0100 Tags: Development, Software Comments: Open

Size: 1.76 MB[Player volume: MAX]


The Net Yaroze executable format is based on the MIPS R3000 RISC CPU, which is Little Endian, meaning binary values grow from right (little end) to left (big end). It is also ECOFF format, which means that the executable depends on a runtime library, or dynamically link libraries (DLL) as Windows calls them.

A toolchain is typically a set of individual programs which create and maintain executable related files, this includes C/C++ or assembly source code, the MakeFile, object binary files, binary archives, and the executable.

These programs are, compiler, assembler, linker, archiver, stripper, etc, a step debugger and a make tool is typically also included.

The ideal toolchain solution is to build in your native Operating System running on your hardware. Also using newer and updated toolchain, is always better, but the catch is that the other original (16-bit) tools may not work well or at all.

Below is a list of the current compilers available targeting the Net Yaroze, that I am aware of.

Image: Images.Toolchain

Image of Metrowerks' CodeWarrior and DOSBOX printing DJGPP's version 2.7.2.

Original GDGPP 16bit compiler.

The original DOS compiler was a port of GCC to DOS (16-Bit) using the DJGPP code base.

This toolchain is very old, it's from November, 1995 (gcc 2.7.2), so it will have a lot of modern features missing.

I would strongly suggest to avoid any emulation solutions that run 16-bit software, instead to use real hardware for this. But if you prefer 16-bit emulation, I would strongly recommend to avoid DOSBOX and use a windows95/98/Me virtual machine instead, but make sure it has good serial/USB support.

Typical IDE-
  • Visual Studio 6.0 via makefile or any C/C++ IDE for Win95+.
  • The original tools, replicates the authentic experience.
  • Less complicated, following the original documentation.
  • All original (16-bit) tools work, as expected.
  • Strict ANSI C, (ie: All variables must be declared at the beginning of the code block).
  • Requires Windows 95, 98 or ME, or DOSBOX - and in my opinion both are hard to work with.
  • The toolchain is very old.
  • Newer PlayStation emulator harder or impossible to integrate and run.

It's hard to recommend this as a solution today, the con's far out weigh the pro's.

GCC 2.8.1 (win32).

Graeme Evans' 2nd build of GCC from March 1998, it must be installed in c:\psx3. To my knowledge, it doesn't support software floating points (floats and doubles). It will compile with no errors, but it will most likely not run if fractions are used that don't result in whole numbers. Compiling with "-msoft-float" will force any usage of floating point numbers as errors in the linking stage.

But this isn't an issue worth worrying about too much, the PlayStation hardware doesn't have floating point hardware, instead relying on software emulation of floating point math. This is really slow because calculations are not optimized by any hardware. So, in fact it's good practice not to use floats.

To my knowledge, the libraries don't use floating point calculations in any meaningful way, the maths library use them, but are typically not used, replaced instead with faster lookup tables (ie sin, cos, tan, etc) and fixed point maths.

But, using "real" floating point maths is more common and portable now, and in that case, this compiler isn't for you.

Saying that, PSX3 in windows XP as a guest in a virtual machine, is fine for most projects. The VM environment makes backing up, transfer and organizing (self contained), very easy and convenient, maybe be even better then a native solution.

Typical IDE-
  • Any editor that can execute a command line (batch file or makefile).
  • Runs on modern platforms without emulation.
  • Windows XP in VirtualBox or VMWare is a great development environment.
  • Very fast compile time.
  • Easy to integrate with newer PlayStation emulator.
  • Runs fine in win32 platforms (and possibly win64?).
  • Provides ISO/ANSI C with some C++ functionality.
  • Not having float support means, it's not a complete replacement.
  • Still an older toolchain.
  • Some original (16-bit) tools will not fully work or only partially.

Native GCC v2.95.3.

Unfortunately the MIPS ECOFF format was removed from GCC many years ago, so the only way to get a working GCC Net Yaroze compiler is to build an older compiler, capable of building the last supported compiler, which is v2.95.3 (March 2001).

So, your modern GCC compiler, builds the older GCC v3.3.4 compiler as normal, which then is used to build GCC v2.95.3 as a native binary with the output targeting the Net Yaroze.

Thankfully, Chris Marshall made an easy to use script (there is also a docker version) which does it all in Linux and possibly Mac's. Windows could also be possible via Windows Subsystem for Linux (WSL), MSYS or Cygwin.

Typical IDE-
  • Any editor that can execute a command line (batch file or makefile).
  • Runs on modern platforms without emulation.
  • A bit better C/C++ support then GCC 2.8.1.
  • Very fast compile time.
  • Includes floating point support.
  • Capable of compiling and linking large projects.
  • The original (16-bit) tools not supported, but most likely not be needed.

Metrowerks CodeWarrior.

Made by Metrowerks, CodeWarrior is an all inclusive C/C++ compiler and IDE built for Net Yaroze development. CodeWarrior already had a Psy-Q (Pro Dev Kit) PlayStation product, and some parts are based on that (file streaming via serial).

They also made compilers for other systems including Windows, PowerPC Mac's and embedded devices, and were seen as high quality compilers at the time.

CodeWarrior, was available for Windows 95 and it was also the only official (and unofficial) Net Yaroze development environment for Apple Macintosh users (OS 7 to 9), here the installation can be seen for CodeWarrior for PowerPC-based Macintoshes.

From a CodeWarrior's v2 readme, the C++ subset includes:

  • Creating C++ classes with or without virtual functions
  • Allocating objects on the heap with new (and destroying them with delete), statically, or on the stack.
  • throwing C++ exceptions.

C++ features that are NOT provided (but is not limited to):

  • namespaces
  • iostreams libraries
  • C++ Standard Template Library

I'm not sure if or how well CodWarrior emulates, ie in wine.

Delta Island has images of R2 (win) and R5(mac) CodeWarrior for Net Yaroze.

  • PC file streaming, using special codewarrior functions.
  • Visual step debugger.
  • The IDE, build tools and debugger all works well (and not slow and buggy) in win32 Operating Systems.
  • Possibly generates better PlayStation binaries then GCC.
  • Also an original tool, replicate the authentic experience.
  • The interface is non standard and early versions have no scroll mouse support.
  • Missing modern IDE features like intellisence (auto complete) and refactoring.
  • To my knowledge there are no command line options.
  • Binaries are not compatible with GCC and visa versa.
  • Executables built with CodeWarrior can not be converted via YarExe, making emulation impossible.

Metrowerks CodeWarrior for Net Yaroze (no audio)

In the video above, I show CodeWarrior V2 installed with V3 patch applied, configured to run at 115.2 Kbps com speed. It is running in winXP VM using my homemade USB (FTDI) to serial cable, I am showing the step debugger in operation. The demo and code is from the included Check program. Thanks to the V3 patch, the scroll mouse works in the IDE, but not in the debugger, maybe better mouse drivers could fix this though. This is my first time using it, it looks slow but stable, has nice visual features, but I think I still prefer GDB, when it actually works.

Siocons alternatives.

TODO make into new page

The next important tool after the toolchain is Siocons, which was the application which sent data to the PlayStation.

Siocons almost works in windows' 16-bit support framework called ntvdm, I think the issue is related to how the legacy software accessed the com ports. This means that while it will run, it will not run well and cause a lot of problems.

Also, running Siocons in DOSBOX will have a more or less the same problem, it will run but have issues while communicating over the com port.

Delta Island have a compiled version of DOSBOX called DosBox patch 5n1 but in my testings, I wasn't able to see a difference and can not recommend using Siocons in DOSBOX.


Minicons from September 2001, is a win32 Siocons replacement by Graeme Evans. It uses the win32 serial calls which means it works just as fast as the original Siocons on 16bit software. It also functions very close to the original with minor differences, ctrl-C to exit instead of Esc key.



Comments are open.

Your name or alias (required):

Your plain text comment (required):

Your entered name and comment will be displayed above this form.
There is no reply notifications or editing of comments.
Spam, swearing or off topic comments will be removed.

 Enter value: 9622  

Page last modified on June 12, 2021, at 04:15 PM and visited 1366 times.

Powered by PmWiki. No cookies used.