N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

## osViGetCurrentLine

Syntax

#include <ultra64.h> /* os.h */ u32 osViGetCurrentLine(void);

Argument
None

Return Value
Half-line number
Explanation
This function returns the half-line number currently being sampled. The least significant bit (LSB) of the line number is fixed at 0 during the non-interlace mode, but the field number (0 or 1) is inserted there in the interlace mode. Which of either the even number (0) or odd number (1) is being scanned can be determined from the field number that is returned (in interlace mode, one screen is displayed in two scans).

Comments
The VI is internally controlled in half-line (0.5 line) units by N64. Since there are 525 scan lines in the case of NTSC, the value of the 0.5 line units is used so that 262.5 lines are rendered in one frame. The current line number is obtained by dividing the half-line number obtained with this function by two.

Non-interlace | :0,2,4,6,...,524, 0,2,4,6,...,524
Interlace | :0,2,4,6,...,524, 1,3,5,7,...,523, 0,2,...

See Also
osViGetCurrentField
osViGetCurrentMode

Revision History
2/1/1999 Completely rewritten

Nintendo® Confidential Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.
Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated March 1998