[A83] Grey scale(and enterlacing, is that the right word for it?)


[Prev][Next][Index][Thread]

[A83] Grey scale(and enterlacing, is that the right word for it?)




Ok, i've though a bit on the comments made on grey scale before and how to do 
it, including drawing a pixel from 1 buffer, then a pixel from the other 
buffer and stuff, and i have this old(er) code from a previous talk about 
grey scale.  This is how i did it:
2 buffers, buffer a and buffer b
i go through and i and buffer a with %10101010 and then and buffer b with 
%01010101 and or them together.
I then send it out to the port.  Is this anything like we were talking about?
I've tried running it on the emulator and it has faint lines, and i'm looking 
into how i would flip the buffers(w/o copying of course) every line.  any 
ideas?

the code:

fastCopy1:
    di                  ; 4
    ld  a,$80               ; 7
    out ($10),a             ; 11
    ld  hl,gbuf-12-(-(12*64)+1)     ; 10
    exx                 ; 4
    ld  hl,SafeRam1-12-(-(12*64)+1) ; 10
    exx                 ; 4
    ld  a,$20               ; 7
    ld  c,a             ; 4
fastCopyAgain1:
    ld  b,64                ; 7
    inc c               ; 4
    ld  de,-(12*64)+1           ; 10
    out ($10),a             ; 11
    add hl,de               ; 11
    exx                 ; 4
    ld  de,-(12*64)+1           ; 10
    add hl,de               ; 11
    ld  de,10               ; 10
    exx                 ; 4
    ld  de,10               ; 10
fastCopyLoop1:
    add hl,de               ; 11
    inc hl              ; 6
    inc hl              ; 6
    ld  a,(hl)              ; 7
    exx                 ; 4
    ld b,%10101010              ; 7
    and b                   ; 4
    ld c,a                  ; 4
    add hl,de               ; 11
    inc hl              ; 6
    inc hl              ; 6
    ld  a,(hl)              ; 7
    ld b,%01010101              ; 7
    and b                   ; 4
    add a,c                 ; 4
    exx                 ; 4
    out ($11),a             ; 11
    djnz    fastCopyLoop1           ; 13/8
    ld  a,c             ; 4
    cp  $2B+1               ; 7
    jr  nz,fastCopyAgain1       ; 10/1
    ret                 ; 10

fastCopy2:
    di
    ld  a,$80               ; 7
    out ($10),a             ; 11
    ld  hl,SafeRam1-12-(-(12*64)+1) ; 10
    exx                 ; 4
    ld  hl,gbuf-12-(-(12*64)+1)     ; 10
    exx                 ; 4
    ld  a,$20               ; 7
    ld  c,a             ; 4
    jp fastCopyAgain1           ; 10




Follow-Ups: