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

Vic2 module. More...

Functions

macro c128lib_SetBorderAndBackgroundColor (borderColor, backgroundColor)
 Sets the border and background color.
 
macro c128lib_SetBorderColor (borderColor)
 Sets the border color.
 
macro c128lib_SetBackgroundColor (backgroundColor)
 Sets the background color.
 
function c128lib_getTextOffset (xPos, yPos)
 Calculates memory offset of text cell specified by given coordinates on 40 cols screen.
 
macro c128lib_SetScreenAndCharacterMemoryWithShadow (config)
 Set screen memory and charset memory position.
 
macro c128lib_SetScreenMemoryAndBitmapPointer (config)
 Set screen memory and bitmap memory pointer.
 
macro c128lib_SetSpriteXPosition (spriteNo, x)
 Sets X position of given sprite (uses sprite MSB register if necessary)
 
macro c128lib_SetSpriteXPositionWithShadow (spriteNo, x)
 Sets X position of given sprite (uses sprite MSB register if necessary) using shadow registers.
 
macro c128lib_SetSpriteYPosition (spriteNo, y)
 Sets y position of given sprite.
 
macro c128lib_SetSpriteYPositionWithShadow (spriteNo, y)
 Sets y position of given sprite using shadow registers.
 
macro c128lib_SetSpritePosition (spriteNo, x, y)
 Sets x and y position of given sprite.
 
macro c128lib_SetSpritePositionWithShadow (spriteNo, x, y)
 Sets x and y position of given sprite using shadow registers.
 
macro c128lib_SpriteMove (spriteNo, speed, quadrant, deltaX, deltaY)
 Define sprite movement.
 
macro c128lib_SpriteEnable (mask)
 Enable one or more sprite, preserving status of other sprites.
 
macro c128lib_SpriteDisable (mask)
 Disable one or more sprite, preserving status of other sprites.
 
macro c128lib_SpriteEnableMulticolor (mask)
 Enable multicolor setting for one or more sprite, preserving status of other sprites.
 
macro c128lib_SpriteDisableMulticolor (mask)
 Disable multicolor setting for one or more sprite, preserving status of other sprites.
 
macro c128lib_SpriteColor (spriteNo, color)
 Disable multicolor setting for one or more sprite.
 
macro c128lib_SpriteMultiColor0 (color)
 Set sprite multi color 0.
 
macro c128lib_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

◆ c128lib_SetBorderAndBackgroundColor()

macro c128lib_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.
Since
1.0.0

◆ c128lib_SetBorderColor()

macro c128lib_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.
Since
1.0.0

◆ c128lib_SetBackgroundColor()

macro c128lib_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.
Since
1.0.0

◆ c128lib_getTextOffset()

function c128lib_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

◆ c128lib_SetScreenAndCharacterMemoryWithShadow()

macro c128lib_SetScreenAndCharacterMemoryWithShadow ( config )

Set screen memory and charset memory position.

Set screen memory and charset memory position by using shadow register.

Character memory selection

  • Vic2.CHAR_MEM_0000 Character memory on $0000
  • Vic2.CHAR_MEM_0800 Character memory on $0800
  • Vic2.CHAR_MEM_1000 Character memory on $1000
  • Vic2.CHAR_MEM_1800 Character memory on $1800
  • Vic2.CHAR_MEM_2000 Character memory on $2000
  • Vic2.CHAR_MEM_2800 Character memory on $2800
  • Vic2.CHAR_MEM_3000 Character memory on $3000
  • Vic2.CHAR_MEM_3800 Character memory on $3800

If omitted, Vic2.CHAR_MEM_0000 will be used.

Character memory offset must be added to current bank selected. For ex. if Vic bank 1 ($4000) is selected, CHAR_MEM_0800 will point to $4000 + $0800

Screen memory selection

  • Vic2.SCREEN_MEM_0000 Screen memory on $0000
  • Vic2.SCREEN_MEM_0400 Screen memory on $0400
  • Vic2.SCREEN_MEM_0800 Screen memory on $0800
  • Vic2.SCREEN_MEM_0C00 Screen memory on $0c00
  • Vic2.SCREEN_MEM_1000 Screen memory on $1000
  • Vic2.SCREEN_MEM_1400 Screen memory on $1400
  • Vic2.SCREEN_MEM_1800 Screen memory on $1800
  • Vic2.SCREEN_MEM_1C00 Screen memory on $1c00
  • Vic2.SCREEN_MEM_2000 Screen memory on $2000
  • Vic2.SCREEN_MEM_2400 Screen memory on $2400
  • Vic2.SCREEN_MEM_2800 Screen memory on $2800
  • Vic2.SCREEN_MEM_2C00 Screen memory on $2c00
  • Vic2.SCREEN_MEM_3000 Screen memory on $3000
  • Vic2.SCREEN_MEM_3400 Screen memory on $3400
  • Vic2.SCREEN_MEM_3800 Screen memory on $3800
  • Vic2.SCREEN_MEM_3C00 Screen memory on $3c00

If omitted, Vic2.SCREEN_MEM_0000 will be used.

Screen memory offset must be added to current bank selected. For ex. if Vic bank 1 ($4000) is selected, SCREEN_MEM_0C00 will point to $4000 + $0c00

Parameters
[in]configScreen memory and/or char memory configuration.
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.0.0

◆ c128lib_SetScreenMemoryAndBitmapPointer()

macro c128lib_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.
Since
1.0.0

◆ c128lib_SetSpriteXPosition()

macro c128lib_SetSpriteXPosition ( spriteNo ,
x  )

Sets X position of given sprite (uses sprite MSB register if necessary)

Parameters
[in]spriteNoNumber of the sprite to move
[in]xX position of sprite
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SetSpriteXPositionWithShadow()

macro c128lib_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
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SetSpriteYPosition()

macro c128lib_SetSpriteYPosition ( spriteNo ,
y  )

Sets y position of given sprite.

Parameters
[in]spriteNoNumber of the sprite to move
[in]yY position of sprite
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SetSpriteYPositionWithShadow()

macro c128lib_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
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SetSpritePosition()

macro c128lib_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
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SetSpritePositionWithShadow()

macro c128lib_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
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SpriteMove()

macro c128lib_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
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SpriteEnable()

macro c128lib_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)
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SpriteDisable()

macro c128lib_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)
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SpriteEnableMulticolor()

macro c128lib_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)
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SpriteDisableMulticolor()

macro c128lib_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)
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SpriteColor()

macro c128lib_SpriteColor ( spriteNo ,
color  )

Disable multicolor setting for one or more sprite.

Parameters
[in]spriteNoNumber of the sprite to set movement
[in]colorColor to set
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SpriteMultiColor0()

macro c128lib_SpriteMultiColor0 ( color )

Set sprite multi color 0.

Parameters
[in]colorColor to set
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0

◆ c128lib_SpriteMultiColor1()

macro c128lib_SpriteMultiColor1 ( color )

Set sprite multi color 1.

Parameters
[in]colorColor to set
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.2.0