Subversion Repositories Kolibri OS

Rev

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

Rev 774 Rev 802
Line 53... Line 53...
53
;;
53
;;
54
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 55... Line 55...
55
 
55
 
Line 56... Line 56...
56
include 'macros.inc'
56
include 'macros.inc'
Line 57... Line 57...
57
 
57
 
Line 58... Line 58...
58
$Revision: 774 $
58
$Revision: 802 $
Line 343... Line 343...
343
	mov	al, [BOOT_VAR+0x901F]	; DMA access
343
	mov	al, [BOOT_VAR+0x901F]	; DMA access
344
	mov	[allow_dma_access], al
344
	mov	[allow_dma_access], al
345
	mov   al,[BOOT_VAR+0x9000]	  ; bpp
345
	mov   al,[BOOT_VAR+0x9000]	  ; bpp
346
	mov   [ScreenBPP],al
346
	mov   [ScreenBPP],al
Line 347... Line -...
347
 
-
 
348
	xchg bx, bx
-
 
349
 
347
 
350
	movzx eax,word [BOOT_VAR+0x900A]  ; X max
348
	movzx eax,word [BOOT_VAR+0x900A]  ; X max
351
	dec   eax
349
	dec   eax
352
	mov   [Screen_Max_X],eax
350
	mov   [Screen_Max_X],eax
353
	mov   [screen_workarea.right],eax
351
	mov   [screen_workarea.right],eax
Line 1030... Line 1028...
1030
 
1028
 
Line 1031... Line 1029...
1031
	pushad
1029
	pushad
1032
 
1030
 
1033
	mov  [irq_owner+4*0], 1    ; timer
-
 
1034
	;mov  [irq_owner+4*1], 1    ; keyboard
1031
	mov  [irq_owner+4*0], 1    ; timer
1035
	mov  [irq_owner+4*5], 1    ; sound blaster
1032
	;mov  [irq_owner+4*1], 1    ; keyboard
1036
	mov  [irq_owner+4*6], 1    ; floppy diskette
1033
	mov  [irq_owner+4*6], 1    ; floppy diskette
1037
	mov  [irq_owner+4*13], 1   ; math co-pros
1034
	mov  [irq_owner+4*13], 1   ; math co-pros
Line 1102... Line 1099...
1102
	mov   ax,[BOOT_VAR+0x900A]
1099
	mov   ax,[BOOT_VAR+0x900A]
1103
	shr   ax,1
1100
	shr   ax,1
1104
	mov   [MOUSE_X],eax
1101
	mov   [MOUSE_X],eax
1105
	pop   eax
1102
	pop   eax
Line 1106... Line -...
1106
 
-
 
1107
	mov   byte [SB16_Status],0	      ; Minazzi Paolo
1103
 
Line 1108... Line 1104...
1108
	mov   [BTN_ADDR],dword BUTTON_INFO    ; address of button list
1104
        mov   [BTN_ADDR],dword BUTTON_INFO    ; address of button list
1109
 
1105
 
1110
     ;!! IP 04.02.2005:
1106
     ;!! IP 04.02.2005:
Line 1181... Line 1177...
1181
    and   eax,0xff
1177
    and   eax,0xff
1182
    mov   [esp+36],dword 0
1178
    mov   [esp+36],dword 0
1183
    mov   [esp+24],eax
1179
    mov   [esp+24],eax
1184
    ret
1180
    ret
Line 1185... Line -...
1185
 
-
 
1186
 
-
 
1187
 
-
 
1188
align 4
-
 
1189
sys_sb16:
-
 
1190
 
-
 
1191
     cmp  word [sb16],word 0
-
 
1192
     jnz  sb16l1
-
 
1193
     mov  [esp+36],dword 1
-
 
1194
     ret
-
 
1195
   sb16l1:
-
 
1196
     mov  [esp+36],dword 0
-
 
1197
     cmp  eax,1    ; set volume - main
-
 
1198
     jnz  sb16l2
-
 
1199
     mov  dx,word [sb16]
