; ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; ::								::
; ::	Modulprotections for Action Replay II & Nordic Power	::
; ::								::
; ::			by Electron / Decade			::
; ::								::
; ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


; 1. Against Action Replay II (perhaps III)

	move.l	#CopList+1,$dff080	; OwnCopList + 1 !!!!!
	move.l	#$fc0002,$c		; your own routine, here a reset

; Thiz lines in your source will make the Action
; Replay II (perhaps III ?) fuck up if the 'FREEZE' button is pressed.
; The important thing is to have a ODD copperlistaddress, then the
; Action Replay jumps to the address found in $c !


; 2. Against Nordic Power & Game brakes ("Bremsen")

	move.l	4,a6				; Exec
	lea	GFXlibrary,a1
	jsr	-$0198(a6)			; OldOpenLib
	move.l	d0,a1
	move.l	38(a1),CopSave			; Save CopAdr
	jsr	-$019e(a6)			; CloseLib
	lea	$dff000,a6
	move.w	$1c(a6),IntenaSave		; INTENAread
	move.w	#$7fff,$09a(a6)
	move.w	#$7fff,$09c(a6)
	move.w  #%1100000000100000,$9a(a6)	; INTENA

	lea	AlertCopP(pc),a0
	move.l	#AlertCopList,d0
	move.w	d0,6(a0)
	swap	d0
	move.w	d0,2(a0)

	move.l	$006c,InterruptSave		; Save old Interrupt
	move.l	#Interrupt,$6c

	move.l	#CopList,$080(a6)		; Set new Cop
 	move.w	#$4421,$88(a6)

	move.w	#-1,$2e(a6)			; Enable Copper to blit !

WaitMouse:
	btst	#6,$bfe001
	bne.s	WaitMouse

	move.l	InterruptSave,$006c		; Set old Interrupt
	move.l	CopSave,$080(a6)
 	move.w	#$4421,$88(a6)
	move.w	#$7fff,$09a(a6)
	move.w	IntenaSave(pc),d0
	ori.w	#$8000,d0
	move.w	d0,$9a(a6)
	clr.l	d0				; Clear Cli Error Flag
	rts	

GFXlibrary:	dc.b	'graphics.library',0,0
InterruptSave:	dc.l	0
IntenaSave:	dc.w	0
CopSave:	dc.l	0

Interrupt:
	movem.l	d0-d7/a0-a6,-(a7)
	lea	$dff000,a6
	btst	#5,$1f(a6)
	beq.s	Nix
	move.l	#CopList,$80(a6)		; Normal old Cop
	move.w	#"D!",$88(a6)
	move.w	#$c000,$09a(a6)
	move.w	#$20,$09c(a6)
Nix:
	movem.l	(a7)+,d0-d7/a0-a6
	rte

CopList:
	dc.l	$01800000			; Red !

;	Place your own CopList here !

 	dc.l	$FfdfFFFE
	dc.l	$3811FFFE			; Last possible waitpos
AlertCopP:
	dc.l	$00800000			; New CopAddress
	dc.l	$00820000
	dc.l	$00884421
	dc.l	-2

AlertCopList:
	dc.l	$01800f00			; Red !
	dc.l	$38dffffe
	dc.l	$00400100
	dc.l	$00420000
	dc.l	$0044ffff
	dc.l	$0046ffff
	dc.l	$00660000
	dc.l	$00540000			; Start: Kill ExecB,Traps
	dc.l	$00560000
	dc.l	$00580000			; Go !
	dc.l	-2

; As you can see the Nordic Power protection is a bit longer, but with
; it also all brakes ("Bremsen") will force a GURU or reset.
; It works like this: The Copper installs at the end the new Copperlist
; which advises the blitter to clear the range $0 - $20000
; If the Interrupt isn't called and the old CopperList isn't restored,
; this will force a Guru (for sure hehehe ...), sometimes you have
; to switch your computer off, because the keyboard does not work anymore

; Question, suggestions, improvements ?
; Leave me a message on the LOST ISLAND DECADE WHQ - +49-0-2137-70787  
                    
;                   Bye ... Electron / Decade


; By the way ... I've NOT tested these routines on other Amigas, but
; they work quite fine on mine.

