Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Disable CIA timers IRQ
2015-08-29 22:50
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
2015-08-29 23:16
Mixer

Registered: Apr 2008
Posts: 418
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.
2015-08-30 08:51
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?
2015-08-30 09:03
spider-j

Registered: Oct 2004
Posts: 443
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
2015-08-30 09:22
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 !!!!!
2015-08-31 14:10
The Phantom
Account closed

Registered: Jan 2004
Posts: 358
Nice find Spider... I saw the same thing and am left wondering how many people code this way (I do)..
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Dr. Doom/RAD
csabanw
Dymo/G★P
algorithm
Derision/Longshot
eryngi
Exile/Anubis
Guests online: 306
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 No Bounds  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 Party Elk 2  (9.7)
2 Cubic Dream  (9.6)
3 Copper Booze  (9.5)
4 Rainbow Connection  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Onscreen 5k  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Nostalgia  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.037 sec.