-
 
1200
     add  dx,4
-
 
1201
     mov  al,0x22
-
 
1202
     out  dx,al
-
 
1203
     mov  esi,1
-
 
1204
     call delay_ms
-
 
1205
     mov  eax,ebx
-
 
1206
     inc  edx
-
 
1207
     out  dx,al
-
 
1208
     ret
-
 
1209
   sb16l2:
-
 
1210
 
-
 
1211
     cmp  eax,2    ; set volume - cd
-
 
1212
     jnz  sb16l3
-
 
1213
     mov  dx,word [sb16]
-
 
1214
     add  dx,4
-
 
1215
     mov  al,0x28
-
 
1216
     out  dx,al
-
 
1217
     mov  esi,1
-
 
1218
     call delay_ms
-
 
1219
     mov  eax,ebx
-
 
1220
     add  edx,1
-
 
1221
     out  dx,al
-
 
1222
     ret
-
 
1223
   sb16l3:
-
 
1224
      mov  [esp+36],dword 2
-
 
1225
      ret
-
 
1226
 
-
 
1227
 
-
 
1228
align 4
-
 
1229
 
-
 
1230
sys_sb16II:
-
 
1231
 
-
 
1232
     cmp  word [sb16],word 0
-
 
1233
     jnz  IIsb16l1
-
 
1234
     mov  [esp+36],dword 1
-
 
1235
     ret
-
 
1236
   IIsb16l1:
-
 
1237
 
-
 
1238
     cmp  eax,1    ; set volume - main
-
 
1239
     jnz  IIsb16l2
-
 
1240
     ; L
-
 
1241
     mov  dx,word [sb16]
-
 
1242
     add  dx,4
-
 
1243
     mov  al,0x30
-
 
1244
     out  dx,al
-
 
1245
     mov  eax,ebx
-
 
1246
     inc  edx
-
 
1247
     out  dx,al
-
 
1248
     ; R
-
 
1249
     mov  dx,word [sb16]
-
 
1250
     add  dx,4
-
 
1251
     mov  al,0x31
-
 
1252
     out  dx,al
-
 
1253
     mov  eax,ebx
-
 
1254
     inc  edx
-
 
1255
     out  dx,al
-
 
1256
     mov  [esp+36],dword 0
-
 
1257
     ret
-
 
1258
   IIsb16l2:
-
 
1259
 
-
 
1260
     cmp  eax,2    ; set volume - cd
-
 
1261
     jnz  IIsb16l3
-
 
1262
     ; L
-
 
1263
     mov  dx,word [sb16]
-
 
1264
     add  dx,4
-
 
1265
     mov  al,0x36
-
 
1266
     out  dx,al
-
 
1267
     mov  eax,ebx
-
 
1268
     inc  edx
-
 
1269
     out  dx,al
-
 
1270
     ; R
-
 
1271
     mov  dx,word [sb16]
-
 
1272
     add  dx,4
-
 
1273
     mov  al,0x37
-
 
1274
     out  dx,al
-
 
1275
     mov  eax,ebx
-
 
1276
     inc  edx
-
 
1277
     out  dx,al
-
 
1278
     mov  [esp+36],dword 0
-
 
1279
     ret
-
 
1280
   IIsb16l3:
-
 
1281
 
-
 
1282
     mov  [esp+36],dword 2
-
 
1283
     ret
-
 
1284
 
-
 
1285
 
1181
 
Line 1286... Line 1182...
1286
display_number:
1182
display_number:
1287
 
1183
 
1288
; eax = print type, al=0 -> ebx is number
1184
; eax = print type, al=0 -> ebx is number
Line 1470... Line 1366...
1470
sys_setup:
1366
sys_setup:
Line 1471... Line 1367...
1471
 
1367
 
1472
; 1=roland mpu midi base , base io address
1368
; 1=roland mpu midi base , base io address
1473
; 2=keyboard   1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus
1369
; 2=keyboard   1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus
1474
; 3=cd base    1, pri.master 2, pri slave 3 sec master, 4 sec slave
-
 
