-
Notifications
You must be signed in to change notification settings - Fork 0
/
newcop.inc
40 lines (40 loc) · 1.26 KB
/
newcop.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
;*******************************************************************************
; Purpose: Special COP reset sequence for DZ/FL and compatible derivatives
; Input : None
; Output : None
; Note(s):
#ifmdef COP
#Drop COP
#endif
COP macro #SAVE# ;kick the COP watchdog
#ifdef NO_COP||!COP
mexit
#endif
#ifparm ~1~ = #SAVE#
#ifdef KickCop
merror KickCop proc is already defined
#endif
#push
#MapOff
#Cycles
KickCop proc
psha
lda #$55
sta COP
coma
sta COP
pula
rtc
KICKCOP_CYCLES equ :cycles
#pull
mexit
#endif
#ifdef KickCop
#temp1 :ocycles
#temp2 :cycles
call KickCop
#temp :cycles+KICKCOP_CYCLES
#Cycles :temp1
#Cycles :temp2+:temp
#endif
endm