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 > question about triggered raster line in raster interrupt
2007-04-01 23:54
Trifox
Account closed

Registered: Mar 2006
Posts: 108
question about triggered raster line in raster interrupt

i am using this code
to initialise my interrupt
this should look fairly common:
(pasted from somewhere ... )



; Initialise Music Interrupt
sei ; turn off interrupts
lda #$7f
ldx #$01
sta $dc0d ; Turn off CIA 1 interrupts
sta $dd0d ; Turn off CIA 2 interrupts
stx $d01a ; Turn on raster interrupts

lda $d011
;ldx #%1000
;ldy #$14
and #%01111111
sta $d011 ; Clear high bit of $d012, set text mode
;stx $d016 ; single-colour
;sty $d018 ; screen at $0400, charset at $2000

lda #<int ; low part of address of interrupt handler code
ldx #>int ; high part of address of interrupt handler code
ldy #0 ; line to trigger interrupt
sta $0314 ; store in interrupt vector
stx $0315
sty $d012

lda $dc0d ; ACK CIA 1 interrupts
lda $dd0d ; ACK CIA 2 interrupts
asl $d019 ; ACK VIC interrupts
cli



to init my interrrupt, i encountered that this interrupt is triggered in row 256 :( what must i do to let it trigger on exactly line 0 ? and only there, not on line 0 AND 256 ... know what i mean ?


i am leaving the interrupt with following fragment:
; Initialise Music Interrupt
sei ; turn off interrupts
lda #$7f
ldx #$01
sta $dc0d ; Turn off CIA 1 interrupts
sta $dd0d ; Turn off CIA 2 interrupts
stx $d01a ; Turn on raster interrupts

lda $d011
;ldx #%1000
;ldy #$14
and #%01111111
sta $d011 ; Clear high bit of $d012, set text mode
;stx $d016 ; single-colour
;sty $d018 ; screen at $0400, charset at $2000

lda #<int ; low part of address of interrupt handler code
ldx #>int ; high part of address of interrupt handler code
ldy #0 ; line to trigger interrupt
sta $0314 ; store in interrupt vector
stx $0315
sty $d012

lda $dc0d ; ACK CIA 1 interrupts
lda $dd0d ; ACK CIA 2 interrupts
asl $d019 ; ACK VIC interrupts
cli

 
... 13 posts hidden. Click here to view all posts....
 
2007-04-02 09:54
yago

Registered: May 2002
Posts: 333
While we are at it...
dont use dec $d019, or asl $d019 or similar..

Please use
lda $d019
sta $d019
makes sure to stay compatible with e.g. c65.

Thanks in Advance,
Zed

2007-04-02 09:58
tlr

Registered: Sep 2003
Posts: 1790
Quote: While we are at it...
dont use dec $d019, or asl $d019 or similar..

Please use
lda $d019
sta $d019
makes sure to stay compatible with e.g. c65.

Thanks in Advance,
Zed



I always used lda #$01/sta $d019 in my stuff, but I've never seen anybody use lda $d019/sta $d019.
2007-04-02 10:05
Trifox
Account closed

Registered: Mar 2006
Posts: 108
whao, thanks for so much information
2007-04-02 10:16
Mace

Registered: May 2002
Posts: 1799
Why would I want to make my stuff compatible with C65?
I'd have to stick to all compatibility rules then, and I didn't even _know_ there was the possibility to do so :-)

BTW, what _are_ the (other) rules to keep C64 compatibility?
2007-04-02 12:17
MagerValp

Registered: Dec 2001
Posts: 1078
WTF? CSDB just deleted my post and gave me a search page instead.
2007-04-02 12:29
WVL

Registered: Mar 2002
Posts: 902
Right. Like most demos are not compatible with c64 because of ASL $d019.. :) I'm guessing 99.9% of demos wouldnt run anyway, because of

-vic trickery
-illegal opcodes
-lotsa other stuff

So please keep saving those cycles and do ASL $D019 ;)
2007-04-02 13:35
Oswald

Registered: Apr 2002
Posts: 5094
looks like I'm alone with my lsr $d019 :)
2007-04-02 13:37
chatGPZ

Registered: Dec 2001
Posts: 11386
inc $d019 ftw!
2007-04-02 13:42
Scout

Registered: Dec 2002
Posts: 1570
Quote: looks like I'm alone with my lsr $d019 :)

Nope :)
2007-04-03 14:41
Graham
Account closed

Registered: Dec 2002
Posts: 990
SRE $D019
Previous - 1 | 2 | 3 - 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
Flashback
csabanw
ned128
LightSide
psych
Yogibear/Protovision
Peacemaker/CENSOR/Hi..
Ben Breton/Absence o..
Apollyon/ALD
Walt/Bonzai
Guests online: 132
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 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 Censor Design  (9.3)
5 Triad  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

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