16  
test_rndnoise.scl -   (,       )
test_rndframeshift.scl -   16     (-  ,  )
test_rndxyframeshift.scl -  ,   random  x+y (    )
test_xyframeshift.scl -    pixel > (frame+x+y)&0xf
test_chunk.scl -    x+y (    -  )
test_woolchunk.scl -    x+y (  ),      3 
        pixel > frame+achunkpixelnumber[pixelnumber])&0x0f

       (   50%    )

   R-Mode      :
        bit 0,d
        jr z,drawnoise_skipnewphase ;for R-Mode
        ld a,h
         cp rebyte/256+16 -(4*2)
         jr c,$+4
          sub 16
         add a,4*2
        ld h,a        
drawnoise_skipnewphase       
        inc d
        ld a,d
        and 7
        jp nz,drawnoisenchr
        ld a,h
         cp rebyte/256+16 -(1*2)
         jr c,$+4
          sub 16
         add a,1*2
        ld h,a        
        ...
drawnoisenchr

        
     realtime?     
frame+achunkpixelnumber[pixelnumber]    achunkpixelnumber[frame, pixelnumber]      

  1  - 
 : scrpixel = achunkscrpixel[pixel(4), frame(4), pixelnumber(4)] -   12 
        
  8  = 32 
  frame+pixelnumber = 4  ,    8  -    2 .

) pixel > frame+achunkpixelnumber[pixelnumber])&0x0f
;8  abcdefgh   -     
        pop bc ;%ccccggggddddhhhh
        ld l,b
        ld b,framepluspixelnumber1
        ld h,framepluspixelnumber2
        ld a,(bc) ;%d000h000
        rrca      ;%0d000h00
        or (hl)   ;%cd00gh00
        rrca      ;%0cd00gh0
        pop bc ;%aaaaeeeebbbbffff
        ld l,c
        ld h,framepluspixelnumber3
        or (hl)   ;%bcd0fgh0
        rrca      ;%0bcd0fgh
        ld l,b
        ld h,framepluspixelnumber4
        or (hl)   ;%abcdefgh
        ld (de),a
        inc e (d?)
;111 t/b ( 99 t/b  rrca,  4  ,  16,    )
       inc/dec h  ld h
       ,      ?

      (16   4   19-  22- b/b,   1.5)
   24,    ,      +
 48         (..   ), , 3D  (    ?       ,     3D  - ?   )

   3 ,  34 t/b,      8(   10) !    ,      ?

 128   2   R-Mode   4  ,     16 ,     (4R+4G+4B+4w)
    R-Mode?   4x4   ,         (    -     )   ?          
      R-Mode,       

   128  :   4R(M)+4G  8   ,    .
   128    12  (   8 ,  128    2,    ,   96 ( 16  ) +6..12 ,      pop:ld (),hl  LDI)   4R+4G+4B,    (     , ..  c2p  48000 ),    :
   :
- R screen1 (c2p)
- G screen0,   screen0
- B screen0,   screen0 (  )
- R screen1 (c2p)
- G screen0,   screen0
- B screen0,   screen0 (  )
- R screen1 (c2p)
- G screen0 (c2p)
   :
- B screen1 (c2p)
- R screen0,   screen0
- G screen0,   screen0 (  )
- B screen1 (c2p)
- R screen0,   screen0
- G screen0,   screen0 (  )
- B screen1 (c2p)
- R screen0 (c2p)
  ..
  16     3D  (    ,    3 )
  R-Mode48,    .
  RGB  ,    ,       !

     4    ( 256  ) -      64:
        pop bc ;4pix + 4pix
        ld l,b
        ld b,framepluspixelnumberRN
        ld a,(bc) ;%abcd0000
        or (hl)   ;%0000efgh
        ld (de),a
        inc e (d?)
;46 t/b (3   ), 16*2*256 = 8K ,  12K -   48K
    4  ( 256   65536)?     -  
      (17 * 17 =   256!)              
    _/  \_ (,  /-  -\)
     ?   !    ?  -      
   ?
  17   ,   
         (  +-1   )    (   )   

