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 > irq rutine
2010-06-08 05:51
turtle
Account closed

Registered: Mar 2005
Posts: 44
irq rutine


i wonder what is the best irq rutine to use for a demo ?


eks .

*=$1000

jrs $ff81
sei
lda #<int1
sta$0314
lda #>int2
sta$0315
lda #$7f
sta $dc0d
lda #$01
sta $d01a
lda #$1b
sta $d011
lda #$33
Sta $d012
cli
rts

int1 *= $1200


2010-06-08 07:11
Conrad

Registered: Nov 2006
Posts: 849
Have a look at this:
http://codebase64.org/doku.php?id=base:introduction_to_raster_i..

That version is pretty much standard for good productions, but the one you've shown on here will work fine as well. Just make sure you put JMP $EA31 (or JMP $EA7E or JMP $EA81) at the end of the IRQ block...


int1 *=$1200

  inc $d020
  dec $d020

  jmp $ea31    ; Returns from IRQ interrupt (using the kernal)
2010-06-08 07:13
enthusi

Registered: May 2004
Posts: 677
quite likely you wanna bank out Kernal ROM and then IRQ is triggered via $fffe/f.
2010-06-08 09:29
j0x

Registered: Mar 2004
Posts: 215
Quoting Conrad
int1 *=$1200

  inc $d020
  dec $d020

  jmp $ea31    ; Returns from IRQ interrupt (using the kernal)

Since you're doing a raster interrupt, you need to acknowledge the raster IRQ, by adding e.g. "dec $d019" to the interrupt code.
2010-06-08 17:27
Radiant

Registered: Sep 2004
Posts: 639
You could of course do pla tay pla tax pla rti manually instead of jmp $ea81. For most demos you probably have Kernal switched off in any case, so manually saving and restoring the IRQ handler affected registers is the way to go. I use zeropage variables:

    sta $02
    stx $03
    sty $04

    [...]

    lda $02
    ldx $03
    ldy $04
    rti


Self modifying code is equally fast and frees up three ZP locations if you need them:

    sta arestore + 1
    stx xrestore + 1
    sty yrestore + 1

    [...]

arestore:
    lda #0
xrestore:
    ldx #0
yrestore:
    ldy #0
    rti
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
Chesser/Blazon
zscs
deetsay
Weetibix
Guests online: 115
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 Triad  (9.3)
5 Censor Design  (9.3)
Top Diskmag Editors
1 Magic  (9.8)
2 hedning  (9.6)
3 Jazzcat  (9.5)
4 Elwix  (9.1)
5 Remix  (9.1)

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