Program Development

Question: The assembler is generating code to trap division by zero.

Answer: Add the option ĖWa,0 to the CCN64 command line. This disables the trapping code

Question: Iím having to hardcode my library paths in my linker script.

Answer: Use the library_path entry in SN.INI or the /l command-line option to specify directories which PSYLINK will search for any library you include with INCLIB.


Question: That doesnít help for object files, particularly the Nintendo microcode objects such as RSPBOOT.OBJ.

Answer: Make a library using PSYLIB2 containing all the microcode objects, and INCLIB that. PSYLINK will only include the modules it needs.


Question: My test program builds correctly but wonít work. Help!

Answer: Make sure you have /p on the PSYLINK command line to build a binary image.


Answer: Make sure youíve run SETCSUM on your binary image. (Any image smaller than 1028K is guaranteed not to work!)


Question: The Nintendo tools make these massive .c files containing my graphics. My program takes ages to link now I have lots of these files in there

Answer: Write a mini linker script for each graphics file to make a binary file from it. Then use INCBIN to include it in your main link script. Using INCBIN rather than INCLUDE saves considerable time


Question: What are these symbols __udivdi3 and suchlike which are left unresolved? They arenít in my program!

Answer: These are compiler-generated calls for math functions. You need to include our support library LIBSN.LIB in your linker script.


Question: I need to know how big my sections and groups are. The Nintendo devkit generated symbols with this information, and some of the demos refer to them.

Answer: PSYLINK generates symbols of the format _group_obj, _group_objend, _group_org, _group_orgend, and _group_size for each group, and similar symbols for each section. (Periods in group and section names are converted to underscores.) You can use the ALIAS directive in your linker script to give new names to these variables to match the names used in the Nintendo demos


Question: Your PSYMAKE build tool doesnít support long filenames.

Answer: Use our 32-bit build of GNUMAKE instead


Question: Our development was going pretty well, until the code grew just a little bit, and suddenly it crashes. Whatís going on?

Answer: The N64 boot process involves:

- checking a 4K security header at the start of your image - downloading the next 1M of your image to the specified load/run address - running our startup code which clears your bss section and jumps to the Ďbootí routine

This means that if your game image is larger than 1Mb then you need to DMA the excess into memory yourself.


Question: I want to use GP optimisation. Why isnít it supported?

Answer: The Nintendo libraries were built without GP optimisation. There is a risk that they might use the GP register as an ordinary register, corrupting its value. For safety we have disabled this feature in CCN64 at the moment.


Question: Why does elfconv corrupt object file names?

Answer: There was a bug in v0.28 of elfconv which made it incorrectly allocate space for converted filenames. Upgrade to latest version of elfconv.


Question: Why do I get garbled output when I use the -MMD option with ccn64?

Answer: This was a bug in CCN64 pre-v3.04. Get the latest version of CCN64.


Question: When I run elfconv I get "Error : Reference to undefined symbol #FEF2" - what does this mean?

Answer: This is due to a bug in elfconv which has been fixed in versions > 0.34. Upgrade to the latest version.