> Hmmmm... quite simple.
> 
> Skipping the paging parts, assuming you have code at 16384-32767 and screen
> at 32768-65535, and ROM0 at 0-16383....
> 
> loop1:
>       ld b,50         ; this will sometimes give slightly more than a second,
>                       ; cos the code below will take some time to execute
>       halt            ; interrupts must be enabled. If you like, you could
>                       ; replace this with a scan-line check
>       djnz $-1
>       ld hl,32768
> 
>       ld a,(hl)       ; see below
>       inc a           ; see below
>       ld (hl),a       ; see below...
>       jr nc, loop1
>       ld bc,24576
> loop3:
>       inc hl
>       ld a,(hl)       ;
>       inc a           ;
>       ld (hl),a       ; ditto
>       jr nc, loop1
>       dec bc
>       ld a,b
>       or c
>       jr nz, loop3
>                       ;bc has got to 0 -- hit the end of the screen...
> 
>                       ;now if (hl)=0, it's finished...
>       ld a,(hl)
>       or a
>       ret z
>       jr loop1

Coudn't it been done even simpler?

loop1   ld hl,(32768+24576-1)
loop2   inc (hl)
        jr nc, loop2
loop3   dec hl
        inc (hl)
        jr nc,loop3
        bit 6,h         ; or 'ld a,h; or a,127'
        jr nz,loop1
        ret

Why wait for screen update? You won't bother to see them all
anyway :)

 -Frode 'not flaming'

-- 
Frode Tenneboe, ECP/PT, CERN, CH-1211 Geneva 23, Switzerland
[EMAIL PROTECTED]             http://www.himolde.no/~frodet

Reply via email to