<h1 style="text-align: center;"><strong>Nintendo 64 Homebrew General Guide</strong></h1>
<p style="text-align: right;">(Rough Draft) - V0.0.4</p>


<hr />
<p style="text-align: center;">If you wish to contribute to the guide, PM Rocky on <a href="https://discordapp.com/invite/ADAUBKz">Discord</a></p>


<hr />

<h2>Chapter 1: Introduction</h2>
The following guide was created by Rocky, with the intent to provide users with a simple to follow quick start guide to help those find the resources, knowledge and information they would require to get started on the path to developing for the Nintendo 64. Below you will find many useful links and resources to help you get started. Should you not find what you are looking for here, please feel free to join the growing community of other Nintendo 64 enthusiasts over at the <strong>N64brew</strong> Channel on <a href="https://discordapp.com/invite/ADAUBKz">Discord</a>, or the <strong>N64Dev IRC</strong> Channel, located here: <a href="irc://irc.efnet.org/#n64dev">#n64dev</a>.

<h3>1.1 Table of Contents</h3>
<ul>
	<li>CHAPTER 1: INTRODUCTION 2</li>
		<ul>
			<li>1.1 Table of Contents 2</li>
			<li>1.2 Using this Manual 2</li>
			<li>1.3 Useful links 2</li>
		</ul>
	<li>CHAPTER 2: SETTING UP YOUR FIRST N64 DEVELOPMENT ENVIRONMENT. 3</li>
		<ul>
			<li>2.1 Requirements 3</li>
			<li>2.2 Installation 3</li>
			<li>2.3 Setting up your Windows 98 VM 3</li>
			<li>2.4 Installing software (Inside VM) 4</li>
			<li>2.5 Testing your N64 development environment 4</li>
		</ul>
	<li>CHAPTER 3: GETTING STARTED 5</li>
		<ul>
			<li>3.1 Our intro to n64 programming 5</li>
			<li>3.2 Getting started with n64 development 5</li>
		</ul>
	<li>CHAPTER 4: FAQ 6</li>
</ul>
	
<h3>1.2 Using this Manual</h3>

<p>This manual covers a large selection of Nintendo 64 Development topics. You can use the table of contents in section 1.1 to help you navigate your way around. There are some important topics that can prove to be more valuable than others, we recommend users beginning with chapters 2 and 3.</p>

<h3>1.3 Useful links</h3>
<ul>
	<li>http://ultra64.ca
	- Official Nintendo 64 documentations and downloads.</li>
	<li>http://N64devkit.square7.ch
	- Official Nintendo documents about n64 programming.</li>
	<li>https://n64squid.com/homebrew/n64-sdk
	- Has lots of useful information about n64 programming in c with the official SDK.</li>
	<li>http://assemblergames.com/l/threads/n64-dd64-ultimate-resource-thread-tools-docs-source.16207
	- Lots of SDK downloads and docs (there are some dead links).</li>
</ul>
<h2>Chapter 2: Setting up your first N64 Development Environment.</h2>

