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 > read $dc0d
2008-03-31 18:28
Testa
Account closed

Registered: Oct 2004
Posts: 197
read $dc0d

when i set up a raster irq i always do lda #$7f sta $dc0d lda $dc0d.. no problem but there is one thing i dont get:
at $ea7e there is also a lda $dc0d.. can i savely skip the lda $dc0d in the irq set up and end the irq with a jmp $ea7e... or is there a diffirence???
2008-03-31 18:43
Ninja

Registered: Jan 2002
Posts: 411
I guess your IRQs are all VIC-based. So, I would recommend to clear the CIA-irq-latch once right after disabling the CIA-IRQs (that's what you seem to do anyhow). Then, you don't need to clear it in every VIC-based IRQ.

Besides this, there is no difference if you read the latch in your code or the ROM does it for you. As long as it gets read somehow somewhere...
2008-04-01 08:40
MagerValp

Registered: Dec 2001
Posts: 1078
Just do lda #$7f sta $dc0d *without* using SEI. If the IRQ is triggered while you're setting the control register, the kernal IRQ handler will clear $dc0d for you before continuing.
2008-04-02 14:37
HCL

Registered: Feb 2003
Posts: 728
I have another related question.. I think i've heard something like when you enter an interrupt, you can tell from a certain register flag if you enterer because of a raster interrupt or a timer interrupt (vic or cia).. Something like
tehIrq:
bvs rasterIrq
bvc timerIrq

The above example doesn't work (i tried), but it should be something similar.. The best alternative i've figured out myself is:
tehIrq
pha
lda $dc0d
bpl rasterIrq
bmi timerIrq

..but that's not like the coder pR0n i want to do :/. Anyone?
2008-04-02 15:05
Ninja

Registered: Jan 2002
Posts: 411
HCL: This is most probably a misunderstanding. You can distingiush between a BRK and an IRQ using the B-flag. But not VIC or CIA.

What I usually use to distinguish is:

ASL $D019
BCS VIC
...CIA here...

Bonus: you get the acked vic_irq for free (and a carry in a consistent state, woohoo!) ;)
2008-04-02 15:06
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: I have another related question.. I think i've heard something like when you enter an interrupt, you can tell from a certain register flag if you enterer because of a raster interrupt or a timer interrupt (vic or cia).. Something like
tehIrq:
bvs rasterIrq
bvc timerIrq

The above example doesn't work (i tried), but it should be something similar.. The best alternative i've figured out myself is:
tehIrq
pha
lda $dc0d
bpl rasterIrq
bmi timerIrq

..but that's not like the coder pR0n i want to do :/. Anyone?


This is how I normally do it:

lsr $d019 ;ack potential raster irq and move the state to carry.
bcs rasterirq

timerirq:
   bit $dc0d ;since it wasn't a raster irq, then it was a timer => ack it.
rti

rasterirq:
rti

2008-04-02 15:10
Ninja

Registered: Jan 2002
Posts: 411
JackAsser: You cycle waster; jump to $dc0c after setting it to $40! ;D
2008-04-02 15:14
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: JackAsser: You cycle waster; jump to $dc0c after setting it to $40! ;D

Ofcourse... but this was the school book example. :D
2008-04-02 15:16
Ninja

Registered: Jan 2002
Posts: 411
school-book example? for HCL? :)
2008-04-02 15:25
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: school-book example? for HCL? :)

Well, the "BEST" alternative he came up with was right out lame. ;D Wouldn't wanna raise the bar too high.
2008-04-02 15:41
Ninja

Registered: Jan 2002
Posts: 411
*rotfl* :)
 
... 7 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
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
BYB/Hokuto Force
Mike
iAN CooG/HVSC
Guests online: 307
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 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Logo Graphicians
1 t0m3000  (10)
2 Sander  (9.8)
3 Mermaid  (9.5)
4 Facet  (9.4)
5 Shine  (9.4)

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