VM Labs SDK Sample Code |
\vmlabs\sample\Video\Screensaver |
Copyright © 2000 VM Labs, Inc. All Rights Reserved |
December 5, 2000 |
This program demonstrates how to implement a simple screen saver. The program displays a small graphic of the VM Labs logo. If 5 seconds go by without any input from the game controller buttons, then the screen saver mode is enabled.
The screensaver() function is called once for every pass of your main program loop. You pass it parameters that define the current display, such as the DMA flags, frame buffer pointer, and size in pixels. It checks to see how many ticks have gone by without input. If there has been recent input, then it returns with a value that indicates that the screen saver is not active. If enough time has gone by without any input, then the screen saver mode is enabled, and the function returns a value to indicate that the rest of the program should not do anything to the display.
Once in screen saver mode, the screensaver() function will animate the display in various ways. In this sample, the color and brightness of the display is altered, and the screen is also scrolled vertically.
Once some input has been detected from the game controller, then the screen saver mode will clear the screen and return a value that indicates that it is giving up control and that the rest of the program should restore the previous display.
Filename | Description |
data.s | Assembly file that includes sample image as binary data. |
graphics.c | Contains the graphics routines used for clearing the frame buffer and for drawing the background image. |
main.c | Main program code for sample. |
makefile | MAKEFILE for building and running sample program. |
progdefs.h | Contains a variety of definitions used throughout the program. |
proto.h | Function prototypes used by program. |
screensaver.c | Functions for implementing screen saver. Contains routines for both 16-bit and 32-bit display modes, but has only been tested with 32-bit pixel displays. |
screensaver.h | Definitions and prototypes for screen saver functions. |
vmlogo.raw | A color graphic of the VM Labs logo in raw RGB format. Used for background. |
Before attempting to load or run any of the SDK samples, make sure you have first read the Hitchhiker's Guide To NUON document.
After that, if you're still having trouble getting this sample program to work, click here to request assistance from developer support.