/*
)      -     ,     (     ,     3 )
      (...)
  ,     N1     N2,    ,   N3,    ,   N4,    %11111111
???     ???
        !!!    ,   ,  !

    3210,  3    (  )
1:
3232
13.3
3232
.313
2:
2323
3.31
2323
313.
3:
313.
2323
3.31
2323
4:
.313
3232
13.3
3232
5:
3232
.313
3232
13.3
6:
2323
313.
2323
3.31
7:
3.31
2323
313.
2323
8:
13.3
3232
.313
3232
   0,    9    16
    0,    ,     %11111111
   0,    3?


[        pop bc
        ld a,c
        and N1
        ld c,a
        ld a,b
        and N2
        or c
        ld (hl),a
        pop bc
        ld a,c
        and N3
        or (hl)
        ld c,a
        ld a,b
        and N4
        or c
        ld (de),a
        inc e
;105 t/b]
[
        ld a,(hl)
        inc l
        and c;N1
        ld d/e,a
        ld a,(hl)
        inc l
        and b;N2
        or d/e
        ld d/e,a
        ld a,(hl)
        inc l
        and N3
        or d/e
        ld d/e,a
        ld a,(hl)
        inc l
        and N2
        or d/e
        ld d/e,a
        1/2*push de
;99.5/105.5 t/b]
[
        ld a,(hl)
        inc l
        xor (hl)
        and c;N1
        xor (hl)
        inc l
        xor (hl)
        and b;N2
        xor (hl)
        inc l
        xor (hl)
        and N3
        xor (hl)
        inc l
        ld d/e,a
        1/2*push de
;89.5 t/b (and e...push af:inc sp   ,  16    ld (...),a   )]

        pop bc
        ld a,c
        xor b
        and l;N1
        xor b
        pop bc
        xor c
        and h;N2
        xor c
        xor b
        and N3
        xor b
        ld (de),a
        inc e
;74 t/b ( 73 t/b,  and e...ld (...),a)
*/




   R-Mode,   (rebyte    ,  ,   ,     ):
repic (0x3000) - 0xd000    (   fastmem)
rebyte (0x2000) - 0x6000 (slowmem)
repic1 (0x3000) - 0x9000 (   fastmem)
rebyte1 (0x2000) -    pg7 (slowmem) 0xe000
   lowmem 4   (  0x180+)
       2 ( ?)
 0x8000,0x1000
  

   (  mlz,  24K,   0x8000..0x8fff):
rebyte1.mlz -> pg7 rebyte1 (0xe000)
      
rebyte.mlz -> rebyte (0x6000)
repic1.mlz -> repic1 (0x9000)
repic.mlz -> repic (0xd000   )


    , ..     
   ? scr0  scr1   ,      

        pop bc ;4pix + 4pix ;slowmem
        ld l,c
        ld a,(hl) ;%abcd0000
        inc h
        ld l,b
        or (hl)   ;%0000efgh
        ld (de),a ;slowmem
        inc e ;47
        pop bc ;4pix + 4pix ;slowmem
        ld l,b
        ld a,(hl) ;%0000efgh
        dec h
        ld l,c
        or (hl)   ;%abcd0000
        ld (de),a ;slowmem
        inc e ;+47 = 94t/ 
    slowmem  slowmem,     (6  slowmem)
       + ? 188t
  ,    bc, ..    
        ld a,0x5x
        out (0xfd),a ;+18t -        R-Mode,   ,      - 0  7
        ; exx:out (c),d/e:exx = 20t,      
 206t + wait (12  slowmem,   6  ,  100t  +2)
   
    de
     ,     
 de     (+1 pop   inc e)
 ,        32/4 = 8  
         ,    16  ( 1   24   )
    (48+23=71  ,     72?),    <=12  ( 1   32-33   )
     !!!

      = 768*2*5.5 = 8448 ( 14362), .. >37  ,  <11    +2
    +2:
;+112
         exx
         out (c),d/e ;screen change at +128 (nowait)
         exx
         inc e:inc bc / pop de ;for end of line
;+142
        pop bc ;4pix + 4pix ;fastmem
        ld l,c
        ld a,(hl) ;%abcd0000 ;slowmem (nowait)
        inc h
        ld l,b
        or (hl)   ;%0000efgh ;slowmem (nowait)
        ld (de),a ;slowmem
        inc e ;47
;+189
        pop bc ;4pix + 4pix
        ld l,b
        ld a,(hl) ;%0000efgh ;slowmem (nowait)
        ld l,c
