| |
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 |
|
| |
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... |
| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
fc93 wont store 0315 always.. |
| |
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 ? |
| |
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
|
| |
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 |
| |
Zyron
Registered: Jan 2002 Posts: 2381 |
And $ff87 writes to $a000. |