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 > How to stop IRQ properly ?
2015-01-20 22:19
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
How to stop IRQ properly ?

sei
...
...
...
cli
.jsr ffe4
cmp #32
bne .

;want to stop all here, and jmp - CLEAN

how ?
there was some ROM routines you can call ?

is this enough ?

sei
lda #$ea
sta $0315
lda #$31
sta $0314
lda #0
sta $d01a
sta $dc0e
cli
jmp PROGRAM
2015-01-20 23:02
TheRyk

Registered: Mar 2009
Posts: 2062
There is a KERNAL routine $FC93 you might want to look at
http://unusedino.de/ec64/technical/aay/c64/romfc93.htm

Just skimmed the ROM-Listing, it should do pretty much what you're aiming at. Did not detect any potential conflicts with KERNAL JMP tables etc. you might have clobbered either. EDIT: that is, if you didn't mess up page $02.. from where that routine gets the default vector addresses... ;) Never explicitly used that one afair, though, no real experience with using it. Guess most people rather do those few bytes without KERNAL, maybe also to be on the sure side/know exactly what is poked...
2015-01-20 23:36
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
fc93 wont store 0315 always..
2015-01-20 23:45
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
improved:

sei
lda #$ea
sta $0315
lda #$31
sta $0314
jsr $ff84
jsr $ff81
lda #0
sta $d01a
sta $dc0e
jmp PROGRAM

no cli :)

anything else to consider ?
2015-01-21 04:14
chatGPZ

Registered: Dec 2001
Posts: 11108
it really depends on what exactly you are doing. generally something like
lda #$7f
sta $dc0d
sta $dd0d
lda #$00
sta $d01a
bit $dc0d
bit $dd0d
inc $d019

should do the trick - however, for something like a crack intro, you probably want to call these kernal functions as well, since you cant be sure things are coded correctly and dont rely on the default values:
$FF81/65409      Init Editor & Video Chips
$FF84/65412      Init I/O Devices, Ports & Timers
$FF87/65415      Init Ram & Buffers
$FF8A/65418      Restore Vectors
2015-01-21 06:40
Fungus

Registered: Sep 2002
Posts: 616
Be Aware that $ff8a also trashes memory at fd30 under the rom.

groepaz, did you copy/paste that out of my stable irq source? :D
2015-01-21 07:06
Zyron

Registered: Jan 2002
Posts: 2381
And $ff87 writes to $a000.
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
ibux/Artline Designs..
B.A.
Ko-Ko
Alakran_64
Apollyon/ALD
v3to/Oxyron^PriorArt
Guests online: 144
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 NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

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