title: "vbmDrawBCD" description: TRSE built-in method (from IDE help)
vbmDrawBCD
Systems: VIC20
Parameters: a, a, b, b, b
vbmDrawBCD( [address-bcd], [address-chars], [byte-x], [byte-y], [byte-lineheight]);
- [address-bcd] - address of a BCD array (number)
- [address-chars] - address of the characterset to use for the font
- [byte-x] - X column (0-19) to display the message
- [byte-y] - Y line (0-183) to display the message
- [byte-bcdlength] - length of the BCD number in bytes
Description
Writes a Binary Coded Decimal (BCD) number to the bitmap.
To be used with the BCD commands to set, add, subtract and compare BCD numbers. Useful for scores and allows numbers of any size, much larger than integer numbers!
Example
font: incbin("font8x8.bin", $4000); // first 64 PETSCII Screen Codes
@define nums $4180 // this is the address where the 0 character data starts in the above font
...
// create a BCD number
score : array[] of byte = ($56, $34, $12); // low bytes first - number is 123456
...
// draws the number 123456 to the screen at column 2, row 10 (pixels)
// with a length of 3 bytes (size of BCD number in memory)
vbmDrawBCD( score, ^@nums, 2, 10, 3 );
See also
- bcdCompare
- bcdIsEqual
- bcdSub
- bcdAdd