1475
; 4=sb16 base , base io address
1370
; 3=cd base    1, pri.master 2, pri slave 3 sec master, 4 sec slave
1476
; 5=system language, 1eng 2fi 3ger 4rus
1371
; 5=system language, 1eng 2fi 3ger 4rus
1477
; 7=hd base    1, pri.master 2, pri slave 3 sec master, 4 sec slave
1372
; 7=hd base    1, pri.master 2, pri slave 3 sec master, 4 sec slave
1478
; 8=fat32 partition in hd
1373
; 8=fat32 partition in hd
1479
; 9
1374
; 9
Line 1541... Line 1436...
1541
   kbnocountry:
1436
   kbnocountry:
1542
     mov  [esp+36],dword 1
1437
     mov  [esp+36],dword 1
1543
     ret
1438
     ret
1544
   nsyse2:
1439
   nsyse2:
1545
     cmp  eax,3 		     ; CD
1440
     cmp  eax,3 		     ; CD
1546
     jnz  nsyse3
1441
     jnz  nsyse4
1547
     test ebx,ebx
1442
     test ebx,ebx
1548
     jz   nosesl
1443
     jz   nosesl
1549
     cmp  ebx, 4
1444
     cmp  ebx, 4
1550
     ja   nosesl
1445
     ja   nosesl
1551
     mov  [cd_base],bl
1446
     mov  [cd_base],bl
Line 1571... Line 1466...
1571
   nosesl:
1466
   nosesl:
1572
     ret
1467
     ret
Line 1573... Line 1468...
1573
 
1468
 
Line 1574... Line -...
1574
cd_base db 0
-
 
1575
 
-
 
1576
   nsyse3:
-
 
1577
 
-
 
1578
     cmp  eax,4 		     ; SB
-
 
1579
     jnz  nsyse4
-
 
1580
     cmp  ebx,0x100
-
 
1581
     jb   nsyse4
-
 
1582
     mov  edx,65535
-
 
1583
     cmp  edx,ebx
-
 
1584
     jb   nsyse4
-
 
1585
     mov  word [sb16],bx
1469
cd_base db 0
Line 1586... Line 1470...
1586
     ret
1470
 
1587
   nsyse4:
1471
   nsyse4:
1588
 
1472
 
Line 1650... Line 1534...
1650
     pusha
1534
     pusha
1651
     call  choice_necessity_partition_1
1535
     call  choice_necessity_partition_1
1652
     popa
1536
     popa
1653
    mov   [hd1_status],0	; free
1537
    mov   [hd1_status],0	; free
1654
     ret
1538
     ret
1655
   nsyse8:
-
 
1656
 
-
 
1657
     cmp  eax,10		     ; SOUND DMA CHANNEL
-
 
1658
     jne  no_set_sound_dma
-
 
1659
     cmp  ebx,3
-
 
1660
     ja   sys_setup_err
-
 
1661
     mov  [sound_dma],ebx
-
 
1662
     ret
-
 
1663
   no_set_sound_dma:
-
 
Line -... Line 1539...
-
 
1539
 
1664
 
1540
nsyse8:
1665
     cmp  eax,11		     ; ENABLE LBA READ
1541
     cmp  eax,11		     ; ENABLE LBA READ
1666
     jne  no_set_lba_read
1542
     jne  no_set_lba_read
1667
     and  ebx,1
1543
     and  ebx,1
1668
     mov  [lba_read_enabled],ebx
1544
     mov  [lba_read_enabled],ebx
1669
     ret
-
 
Line -... Line 1545...
-
 
1545
     ret
1670
   no_set_lba_read:
1546
 
1671
 
1547
no_set_lba_read:
1672
     cmp  eax,12		     ; ENABLE PCI ACCESS
1548
     cmp  eax,12                     ; ENABLE PCI ACCESS
1673
     jne  no_set_pci_access
1549
     jne  no_set_pci_access
1674
     and  ebx,1
1550
     and  ebx,1
