Subversion Repositories Kolibri OS

Rev

Rev 129 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 129 Rev 384
Line 51... Line 51...
51
     palvgalbl3:
51
     palvgalbl3:
52
       out dx,al  ; green 0,31 or 63
52
       out dx,al  ; green 0,31 or 63
53
       add ah,1
53
       add ah,1
54
       loop palvganew
54
       loop palvganew
55
;       mov    dx, 3ceh
55
;       mov    dx, 3ceh
56
;       mov    ax, 0005h 
56
;       mov    ax, 0005h
57
;       out    dx, ax        
57
;       out    dx, ax
58
       ret
58
       ret
Line 59... Line 59...
59
 
59
 
Line 60... Line 60...
60
palette320x200:
60
palette320x200:
Line 112... Line 112...
112
 
112
 
113
uglobal
113
uglobal
114
  novesachecksum dd 0x0
114
  novesachecksum dd 0x0
115
  EGA_counter    db  0
115
  EGA_counter    db  0
116
  VGA_drawing_screen db 0
116
  VGA_drawing_screen db 0
117
  VGA_8_pixels: 
117
  VGA_8_pixels:
118
     rb 16
118
     rb 16
119
  temp:
119
  temp:
120
     .cx dd 0
120
     .cx dd 0
Line 121... Line 121...
121
endg
121
endg
Line 122... Line 122...
122
 
122
 
123
checkVga_N13:
123
checkVga_N13:
Line 124... Line 124...
124
 
124
 
125
        cmp    [0xfe0c],dword 0x13
125
        cmp    [SCR_MODE],dword 0x13
126
        jne   @f
126
        jne   @f
127
 
127
 
128
;      cnvl:
128
;      cnvl:
129
        pushad
129
        pushad
130
        cmp   [EGA_counter],1
130
        cmp   [EGA_counter],1
131
        je   novesal
131
        je   novesal
132
        mov    ecx,[0xfb0a]
132
        mov    ecx,[MOUSE_X]
133
        cmp    ecx,[novesachecksum]
133
        cmp    ecx,[novesachecksum]
Line 149... Line 149...
149
        mov    eax,480-100
149
        mov    eax,480-100
150
      m13l4:
150
      m13l4:
151
        sub    eax,100
151
        sub    eax,100
152
        imul   eax,640*4
152
        imul   eax,640*4
153
        add    ecx,eax
153
        add    ecx,eax
154
        movzx  eax,word [0xfb0a]
154
        movzx  eax,word [MOUSE_X]
155
        cmp    eax,160
155
        cmp    eax,160
156
        jge    m13l1
156
        jge    m13l1
157
        mov    eax,160
157
        mov    eax,160
158
      m13l1:
158
      m13l1:
159
        cmp    eax,640-160
159
        cmp    eax,640-160
Line 161... Line 161...
161
        mov    eax,640-160
161
        mov    eax,640-160
162
      m13l2:
162
      m13l2:
163
        sub    eax,160
163
        sub    eax,160
164
        shl    eax,2
164
        shl    eax,2
165
        add    ecx,eax
165
        add    ecx,eax
166
        mov    esi,[0xfe80]
166
        mov    esi,[LFBAddress]
167
        add    esi,ecx
167
        add    esi,ecx
168
        mov    edi,0xa0000
168
        mov    edi,VGABasePtr
169
        mov    edx,200
169
        mov    edx,200
170
        mov    ecx,320
170
        mov    ecx,320
171
        cld
171
        cld
172
     m13pix:
172
     m13pix:
173
        lodsd
173
        lodsd
Line 194... Line 194...
194
        mov    [EGA_counter],0
194
        mov    [EGA_counter],0
195
        popad
195
        popad
196
        ret
196
        ret
Line 197... Line 197...
197
 
197
 
198
VGA_drawbackground:
198
VGA_drawbackground:
199
; draw all  
199
; draw all
200
        cmp    [0xfe0c],dword 0x12
200
        cmp    [SCR_MODE],dword 0x12
201
        jne     .end
