Subversion Repositories Kolibri OS

Rev

Rev 1300 | Rev 1306 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1300 Rev 1304
Line 55... Line 55...
55
;;
55
;;
56
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
56
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 57... Line 57...
57
 
57
 
Line 58... Line 58...
58
include 'macros.inc'
58
include 'macros.inc'
Line 59... Line 59...
59
 
59
 
Line 60... Line 60...
60
$Revision: 1300 $
60
$Revision: 1304 $
Line 1178... Line 1178...
1178
        mov   byte [DONT_SWITCH],al ; change task if possible
1178
        mov   byte [DONT_SWITCH],al ; change task if possible
1179
        pop   eax
1179
        pop   eax
1180
        ret
1180
        ret
Line 1181... Line 1181...
1181
 
1181
 
1182
align 4
-
 
-
 
1182
align 4
1183
 
1183
;input  eax=43,bl-byte of output, ecx - number of port
Line 1184... Line 1184...
1184
sys_outport:
1184
sys_outport:
1185
 
1185
 
Line 1186... Line 1186...
1186
    mov   edi,ebx          ; separate flag for read / write
1186
    mov   edi,ecx          ; separate flag for read / write
1187
    and   ebx,65535
1187
    and   ecx,65535
1188
 
1188
 
-
 
1189
    mov   eax,[RESERVED_PORTS]
1189
    mov   ecx,[RESERVED_PORTS]
1190
    test  eax,eax
1190
    test  ecx,ecx
1191
    jnz   .sopl8
Line 1191... Line 1192...
1191
    jne   sopl8
1192
    inc	  eax
1192
    mov   [esp+36],dword 1
1193
	mov   [esp+32],eax
1193
    ret
1194
    ret
1194
 
1195
 
1195
  sopl8:
1196
  .sopl8:
1196
    mov   edx,[TASK_BASE]
1197
    mov   edx,[TASK_BASE]
Line 1197... Line 1198...
1197
    mov   edx,[edx+0x4]
1198
    mov   edx,[edx+0x4]
1198
    and   ebx,65535
1199
    ;and   ecx,65535
1199
    cld
1200
    ;cld - set on interrupt 0x40
1200
  sopl1:
1201
  .sopl1:
1201
 
1202
 
1202
    mov   esi,ecx
1203
    mov   esi,eax
1203
    shl   esi,4
1204
    shl   esi,4
1204
    add   esi,RESERVED_PORTS
1205
    add   esi,RESERVED_PORTS
1205
    cmp   edx,[esi+0]
1206
    cmp   edx,[esi+0]
1206
    jne   sopl2
1207
    jne   .sopl2
Line -... Line 1208...
-
 
1208
    cmp   ecx,[esi+4]
1207
    cmp   ebx,[esi+4]
1209
    jb    .sopl2
Line 1208... Line 1210...
1208
    jb    sopl2
1210
    cmp   ecx,[esi+8]
-
 
1211
    jg    .sopl2
1209
    cmp   ebx,[esi+8]
1212
.sopl3:
1210
    jg    sopl2
1213
 
1211
    jmp   sopl3
1214
    test  edi,0x80000000 ; read ?
Line 1212... Line 1215...
1212
 
1215
    jnz   .sopl4
1213
  sopl2:
-
 
1214
 
-
 
1215
    dec   ecx
-
 
Line 1216... Line 1216...
1216
    jnz   sopl1
1216
 
1217
    mov   [esp+36],dword 1
1217
	mov	  eax,ebx
-
 
1218
    mov   dx,cx          ; write
1218
    ret
1219
    out   dx,al
1219
 
1220
    and   [esp+32],dword 0
Line 1220... Line -...
1220
  sopl3:
-
 
Line -... Line 1221...
-
 
1221
    ret
-
 
1222
 
1221
 
1223
	.sopl2:
1222
    test  edi,0x80000000 ; read ?
1224
 
1223
    jnz   sopl4
1225
    dec   eax
1224
 
1226
    jnz   .sopl1
1225
    mov   dx,bx          ; write
1227
	inc	  eax
1226
    out   dx,al
1228
    mov   [esp+32],eax
Line 1227... Line 1229...
1227
    and   [esp+36],dword 0
1229
    ret
Line 1228... Line 1230...
1228
    ret
1230
 
Line 2556... Line 2558...
2556
    ret
2558
    ret
Line 2557... Line 2559...
2557
 
2559
 
Line 2558... Line 2560...
2558
align 4
2560
align 4
2559
 
-
 
2560
sys_getbackground:
2561
 
-
 
2562
sys_getbackground:
2561
 
2563
;    cmp   eax,1                                  ; SIZE
2562
    cmp   eax,1                                  ; SIZE
2564
    dec	  ebx
2563
    jnz   nogb1
2565
    jnz   nogb1
2564
    mov   eax,[BgrDataWidth]
2566
    mov   eax,[BgrDataWidth]
2565
    shl   eax,16
2567
    shl   eax,16
2566
    mov   ax,[BgrDataHeight]
2568
    mov   ax,[BgrDataHeight]
Line 2567... Line 2569...
2567
    mov   [esp+36],eax
2569
    mov   [esp+32],eax
2568
    ret
-
 
2569
 
2570
    ret
-
 
2571
 
2570
nogb1:
2572
nogb1:
Line 2571... Line 2573...
2571
 
2573
;    cmp   eax,2                                  ; PIXEL
2572
    cmp   eax,2                                  ; PIXEL
2574
    dec	  ebx
2573
    jnz   nogb2
2575
    jnz   nogb2
2574
 
2576
 
2575
        mov     eax, [img_background]
2577
        mov     eax, [img_background]
2576
        test    ebx, ebx
2578
        test    ecx, ecx
2577
        jz      @f
2579
        jz      @f
2578
        cmp     eax, static_background_data
2580
        cmp     eax, static_background_data
2579
        jz      .ret
2581
        jz      .ret
2580
@@:
2582
@@:
2581
    mov ecx, [mem_BACKGROUND]
2583
    mov ebx, [mem_BACKGROUND]
2582
    add ecx, 4095
2584
    add ebx, 4095
Line 2583... Line 2585...
2583
    and ecx, -4096
2585
    and ebx, -4096
Line 2584... Line 2586...
2584
    sub ecx, 4
2586
    sub ebx, 4
2585
    cmp ebx, ecx
2587
    cmp ecx, ebx
2586
    ja  .ret
2588
    ja  .ret
2587
 
2589
 
2588
    mov   eax,[ebx+eax]
2590
    mov   eax,[ecx+eax]
Line 2589... Line 2591...
2589
 
2591
 
-
 
2592
    and   eax, 0xFFFFFF
2590
    and   eax, 0xFFFFFF
2593
    mov   [esp+32],eax
2591
    mov   [esp+36],eax
2594
.ret:
2592
.ret:
2595
    ret
2593
    ret
2596
  nogb2:
2594
  nogb2:
2597
 
Line 2595... Line -...
2595
 
-
 
2596
    cmp   eax,4                                  ; TILED / STRETCHED
2598
;    cmp   eax,4                                  ; TILED / STRETCHED
Line 2597... Line 2599...
2597
    jnz   nogb4
2599
    dec   ebx
2598
    mov   eax,[BgrDrawMode]
2600
    jnz   nogb4
2599
  nogb4:
2601
    mov   eax,[BgrDrawMode]