A82: NASRWARP


[Prev][Index][Thread]

A82: NASRWARP



Sorry for the long paste, but for some reason NASRWARP doesn't work with Ash
(I'm sure you already knew that tho)
I know at least three ppl want this fixed so Dying Eyes can be ported to Ash.
please help
this routine will display a blank screen:

NASRWARP:    
        push    bc
        ex      de,hl
        call FIND_PIXEL			;;changed from ROM_CALL(FIND_PIXEL) for Ash
        ld      bc,GRAPH_MEM		;;changed from $fc00 for Ash
        add     hl,bc
        ld      (PicCoor),hl
        ex      de,hl
        ld      b,$ff
Patch:
        rla
        inc     b
        jr      nc,Patch
        ld      a,(hl)
        ld      c,a      
        inc     hl
        ld      a,(hl)
        ld      (offset),a
        ld      a,b   
        ld      e,c
        cp      (hl)
        jr      c,DS1
        inc     e
DS1:
        inc     hl
        ld      a,(hl)
        ld      d,a
        inc     hl
YLoop:            
        push    bc 
        push    de
        ld      b,8
        ex      de,hl
        ld      hl,TempLine
InitTempLineLoop:
        ld      (hl),$ff
        inc     hl
        djnz    InitTempLineLoop
        ex      de,hl
	ld	a,(NASR_Status)
	cp	0
	jr	z,NASRErase
NASRDraw:
        ld      b,0
        ld      de,TempLine
        ldir       
	jr	NASRDrawFin
NASRErase:
	ld	b,c
	ld	hl,TempLine
LoadEmpty:
	ld	(hl),0
	inc	hl
	djnz	LoadEmpty
NASRDrawFin:
        pop     de
        pop     bc
        push    hl
        push    bc         
        push    de
        ld      d,b
        ld      a,b
        cp      0
        jr      z,skipshift
SpriLoop1:
        ld      a,b    
        ld      HL,TempLine
        ld      b,e
        scf
SpriLoop2:        
        rr      (HL)
        inc     HL
        djnz    SpriLoop2
        ld      b,a
        djnz    SpriLoop1        
        ld      b,d
skipshift:
        ld      a,$ff           ;fill accumulator
        inc     b
mask1:
        srl     a               ;make the mask
        djnz    mask1           ;something like
        scf                     ;00001111 ->
        rl      a                        
        ld      hl,(PicCoor)    ;implement the mask
        or      (hl)            ;this preserve the 0 bits
        ld      hl,TempLine   ;become xxxx1111
        and     (hl)            ;when anded, become
        ld      (hl),a          ;xxxxyyyy
        ld      b,d             ;retrieve b
        ld      a,(offset)
        dec     a
        sub     b
        jr      nc,skip
        sub     248
skip:
        ld      b,a
        inc     b
        ld      a,$ff
mask2:               
        sla     a
        djnz    mask2
        scf
        rr      a
        dec     e
        ld      hl,(PicCoor)
        ld      d,0
        add     hl,de
        or      (hl)
        ld      hl,TempLine
        add     hl,de
        and     (hl)
        ld      (hl),a
        inc     e
        ld      c,e
        ld      hl,(PicCoor)
        ld      de,12			;;Changed from 16 for Ash
        push    hl
        add     hl,de
        ld      (PicCoor),hl
        pop     hl
        ld      de,TempLine
        ex      de,hl
        ld      b,0
        ldir      
        pop     de
        pop     bc
        pop     hl
        dec     d
        jp      nz,YLoop		;;Changed from jr nz, YLoop for Ash
        pop     bc
		ROM_CALL(DISP_GRAPH)	;;Added for Ash
        ret

TIA,

~Adamman