VM Labs SDK Sample Code

\vmlabs\sample\Miscellaneous\VMBalls3

Copyright © 2000-2001 VM Labs, Inc.  All Rights Reserved

March 2, 2001


This is the 3rd major revision example of ball sprites flying around the TV screen.

The main purpose of this program is to demonstrate how to do DMA to the screen.  The program throws up a background image that contains a stylized version of the VM Labs logo, and then plots a number of simple sprites textured with a "V" logo, which move around the screen and bounce off the edges.

The ball sprite data is 32 bits, and the alpha channel is used to determine which portions of the sprite are transparent.  This is a simple Yes/No test only.  No blending is performed.  The sprite draw routine only writes those pixels which are non-transparent.

Please note that this sample is only intended to demonstrate the basic concepts behind doing DMA.  The methods it uses for drawing the ball sprites are far from being the most efficient.  For one thing, the program runs entirely on MPE 3.  No other processors are used.  Also, even the inner loop of the sprite drawing routine is written in C.  A more serious attempt at drawing sprites would use assembly language, at least for the inner loops, and would also probably try to implement more sophisticated alpha channel handling.  It would also probably run mainly on another processor, leaving MPE 3 available for running the main thread of your program

This also shows off a simple technique of using fixed point values to store the values used for the position, speed, and movement vector for each ball.

Filename Description
graphics.c A variety of graphics routines used to display the JPEG images after they are decoded.
makefile MAKEFILE for building and running sample program.
proto.h Function prototypes used by program.
screenbuffers.c Functions for initializing and managing screen buffers.
sprite.s Assembly language module that does binary include of image data.
vball.raw Raw RGB image file (32*32) for ball sprite.  Converted into YCRCB format when program build is done.
vmballs.c Main program code for sample.
vmballs.h Contains a variety of definitions used throughout the program
vmlogo.raw Raw RGB image file (360*240) for background image.  Converted into YCRCB format when program build is done.

 


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.

Click here for other online SDK documentation.