2017-12-06 23:23:30 +00:00
|
|
|
// Hardware addresses for C64
|
|
|
|
|
2018-07-12 16:30:35 +00:00
|
|
|
#if not(CBM_64)
|
|
|
|
#warn c64_cia module should be only used on C64-compatible targets
|
|
|
|
#endif
|
|
|
|
|
2017-12-06 23:23:30 +00:00
|
|
|
// CIA1
|
2018-12-16 20:07:04 +00:00
|
|
|
volatile byte cia1_pra @$DC00
|
|
|
|
volatile byte cia1_prb @$DC01
|
2017-12-06 23:23:30 +00:00
|
|
|
byte cia1_ddra @$DC02
|
|
|
|
byte cia1_ddrb @$DC03
|
2018-12-16 20:07:04 +00:00
|
|
|
volatile byte cia2_pra @$DD00
|
|
|
|
volatile byte cia2_prb @$DD01
|
2017-12-06 23:23:30 +00:00
|
|
|
byte cia2_ddra @$DD02
|
|
|
|
byte cia2_ddrb @$DD03
|
|
|
|
|
2018-02-01 21:39:38 +00:00
|
|
|
macro asm void cia_disable_irq() {
|
2018-12-16 20:07:04 +00:00
|
|
|
? LDA #$7f
|
|
|
|
! LDA $dc0d
|
|
|
|
! LDA $dd0d
|
|
|
|
! LDA $dc0d
|
|
|
|
! LDA $dd0d
|
2017-12-06 23:23:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-02-01 21:39:38 +00:00
|
|
|
macro void vic_bank_0000() {
|
|
|
|
cia2_ddra = 3
|
|
|
|
cia2_pra = 3
|
2017-12-06 23:23:30 +00:00
|
|
|
}
|
|
|
|
|
2018-02-01 21:39:38 +00:00
|
|
|
macro void vic_bank_4000() {
|
|
|
|
cia2_ddra = 3
|
|
|
|
cia2_pra = 2
|
2017-12-06 23:23:30 +00:00
|
|
|
}
|
|
|
|
|
2018-02-01 21:39:38 +00:00
|
|
|
macro void vic_bank_8000() {
|
|
|
|
cia2_ddra = 3
|
|
|
|
cia2_pra = 1
|
2017-12-06 23:23:30 +00:00
|
|
|
}
|
|
|
|
|
2018-02-01 21:39:38 +00:00
|
|
|
macro void vic_bank_C000() {
|
|
|
|
cia2_ddra = 3
|
|
|
|
cia2_pra = 0
|
2018-07-12 16:30:35 +00:00
|
|
|
}
|