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

Vdc module. More...

Namespaces

namespace  Vdc
 

Functions

macro Go40 ()
 Go to 40 columns mode.
 
macro Go80 ()
 Go to 80 columns mode.
 
function calculateBackgroundAndForeground (background, foreground)
 Calculate byte with hi nibble to foreground color and low nibble to background color.
 
macro SetBackgroundForegroundColor (background, foreground)
 Set background and foreground color, also disable bit 6 of HORIZONTAL_SMOOTH_SCROLLING register.
 
macro SetBackgroundForegroundColorWithVars (background, foreground)
 Set background and foreground color, also disable bit 6 of HORIZONTAL_SMOOTH_SCROLLING register. Use vars instead of labels.; Warning: high nibble of background must be 0, it's up to developer to check this.
 
macro ReadFromVdcMemoryByCoordinates (xPos, yPos, destination, qty)
 Read from Vdc internal memory and write it to Vic screen memory by using coordinates.
 
macro ReadFromVdcMemoryByAddress (source, destination, qty)
 Read from Vdc internal memory and write it to Vic screen memory by using source address.
 
macro WriteToVdcMemoryByCoordinates (source, xPos, yPos, qty)
 Read from Vic screen memory and write it to Vdc internal memory by using coordinates.
 
macro WriteToVdcMemoryByAddress (source, destination, qty)
 Read from Vic screen memory and write it to Vdc internal memory by using coordinates.
 
function getTextOffset80Col (xPos, yPos)
 Calculates memory offset of text cell specified by given coordinates on 80 cols screen.
 
macro GetVdcDisplayStart ()
 
macro SetVdcUpdateAddress (address)
 Set the pointer to the RAM area that is to be updated. The update pointer is stored in Vdc register CURRENT_MEMORY_HIGH_ADDRESS and CURRENT_MEMORY_LOW_ADDRESS.
 
macro WriteVdc ()
 Write a value into Vdc register without using kernal routine instead of pure instruction. It needs register number in X and value to write in A. It costs 11 bytes and 14 cycles.
 
macro ReadVdc ()
 Read a value from Vdc register without using kernal routine instead of pure instruction. It needs register number in X and value is written in A. It costs 11 bytes and 14 cycles.
 

Detailed Description

Vdc module.

Simple macros for Vdc.

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

◆ Go40()

macro Go40 ( )

Go to 40 columns mode.

Remarks
Register .A will be modified.
Flags N and Z will be affected.
Note
Use c128lib_Go40 in vdc-global.asm
Since
1.1.0

◆ Go80()

macro Go80 ( )

Go to 80 columns mode.

Remarks
Register .A will be modified.
Flags N and Z will be affected.
Note
Use c128lib_Go80 in vdc-global.asm
Since
1.1.0

◆ calculateBackgroundAndForeground()

function calculateBackgroundAndForeground ( background ,
foreground  )

Calculate byte with hi nibble to foreground color and low nibble to background color.

Parameters
[in]backgroundBackground color
[in]foregroundForeground color
Returns
Byte with foreground and background color combined
Since
1.1.0

◆ SetBackgroundForegroundColor()

macro SetBackgroundForegroundColor ( background ,
foreground  )

Set background and foreground color, also disable bit 6 of HORIZONTAL_SMOOTH_SCROLLING register.

Parameters
[in]backgroundBackground color
[in]foregroundForeground color
Remarks
Register .A and .X will be modified.
Flags N, Z and O will be affected.
Note
Use c128lib_SetBackgroundForegroundColor in vdc-global.asm
Since
1.1.0

◆ SetBackgroundForegroundColorWithVars()

macro SetBackgroundForegroundColorWithVars ( background ,
foreground  )

Set background and foreground color, also disable bit 6 of HORIZONTAL_SMOOTH_SCROLLING register. Use vars instead of labels.; Warning: high nibble of background must be 0, it's up to developer to check this.

Parameters
[in]backgroundBackground color address
[in]foregroundForeground color address
Remarks
Register .A and .X will be modified.
Flags N, Z, C and O will be affected.
Note
Use c128lib_SetBackgroundForegroundColorWithVars in vdc-global.asm
Since
1.1.0

