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 Productions > Richard's Interrupts
2002-05-06 03:13
Stryyker

Registered: Dec 2001
Posts: 465
Richard's Interrupts

I thought this would be a better place to discuss your problem :)

Following the program makes no sense to me.

To end interrupts, you can JMP to a number of Kernal addresses, keyboard/withough keybaord scanning etc.

An alternative is RTI (ReTurn from Interrupt). This needs a little work if you use interrupt via $0314/$0315. You will need to PLA, TAX, PLA, TAY, PLA, RTI (maybe swap TAX with TAY as my memory fails me).

Most of the JMP $EA81 will not work as you branch before it is executed. You can do some embedding of interrupts within the current one but you will lose the purpose of what you want (double raster interrupt for stable rasters is a simple example).

I don't fully understand what you are trying to achieve and how but maybe somethink like:

INT1
lda #$00
sta $d020
sta $d021
lda #$7c
ldx #<INT2
ldy #>INT2
jmp FINint

INT2
lda #$06
sta $D020
sta $D021
jsr $1003
lda #$30
ldx #<INT1
ldy #>INT1
jmp FINint

FINint
sta $D012
stx $0314
sty $0315
lda #$01
sta $D019
jmp $EA81

It's only a guess but your bit in the question was a bit messy :)
2002-05-06 08:42
T.M.R
Account closed

Registered: Dec 2001
Posts: 749
A quick comment: Richard's IRQ is (in part) mine from the "Hex Files" articles in Commodore Zone. It works by having a central routine which catches all interrupt requests, plays with $D019 and then checks a label to see which actual split to call.

i hasten to add it doesn't normally look like that, not sure what went wrong...? i can't guarantee the following to be the best method, but it goes - if the tabs vanish, sorry in advance! =-)

rstr1p = $00
rstr2p = $80
rstr3p = $c0

rn = $0340

* = $0900

sei
lda #$01
sta rn
lda #<int
sta $0314
lda #>int
sta $0315
lda #$7f
sta $dc0d
sta $dd0d
lda #rstr1p
sta $d012
lda #$1b
sta $d011
lda #$01
sta $d019
sta $d01a
cli

lok jmp lok

int lda $d019
and #$01
sta $d019
bne ya
jmp $ea81

ya lda rn
sta $d020
cmp #$02
beq rout2
cmp #$03
beq rout3

rout1 lda #$02
sta rn
lda #rstr2p
sta $d012
jmp $ea81

rout2 lda #$03
sta rn
lda #rstr3p
sta $d012
jmp $ea81

rout3 lda #$01
sta rn
lda #rstr1p
sta $d012
jmp $ea31
2002-05-06 16:44
Richard

Registered: Dec 2001
Posts: 619
Okay, thanks guys, I'll check it out. And try and understand these routines. Hopefully I'll save a lot of rastertime.
2002-05-08 15:29
Dosoo
Account closed

Registered: Apr 2002
Posts: 32
Why to keep the KERNAL enabled at all? If you take the kernal off the you can put the interrupt address straight the $fffe and $ffff

No hassling needed, only remember to store all the index registers beforehand (no need to use stack, simple sta/stx/sty is enough).
2002-05-08 16:24
cadaver

Registered: Feb 2002
Posts: 1153
Very true, switching Kernal off saves a lot of cycles. Though, I guess Richard isn't yet making so extreme programs that each cycle would be required (no offense at all!), and he might also be using Kernal/Basic routines.
2002-05-08 17:18
Richard

Registered: Dec 2001
Posts: 619
Quote: Why to keep the KERNAL enabled at all? If you take the kernal off the you can put the interrupt address straight the $fffe and $ffff

No hassling needed, only remember to store all the index registers beforehand (no need to use stack, simple sta/stx/sty is enough).


What sort of listing do you use to switch off the Kernal?
2002-05-09 08:44
T.M.R
Account closed

Registered: Dec 2001
Posts: 749
Quote: Why to keep the KERNAL enabled at all? If you take the kernal off the you can put the interrupt address straight the $fffe and $ffff

No hassling needed, only remember to store all the index registers beforehand (no need to use stack, simple sta/stx/sty is enough).


The main reason the KERNEL is enabled is because the interrupt comes from a *beginners* course in coding - i don't know about anyone else, but i think banking everything out is a little too advanced for that...? =-)

(That said, i personally leave the KERNEL banked in on my stuff, but i'm lazy. =-)
2002-05-09 10:54
Stryyker

Registered: Dec 2001
Posts: 465
lda #$35
sta $01

switches out the BASIC and kernal ROMs but keeping the IO area switched in. Some precautions are needed or else you'll crash :)
2002-05-09 17:57
T.M.R
Account closed

Registered: Dec 2001
Posts: 749
Quote: lda #$35
sta $01

switches out the BASIC and kernal ROMs but keeping the IO area switched in. Some precautions are needed or else you'll crash :)


Erm, where are the *interupts* then...? =-)
2002-05-10 01:54
Stryyker

Registered: Dec 2001
Posts: 465
Someone earlier pointed out the interrupt (IRQ) addresses when the kernal is switched out. Richard asked for alisting to swtich out the ROM, so I did :)
2002-05-10 08:54
T.M.R
Account closed

Registered: Dec 2001
Posts: 749
Quote: Someone earlier pointed out the interrupt (IRQ) addresses when the kernal is switched out. Richard asked for alisting to swtich out the ROM, so I did :)

Well, it's a little more complex than that, as we both (but Richard probably doesn't) know. Tell you what, you okay with Richard sending you his source when he tries to do it and it doesn't work...?

(He sent it to me already, it must be someone else's go surely? =-)
 
... 5 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
d0c
Didi/Laxity
bugjam
The Human Co../Maste..
Jazzcat/Onslaught
Jammer
Beast/Crescent
Ghost/Quantum
t0m3000/ibex-crew
Marco/DDM
Fritske
kbs/Pht/Lxt
Guests online: 122
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 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.8)
4 Acidchild  (9.7)
5 Starlight  (9.6)

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