![]() |
c128lib Base
Base macros for C128
|
Vic2 module. More...
Functions | |
macro | SetBorderAndBackgroundColor (borderColor, backgroundColor) |
Sets the border and background color. | |
macro | SetBorderColor (borderColor) |
Sets the border color. | |
macro | SetBackgroundColor (backgroundColor) |
Sets the background color. | |
function | getTextOffset (xPos, yPos) |
Calculates memory offset of text cell specified by given coordinates on 40 cols screen. | |
macro | SetScreenAndCharacterMemoryWithShadow (config) |
macro | SetScreenMemoryAndBitmapPointer (config) |
Set screen memory and bitmap memory pointer. | |
function | spriteXReg (spriteNo) |
Calculates sprite X position register address. | |
function | spriteShadowXReg (spriteNo) |
function | spriteYReg (spriteNo) |
function | spriteShadowYReg (spriteNo) |
function | spriteMask (spriteNo) |
function | spriteColorReg (spriteNo) |
macro | SetSpriteXPosition (spriteNo, x) |
macro | SetSpriteXPositionWithShadow (spriteNo, x) |
Sets X position of given sprite (uses sprite MSB register if necessary) using shadow registers. | |
macro | SetSpriteYPosition (spriteNo, y) |
Sets y position of given sprite. | |
macro | SetSpriteYPositionWithShadow (spriteNo, y) |
Sets y position of given sprite using shadow registers. | |
macro | SetSpritePosition (spriteNo, x, y) |
Sets x and y position of given sprite. | |
macro | SetSpritePositionWithShadow (spriteNo, x, y) |
Sets x and y position of given sprite using shadow registers. | |
function | getSpriteMovementStartingAddress (spriteNo) |
Get starting address for sprite movement to use with. | |
macro | SpriteMove (spriteNo, speed, quadrant, deltaX, deltaY) |
Define sprite movement. | |
macro | SpriteEnable (mask) |
Enable one or more sprite, preserving status of other sprites. | |
macro | SpriteDisable (mask) |
Disable one or more sprite, preserving status of other sprites. | |
macro | SpriteEnableMulticolor (mask) |
Enable multicolor setting for one or more sprite, preserving status of other sprites. | |
macro | SpriteDisableMulticolor (mask) |
Disable multicolor setting for one or more sprite, preserving status of other sprites. | |
macro | SpriteColor (spriteNo, color) |
Disable multicolor setting for one or more sprite. | |
macro | SpriteMultiColor0 (color) |
Set sprite multi color 0. | |
macro | SpriteMultiColor1 (color) |
Set sprite multi color 1. | |
Vic2 module.
Simple macros for Vic2.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
macro SetBorderAndBackgroundColor | ( | borderColor | , |
backgroundColor | ) |
Sets the border and background color.
This macro sets the border and background color of the Vic2. If the border color and background color are not the same, it loads the background color into the accumulator and stores it in Vic2.BG_COL_0.
[in] | borderColor | The color to set the border to. |
[in] | backgroundColor | The color to set the background to. |
macro SetBorderColor | ( | borderColor | ) |
Sets the border color.
This macro sets the border color of the Vic2. It loads the border color into the accumulator and stores it in Vic2.BORDER_COL.
[in] | borderColor | The color to set the border to. |
macro SetBackgroundColor | ( | backgroundColor | ) |
Sets the background color.
This macro sets the background color of the Vic2. It loads the background color into the accumulator and stores it in Vic2.BG_COL_0.
[in] | backgroundColor | The color to set the background to. |
function getTextOffset | ( | xPos | , |
yPos | ) |
macro SetScreenAndCharacterMemoryWithShadow | ( | config | ) |
macro SetScreenMemoryAndBitmapPointer | ( | config | ) |
Set screen memory and bitmap memory pointer.
Set screen memory and bitmap memory pointer by using shadow register.
[in] | config | Screen memory and/or bitmap memory configuration. |
function spriteXReg | ( | spriteNo | ) |
Calculates sprite X position register address.
[in] | spriteNo | Number of the sprite x-coordinate to get |
function spriteShadowXReg | ( | spriteNo | ) |
function spriteYReg | ( | spriteNo | ) |
function spriteShadowYReg | ( | spriteNo | ) |
function spriteMask | ( | spriteNo | ) |
function spriteColorReg | ( | spriteNo | ) |
macro SetSpriteXPosition | ( | spriteNo | , |
x | ) |
macro SetSpriteXPositionWithShadow | ( | spriteNo | , |
x | ) |
Sets X position of given sprite (uses sprite MSB register if necessary) using shadow registers.
[in] | spriteNo | Number of the sprite to move |
[in] | x | X position of sprite |
macro SetSpriteYPosition | ( | spriteNo | , |
y | ) |
Sets y position of given sprite.
[in] | spriteNo | Number of the sprite to move |
[in] | y | Y position of sprite |
macro SetSpriteYPositionWithShadow | ( | spriteNo | , |
y | ) |
Sets y position of given sprite using shadow registers.
[in] | spriteNo | Number of the sprite to move |
[in] | y | Y position of sprite |
macro SetSpritePosition | ( | spriteNo | , |
x | , | ||
y | ) |
Sets x and y position of given sprite.
[in] | spriteNo | Number of the sprite to move |
[in] | x | X position of sprite |
[in] | y | Y position of sprite |
macro SetSpritePositionWithShadow | ( | spriteNo | , |
x | , | ||
y | ) |
Sets x and y position of given sprite using shadow registers.
[in] | spriteNo | Number of the sprite to move |
[in] | x | X position of sprite |
[in] | y | Y position of sprite |
function getSpriteMovementStartingAddress | ( | spriteNo | ) |
Get starting address for sprite movement to use with.
[in] | spriteNo | Number of the sprite to move |
macro SpriteMove | ( | spriteNo | , |
speed | , | ||
quadrant | , | ||
deltaX | , | ||
deltaY | ) |
Define sprite movement.
[in] | spriteNo | Number of the sprite to set movement |
[in] | speed | Speed of sprite |
[in] | quadrant | Determines main direction of sprite (use SPRITE_MAIN_DIR_* labels); |
[in] | deltaX | move sprite on X each interrupt |
[in] | deltaY | move sprite on Y each interrupt |
macro SpriteEnable | ( | mask | ) |
Enable one or more sprite, preserving status of other sprites.
[in] | mask | Sprite mask (use SPRITE_MASK_* eventually with | to enable more sprite at once) |
macro SpriteDisable | ( | mask | ) |
Disable one or more sprite, preserving status of other sprites.
[in] | mask | Sprite mask (use SPRITE_MASK_* eventually with | to disable more sprite at once) |
macro SpriteEnableMulticolor | ( | mask | ) |
Enable multicolor setting for one or more sprite, preserving status of other sprites.
[in] | mask | Sprite mask (use SPRITE_MASK_* eventually with | to set multicolor on more sprite at once) |
macro SpriteDisableMulticolor | ( | mask | ) |
Disable multicolor setting for one or more sprite, preserving status of other sprites.
[in] | mask | Sprite mask (use SPRITE_MASK_* eventually with | to unset multicolor on more sprite at once) |
macro SpriteColor | ( | spriteNo | , |
color | ) |
Disable multicolor setting for one or more sprite.
[in] | spriteNo | Number of the sprite to set movement |
[in] | color | Color to set |
macro SpriteMultiColor0 | ( | color | ) |
Set sprite multi color 0.
[in] | color | Color to set |
macro SpriteMultiColor1 | ( | color | ) |
Set sprite multi color 1.
[in] | color | Color to set |