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: 2.05 MB[Player volume: MAX]

Toolchain

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 DJGPP 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 C language and compiler features missing or unsupported.

I previously suggested avoiding DOSBOX and to use a native or virtual machine with a 16bit OS, but after further testing, the Net Yaroze DJGPP toolchain does work in DOSBOX in both a native environment or in a virtual one. However, very large projects might have issues with DOSBOX settings and/or the compiler itself (apart from being old, it's a proprietary port of a free compiler).

The above methods make the original toolchain binary harder to use, but thanks to brill2k, who informed me that the original Net Yaroze toolchain can run well in modern Windows 64bit operating systems using NTVDMx64 by Leecher1337. Simply download the compressed file linked "downloaded here", and follow the install instructions. Basically extract it and go to the folder with your preferred language and run the install.bat, after installation a reboot is required, lastly remove the extracted folders.

In the video below brill show's how to install and configure the Net Yaroze binaries and setup the environment variables which is useful if you use an IDE which requires these variables, but they are optional if you choose to run them from a batch file and use make or launch the IDE via the command line etc.

  https://www.youtube.com/watch?v=HaiPIw0cpyA  

Set Up Net Yaroze On Modern OS (Rus + Eng sub), video by brill2k

Typical IDE-
  • Any editor that can execute a command line.
Pro's-
  • Modern OS and IDE.
  • Original toolchain, providing all the features of Net Yaroze.
  • All GCC code examples, demo's and tutorials just works.
  • Simpler toolchain and less complicated, which the original documentation and help was written for.
Con's-
  • A bit very slower then a pure native binary but still very usable.
  • Strict ANSI C, (ie: All variables must be declared at the beginning of the code block).
  • The toolchain is very old (and probably buggy).
  • To my knowledge, only works in Windows 7 or newer, 64bit operating system.

GCC 2.8.1 (win32).

Graeme Evans' 2nd build of GCC from March 1998, it's configured to 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 have to be converted in software at runtime, instead of any hardware acceleration. So, in fact it's good practice not to use floats. However this also means that the math library needs to be replaced with a fixed point one, which are typically faster lookup tables (ie sin, cos, tan, etc) the trade off being a lack in precision.

To my knowledge, apart from the included math library which does use floats, the rest of the Net Yaroze libraries does not use floating point calculations.

But, using "real" floating point math 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.

https://archive.org/details/NetYaroze-GCC281

Typical IDE-
  • Any editor that can execute a command line (batch file or makefile).
Pro's-
  • 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.
Con's-
  • 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. Windows could also be possible via Windows Subsystem for Linux (WSL), MSYS or Cygwin.

https://github.com/ChrisRx/mipsel-ecoff-toolchain

Typical IDE-
  • Any editor that can execute a command line (batch file or makefile).
Pro's-
  • 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.
Con's-
  • The original (16-bit) tools not supported, but most likely not 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 CodeWarrior emulates, ie in wine.

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

Pro's-
  • 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.
  • YarExe support for CodeWarrior is Work In Progress.
Con's-
  • The interface is non standard and early versions have limited 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.
   

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.

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.

Linux/Unix.

TODO


Emulation

(TODO - Move to it's own page - TODO)

Emulation is very important in the retro development community, and Net Yaroze does benefit from PlayStation emulators. Obviously testing and debugging on original hardware is better, but it's also slower, compared to using emulation. The catch to using emulators is that they're not really built for development, so some emulators are better for developing retro console software then others.

Because Net Yaroze requires a connection to the serial port to connect to the remote debugger, it makes it very difficult (or impossible) to recreate. So I have yet to see any C/C++ step debugging using emulation, the next best thing is output text from printf's statements via the serial port as TTY (Teletypes).

The trick to developing using emulation, is to use and test on as many as possible, here are a few that I use.
The list below is based on my personal experience and ordered in how often I use them.

NO$PSX

NO$PSX

Pro's-
  • Good emulation, with development tools like VRAM viewer and assembly debugger.
  • Doesn't require an ISO - runs self contained executables.
  • Very light on resources, fast and simple emulator.
  • Works on windows XP and newer.

PCSXR

Net Yaroze custom PCSXR build

Pro's-
  • Supports Net Yaroze CDROM access without creating an ISO.
  • Converts CodeWarrior executables (not the debugging format) into standard PSX executables and runs them.
  • Loads from siocons script or self contained executable.
  • Very light on resources, fast and simple emulator.
  • Works on windows XP and newer.
Con's-
  • Very old and not so great emulation.
  • No TTY output - no printf support.

PCSX-REDUX

Based on the old code but rewritten from scratch.

PCSX-REDUX

Pro's-
  • In active development.
  • Focused on retro game development.
  • Extensive hacking tools, Assembly step debugger, memory viewers, etc.
  • TTY output, GCC Mips-ELF step debugger integration WIP.
  • Doesn't require an ISO - runs self contained executables.
Con's-
  • Requires modern OS.
  • Can be very resource hungry.

Mednafen

Mednafen

Pro's-
  • Aims to be accurate emulation.
  • Works on windows XP and newer.
  • Requires 100% correct CUE/BIN files.
Con's-
  • No self contained executable support.
  • No TTY output - no printf support.
  • Can be very resource hungry.

XEBRA

Has a debug menu option but I couldn't get any TTY out.

XEBRA

Pro's-
  • Aims to be accurate emulation.
  • Requires CUE/BIN files.
  • Very light on resources, fast and simple emulator.
  • Works on windows XP and newer.
Con's-
  • No self contained executable support
  • No TTY output - no printf support



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: 5599  

Page last modified on February 14, 2022, at 01:27 PM and visited 2094 times.

Powered by PmWiki. No cookies used.