;

; Game "Bride of Frankenstein" - ZX-Spectrum

; http://www.worldofspectrum.org/infoseekid.cgi?id=0000700

;

; BUGFIX poke provided by Battle Bunny (JimG).

; BUGFIX patch provided by Einar Saukas.

;

; This patch solves the following problem in this game:

; * A player attacked near a wall or closed door always gets stuck, thus loosing the game.

;

; This patch is implemented as a program to load the original SpeedLock 4 release and apply this fix automatically.

; This implementation is loosely based on SpeedLock 4 loader by Jon North from Your Sinclair issue 30.

;

	org $5b00

	ld hl,$e4ed

	ld sp,$b7ff

	ld ix,numb

        ld b,$06

loop:   push bc

	ld b,$00

        ld c,(ix+$00)

	inc ix

	ld de,$5748

	push hl

	push bc

	ldir

	ld hl,$574b

	ld a,(hl)

	cp $36

	jr nz,skip

	ld (hl),$00

skip:   ex de,hl

	ld (hl),$c9

	ld e,$96

	call $5748

	pop bc

	pop hl

	add hl,bc

	pop bc

	djnz loop

	ld hl,$ee56

	ld de,$f9ef

	ld bc,$0400

	ldir

	ld hl,$fd5a

	ld (hl),$00

	ld hl,poke

	ld ($fd2a),hl

	jp $fcf1

numb:	defb $10, $18, $32, $0e, $19, $16

poke:   ld a,$05

	ld ($9dff), a            ; POKE 40447,5

	ld sp,$6977

	jp $8590

