iQue Player Software Development Kit

Edit on Github | Updated: 11th May 2020

The iQue Player was a sort of plug and play version of the Nintendo 64 system sold in China with its main aim to stop the rampant piracy in the market.

It is a mystery how someone managed to leak the iQue SDK as no 3rd party software was ever released for the platform, so it is quite impressive that someone managed to obtain and leak this Software Development Kit.

This post covers the contents from version 1.5 SDK which is available from ultra64.ca thanks to someone who managed to obtain and backup the CD. The SDK was built on top of the N64 SDK but ported to build for version 8/9 of Red Hat Linux instead of SGI workstations.


Bundled software (RPM installers)

The target development environment for the iQue SDK was a Red Hat Linux machine so the official SDk comes bundled with the following installers:

  • binutils-mips-linux-2.9.5-3.i386.rpm
  • egcs-mips-linux-1.1.2-4.i386.rpm
  • libelf-0.8.2-2.i386.rpm
  • libelf-devel-0.8.2-2.i386.rpm

These are all standard dependencies for cross-compiling to the MIPS architecture which was used for both the N64 and iQue player.

These is also an install.sh bash script which can be run to install the dependencioes along with running make in the models directory and setting up per_user folder.


Doc folder - Documentation

This folder only contains a few new documents that are exclusive to the iQue player, the rest are just copied directly from the Nintendo 64 Official SDK.

AuxData

When Animal Forest (Animal Crossing) was to be ported to the platform the development team had a problem. One of the cool features of Animal Forest was that if you had a friend that also played the game you could visit their town if you had their save data on a Controller Pak (Memory Card).

The problem with porting this to the iQue is that Controller Pak’s didn’t exist on the system, so how would this feature be implemented for the iQue? The answer to this problem was added to the API in version 1.3 of the SDK, Auxiliary data or AuxData for short was an API that allowed storing this Controller Pak data on the iQue cartridge.

GDB - iQue Player Debugger

First added in version 1.2 of the iQue SDK, the iQue Player Debugger allows proper source level debugging to be performed through the USB interface.

It is a fork of the very well known GNU Debugger (GDB) and consists of 3 main parts:

  • ique_gdb - command line tool that the developer uses to set breakpoints etc
  • GDB Stub - Runs on the iQue Player itself as is located in the debug version of libUltra called libultra_d
  • mux - takes commands from ique_gdb via TCP and forwards it to the GDB Stub on the iQue via USB

Note that the debugger only supports code compiled for the R4300 CPU and so does not help debug issues with the Reality Co-Processor code such as RSP microcode.

Also note that in order to debug a game, not only does it have to be compiled with the debug version of libultra but also needs to call the function gdbInit to initialise the GDB stub on the iQue.

N64OnlineManuals52

This is the same documentation as could be found in version 5.2 of the Nintendo 64 SDK, as far as we know there has been no changes to it for iQue but someone should do a Folder Diff on this to make sure.

Official Nintendo 64 SDK

For the contents of the 5.2 Nintendo 64 SDK Documentation check out this post.


Modules folder - Reality Debug Bridge Driver Module

The modules folder contains source code for the Reality Debug Bridge (RDB) which is a Linux driver used to communicate with the iQue Player, mainly for debugging.

A humorous reference to the 1933 movie Duck soup appears in the source code in the following line:

#define DRIVER_AUTHOR "Rufus T. Firefly, rtf@freedonia.gov"

per_user folder - Main SDK files

The per_user folder is exactly what it sounds like, these are installed on a user basis instead of globally on the system, so each user on the system can modify their installation to suit their own needs.

include - C Header files for iQue SDK

Like pretty much all C/C++ Software development kits, the interface to the SDKs functions and structures are located in the Header files. The includes for the iQue SDK includes all the previous header files from the N64 SDK plus some added extras.

ide - Interactive Diagnostic Environment headers

Initially we thought this would be related to an Integrated development environment, but alas its an acronym for what they called the Interactive Diagnostic Environment.

Header File Name Description
ide/dbg_comm.h Common debug functions such as dgDmaReadMem (SGI)
ide/diag.h Common structure definitions and global variables for BOSTON diags
ide/ide.h Data structures used by the Interactive Diagnostic Environment interpreter.

sys - System headers

Header File Name Description
sys/asm.h MIPS Assembly preprocessor macros (GNU C Library)
sys/fpregdef.h MIPS Register preprocessor defines (GNU C Library)
sys/fpu.h Floating Point control functions (SGI)
sys/inst.h MIPS Instruction Format defines (MIPS)
sys/regdef.h Symbolic register names for 32 bit ABI (GNU C Library)
sys/u64driver.h N64 development kit driver for SGI Indy
sys/u64gio.h N64 development kit Global IO defines (SGI)
sys/ucontext.h System V/mips ABI compliant context switching support (GNU C Library)

Make - Common include for Makefiles

Makefiles are used to build all the source code in the SDK and so instead of duplicating the same logic in many Makefiles, common logic is placed into a file in this directory.

Header File Name Description
make/commondefs Common definition such as where to find the compilers (SGI)
make/commonrules Common Makefile Rules (SGI)
make/ismcommondefs Common definitions for building ism idb’s and images
make/ismcommonrules Commonrules to build idb’s and images for an ism
make/kcommondefs contains basic common flags/locations for kernel builds (SGI)
make/kcommonrules common rules for kernel makefiles (SGI)
make/PRdefs Just links to PRdefs in the PR directory (SGI)
make/releasedefs Version information for the current release
make/startversion generate version number (and alpha number) in a standard fashion

Currently unsure what an ISM IDB is or what gendist does (Generated Probability Distribution Models?).

nustd - Nintendo Ultra Standard Library includes

Unlike previous header files, this library is written by Nintendo themselves and thus has comments in Japanese.

Header File Name Description
nustd/ctype.h Common type functions such as isdigit
nustd/malloc.h Standard Memory Allocation
nustd/math.h Maths functions such as floor
nustd/mathdef.h Maths definitions such as PI: DVAL_PI
nustd/setjmp.h Defined two jump functions setjmp and longjmp

PR - Project Reality (N64) Includes

This folder is part of the Official Nintendo 64 SDK and seems to be a fairly unmodified version of it. The main difference is the addition of files that start with the prefix bb.

Note that files with the prefix Leo refer to the Nintendo 64 Disk Drive (64DD) as Leo was its codename while in development.

The SK API for iQue was used to allow games and software to interact with the Secure Kernel of the iQue, the website iQueBrew has an excellent page with all the known Secure Kernel calls SKC - iQueBrew.


lib folder - Compiled Library files for iQue

The lib folder unsurprisingly contains static libraries that can be linked with iQue applications.

Not sure why there is 2 versions of the Music libraries, some have the prefix libn_ and the others are just lib.

PR - Project reality (N64) Libraries

This folder contains the standard pre-compiled libraries that were distributed as part of the official Nintendo 64 SDK.


sbin - Command line tools

The sbin directory contains pre-build command line tools that are useful for developers when writing iQue applications. Many of these are based on the N64 version of the same name.

Note that if you are interest in the source code for any of these tools then you can find it in “BroadOn Leak”.

BroadOn Archive - Nintendo May 2020 Leak (4Chan)

For more information about the BroadOn N64 Leak.