Chapter 12 Programming Cautions


This chapter is a compilation of the tasks that must be performed and areas requiring particular care, including some of the points already mentioned. A list of these items is presented first. Descriptions of each item, including detailed reasons for each, are subsequently presented. Please read and take note of these items.

Items requiring close attention

  1. During disk access, do not access the Game Pak ROM or other AD16 device. (12.1)

  2. After the IPL starts the game, disk access is prohibited until the first screen appears. (12.2)

  3. After a disk exchange is detected, be sure to call LeoReadDiskID(). Subsequently, be sure to compare the disk ID read by this function with the original ID. (12.3)

  4. If a write to save data is interrupted by the user, the contents of the block being written to at that time may be destroyed. (12.12)
    5. In the master, place an initial value in blocks that are used or may be used by the game. (12.4)

  5. When the RTC is used during a Game Pak-startup game, please ensure that the time can be set during the game. (It is not necessary to enable the time to be set at any point during a game. It would be sufficient, for example, for a menu for setting the time to appear immediately after the game starts.) In addition, please be careful to ensure that problems such as game hang-ups do not occur if the user enters an odd time. (12.5)

  6. Please set the times for the standby and sleep modes to the default settings or to the shortest possible times below these settings. (12.6)

  7. If a preNMI state occurs, be sure to call LeoReset( ). (12.7)

  8. Ensure that screen display is possible even if startup is performed using a disk other than the startup disk. (12.8)

  9. Ensure that changes in processing time resulting from retries or errors are adequately handled. (12.9)

Other points of caution

  1. Use the EPI functions to access the PI bus. Do not use the Pi functions. (12.10)

  2. When very important data are written, it is recommended that the data be read and checked immediately after they are written to confirm that they were written properly (verification). (12.11)

  3. If a disk exchange is detected at a point where a calculation using LeoLBAToByte(), LeoByteToLBA(), or LeoReadCapacity() is required, be sure to execute the function again. (12.13)

  4. Please consider that a disk may be removed part way through a game. Also consider the time required for error handling when a disk is reinserted after being removed. (12.14)

  5. Calling disk-related functions from multiple threads is problematic. (12.15)

  6. Consider the possibility of battery failure when using the RTC. (12.16)

  7. Consider the accuracy of the RTC when using it. (12.17)

  8. The IPL is installed in /usr/lib/PR/ in the NW version, in same directory as Partner in PC versions 1.06 or earlier, and in ultra\usr\lib\PR in PC versions 1.07 or later. (12.18)

  9. Be careful when using a shared command block. The next function executed will overwrite the previous results. (12.19)

  10. LeoBootID is not saved with a Game Pak startup.(12.20)

The following section elaborates on each of the above points in order.


12.1 Mixing of 64DD instructions and PI bus access is prohibited.

12.2 After the IPL starts the game, disk access is prohibited until the first screen.

12.3 After a disk exchange is detected, be sure to call LeoReadDiskID(). Then check the disk ID read by this function.

12.4 In the master, place an initial value in blocks that are used or may be used by the game.

12.5 Setting the RTC at the time of a Game Pak startup.

12.6 Set the times for switching to standby and sleep modes to the shortest times possible.

12.7 Call LeoReset() if a preNMI state occurs.(

12.8 Ensure that screen display is possible even when startup is performed using a non-startup disk.

12.9 Ensure that changes in processing time resulting from retries or errors are adequately handled.

12.10 Use the EPI functions to access the PI bus. Do not use the Pi functions.

12.11 Verification is recommended when writing critical data.

12.12 Pay careful attention to write interrupts.

12.13 If a disk exchange is detected at a point in the program that uses results from LeoLBAToByte(), LeoByteToLBA(), or LeoReadCapacity( ), execute the function again.

12.14 Consider that a disk may be removed part way through a game. Also consider the time required for error handling when a disk is reinserted after being removed.

12.15 Calling to disk-related functions from multiple threads is problematic.

12.16 Consider the possibility of battery failure when using the RTC.

12.17 Give adequate consideration to the accuracy of the RTC when using it.

12.18 The IPL is installed in /usr/lib/PR/ in the NW version, in same directory as Partner in PC versions 1.06 or earlier, and in ultra\usr\lib\PR in PC versions 1.07 or later.

12.19 Be careful when using a shared command block. The next function executed will overwrite the previous results.

12.20 LeoBootID is not saved with a Game Pak startup.