| |
Trap
Registered: Jul 2010 Posts: 222 |
Best practice IRQ recovery
Hi,
Here's a little newbie question. Sorry, I'm still learning this shit and it's really complicated :(
I have kernel off ($01=$35) and I am running IRQ's using the normal $fffe/$ffff vectors.
I want to exit from this and call a prepacked piece of code (in this case something packed with TinyCrunch).
I tried restoring the IRQ vectors and jump to the packer. However, it just hangs. I tried some other things but all gave the same result. The only thing that worked was when I did this:
sei
lda #$36
sta $01
jsr $ff81
jmp unpacker
The problem of course is that it resets the VIC which isn't really great for my situation.
So, my question:
What is the correct/proper way to exit from a part and go to the next? preferably not using kernal routines :|
Thank you.
Trap |
|
... 78 posts hidden. Click here to view all posts.... |
| |
TWW
Registered: Jul 2009 Posts: 541 |
Best of both worlds :)
// Disable all CIA interrupts
lda #$7f
sta $dc0d
sta $dd0d
// Acknowlege any pending CIA iterrupts
lda $dc0d
lda $dd0d
|
| |
Krill
Registered: Apr 2002 Posts: 2825 |
Quoting Oswaldanyone who didnt spent years using these registers by hex values raise their hands. nobody? good :) Some people got into C-64 coding only recently.
Quote:if you code like this, and then you see your code in monitor, you will have no clue what part of your code you see. VICEmon symbol files have been invented. \=D/
Quote:same goes for source code thats programmed as a script. Please elaborate. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11100 |
TWW: there are no pending interrupts after disabling them (or to be precise, they'd still trigger, before you can even ACK, the original handler will take care of them) |
| |
TWW
Registered: Jul 2009 Posts: 541 |
GPZ: This is done inside a sei-cli raster IRQ setup to ensure no accidental CIA IRQ triggers after cli'ing which may have activated between the sei and the point you actually disable them. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11100 |
so DONT USE SEI/CLI. *sigh* |
| |
TWW
Registered: Jul 2009 Posts: 541 |
This was posted in response to the discussion above regarding $dc0d vs CIA1_REG whatever above by Oswald/Krill.
*sight* yourself... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11100 |
>_< |
| |
Frantic
Registered: Mar 2003 Posts: 1627 |
GPZ: How about writing that SEI/CLI rant at https://codebase64.org/doku.php?id=base:interrupts ? :D |
| |
chatGPZ
Registered: Dec 2001 Posts: 11100 |
Should do that, some day. Better yet, trick cjam into doing it :o) |
| |
Frantic
Registered: Mar 2003 Posts: 1627 |
@CJam: Groepaz said you had promised to write that anti SEI/CLI rant at https://codebase64.org/doku.php?id=base:interrupts We are waiting. |
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 - Next |