Subversion Repositories Kolibri OS

Rev

Rev 260 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1.   encoding_raw:
  2.     DEBUGF 1,'RAW\n'
  3.  
  4.     mov   ax,[frame.y]                        ;
  5.     mov   bx,[screen.width]                   ;
  6.     mul   bx                                  ;
  7.     shl   edx,16                              ;
  8.     mov   dx,ax                               ; [screen.width]*[frame.y]
  9.     movzx eax,[frame.x]
  10.     add   edx,eax                             ; [screen.width]*[frame.y]+[frame.x]
  11.  
  12.     mov   eax,3                               ;
  13.     mul   edx                                 ; ([screen.width]*[frame.y]+[frame.x])*3
  14.  
  15.     add   eax,framebuffer_data                ;
  16.     push  eax                                 ; framebuffer_data+([screen.width]*[frame.y]+[frame.x])*3
  17.  
  18.     mov   ax,[frame.width]                    ;
  19.     mov   bx,3                                ;
  20.     mul   bx                                  ;
  21.     shl   edx,16                              ;
  22.     mov   dx,ax                               ; [frame.width]*3
  23.  
  24.     pop   eax                                 ;
  25.     add   edx,eax                             ; framebuffer_data+([screen.width]*[frame.y]+[frame.x])*3+[frame.width]*3
  26.     push  eax                                 ;
  27.     push  edx                                 ;
  28.  
  29.     mov   ax,[frame.height]                   ;
  30.     dec   ax                                  ;
  31.     mov   bx,3                                ;
  32.     mul   bx                                  ;
  33.     mov   bx,[screen.width]                   ;
  34.     mul   bx                                  ;
  35.     shl   edx,16                              ;
  36.     mov   dx,ax                               ;
  37.     mov   ecx,edx                             ;
  38.     pop   edx                                 ;
  39.     add   ecx,edx                             ; mov ecx,edx+([frame.height]-1)*[screen.width]*3
  40.     pop   ebx
  41.  
  42.    .pixelloop32:
  43.     cmp   ebx,ecx
  44.     jge   next_rectangle
  45.  
  46. ;    add   esi,2           ; 32 bit code RAW - OK
  47. ;    mov   al,[esi]        ;
  48. ;    mov   [ebx],al        ;
  49. ;    inc   ebx             ;
  50. ;    dec   esi             ;
  51. ;                          ;
  52. ;    mov   al,[esi]        ;
  53. ;    mov   [ebx],al        ;
  54. ;    inc   ebx             ;
  55. ;    dec   esi             ;
  56. ;                          ;
  57. ;    mov   al,[esi]        ;
  58. ;    mov   [ebx],al        ;
  59. ;    inc   ebx             ;
  60. ;    add   esi,4           ;
  61.  
  62. ;    push  ecx             ; 16 bit code RAW
  63. ;    mov   cl,51
  64. ;
  65. ;    mov   ax,[esi]        ;
  66. ;        xchg  al,ah
  67. ;    and   al,00011111b    ;
  68. ;        xchg  al,ah
  69. ;    mul   cl
  70. ;    mov   [ebx],al        ;
  71. ;    inc   ebx             ;
  72. ;
  73. ;    mov   ax,[esi]        ;
  74. ;        xchg  al,ah
  75. ;    shr   ax,5            ;
  76. ;        xchg  al,ah
  77. ;    and   al,00011111b    ;
  78. ;    mul   cl
  79. ;    mov   [ebx],al        ;
  80. ;    inc   ebx             ;
  81. ;
  82. ;    mov   ax,[esi]        ;
  83. ;    xchg  al,ah
  84. ;    shr   ax,10           ;
  85. ;    and   al,00011111b    ;
  86. ;    mul   cl
  87. ;    mov   [ebx],al        ;
  88. ;    inc   ebx             ;
  89. ;
  90. ;    inc   esi             ;
  91. ;    inc   esi             ;
  92. ;    pop   ecx
  93.  
  94.     push  ecx             ; 8 bit code RAW - OK
  95.     mov   cl,85           ;
  96.                           ;
  97.     mov   al,[esi]        ;
  98.     shr   al,4            ;
  99.     and   al,3            ;
  100.     mul   cl              ;
  101.     mov   [ebx],al        ;
  102.     inc   ebx             ;
  103.                           ;
  104.     mov   al,[esi]        ;
  105.     shr   al,2            ;
  106.     and   al,3            ;
  107.     mul   cl              ;
  108.     mov   [ebx],al        ;
  109.     inc   ebx             ;
  110.                           ;
  111.     mov   al,[esi]        ;
  112.     and   al,3            ;
  113.     mul   cl              ;
  114.     mov   byte[ebx],al    ;
  115.     inc   ebx             ;
  116.     inc   esi             ;
  117.     pop   ecx             ;
  118.  
  119.  
  120.     cmp   ebx,edx
  121.     jl    .pixelloop32
  122.  
  123.     push  edx
  124.     push  ebx
  125.     mov   ax,[screen.width]
  126.     mov   bx,3
  127.     mul   bx
  128.     shl   edx,16
  129.     mov   dx,ax
  130.     mov   eax,edx
  131.     pop   ebx
  132.     pop   edx
  133.  
  134.     add   ebx,eax ; eax = [screen.width]*3
  135.     add   edx,eax
  136.  
  137.     push  edx
  138.     push  ebx
  139.     mov   ax,[frame.width]
  140.     mov   bx,3
  141.     mul   bx
  142.     shl   edx,16
  143.     mov   dx,ax
  144.     mov   eax,edx
  145.     pop   ebx
  146.     pop   edx
  147.  
  148.     sub   ebx,eax ; eax = [frame.width]*3
  149.  
  150.     jmp   .pixelloop32
  151.  
  152.  
  153.  
  154.