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

Cia module. More...

Functions

macro c128lib_GetFirePressedPort1 ()
 Checks if the fire button is pressed on joystick port 1.
 
macro c128lib_GetFirePressedPort2 ()
 Checks if the fire button is pressed on joystick port 2.
 
macro c128lib_DisableCIAInterrupts ()
 Disables the interrupts from both CIA chips.
 
macro c128lib_SetVicBank (bank)
 Configures Vic bank (16K) which is directly addressable by VIC2 chip.
 

Detailed Description

Cia module.

Simple macros for Cia.

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_GetFirePressedPort1()

macro c128lib_GetFirePressedPort1 ( )

Checks if the fire button is pressed on joystick port 1.

This macro checks if the fire button is pressed on joystick port 1. It loads the data from CIA1's data port B into the accumulator and then performs a bitwise AND operation with the JOY_FIRE constant.;

Returns
If .A is non zero, fire is pressed
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.0.0

◆ c128lib_GetFirePressedPort2()

macro c128lib_GetFirePressedPort2 ( )

Checks if the fire button is pressed on joystick port 2.

This macro checks if the fire button is pressed on joystick port 2. It loads the data from CIA1's data port A into the accumulator and then performs a bitwise AND operation with the JOY_FIRE constant.;

Returns
If .A is non zero, fire is pressed
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.0.0

◆ c128lib_DisableCIAInterrupts()

macro c128lib_DisableCIAInterrupts ( )

Disables the interrupts from both CIA chips.

This macro disables the interrupts from both CIA chips on a Commodore 64. It loads the accumulator with the value $7F, which disables all interrupt sources, and then stores this value in the IRQ control registers of both CIA chips. It then reads the IRQ control registers to confirm the changes.

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

◆ c128lib_SetVicBank()

macro c128lib_SetVicBank ( bank )

Configures Vic bank (16K) which is directly addressable by VIC2 chip.

Parameters
[in]bankBank to set
Remarks
Register .A will be modified.
Flags N, Z and C will be affected.
Note
Bank parameter can be filled with Cia.BANK_0, Cia.BANK_1, Cia.BANK_2, Cia.BANK_3
BANK_0 $0000-$3FFF, BANK_1 $4000-$7FFF, BANK_2 $8000-$BFFF, BANK_3 $C000-$FFFF
Since
1.2.0