◆ ReadFromVdcMemoryByCoordinates()

macro ReadFromVdcMemoryByCoordinates ( xPos ,
yPos ,
destination ,
qty  )

Read from Vdc internal memory and write it to Vic screen memory by using coordinates.

Parameters
[in]xPosX coord on Vdc screen
[in]yPosY coord on Vdc screen
[in]destinationVic screen memory absolute address
[in]qtyNumber of byte to copy
Remarks
Register .A and .X will be modified.
Flags N, Z and O will be affected.
Note
Use c128lib_ReadFromVdcMemoryByCoordinates in vdc-global.asm
Since
1.1.0

◆ ReadFromVdcMemoryByAddress()

macro ReadFromVdcMemoryByAddress ( source ,
destination ,
qty  )

Read from Vdc internal memory and write it to Vic screen memory by using source address.

Parameters
[in]sourceVdc memory absolute address
[in]destinationVic screen memory absolute address
[in]qtyNumber of byte to copy
Remarks
Register .A, .X and .Y will be modified.
Flags N, Z and C will be affected.
Note
Use c128lib_ReadFromVdcMemoryByAddress in vdc-global.asm
Since
1.1.0

◆ WriteToVdcMemoryByCoordinates()

macro WriteToVdcMemoryByCoordinates ( source ,
xPos ,
yPos ,
qty  )

Read from Vic screen memory and write it to Vdc internal memory by using coordinates.

Parameters
[in]xPosX coord on Vic screen
[in]yPosY coord on Vic screen
[in]destinationVdc internal memory absolute address
[in]qtyNumber of byte to copy
Remarks
Register .A, .X and .Y will be modified.
Flags N, Z and C will be affected.
Note
Use c128lib_WriteToVdcMemoryByCoordinates in vdc-global.asm
Since
1.1.0

◆ WriteToVdcMemoryByAddress()

macro WriteToVdcMemoryByAddress ( source ,
destination ,
qty  )

Read from Vic screen memory and write it to Vdc internal memory by using coordinates.

Parameters
[in]sourceVdc memory absolute address
[in]destinationVic screen memory absolute address
[in]qtyNumber of byte to copy
Remarks
Register .A, .X and .Y will be modified.
Flags N, Z and C will be affected.
Note
Use c128lib_WriteToVdcMemoryByAddress in vdc-global.asm
Since
1.1.0

◆ getTextOffset80Col()

function getTextOffset80Col ( xPos ,
yPos  )

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

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

◆ GetVdcDisplayStart()

macro GetVdcDisplayStart ( )

◆ SetVdcUpdateAddress()

macro SetVdcUpdateAddress ( address )

Set the pointer to the RAM area that is to be updated. The update pointer is stored in Vdc register CURRENT_MEMORY_HIGH_ADDRESS and CURRENT_MEMORY_LOW_ADDRESS.

Parameters
[in]addressAddress of update area
Remarks
Register .A and .X will be modified.
Flags N, Z and O will be affected.
Note
Use c128lib_SetVdcUpdateAddress in vdc-global.asm
Since
1.1.0

◆ WriteVdc()

macro WriteVdc ( )

Write a value into Vdc register without using kernal routine instead of pure instruction. It needs register number in X and value to write in A. It costs 11 bytes and 14 cycles.

Precondition
Register .X must be filled with internal Vdc register to write on.
Register .A must be filled with the value that will be written to internal Vdc register.
Remarks
Flags N, Z and O will be affected.
Note
Use c128lib_WriteVdc in vdc-global.asm
Since
1.1.0

◆ ReadVdc()

macro ReadVdc ( )

Read a value from Vdc register without using kernal routine instead of pure instruction. It needs register number in X and value is written in A. It costs 11 bytes and 14 cycles.

Precondition
Register .X must be filled with internal Vdc register to read from.
Remarks
Register .A will be modified.
Flags N, Z and O will be affected.
Postcondition
Register .A will contain the value read from internal Vdc register.
Note
Use c128lib_ReadVdc in vdc-global.asm
Since
1.1.0