Line 1689... Line 1565...
1689
sys_getsetup:
1565
sys_getsetup:
Line 1690... Line 1566...
1690
 
1566
 
1691
; 1=roland mpu midi base , base io address
1567
; 1=roland mpu midi base , base io address
1692
; 2=keyboard   1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus
1568
; 2=keyboard   1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus
1693
; 3=cd base    1, pri.master 2, pri slave 3 sec master, 4 sec slave
-
 
1694
; 4=sb16 base , base io address
1569
; 3=cd base    1, pri.master 2, pri slave 3 sec master, 4 sec slave
1695
; 5=system language, 1eng 2fi 3ger 4rus
1570
; 5=system language, 1eng 2fi 3ger 4rus
1696
; 7=hd base    1, pri.master 2, pri slave 3 sec master, 4 sec slave
1571
; 7=hd base    1, pri.master 2, pri slave 3 sec master, 4 sec slave
1697
; 8=fat32 partition in hd
1572
; 8=fat32 partition in hd
Line 1747... Line 1622...
1747
     jnz  ngsyse3
1622
         jnz  ngsyse3
1748
     movzx eax,[cd_base]
1623
         movzx eax,[cd_base]
1749
     mov  [esp+36],eax
1624
         mov  [esp+36],eax
1750
     ret
1625
         ret
1751
   ngsyse3:
1626
ngsyse3:
1752
 
-
 
1753
     cmp  eax,4
-
 
1754
     jne  ngsyse4
-
 
1755
     mov  eax,[sb16]
-
 
1756
     mov  [esp+36],eax
-
 
1757
     ret
-
 
1758
   ngsyse4:
-
 
1759
 
-
 
1760
     cmp  eax,5
1627
         cmp  eax,5
1761
     jnz  ngsyse5
1628
         jnz  ngsyse5
1762
     mov  eax,[syslang]
1629
         mov  eax,[syslang]
1763
     mov  [esp+36],eax
1630
         mov  [esp+36],eax
1764
     ret
1631
         ret
Line 1779... Line 1646...
1779
     jne  ngsyse9
1646
     jne  ngsyse9
1780
     mov  eax,[timer_ticks] ;[0xfdf0]
1647
     mov  eax,[timer_ticks] ;[0xfdf0]
1781
     mov  [esp+36],eax
1648
     mov  [esp+36],eax
1782
     ret
1649
     ret
1783
   ngsyse9:
1650
ngsyse9:
1784
     cmp  eax,10
-
 
1785
     jnz  ngsyse10
-
 
1786
     mov eax,[sound_dma]
-
 
1787
     mov  [esp+36],eax
-
 
1788
     ret
-
 
1789
   ngsyse10:
-
 
1790
     cmp  eax,11
1651
     cmp  eax,11
1791
     jnz  ngsyse11
1652
     jnz  ngsyse11
1792
     mov eax,[lba_read_enabled]
1653
     mov eax,[lba_read_enabled]
1793
     mov  [esp+36],eax
1654
     mov  [esp+36],eax
1794
     ret
1655
     ret
Line 2526... Line 2387...
2526
	shr	ecx, 12
2387
	shr	ecx, 12
2527
@@:
2388
@@:
2528
	and	dword [page_tabs+eax*4], 0
2389
	and	dword [page_tabs+eax*4], 0
2529
	mov	edx, eax
2390
	mov	edx, eax
2530
	shl	edx, 12
2391
	shl	edx, 12
-
 
2392
        push eax
2531
	invlpg	[edx]
2393
	invlpg	[edx]
-
 
2394
        pop eax
2532
	inc	eax
2395
	inc	eax
2533
	loop	@b
2396
	loop	@b
2534
	pop	eax
2397
	pop	eax
2535
	and	dword [page_tabs+(eax-1)*4], not DONT_FREE_BLOCK
2398
	and	dword [page_tabs+(eax-1)*4], not DONT_FREE_BLOCK
2536
	stdcall user_free, ebx
2399
	stdcall user_free, ebx