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: 460
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: 505
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
Isildur/Samar
Mr. Mouse/XeNTaX/G*P
zzarko/Avatar
Matt
ice00/Ice Team
syntaxerror
Guests online: 225
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Uncensored  (9.5)
9 Wonderland XIV  (9.5)
10 No Bounds  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Webmasters
1 Slaygon  (9.7)
2 Perff  (9.6)
3 Sabbi  (9.5)
4 Morpheus  (9.4)
5 CreaMD  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 1.391 sec.