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

Vdc module. More...

Functions

macro c128lib_Go40 ()
 Go to 40 columns mode.
 
macro c128lib_Go80 ()
 Go to 80 columns mode.
 
macro c128lib_SetBackgroundForegroundColor (background, foreground)
 Set background and foreground color, also disable bit 6 of HORIZONTAL_SMOOTH_SCROLLING register.
 
macro c128lib_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 c128lib_ReadFromVdcMemoryByCoordinates (xPos, yPos, destination, qty)
 Read from Vdc internal memory and write it to Vic screen memory by using coordinates.
 
macro c128lib_ReadFromVdcMemoryByAddress (source, destination, qty)
 Read from Vdc internal memory and write it to Vic screen memory by using source address.
 
macro c128lib_WriteToVdcMemoryByCoordinates (source, xPos, yPos, qty)
 Read from Vic screen memory and write it to Vdc internal memory by using coordinates.
 
macro c128lib_WriteToVdcMemoryByAddress (source, destination, qty)
 Read from Vic screen memory and write it to Vdc internal memory by using coordinates.
 
function c128lib_getTextOffset80Col (xPos, yPos)
 Calculates memory offset of text cell specified by given coordinates on 80 cols screen.
 
macro c128lib_GetVdcDisplayStart ()
 Returns the address start of Vdc display memory data. This is stored in Vdc register SCREEN_MEMORY_STARTING_HIGH_ADDRESS and SCREEN_MEMORY_STARTING_LOW_ADDRESS. The 16-bit value is stored in $FB and $FC.
 
macro c128lib_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 c128lib_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 c128lib_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

◆ c128lib_Go40()

macro c128lib_Go40 ( )

Go to 40 columns mode.

Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.1.0

◆ c128lib_Go80()

macro c128lib_Go80 ( )

Go to 80 columns mode.

Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.1.0

◆ c128lib_SetBackgroundForegroundColor()

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

◆ c128lib_SetBackgroundForegroundColorWithVars()

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

◆ c128lib_ReadFromVdcMemoryByCoordinates()

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

◆ c128lib_ReadFromVdcMemoryByAddress()

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

◆ c128lib_WriteToVdcMemoryByCoordinates()

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

◆ c128lib_WriteToVdcMemoryByAddress()

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

◆ c128lib_getTextOffset80Col()

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

◆ c128lib_GetVdcDisplayStart()

macro c128lib_GetVdcDisplayStart ( )

Returns the address start of Vdc display memory data. This is stored in Vdc register SCREEN_MEMORY_STARTING_HIGH_ADDRESS and SCREEN_MEMORY_STARTING_LOW_ADDRESS. The 16-bit value is stored in $FB and $FC.

Remarks
Register .A and .X will be modified.
Flags N, Z and O will be affected.
Since
1.1.0

◆ c128lib_SetVdcUpdateAddress()

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

◆ c128lib_WriteVdc()

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

◆ c128lib_ReadVdc()

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