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: 2244
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: 11386
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: 686
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
REBEL 1/HF
Mike
Stratford/Xenon
Walt/Bonzai
lA-sTYLe/Quantum
sln.pixelrat
4gentE/ΤRIΛD
Inge/HVSC
iAN CooG/HVSC
LightSide
zscs
The MeatBall
t0m3000/hf^boom!^ibx
𝘁𝗡𝗚/FairLight
Hairdog/BOOM!^Dream
katon/Lepsi De
Guests online: 130
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 Layers  (9.6)
2 No Listen  (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 Graphicians
1 Mirage  (9.8)
2 Archmage  (9.7)
3 Pal  (9.6)
4 Carrion  (9.6)
5 Sulevi  (9.6)

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