Skip to content

Sprite display functions with simplified editing of Color/Early Clock parameters in G3 screen mode (V9938)

Notifications You must be signed in to change notification settings

mvac7/SDCC_VDP_SPRITES_12_MSXROM_Lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VDP SPRITES 1/2 MSX ROM SDCC Library (fR3eL Project)

Author: mvac7 [[email protected]]
Architecture: MSX
Format: C Object (SDCC .rel)
Programming language: C and Z80 assembler

Description

Open Source library with functions to directly access to sprites of the TMS9918A.

Provides a set of functions for displaying Sprites, both fully (PUTSPRITE) and specific (positioning, color, pattern, visibility and EarlyClock).

Contains the PUTSPRITE function similar to that of MSX BASIC.

The SPRITES 1/2 version is the same as the SPRITES Library except that it edits the Color/Early Clock parameters in the G3 screen mode (V9938), in a simplified way, as the MSX-BASIC does with the PUTSPRITE instruction.

The functions that assign a color, such as PUTSPRITE or SetSpriteColor, will do it in all the lines of the sprite, so it will NOT be useful to take advantage of the multicolored improvement of the sprites of the V9938.

The Early Clock functions have also been adapted for the G3 mode, since they access the color table of the sprite planes and write in all the lines.

It is complemented with the VDP TMS9918A MSX ROM Library, necessary for the initialization of the screen (screen and sprites mode).

It uses the functions from the MSX BIOS, so it is designed to create applications in ROM format.

Use them for developing MSX applications using Small Device C Compiler (SDCC) cross compiler.

In the source code (\examples), you can find applications for testing and learning purposes.

This library is part of the MSX fR3eL Project.

Enjoy it!

About the Sprite libraries

I'm developing several libraries for the management of MSX Sprites, both for the creation of ROMs (using the BIOS), and MSX-DOS executables.

They are designed for the development of applications for the first generation of MSX but some of the variations are directed in how certain functions behave when using the G3 mode of the video processor V9938 and thus be able to take advantage of it, when it is executed in a MSX2 or higher.

The projected libraries are the following:

  • SPRITES Small - Basic functions for managing Sprites. It is more compact so it takes up less space in our application.
  • SPRITES - It includes the same functions as the Small version and adds to access specific parameters (positioning, color, pattern, visibility and EarlyClock).
  • SPRITES 1/2 - Same as SPRITES but in the G3 screen mode (V9938), it treats the color parameters in a simplified way. Assign the color parameters and EarlyClock to all the lines of the Sprites.
  • SPRITES DUMP (In development) - Uses a buffer in RAM that has to be dumped in each interruption. Includes a Sprite Flicker, to allow viewing up to 8 sprites per line.

To optimize our development, I recommend building your library with only those functions you need.

I have yet to develop a library to work with the multi-colored Sprites of the V9938.

History of versions

  • v1.2 (22/12/2020) Removed sprite mode initialization functions.
  • v1.1 (2/02/2017)
  • v1.0 ?

Requirements

Acknowledgments

I want to give a special thanks to all those who freely share their knowledge with the MSX developer community.

Functions

  • void ClearSprites() - Initialises all sprite data.
  • void PUTSPRITE(char plane, char x, char y, char color, char pattern) - Displays the sprite pattern.
  • void SetSpritePattern(char plane, char pattern) - Assign a pattern to a sprite plane.
  • void SetSpriteColor(char plane, char color) - Assign a color to a sprite plane.
  • void SetSpritePosition(char plane, char x, char y) - Assigns the position coordinates of a sprite plane.
  • void SetSpriteVisible(char plane, boolean state) - Hides or shows a sprite plane.
  • void SetEarlyClock(char plane) - Apply the Early Clock of a sprite plane. Move 32 points to the left the X position of the sprite.
  • void UnsetEarlyClock(char plane) - Disables the Early Clock. Restore the position of a sprite plane.

About

Sprite display functions with simplified editing of Color/Early Clock parameters in G3 screen mode (V9938)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published