Reroute NMI (RESTORE key) / location of CIA 1&2

Started by MIRKOSOFT, December 07, 2009, 03:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MIRKOSOFT

Hi!

I want to ask how to reroute NMI (pressing RESTORE key) - replacing call of original NMI routine - rewritting vectors?

Also, I'm not sure - where in RAM is location of CIA1 and CIA2 ? (on C64 it is $DC00/$DD00)

Thanks for every help.

Miro
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster and more!!!

http://www.mirkosoft.sk

SmallCleverDinosaur

This is becoming a standard answer; check "Mapping the C128" :)

On page 95, the vector at addresses 792-793 is described. It is the indirect NMI-vector through which all NMI interrupts are being routed.

The CIA's are in the I/O section which is not actually in RAM, but "above" RAM. They are located at the same addresses as in the C64. Again, see "Mapping the C128" for details (page 465-493) :)
Ignorance is a precious thing. Once lost, it can never be regained.

MIRKOSOFT

Hi!

Yes, now RESTORE key works.
My own subroutine ends with RTI, but problem is here: after pressing RESTORE key my routine works and when ends, computer beeps and then goes to MONITOR, so there must be st. wrong, can you help me?

Thank you very much.

Miro
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster and more!!!

http://www.mirkosoft.sk

Hydrophilic

Before the JMP($318), the KERNAL also pushes MMU.CR, A, X, and Y on stack.  You must remove them from stack before RTI or computer will crash (Monitor).

The easy way to end your program is JMP $FF33, and this should work in any BANK (except 4, 5, 6, or 7).  Here is the disassembly:

. 0ff33  pla
. 0ff34  sta $ff00
. 0ff37  pla
. 0ff38  tay
. 0ff39  pla
. 0ff3a  tax
. 0ff3b  pla
. 0ff3c  rti
I'm kupo for kupo nuts!