Chapter 7 Library Functions


This chapter describes the library functions used in actual programming. All of the functions are included in libleo_d.a (for debugging use) and libleo.a (for use in the final master). When using 64DD-related functions, always specify the following at compile time.

[NW]

-lleo_d -lultra_d (in debugging stage)

OR

-lleo -lultra_rom (in final stage)

[PC]

-lleo_d -lgultra_d (in debugging stage)

OR

-lleo -lgultra_rom (in final stage)

Furthermore, include the header file PR/leo.h in addition to ultra64.h. (Please be careful to use the proper order. In particular, be sure to link libleo*.a before linking libultra*.a.)

Note: Because libleo_d.a includes debugging information, it is larger and inferior in performance to libleo.a,which contains no debugging information. When submitting a master, please be sure to use libleo.a (For information on master submission, please see "Chapter 5, The Development Process.")

64DD-related functions are grouped into the following 4 classifications.


7.1 Initialization Functions

7.2 Asynchronous functions
7.2.1 Forced Mode Changes
7.2.2 Reading and Writing
7.2.3 Seek
7.2.4 Reading the Disk ID
7.2.5 Reading and Setting the RTC
7.3 Synchronous functions
7.3.1 Converting between Byte Number and LBA Number
7.3.2 Checking the Writable and Readable Area
7.3.3 Checking the Hardware and Software Versions

7.4 Font functions

7.5 Other important functions
7.5.1 Issued when a preNMI Occurs
7.5.2 Clearing a Reset
7.5.3 Clearing the Command Queue
7.5.4 Re-start up
7.5.5 Check if a drive is connected.
7.6 Special Functions
7.6.1 Setting the Mode Switch Time
7.6.2 Rezeroing
7.6.3 Checking the Current Drive Status

7.7 Disk Startup and Game Pak ROM Startup

7.8 Retry and Error Correction

7.9 Write Interrupts