Skip to content

mvac7/fR3eL_VDP_PRINT_Lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VDP PRINT MSX SDCC Library (fR3eL Project)

NameVDP_PRINT
ArchitectureMSX
EnvironmentROM, MSX BASIC or MSX-DOS
FormatC Object (SDCC .rel)
Programming languageC and Z80 assembler
CompilerSDCC v4.4 or newer

Description

C function library for displaying text strings in TMS9918A graphics modes (Graphic1 and Graphic2).

You can use this library to develop applications for ROM, MSXBASIC or MSX-DOS environments, using the Small Device C Compiler (SDCC) cross compiler.

Requires the VDP_TMS9918A Library to write to the VRAM and so that you can start the graphics modes.

  • for all environments VDP_TMS9918A Library. (Fast but takes up more space).
  • for only ROM and MSX BASIC (Use BIOS) VDP_TMS9918A_MSXBIOS Library. (Small but slow).

You can access the documentation here with How to use the library.

These libraries are part of the MSX fR3eL Project.

This project is open source under the MIT license. You can add part or all of this code in your application development or include it in other libraries/engines.

Enjoy it!


Note:
The function to convert a 16-bit value to ASCII (num2Dec16) is an adaptation of a routine included in Baze's Z80 routine collection.


History of versions

(dd/mm/yyyy)

  • v1.4 (20/06/2025) update to SDCC (4.1.12) Z80 calling conventions; Remove GetStringLength
  • v1.3 (27/09/2021) Add VLOCATE; Remove VPrintString and VPrintNum
  • v1.2 (16/04/2021) VPRINTN string size control
  • v1.1 (09/09/2020)
  • v1.0 (04/02/2016) First version


Requirements for compile



Functions

Name Declaration Description
VLOCATE VLOCATE(column, line) Moves the cursor to the specified location
VPRINT VPRINT(text) Prints a string of characters on the screen
VPRINTN VPRINTN(text, length) Prints a character string with a limited length on the screen
VPrintNumber VPrintNumber(value) Prints a number (char or unsigned int)
VPrintFNumber VPrintFNumber(value, emptyChar, length) Prints a number on the screen with formatting parameters
num2Dec16 num2Dec16(value, textParameters) Converts a number to a String


Code Examples

The project includes several examples that I have used to test the library and that can help you learn how to use this library.

You can find them in the examples/ folder.


Example 1 (ROM)

Example included in the HOWTO document.

examples/Example01

Example screenshot


Example 2 (ROM)

Example where all the functions of the VDP_PRINT library are tested in the ROM environment.

examples/Example02

Example screenshot


Example 3 (MSX-DOS)

Example where all the functions of the VDP_PRINT library are tested in the MSX-DOS environment.

examples/Example03

Example screenshot

About

C function library for displaying text strings in TMS9918A graphics modes (Graphic1 and Graphic2)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors