;

; Game "Edd the Duck" - ZX-Spectrum

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

;

; BUGFIX pokes provided by Mr. Anonymous.

; BUGFIX patch provided by Einar Saukas.

;

; This patch solves the following problems in this game:

; * Level 7 is impossible to complete because it only has 19 stars instead of 20;

; * In level 7 there's also some graphical corruption.

;

; This patch is implemented as a program to load the original SpeedLock 7 release and apply all fixes automatically.

; This implementation is based on SpeedLock 7 loader from "Magnificent Seven" tape by Your Sinclair issue 73.

;

        org $ff0e

        ld hl,poke

        ld de,$5ba0

        ld bc,start-poke

        ld ($fe33),de

        ldir

        push ix

        ld de,$00c3

        jp $fe5d

poke:   ex de,hl

        ld hl,$0dfd

        ld ($a601),hl     ; POKE 42497,15: POKE 42498,255

        ld a,$0a

        ld ($a603),a      ; POKE 42499,248 (ice cream)

        ld hl,$f2f2

        ld ($a661),hl     ; POKE 42593,0: POKE 42594,0

        ld a,$f2

        ld ($a663),a      ; POKE 42595,0   (tree top corruption)

        ld hl,$f2f8

        ld ($a691),hl     ; POKE 42641,10: POKE 42642,0

        ld a,$da

        ld ($a693),a      ; POKE 42643,40  (tree lower corruption)

        ld hl,$f2f2

        ld ($a6c1),hl     ; POKE 42689,0: POKE 42690,0

        ld a,$f2

        ld ($a6c3),a      ; POKE 42691,0   (house top corruption)

        ld hl,$f2f2

        ld ($a541),hl     ; POKE 42305,0: POKE 42306,0

        ld a,$f2

        ld ($a543),a      ; POKE 42307,0   (grass1)

        ld hl,$f2f2

        ld ($a571),hl     ; POKE 42353,0: POKE 42354,0

        ld a,$f2

        ld ($a573),a      ; POKE 42355,0   (grass2)

        ld a,$22

        ld ($b0bf),a      ; POKE 45247,208

        ld hl,$98a2

        ld ($b0c1),hl     ; POKE 45249,80: POKE 45250,106

        ld hl,$f2f2

        ld ($b0c3),hl     ; POKE 45251,0: POKE 45252,0  (missing star)

        ex de,hl

        jp $fedf

start:  ld ix,$eeab       ; USR 65405

        ld de,$1063

        ld a,$ff

        scf

        call $0556

        jr nc,start

        xor a

        ld ($fefd),a

        jp $ef0a

