| |
DJ Indikator
Registered: Jul 2013 Posts: 4 |
Disable CIA timers IRQ
How can i disable CIA1 Timer A irq, but NO STOP timer A?
When i code
...
lda #$7f
sta $dc0d
lda $dc0d
cli
there NO DISABLE irq on timer A :( and irq handler still calling.
But if i code
...
lda #$01
sta $dc0d
lda $dc0d
cli
the timer works as counter, but no irq happens.
What wrong in first case?
Thanx |
|
| |
Mixer
Registered: Apr 2008 Posts: 452 |
The running of timers and whether they generate IRQ are separate issues.
Timer only generates IRQ if it is set to do so with $dc0d.
Timers can be started or stopped running with their control register (Timer A) $DC0E and (Timer B) $DC0F.
You need to check which source generated the IRQ in the IRQ handler. You may be experiencing an IRQ of the CIA timer B or a port or a raster IRQ, so you need to check those also or make sure that they do not happen.
When writing to CIA control registers the high bit decides whether it is a bit set or clear operation. #$7f clears all #$01 clears lowest bit #$81 would set lowest bit.
Hope this helps. |
| |
DJ Indikator
Registered: Jul 2013 Posts: 4 |
All right. It's clear. There no any other IRQ. The full code is:
sei
lda #$35
sta $01
lda #<irq_n
sta $fffe
lda #>irq_n
sta $ffff
lda #$00
sta $d01a ;SET ALL VIC irq OFF
asl $d019 ;CLR VIC irq status
lda #$26 ;set timer A 100 ps
sta $dc05
lda #$7d
sta $dc04
lda %00000001 ;MAGIC CODE
sta $dc0d ;MAGIC CODE
lda %01111111
sta $dc0d
lda $dc0d ;clr CIA1 irq status
cli
with this code - IRQ not work.
If i remove "MAGIC CODE" - irq work. Why? |
| |
spider-j
Registered: Oct 2004 Posts: 498 |
Don't know what you want to do, but to me it looks as if you at least forgot the #
here:
lda #%00000001
and here:
lda #%01111111 |
| |
DJ Indikator
Registered: Jul 2013 Posts: 4 |
Quote: Don't know what you want to do, but to me it looks as if you at least forgot the #
here:
lda #%00000001
and here:
lda #%01111111
Genious!!!! A day with dig manuals etc, but the problem is simple #% :) Thank you !!!!! |
| |
The Phantom
Registered: Jan 2004 Posts: 360 |
Nice find Spider... I saw the same thing and am left wondering how many people code this way (I do).. |