201
        jne     .end
202
        pushad
202
        pushad
203
        mov    esi,[0xfe80]
203
        mov    esi,[LFBAddress]
204
        mov    edi,0xa0000
204
        mov    edi,VGABasePtr
205
        mov    ebx,640/32  ; 640*480/(8*4)
205
        mov    ebx,640/32  ; 640*480/(8*4)
206
        mov    edx,480
206
        mov    edx,480
207
     @@:
207
     @@:
208
        push   ebx edx esi edi
208
        push   ebx edx esi edi
209
        shl    edx,9           
209
        shl    edx,9
210
        lea    edx,[edx+edx*4]
210
        lea    edx,[edx+edx*4]
211
        add    esi,edx
211
        add    esi,edx
212
        shr    edx,5
212
        shr    edx,5
213
        add    edi,edx
213
        add    edi,edx
Line 222... Line 222...
222
 
222
 
223
VGA_draw_long_line:
223
VGA_draw_long_line:
224
        mov    dx,3ceh
224
        mov    dx,3ceh
225
        mov    ax,0ff08h
225
        mov    ax,0ff08h
226
        cli
226
        cli
227
        out    dx, ax 
227
        out    dx, ax
228
        mov    ax,0005h
228
        mov    ax,0005h
229
        out    dx, ax
229
        out    dx, ax
230
    m12pix:
230
    m12pix:
231
        call   VGA_draw_32_pixels
231
        call   VGA_draw_32_pixels
Line 316... Line 316...
316
VGA_putpixel:
316
VGA_putpixel:
317
 ; eax = x
317
 ; eax = x
318
 ; ebx = y
318
 ; ebx = y
319
        mov     ecx,eax
319
        mov     ecx,eax
320
        mov     eax, [esp+32-8+4] ; color
320
        mov     eax, [esp+32-8+4] ; color
321
        shl        ebx,9           
321
        shl        ebx,9
322
        lea        ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5
322
        lea        ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5
323
        lea     edx, [ebx+ecx*4]  ; + x*BytesPerPixel (Vesa2.0 32)
323
        lea     edx, [ebx+ecx*4]  ; + x*BytesPerPixel (Vesa2.0 32)
324
        mov     edi,edx
324
        mov     edi,edx
325
        add     edi, [0xfe80]     ; + LFB address
325
        add     edi, [LFBAddress]     ; + LFB address
326
        mov     [edi], eax        ; write to LFB for Vesa2.0
326
        mov     [edi], eax        ; write to LFB for Vesa2.0
327
        shr     edx,5             ; change BytesPerPixel to 1/8
327
        shr     edx,5             ; change BytesPerPixel to 1/8
328
        mov     edi,edx
328
        mov     edi,edx
329
        add     edi, 0x0a0000     ; address of pixel in VGA area
329
        add     edi, VGABasePtr     ; address of pixel in VGA area
330
        and     ecx,0x07          ; bit no. (modulo 8)
330
        and     ecx,0x07          ; bit no. (modulo 8)
331
        pushfd
331
        pushfd
332
        ; edi = address, eax = 24bit colour, ecx = bit no. (modulo 8)
332
        ; edi = address, eax = 24bit colour, ecx = bit no. (modulo 8)
333
        xor    edx,edx
333
        xor    edx,edx
334
        cmp    eax,0
334
        cmp    eax,0
Line 344... Line 344...
344
        jbe    .p13red
344
        jbe    .p13red
345
        or     dl,0x02
345
        or     dl,0x02
346
        cmp    ah,170
346
        cmp    ah,170
347
        jbe    .p13red
347
        jbe    .p13red
348
        or     dl,0x08
348
        or     dl,0x08
349
.p13red: 
349
.p13red:
350
        shr    eax,8
350
        shr    eax,8
351
        cmp    ah,85
351
        cmp    ah,85
352
        jbe    .p13cont
352
        jbe    .p13cont
353
        or     dl,0x04
353
        or     dl,0x04
354
        cmp    ah,170
354
        cmp    ah,170
