;Colour grabber - get image from ;screen - adapted from proc17 ;5/12/97 - takes value from RANDOMIZE.. ;Exits with the last used address org 24576 addpi1: ld hl,0 ld (selxy),hl inc l inc h ld (selwid),hl call sellec ret c ld hl,(23670) call gclip push hl pop bc ret ;Try to create a moving flashy ;box ala grabber... sellec: ld hl,(selwid) ld (temdim),hl ld hl,selxy call selloa ret c ld hl,(selxy) ld (temdim),hl ld hl,selwid selloa: ld (selpar),hl sello0: ld hl,(selpar) ld e,(hl) inc hl ld d,(hl) ex de,hl ld (temcoo),hl ld hl,(selxy) ld a,h srl a srl a srl a add 88 ld d,a ld a,h and 7 rrca rrca rrca add l ld e,a ld (attadd),de call prbox xor a ld (23560),a sello1: ld a,(23560) and a jr z,sello1 ld de,(attadd) call prbox ld de,(selpar) ld hl,temcoo cp 14 jr nz,sello9 scf ret sello9: cp 32 jr nz,sello8 and a ret sello8: sub 8 ld b,a jr nz,sellor dec (hl) sellor: dec b jr nz,sellod inc (hl) sellod: inc hl dec b jr nz,sellou inc (hl) sellou: dec b jr nz,selloc dec (hl) ;Check that our positions are ;ok.. selloc: ld bc,(temdim) inc de ld a,(hl) add b cp 25 jr nc,sello2 cp b jr c,sello2 ld a,(hl) ld (de),a sello2: dec hl dec de ld a,(hl) add c cp 33 jr nc,sello3 cp c jr c,sello3 ld a,(hl) ld (de),a sello3: ld hl,(selwid) ld a,h and a jr nz,sello4 inc h sello4: ld a,l and a jr nz,sello5 inc l sello5: ld (selwid),hl jp sello0 prbox: ld bc,(selwid) push af prbox0: push de push bc prbox1: ld a,(de) and 192 ld b,a ld a,(de) cpl and 63 or b ld (de),a inc e dec c jr nz,prbox1 pop bc pop hl ld de,32 add hl,de ex de,hl djnz prbox0 pop af ret ;Grab a clip from the screen ;Entry: hl=addy of where to put ;clip gclip: push hl ld hl,(selxy) ld a,h and 248 add 64 ld d,a ld a,h and 7 rrca rrca rrca add l ld e,a pop hl ;de=screen address ;hl=addy of where to dump ld bc,(selwid) ;depth grabl1: push de push bc ld bc,(selwid) ;width grabl2: push de ld b,8 grabl3: ld a,(de) ld (hl),a inc hl inc d djnz grabl3 dec d ld a,d rrca rrca rrca and 3 or 88 ld d,a ld a,(de) ld (hl),a inc hl pop de inc e dec c jr nz,grabl2 pop bc pop de ld a,d add 7 ld d,a call drow djnz grabl1 ret drow: inc d ld a,7 and d ret nz ld a,e add 32 ld e,a ret c ld a,d sub 8 ld d,a ret attadd: dw 0 selxy: dw 0 selwid: db 3 seldep: db 3 selpar: dw 0 temdim: dw 0 temcoo: dw 0 END