;+214
        dec h
        or (hl)   ;%abcd0000 ;slowmem (nowait)
         pop bc ;4pix + 4pix ;!!!!!!!
;+235 = +9
        ld (de),a ;slowmem (write at t-state +16)
;+16
        inc e
        ld l,c
;+24
        ld a,(hl) ;%abcd0000 ;slowmem (+32(31))
;+32
        inc h
        ld l,b
;+40
        or (hl)   ;%0000efgh ;slowmem (+48(47))
;+48
        ld (de),a ;slowmem (write at t-state +56(55))
;+56
        pop bc ;4pix + 4pix
;+66
         inc e
         nop ;!!!!!!!!!!!!!!!
        ld l,b
;+78
        ld a,(hl) ;%0000efgh ;slowmem (+88(85))
;+88
        dec h
        ld l,c
;+96
        or (hl)   ;%abcd0000 ;slowmem (+104(103))
;+104
        ld (de),a ;slowmem (write at t-state +112(111))
;+112

  -    3+5+3 = 11 

   (       ,      )?
        
    :
-     32     ,   pop de   (   )
- jp nz     ,     
-  inc d,   e (4    )
-     
          ?
,  16  (8+8)       h -   (    , ..    )
     h   32 ?
 ld h,N     ???     3 !   ,     +8 !
[   h     ?
   5  :
<body>
jr nz
inc d
<body>
jr nz
inc d
ld h,
<body> - ,   +7 
<body>
jr nz
inc d
<body>
jr nz]

mcloop
;max +122 (119-1, 120-1  126-1 (ld h,N))
         exx
         out (c),d ;screen change at +138 (nowait)
         exx
;+142
        pop bc ;4pix + 4pix
        ld l,c
        ld a,(hl) ;%abcd0000 ;slowmem
        inc h
        ld l,b
        or (hl)   ;%0000efgh ;slowmem
        ld (de),a ;slowmem
;+185
        pop bc ;4pix + 4pix
        ld l,b
        ld a,(hl) ;%0000efgh ;slowmem
        ld l,c
;+210
        inc e
        dec h
        or (hl)   ;%abcd0000 ;slowmem
         pop bc ;4pix + 4pix ;!!!!!!!!!
;+235 = +7
        ld (de),a ;slowmem (write at t-state +16)
;+16
        inc e
        ld l,c
        ld a,(hl) ;%abcd0000 ;slowmem
        inc h
        ld l,b
        or (hl)   ;%0000efgh ;slowmem
;+48
        ld (de),a ;slowmem (write at t-state +56(55))
;+56
        pop bc ;4pix + 4pix
;+66
        inc e
         nop ;!!!!!!!!!!!!!!!
        ld l,b
        ld a,(hl) ;%0000efgh ;slowmem
        dec h
        ld l,c
        or (hl)   ;%abcd0000 ;slowmem
;+104
        ld (de),a ;slowmem (write at t-state +112(111))
;+112
;-----------------
         inc e
         exx
         out (c),e ;screen change at +132 (nowait) -   !
         exx
;+136
        pop bc ;4pix + 4pix
        ld l,c
        ld a,(hl) ;%abcd0000 ;slowmem
        inc h
        ld l,b
        or (hl)   ;%0000efgh ;slowmem
        ld (de),a ;slowmem
        inc e ;47
;+183
        pop bc ;4pix + 4pix
        ld l,b
        ld a,(hl) ;%0000efgh ;slowmem
        ld l,c
;+208
        dec h
        or (hl)   ;%abcd0000 ;slowmem
         pop bc ;4pix + 4pix
;+229 = +1
        ld (de),a ;slowmem (write at t-state +8)
;+8
        inc e
        ld l,c
        ld a,(hl) ;%abcd0000 ;slowmem
        inc h
        ld l,b
        or (hl)   ;%0000efgh ;slowmem
;+40
        ld (de),a ;slowmem (write at t-state +48(47))
;+48
        pop bc ;4pix + 4pix
;+58
        inc e
         nop ;!!!!!!!!!!!!!!!
        ld l,b
        ld a,(hl) ;%0000efgh ;slowmem
        dec h
        ld l,c
        or (hl)   ;%abcd0000 ;slowmem
;+96
        ld (de),a ;slowmem (write at t-state +104(103))
;+104
         inc e
         jr nz,mcloop ;+120
;+115
        inc d
;+119
        ...


          (  )