<h3>2.1 Requirements</h3>
<ul>
	<li>• Win98 SE
	<li>• VMware player (VirtualBox doesn't fully support DOS based operating systems)
	<li>• Nintendo 64 SDK 5.0 installer
</ul>

<h3>2.2 Installation</h3>

<p>Install VMware player and install win98SE in an VM. After that you can install the VMware tools, for more interaction between the host OS and the guest OS. One of the functions this will add is the possibility to run win98 at native screen resolution. To do this, you have to change the graphics driver. This can be done by right clicking at the windows desktop and selecting "properties". In the top of the upcoming window, click at "settings" and then at "advanced". In the upcoming window, go to the "adapter" tab and click "change".</p>

<p>In the update device driver wizard, click "next" and then the second radio button. There should be shown up 1 compatible screen driver from VMware, select that one and click "next".</p>

<h3>2.3 Setting up your Windows 98 VM</h3>

<p>Download the following programs/files inside your VM</p>
<ul>
	<li>• Opera 9.64 or Firefox 2 (to download with Internet Explorer)</li>
	<li>• A program to unpack files (example WinRAR 3.xx)</li>
	<li>• N64sdk.7z</li>
	<li>• (optional) A text editor / IDEM</li>
</ul>

<p>I recommend to download some software from http://www.oldapps.com/index.php because you can filter on win98 by lots of downloads.</p>

<h3>2.4 Installing software (Inside VM)</h3>

<p>The first thing to download and install is a new browser, because Internet Explorer 5 is rather difficult to work with. After that install the unpack program and optionally a text editor or IDE.
To install the SDK, “insert” the Nintendo 64 SDK 5.0 installer and run it. This should install all tools, except for the sound tools and the allman50 manuals. Allman50 does include the samples that are referred to in the documentation.</p>

<p>You can install the n64 sound tools from:</p>
<div class="code-block">
	<p>&lt;drive&gt;:\pc\SnsTools\Setup.exe</p>
</div>

<p>To get the compiler working, you have to extract N64sdk.7z and copy the <u><strong>ultra</u></strong> folder to the root of your virtual hard drive. You only have to copy the missing files.</p>
<p>Optionally, you can copy and/or extract the manuals from: <span class="code">&lt;drive&gt;:\man\allman50.tgz</span> to a folder where you can find it fast and easy (on the Host or guest OS, depend on preference).</p>
<p>After this, you are ready to learn programming for the n64. The allman50 web documentation should help you to learn the ins and outs of the n64.</p>

<h3>2.5 Testing your N64 development environment</h3>

<p>There are lots of demo programs to learn from included with the installation. To get fast to your development environment after starting the dos command prompt, we are going to make a folder for that contains the source code and a bat file. In our example below, you have to replace <span class="code">&lt;..&gt;</span> with the source code dir and move save the file as <span class="code">c:\windows\setup.bat</span>
<div class="code-block">
<p>setup.bat</p>
<p>cd c:\ultra</p>
<p>call setup.bat</p>
<p>cd</p>
</div>
</p>So when you want to use the compiler tools, you only have to type "setup" (without quotes) to make the terminal ready for usage with the n64 compiler tools. You have to do this each time starting up the terminal</p>
<p>To really test your setup, move the source code of one of the example programs to your source code folder and run the setup file for setting up the compiler tools. This makes you able to use make (the compiler tools are an fork of the gnu c 3.xx modified to make n64 roms).</p>

<h2>Chapter 3: Getting started</h2>

<h3>3.1 Our intro to n64 programming</h3>

<p>Lots of people are saying that the n64 is (too) difficult to program. But it's just that the programmers have to learn some new aspect before he begins with coding for n64. Reading lots about the hardware details should be a required part of the road to an homebrew ROM. End even the way the system boots can be managed by the programmer. It's not really difficult, but it's a fun challenge.</p>

<h3>3.2 Getting started with n64 development</h3>

<p>The N64 isn’t an easy platform to program for, because of the usage of two processors, the CPU and the Reality CoProcessor (RCP). The RCP is a combination of the I/O + Reality Display Processor (RDP) + Reality Signal Processor (RSP). All these chips have to be initialized before the system can give video output. Because of the complexity of the system, and cut off c libraries you're required to learn the basics of n64 before programming anything. Unfortunately, there is no studio.h in the SDK.</p>
<p>To help you with learning the N64, here is the way I am learning it.</p>
<p>Open the n64 SDK docs (allman50 folder, or ultra64.ca) and go to the “intro to n64 &amp; tutorial” section and start with reading the intro to the n64 and then the n64 tutorial, all example code in the manual can be found in the allman50 folder.
The best solution to test your homebrew is buying real hardware, because existing emulators co only support official Roms and can crash by using other Roms, this is because the n64 is really hard to emulate perfect because of the two asynchronous operating processors. We recommend the 64drive because it's the only homebrew cartridge that is made for homebrew development.</p>
<h2>Chapter 4: FAQ</h2>