c128lib Base
Base macros for C128
Loading...
Searching...
No Matches
vic2.asm File Reference

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.
 

Detailed Description

Vic2 module.

Simple macros for Vic2.

Author
Raffaele Intorcia raffa.nosp@m.ele..nosp@m.intor.nosp@m.cia@.nosp@m.gmail.nosp@m..com

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.

Date
2024

Function Documentation

◆ SetBorderAndBackgroundColor()

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.

Parameters
[in]borderColorThe color to set the border to.
[in]backgroundColorThe color to set the background to.
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Note
Use c128lib_SetBorderAndBackgroundColor in vic2-global.asm
Since
1.0.0

◆ SetBorderColor()

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.

Parameters
[in]borderColorThe color to set the border to.
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Note
Use c128lib_SetBorderColor in vic2-global.asm
Since
1.0.0

◆ SetBackgroundColor()

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.

Parameters
[in]backgroundColorThe color to set the background to.
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Note
Use c128lib_SetBackgroundColor in vic2-global.asm
Since
1.0.0

◆ getTextOffset()

function getTextOffset ( xPos ,
yPos  )

Calculates memory offset of text cell specified by given coordinates on 40 cols screen.

Parameters
[in]xPosX coord on Vdc screen
[in]yPosY coord on Vdc screen
Returns
Memory offset of Vic2 specified coordinate
Since
1.1.0

◆ SetScreenAndCharacterMemoryWithShadow()

macro SetScreenAndCharacterMemoryWithShadow ( config )

◆ SetScreenMemoryAndBitmapPointer()

macro SetScreenMemoryAndBitmapPointer ( config )

Set screen memory and bitmap memory pointer.

Set screen memory and bitmap memory pointer by using shadow register.

Parameters
[in]configScreen memory and/or bitmap memory configuration.
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Labels Vic2.CHAR* and Vic2.SCREEN_MEM* can be used to compose.
Note
Use c128lib_SetScreenMemoryAndBitmapPointer in vic2-global.asm
Since
1.0.0

◆ spriteXReg()

function spriteXReg ( spriteNo )

Calculates sprite X position register address.

Parameters
[in]spriteNoNumber of the sprite x-coordinate to get
Since
1.2.0

◆ spriteShadowXReg()

function spriteShadowXReg ( spriteNo )

◆ spriteYReg()

function spriteYReg ( spriteNo )

◆ spriteShadowYReg()

function spriteShadowYReg ( spriteNo )

◆ spriteMask()

function spriteMask ( spriteNo )

◆ spriteColorReg()

function spriteColorReg ( spriteNo )

◆ SetSpriteXPosition()

macro SetSpriteXPosition ( spriteNo ,
x  )

◆ SetSpriteXPositionWithShadow()

macro SetSpriteXPositionWithShadow ( spriteNo ,
x  )

Sets X position of given sprite (uses sprite MSB register if necessary) using shadow registers.

Parameters
[in]spriteNoNumber of the sprite to move
[in]xX position of sprite
Note
Use c128lib_SetSpriteXPositionWithShadow in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ SetSpriteYPosition()

macro SetSpriteYPosition ( spriteNo ,
y  )

Sets y position of given sprite.

Parameters
[in]spriteNoNumber of the sprite to move
[in]yY position of sprite
Note
Use c128lib_SetSpriteYPosition in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ SetSpriteYPositionWithShadow()

macro SetSpriteYPositionWithShadow ( spriteNo ,
y  )

Sets y position of given sprite using shadow registers.

Parameters
[in]spriteNoNumber of the sprite to move
[in]yY position of sprite
Note
Use c128lib_SetSpriteYPositionWithShadow in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ SetSpritePosition()

macro SetSpritePosition ( spriteNo ,
x ,
y  )

Sets x and y position of given sprite.

Parameters
[in]spriteNoNumber of the sprite to move
[in]xX position of sprite
[in]yY position of sprite
Note
Use c128lib_SetSpritePosition in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ SetSpritePositionWithShadow()

macro SetSpritePositionWithShadow ( spriteNo ,
x ,
y  )

Sets x and y position of given sprite using shadow registers.

Parameters
[in]spriteNoNumber of the sprite to move
[in]xX position of sprite
[in]yY position of sprite
Note
Use c128lib_SetSpritePositionWithShadow in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ getSpriteMovementStartingAddress()

function getSpriteMovementStartingAddress ( spriteNo )

Get starting address for sprite movement to use with.

See also
SpriteMove
Parameters
[in]spriteNoNumber of the sprite to move
Since
1.2.0

◆ SpriteMove()

macro SpriteMove ( spriteNo ,
speed ,
quadrant ,
deltaX ,
deltaY  )

Define sprite movement.

Parameters
[in]spriteNoNumber of the sprite to set movement
[in]speedSpeed of sprite
[in]quadrantDetermines main direction of sprite (use SPRITE_MAIN_DIR_* labels);
[in]deltaXmove sprite on X each interrupt
[in]deltaYmove sprite on Y each interrupt
Note
Use c128lib_SpriteMove in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ SpriteEnable()

macro SpriteEnable ( mask )

Enable one or more sprite, preserving status of other sprites.

Parameters
[in]maskSprite mask (use SPRITE_MASK_* eventually with | to enable more sprite at once)
Note
Use c128lib_SpriteEnable in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ SpriteDisable()

macro SpriteDisable ( mask )

Disable one or more sprite, preserving status of other sprites.

Parameters
[in]maskSprite mask (use SPRITE_MASK_* eventually with | to disable more sprite at once)
Note
Use c128lib_SpriteDisable in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ SpriteEnableMulticolor()

macro SpriteEnableMulticolor ( mask )

Enable multicolor setting for one or more sprite, preserving status of other sprites.

Parameters
[in]maskSprite mask (use SPRITE_MASK_* eventually with | to set multicolor on more sprite at once)
Note
Use c128lib_SpriteEnableMulticolor in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ SpriteDisableMulticolor()

macro SpriteDisableMulticolor ( mask )

Disable multicolor setting for one or more sprite, preserving status of other sprites.

Parameters
[in]maskSprite mask (use SPRITE_MASK_* eventually with | to unset multicolor on more sprite at once)
Note
Use c128lib_SpriteDisableMulticolor in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ SpriteColor()

macro SpriteColor ( spriteNo ,
color  )

Disable multicolor setting for one or more sprite.

Parameters
[in]spriteNoNumber of the sprite to set movement
[in]colorColor to set
Note
Use c128lib_SpriteColor in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ SpriteMultiColor0()

macro SpriteMultiColor0 ( color )

Set sprite multi color 0.

Parameters
[in]colorColor to set
Note
Use c128lib_SpriteMultiColor0 in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ SpriteMultiColor1()

macro SpriteMultiColor1 ( color )

Set sprite multi color 1.

Parameters
[in]colorColor to set
Note
Use c128lib_SpriteMultiColor1 in vic2-global.asm
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0