Re: A86: Off and ret routine


[Prev][Next][Index][Thread]

Re: A86: Off and ret routine




In a message dated 98-11-21 19:44:03 EST, Cassidy Roop writes:

<< Is there a way to turn the calculator off from a program and then have
 it continue program execution?  I thought calling _calcoff ($4101?) did
 this but it goes to the homescreen when you turn it back on... >>

You need to trigger the APD for this.  The following (untested) routine should
do it:

ld a,1
ld ($C009), a
ld ($C00A), a              ;Set APD counter to 1
set 2,(iy+$08)
set 3,(iy+$08)             ;These flags must be set for APD to happen
halt                            ;APD will happen w/next interrupt
res 2,(iy+$08)
res 3,(iy+$08)             ;Reset flags

--David