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: 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.
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: 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
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

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)..
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
E$G/HF ⭐ 7
Chesser/Blazon
El Gato
Steffan/BOOM!
The Human Co../Maste..
aNdy/AL/Cosine
v3nt0r/ibex-crew
t0m3000/hf^boom!^ibx
MCM/ONSLAUGHT
Fred/Channel 4
Hobbit/Laser Inc.
REBEL 1/HF
acrouzet/G★P
Krill/Plush
Mason/Unicess
Smasher/F4CG
Guests online: 95
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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