Line 367... Line 367...
367
        rol    edx,8
367
        rol    edx,8
368
        mov    [edi],dl
368
        mov    [edi],dl
369
        popfd
369
        popfd
370
;.end:
370
;.end:
371
        ret
371
        ret
372
        
372
 
373
VGA__putimage:
373
VGA__putimage:
374
; ecx = size [x|y]
374
; ecx = size [x|y]
375
; edx = coordinates [x|y]
375
; edx = coordinates [x|y]
376
        cmp    [0xfe0c],dword 0x12
376
        cmp    [SCR_MODE],dword 0x12
377
        jne     @f
377
        jne     @f
378
         pushad
378
         pushad
379
         rol  edx,16
379
         rol  edx,16
380
         movzx eax,dx
380
         movzx eax,dx
381
         rol  edx,16
381
         rol  edx,16
Line 391... Line 391...
391
VGA_draw_bar:
391
VGA_draw_bar:
392
; eax   cx
392
; eax   cx
393
; ebx   cy
393
; ebx   cy
394
; ecx   xe
394
; ecx   xe
395
; edx   ye
395
; edx   ye
396
        cmp    [0xfe0c],dword 0x12
396
        cmp    [SCR_MODE],dword 0x12
397
        jne     @f
397
        jne     @f
398
         pushad
398
         pushad
399
         sub   ecx,eax
399
         sub   ecx,eax
400
         sub   edx,ebx
400
         sub   edx,ebx
401
         and   eax,0xffff
401
         and   eax,0xffff
Line 407... Line 407...
407
@@:
407
@@:
408
         ret
408
         ret
Line 409... Line 409...
409
 
409
 
410
VGA_draw_bar_1:
410
VGA_draw_bar_1:
411
        mov     [temp.cx],eax
411
        mov     [temp.cx],eax
412
        mov     eax, [0x3010]
412
        mov     eax, [TASK_BASE]
413
        add     ebx, [eax-twdw + 4]
413
        add     ebx, [eax-twdw + 4]
414
        mov     eax, [eax-twdw + 0]
414
        mov     eax, [eax-twdw + 0]
415
        add     eax, [temp.cx]
415
        add     eax, [temp.cx]
416
        and     eax,0xfff8
416
        and     eax,0xfff8
417
        shl     ebx,9           
417
        shl     ebx,9
418
        lea     ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5
418
        lea     ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5
419
        lea     ebx, [ebx+eax*4]  ; + x*BytesPerPixel (Vesa2.0 32)
419
        lea     ebx, [ebx+eax*4]  ; + x*BytesPerPixel (Vesa2.0 32)
420
        mov     esi,ebx
420
        mov     esi,ebx
421
        add     esi, [0xfe80]     ; + LFB address
421
        add     esi, [LFBAddress]     ; + LFB address
422
        shr     ebx,5             ; change BytesPerPixel to 1/8
422
        shr     ebx,5             ; change BytesPerPixel to 1/8
423
        mov     edi,ebx
423
        mov     edi,ebx
424
        add     edi, 0x0a0000     ; address of pixel in VGA area
424
        add     edi, VGABasePtr   ; address of pixel in VGA area
425
        mov     ebx,ecx
425
        mov     ebx,ecx
426
        shr     ebx,5
426
        shr     ebx,5
427
        inc     ebx
427
        inc     ebx
428
.main_loop:
428
.main_loop:
Line 432... Line 432...
432
        call   VGA_draw_long_line_1
432
        call   VGA_draw_long_line_1
433
        ret
433
        ret
Line 434... Line 434...
434
 
434
 
435
VGA_draw_long_line_1:
435
VGA_draw_long_line_1:
436
        push   ebx edx esi edi
436
        push   ebx edx esi edi
437
        shl    edx,9           
437
        shl    edx,9
438
        lea    edx,[edx+edx*4]
438
        lea    edx,[edx+edx*4]
439
        add    esi,edx
439
        add    esi,edx
440
        shr    edx,5
440
        shr    edx,5
441
        add    edi,edx
441
        add    edi,edx