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: 422
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: 444
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
Morpheus/IPC+C64.COM
Scooby/G★P/Light
Steel/SCS&TRC/G★P
Meikel aka ZUX/Sparks
tlr
Airwolf/F4CG
St0fF/N30PLA51A/tOM
Guests online: 141
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Graphicians
1 Sulevi  (10)
2 Mirage  (9.8)
3 Lobo  (9.7)
4 Mikael  (9.7)
5 Archmage  (9.7)

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