/kernel/trunk/drivers/sb16/CONFIG.INC |
---|
File deleted |
/kernel/trunk/drivers/sb16/SB16.INC |
---|
File deleted |
\ No newline at end of file |
/kernel/trunk/drivers/sb16/sb16.asm |
---|
File deleted |
/kernel/trunk/drivers/ati2d.asm |
---|
7,8 → 7,6 |
format MS COFF |
DEBUG equ 1 |
include 'proc32.inc' |
include 'imports.inc' |
16,6 → 14,8 |
API_VERSION equ 0x01000100 |
DEBUG equ 1 |
STRIDE equ 8 |
VID_ATI equ 0x1002 |
/kernel/trunk/drivers/com_mouse.asm |
---|
11,12 → 11,14 |
format MS COFF |
DEBUG equ 0 |
API_VERSION equ 5 ;debug |
include 'proc32.inc' |
include 'imports.inc' |
API_VERSION equ 5 ;debug |
OS_BASE equ 0x80000000; |
new_app_base equ 0x0 |
PROC_BASE equ OS_BASE+0x0080000 |
struc IOCTL |
{ .handle dd ? |
34,6 → 36,7 |
public START |
public version |
DEBUG equ 0 |
DRV_ENTRY equ 1 |
DRV_EXIT equ -1 |
/kernel/trunk/drivers/ensoniq.asm |
---|
9,12 → 9,12 |
format MS COFF |
DEBUG equ 1 |
include 'proc32.inc' |
include 'imports.inc' |
DEBUG equ 1 |
REMAP_IRQ equ 0 |
;irq 0,1,2,8,12,13 íåäîñòóïíû |
/kernel/trunk/drivers/ps2mouse.asm |
---|
1,7 → 1,5 |
format MS COFF |
DEBUG equ 0 |
include 'proc32.inc' |
include 'imports.inc' |
/kernel/trunk/drivers/sis.asm |
---|
7,13 → 7,12 |
format MS COFF |
DEBUG equ 1 |
include 'proc32.inc' |
include 'imports.inc' |
API_VERSION equ 0x01000100 |
DEBUG equ 1 |
DEBUG_IRQ equ 0 |
USE_COM_IRQ equ 0 ;make irq 3 and irq 4 available for PCI devices |
Property changes: |
Added: svn:keywords |
+Rev |
\ No newline at end of property |
/kernel/trunk/drivers/sound.asm |
---|
7,7 → 7,6 |
format MS COFF |
DEBUG equ 1 |
include 'proc32.inc' |
include 'imports.inc' |
14,6 → 13,7 |
API_VERSION equ 0x01000100 |
DEBUG equ 1 |
DEBUG_IRQ equ 0 |
USE_COM_IRQ equ 0 ;make irq 3 and irq 4 available for PCI devices |
Property changes: |
Added: svn:keywords |
+Rev |
\ No newline at end of property |
/kernel/trunk/drivers/imports.inc |
---|
6,10 → 6,8 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
macro kernel_export [name]{ |
forward |
;display `name,#13,#10 |
if used name |
if DEBUG |
display 'uses: ',`name,#13,#10 |
end if |
extrn name |
end if |
} |
21,7 → 19,6 |
GetService,\ |
ServiceHandler,\ |
AttachIntHandler,\ |
GetIntHandler,\ |
FpuSave,\ |
FpuRestore,\ |
ReservePortArea,\ |
/kernel/trunk/drivers/infinity.asm |
---|
10,14 → 10,7 |
format MS COFF |
DEBUG equ 1 |
include 'proc32.inc' |
include 'main.inc' |
include 'imports.inc' |
CURRENT_API equ 0x0101 ;1.01 |
COMPATIBLE_API equ 0x0100 ;1.00 |
25,6 → 18,13 |
SOUND_VERSION equ CURRENT_API |
include 'proc32.inc' |
;include 'system.inc' |
include 'main.inc' |
include 'imports.inc' |
FORCE_MMX equ 0 ;set to 1 to force use mmx or |
FORCE_MMX_128 equ 0 ;integer sse2 extensions |
;and reduce driver size |
33,6 → 33,9 |
USE_SSE2_MIXER equ 0 ;floating point mixer. Disabled by default |
DEBUG equ 1 |
OS_BASE equ 0x80000000 |
CAPS_SSE2 equ 26 |
1206,7 → 1209,7 |
;r_size r_dt resampler_func |
dd 0,0,0 ; 0 PCM_ALL |
dd 16384, 0, copy_stream ; 1 PCM_2_16_48 |
dd 8192, 0, m16_stereo ; 2 PCM_1_16_48 |
dd 16384, 0, m16_stereo ; 2 PCM_1_16_48 |
dd 16384, 30109, resample_2 ; 3 PCM_2_16_44 |
dd 8192, 30109, resample_1 ; 4 PCM_1_16_44 |
/kernel/trunk/drivers/sceletone.asm |
---|
9,8 → 9,6 |
format MS COFF |
DEBUG equ 1 |
API_VERSION equ 0 ;debug |
include 'proc32.inc' |
37,6 → 35,8 |
public service_proc |
public version |
DEBUG equ 1 |
DRV_ENTRY equ 1 |
DRV_EXIT equ -1 |
STRIDE equ 4 ;size of row in devices table |
/kernel/trunk/drivers/proc32.inc |
---|
71,7 → 71,7 |
if parmbytes | localbytes |
leave |
end if |
if flag and 10000b |
if (flag and 10000b) | (parmbytes=0) |
retn |
else |
retn parmbytes |
/kernel/trunk/core/dll.inc |
---|
37,11 → 37,15 |
mov eax, [access_rights] |
mov [irq_rights + 4 * ebx], eax |
;push eax |
;mov eax, [TASK_BASE] |
;mov eax, [eax + TASKDATA.pid] ; faster or smaller? :) |
;call get_pid |
mov [irq_owner + 4 * ebx], PID_KERNEL ; all handlers belong to a kernel |
mov [irq_owner + 4 * ebx], PID_KERNEL ;eax |
;pop eax |
stdcall enable_irq, [irq] |
mov eax, 1 |
ret |
.err: |
xor eax, eax |
/kernel/trunk/core/sched.inc |
---|
15,6 → 15,7 |
align 32 |
irq0: |
; pushfd |
pushad |
mov ax, app_data ; |
mov ds, ax |
41,6 → 42,7 |
mov [DONT_SWITCH], byte 0 |
popad |
; popfd |
iretd |
.change_task: |
225,6 → 227,9 |
@@: |
mov eax, [ebx+APPDATA.saved_esp0] |
mov [tss._esp0], eax |
; mov eax, [ebx+APPDATA.pl0_stack] |
; add eax, RING0_STACK_SIZE |
; mov [tss._esp0], eax |
mov ax, graph_data |
mov gs, ax |
/kernel/trunk/core/syscall.inc |
---|
128,10 → 128,10 |
dd sys_settime ; 22-setting date,time,clock and alarm-clock |
dd 0 |
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist |
dd 0 ; |
dd sys_sb16 ; 25-SetSb16 |
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,. |
dd 0 |
dd 0 ; |
dd sys_sb16II ; 28-SetSb16 |
dd 0 |
dd sys_current_directory ; 30-Get/SetCurrentDirectory |
dd 0 |
208,10 → 208,10 |
dd cross_order ; 22-setting date,time,clock and alarm-clock |
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent |
dd cross_order ; 24-PlayCdTrack,StopCd and GetCdPlaylist |
dd undefined_syscall ; 25-reserved |
dd cross_order ; 25-SetSb16 |
dd cross_order ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,. |
dd undefined_syscall ; 27-reserved |
dd undefined_syscall ; 28-reserved |
dd cross_order ; 28-SetSb16 |
dd sys_date ; 29-GetDate |
dd cross_order ; 30-Get/SetCurrentDirectory |
dd undefined_syscall ; 31-reserved |
/kernel/trunk/core/conf_lib.inc |
---|
22,15 → 22,12 |
locals |
par db 30 dup(?) |
endl |
pushad |
;[gui] |
;mouse_speed |
lea eax,[par] |
push eax |
invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed,\ |
eax,30, ugui_mouse_speed_def |
invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed, eax,30, ugui_mouse_speed_def |
pop eax |
stdcall strtoint,eax |
mov [mouse_speed_factor], ax |
38,13 → 35,36 |
;mouse_delay |
lea eax,[par] |
push eax |
invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay,\ |
eax,30, ugui_mouse_delay_def |
invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay, eax,30, ugui_mouse_delay_def |
pop eax |
stdcall strtoint,eax |
mov [mouse_delay], eax |
;[dev] |
;sb16 |
lea eax,[par] |
push eax |
invoke ini.get_str,conf_fname, udev, udev_sb16, eax,30, udev_sb16_def |
pop eax |
stdcall strtoint,eax |
cmp eax, 0x100 |
jb @f |
cmp eax, 0x10000 |
jae @f |
mov [sb16], eax |
@@: |
;sound_dma |
lea eax,[par] |
push eax |
invoke ini.get_str,conf_fname, udev, udev_sound_dma, eax,30, udev_sound_dma_def |
pop eax |
stdcall strtoint,eax |
cmp eax, 3 |
ja @f |
mov [sound_dma], eax |
@@: |
;midibase |
lea eax,[par] |
push eax |
51,7 → 71,6 |
invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def |
pop eax |
stdcall strtoint,eax |
cmp eax, 0x100 |
jb @f |
cmp eax, 0x10000 |
61,6 → 80,7 |
inc eax |
mov [midisp], eax |
@@: |
popad |
ret |
endp |
72,6 → 92,10 |
ugui_mouse_delay_def db '0x00A',0 |
udev db 'dev',0 |
udev_sb16 db 'sb16',0 |
udev_sb16_def db '0x220',0 |
udev_sound_dma db 'sound_dma',0 |
udev_sound_dma_def db '1',0 |
udev_midibase db 'midibase',0 |
udev_midibase_def db '0x320',0 |
/kernel/trunk/video/cursors.inc |
---|
468,8 → 468,6 |
.init: |
mov [cur_def_interl], ebx |
; stdcall load_pe_driver, szAtiHW |
stdcall load_driver, szHwMouse |
mov [hw_cursor], eax |
test eax, eax |
/kernel/trunk/kernel.asm |
---|
345,6 → 345,8 |
mov al,[BOOT_VAR+0x9000] ; bpp |
mov [ScreenBPP],al |
xchg bx, bx |
movzx eax,word [BOOT_VAR+0x900A] ; X max |
dec eax |
mov [Screen_Max_X],eax |
1030,6 → 1032,7 |
mov [irq_owner+4*0], 1 ; timer |
;mov [irq_owner+4*1], 1 ; keyboard |
mov [irq_owner+4*5], 1 ; sound blaster |
mov [irq_owner+4*6], 1 ; floppy diskette |
mov [irq_owner+4*13], 1 ; math co-pros |
mov [irq_owner+4*14], 1 ; ide I |
1101,6 → 1104,7 |
mov [MOUSE_X],eax |
pop eax |
mov byte [SB16_Status],0 ; Minazzi Paolo |
mov [BTN_ADDR],dword BUTTON_INFO ; address of button list |
;!! IP 04.02.2005: |
1179,6 → 1183,106 |
mov [esp+24],eax |
ret |
align 4 |
sys_sb16: |
cmp word [sb16],word 0 |
jnz sb16l1 |
mov [esp+36],dword 1 |
ret |
sb16l1: |
mov [esp+36],dword 0 |
cmp eax,1 ; set volume - main |
jnz sb16l2 |
mov dx,word [sb16] |
add dx,4 |
mov al,0x22 |
out dx,al |
mov esi,1 |
call delay_ms |
mov eax,ebx |
inc edx |
out dx,al |
ret |
sb16l2: |
cmp eax,2 ; set volume - cd |
jnz sb16l3 |
mov dx,word [sb16] |
add dx,4 |
mov al,0x28 |
out dx,al |
mov esi,1 |
call delay_ms |
mov eax,ebx |
add edx,1 |
out dx,al |
ret |
sb16l3: |
mov [esp+36],dword 2 |
ret |
align 4 |
sys_sb16II: |
cmp word [sb16],word 0 |
jnz IIsb16l1 |
mov [esp+36],dword 1 |
ret |
IIsb16l1: |
cmp eax,1 ; set volume - main |
jnz IIsb16l2 |
; L |
mov dx,word [sb16] |
add dx,4 |
mov al,0x30 |
out dx,al |
mov eax,ebx |
inc edx |
out dx,al |
; R |
mov dx,word [sb16] |
add dx,4 |
mov al,0x31 |
out dx,al |
mov eax,ebx |
inc edx |
out dx,al |
mov [esp+36],dword 0 |
ret |
IIsb16l2: |
cmp eax,2 ; set volume - cd |
jnz IIsb16l3 |
; L |
mov dx,word [sb16] |
add dx,4 |
mov al,0x36 |
out dx,al |
mov eax,ebx |
inc edx |
out dx,al |
; R |
mov dx,word [sb16] |
add dx,4 |
mov al,0x37 |
out dx,al |
mov eax,ebx |
inc edx |
out dx,al |
mov [esp+36],dword 0 |
ret |
IIsb16l3: |
mov [esp+36],dword 2 |
ret |
display_number: |
; eax = print type, al=0 -> ebx is number |
1368,6 → 1472,7 |
; 1=roland mpu midi base , base io address |
; 2=keyboard 1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus |
; 3=cd base 1, pri.master 2, pri slave 3 sec master, 4 sec slave |
; 4=sb16 base , base io address |
; 5=system language, 1eng 2fi 3ger 4rus |
; 7=hd base 1, pri.master 2, pri slave 3 sec master, 4 sec slave |
; 8=fat32 partition in hd |
1438,7 → 1543,7 |
ret |
nsyse2: |
cmp eax,3 ; CD |
jnz nsyse4 |
jnz nsyse3 |
test ebx,ebx |
jz nosesl |
cmp ebx, 4 |
1468,6 → 1573,17 |
cd_base db 0 |
nsyse3: |
cmp eax,4 ; SB |
jnz nsyse4 |
cmp ebx,0x100 |
jb nsyse4 |
mov edx,65535 |
cmp edx,ebx |
jb nsyse4 |
mov word [sb16],bx |
ret |
nsyse4: |
cmp eax,5 ; SYSTEM LANGUAGE |
1536,15 → 1652,23 |
popa |
mov [hd1_status],0 ; free |
ret |
nsyse8: |
nsyse8: |
cmp eax,10 ; SOUND DMA CHANNEL |
jne no_set_sound_dma |
cmp ebx,3 |
ja sys_setup_err |
mov [sound_dma],ebx |
ret |
no_set_sound_dma: |
cmp eax,11 ; ENABLE LBA READ |
jne no_set_lba_read |
and ebx,1 |
mov [lba_read_enabled],ebx |
ret |
no_set_lba_read: |
no_set_lba_read: |
cmp eax,12 ; ENABLE PCI ACCESS |
jne no_set_pci_access |
and ebx,1 |
1567,6 → 1691,7 |
; 1=roland mpu midi base , base io address |
; 2=keyboard 1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus |
; 3=cd base 1, pri.master 2, pri slave 3 sec master, 4 sec slave |
; 4=sb16 base , base io address |
; 5=system language, 1eng 2fi 3ger 4rus |
; 7=hd base 1, pri.master 2, pri slave 3 sec master, 4 sec slave |
; 8=fat32 partition in hd |
1624,6 → 1749,14 |
mov [esp+36],eax |
ret |
ngsyse3: |
cmp eax,4 |
jne ngsyse4 |
mov eax,[sb16] |
mov [esp+36],eax |
ret |
ngsyse4: |
cmp eax,5 |
jnz ngsyse5 |
mov eax,[syslang] |
1648,6 → 1781,12 |
mov [esp+36],eax |
ret |
ngsyse9: |
cmp eax,10 |
jnz ngsyse10 |
mov eax,[sound_dma] |
mov [esp+36],eax |
ret |
ngsyse10: |
cmp eax,11 |
jnz ngsyse11 |
mov eax,[lba_read_enabled] |
2389,9 → 2528,7 |
and dword [page_tabs+eax*4], 0 |
mov edx, eax |
shl edx, 12 |
push eax |
invlpg [edx] |
pop eax |
inc eax |
loop @b |
pop eax |
/kernel/trunk/data32.inc |
---|
90,7 → 90,6 |
szPS2MDriver db 'PS2MOUSE',0 |
szCOM_MDriver db 'COM_MOUSE',0 |
szUSB db 'USB',0 |
szAtiHW db '/rd/1/drivers/ati2d.drv',0 |
szSTART db 'START',0 |
szEXPORTS db 'EXPORTS',0 |
147,6 → 146,7 |
align 4 |
keyboard dd 1 |
sound_dma dd 1 |
syslang dd 1 |
boot_y dd 10 |
283,9 → 283,7 |
mem_block_map rb 512 |
event_map rb 64 |
mem_block_list rd 64 |
large_block_list rd 31 |
mem_block_mask rd 2 |
large_block_mask rd 1 |
mem_used.fd rd 1 |
mem_used.bk rd 1 |
366,6 → 364,8 |
fat32part rd 1 ; for boot 0x1 |
cdpos rd 1 |
sb16 rd 1 |
;CPUID information |
cpu_vendor rd 3 |
cpu_sign rd 1 |
/kernel/trunk/hid/mousedrv.inc |
---|
114,25 → 114,29 |
movzx edx, byte [display_data+ebx+eax] |
shl edx, 8 |
mov esi, [edx+SLOT_BASE+APPDATA.cursor] |
mov ecx, [edx+SLOT_BASE+APPDATA.cursor] |
cmp esi, [current_cursor] |
cmp ecx, [current_cursor] |
je .draw |
; cmp [esi+CURSOR.magic], 'CURS' |
cmp [ecx+CURSOR.magic], 'CURS' |
jne .fail |
push ecx |
call [select_hw_cursor] |
mov [current_cursor], ecx |
; cmp [ecx+CURSOR.size], CURSOR_SIZE |
; jne .fail |
push esi |
call [select_hw_cursor] |
mov [current_cursor], esi |
.draw: |
stdcall [set_hw_cursor], esi |
stdcall [set_hw_cursor], ecx |
popad |
ret |
.fail: |
mov ecx, [def_cursor] |
mov [edx+SLOT_BASE+APPDATA.cursor], ecx |
stdcall [set_hw_cursor], ecx ; stdcall: [esp]=ebx,eax |
stdcall [set_hw_cursor], ecx |
popad |
ret |
/kernel/trunk/docs/sysfuncr.txt |
---|
1133,7 → 1133,18 |
====================================================================== |
== ãªæ¨ï 21, ¯®¤äãªæ¨ï 4 - ãáâ ®¢¨âì ¡ §®¢ë© ¯®àâ Sound Blaster. = |
====================================================================== |
¤ «¥ |
à ¬¥âàë: |
* eax = 21 - ®¬¥à äãªæ¨¨ |
* ebx = 4 - ®¬¥à ¯®¤äãªæ¨¨ |
* ecx = ®¬¥à ¡ §®¢®£® ¯®àâ |
®§¢à é ¥¬®¥ § 票¥: |
* eax = 0 - ãá¯¥è® |
* eax = -1 - ®è¨¡®çë© ®¬¥à ¯®àâ |
¬¥ç ¨ï: |
* ®¬¥à ¯®àâ ¤®«¦¥ 㤮¢«¥â¢®àïâì ãá«®¢¨ï¬ 0x100<=ecx<=0xFFFF. |
* áâ ®¢ª ¡ §ë 㦠¤«ï à ¡®âë äãªæ¨© 25, 28, 55. |
* ®«ãç¨âì ãáâ ®¢«¥ë© ¡ §®¢ë© ¯®àâ ¬®¦® ¢ë§®¢®¬ |
¯®¤äãªæ¨¨ 4 äãªæ¨¨ 26. |
====================================================================== |
========= ãªæ¨ï 21, ¯®¤äãªæ¨ï 5 - ãáâ ®¢¨âì ï§ëª á¨á⥬ë. ======== |
1201,7 → 1212,18 |
====================================================================== |
===== ãªæ¨ï 21, ¯®¤äãªæ¨ï 10 - ãáâ ®¢¨âì ª « DMA ¤«ï §¢ãª . ==== |
====================================================================== |
¤ «¥ : |
à ¬¥âàë: |
* eax = 21 - ®¬¥à äãªæ¨¨ |
* ebx = 10 - ®¬¥à ¯®¤äãªæ¨¨ |
* ecx = ®¬¥à ª « (®â 0 ¤® 3 ¢ª«îç¨â¥«ì®) |
®§¢à é ¥¬®¥ § 票¥: |
* eax = 0 - ãá¯¥è® |
* eax = -1 - ¥¢¥àë© ®¬¥à ª « |
¬¥ç ¨ï: |
* ®¬¥à ª « DMA ¨á¯®«ì§ã¥âáï ¢ |
¯®¤äãªæ¨¨ 1 äãªæ¨¨ 55. |
* ®«ãç¨âì ª « DMA ¤«ï §¢ãª ¬®¦® ¢ë§®¢®¬ |
¯®¤äãªæ¨¨ 10 äãªæ¨¨ 26. |
====================================================================== |
====================== ãªæ¨ï 21, ¯®¤äãªæ¨ï 11 ===================== |
1499,7 → 1521,22 |
====================================================================== |
============== ãªæ¨ï 25 - ãáâ ®¢¨âì £à®¬ª®áâì SBPro. ============== |
====================================================================== |
¤ «¥ |
à ¬¥âàë: |
* eax = 25 - ®¬¥à äãªæ¨¨ |
* ebx = çâ® ãáâ ¢«¨¢ âì: |
* 1 - ãáâ ®¢¨âì ®¡éãî £à®¬ª®áâì |
* 2 - ãáâ ®¢¨âì £à®¬ª®áâì CD-audio |
* cl = ã஢¥ì £à®¬ª®áâ¨: áâ à訥 4 ¡¨â ¤«ï «¥¢®© ª®«®ª¨, |
¬« ¤è¨¥ 4 - ¤«ï ¯à ¢®© |
®§¢à é ¥¬®¥ § 票¥: |
* eax = 0 - ãá¯¥è® |
* eax = 1 - ¥ ®¯à¥¤¥«¥ ¡ § SB |
* eax = 2 - ¥¢¥à ï ¯®¤äãªæ¨ï |
¬¥ç ¨ï: |
* ।¢ à¨â¥«ì® 㦮 ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ SB ¢ë§®¢®¬ |
¯®¤äãªæ¨¨ 4 äãªæ¨¨ 21. |
* ¬®âਠ⠪¦¥ äãªæ¨î 28 |
ãáâ ®¢ª¨ §¢ãª ¤«ï ¡®«¥¥ ¯®§¤¥£® áâ ¤ àâ SB16. |
====================================================================== |
===== ãªæ¨ï 26, ¯®¤äãªæ¨ï 1 - ¯®«ãç¨âì ¡ §®¢ë© ¯®àâ MPU MIDI. ===== |
1566,7 → 1603,14 |
====================================================================== |
=== ãªæ¨ï 26, ¯®¤äãªæ¨ï 4 - ¯®«ãç¨âì ¡ §®¢ë© ¯®àâ Sound Blaster. == |
====================================================================== |
¤ «¥ |
à ¬¥âàë: |
* eax = 26 - ®¬¥à äãªæ¨¨ |
* ebx = 4 - ®¬¥à ¯®¤äãªæ¨¨ |
®§¢à é ¥¬®¥ § 票¥: |
* eax = ®¬¥à ¡ §®¢®£® ¯®àâ |
¬¥ç ¨ï: |
* áâ ®¢ª ¡ §ë 㦠¤«ï à ¡®âë äãªæ¨© 25, 55. |
* áâ ®¢¨âì ¡ §®¢ë© ¯®àâ ¬®¦® ¢ë§®¢®¬ ¯®¤äãªæ¨¨ 4 äãªæ¨¨ 21. |
====================================================================== |
========== ãªæ¨ï 26, ¯®¤äãªæ¨ï 5 - ¯®«ãç¨âì ï§ëª á¨á⥬ë. ========= |
1635,7 → 1679,15 |
====================================================================== |
====== ãªæ¨ï 26, ¯®¤äãªæ¨ï 10 - ¯®«ãç¨âì ª « DMA ¤«ï §¢ãª . ===== |
====================================================================== |
¤ «¥ |
à ¬¥âàë: |
* eax = 26 - ®¬¥à äãªæ¨¨ |
* ebx = 10 - ®¬¥à ¯®¤äãªæ¨¨ |
®§¢à é ¥¬®¥ § 票¥: |
* eax = ®¬¥à ª « (®â 0 ¤® 3 ¢ª«îç¨â¥«ì®) |
¬¥ç ¨ï: |
* ®¬¥à ª « DMA ¨á¯®«ì§ã¥âáï ¢ ¯®¤äãªæ¨¨ 1 äãªæ¨¨ 55. |
* áâ ®¢¨âì ª « DMA ¤«ï §¢ãª ¬®¦® ¢ë§®¢®¬ |
¯®¤äãªæ¨¨ 10 äãªæ¨¨ 21. |
====================================================================== |
====================== ãªæ¨ï 26, ¯®¤äãªæ¨ï 11 ===================== |
1669,7 → 1721,21 |
====================================================================== |
=============== ãªæ¨ï 28 - ãáâ ®¢¨âì £à®¬ª®áâì SB16. ============== |
====================================================================== |
¤ «¥ |
à ¬¥âàë: |
* eax = 28 - ®¬¥à äãªæ¨¨ |
* ebx = çâ® ãáâ ¢«¨¢ âì: |
* 1 - ãáâ ®¢¨âì ®¡éãî £à®¬ª®áâì |
* 2 - ãáâ ®¢¨âì £à®¬ª®áâì CD-audio |
* cl = ã஢¥ì £à®¬ª®á⨠(0=off, 0xFF=max) |
®§¢à é ¥¬®¥ § 票¥: |
* eax = 0 - ãá¯¥è® |
* eax = 1 - ¥ ®¯à¥¤¥«¥ ¡ § SB |
* eax = 2 - ¥¢¥à ï ¯®¤äãªæ¨ï |
¬¥ç ¨ï: |
* ।¢ à¨â¥«ì® 㦮 ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ SB ¢ë§®¢®¬ |
¯®¤äãªæ¨¨ 4 äãªæ¨¨ 21. |
* â äãªæ¨ï ¯à¥¤®áâ ¢«ï¥â ¡®«ìè¥ ¢ ਠ⮢ ¤«ï £à®¬ª®áâ¨, |
祬 äãªæ¨ï 25. |
====================================================================== |
================ ãªæ¨ï 29 - ¯®«ãç¨âì á¨á⥬ãî ¤ âã. =============== |
/kernel/trunk/docs/sysfuncs.txt |
---|
1128,7 → 1128,18 |
====================================================================== |
====== Function 21, subfunction 4 - set Sound Blaster base port. ===== |
====================================================================== |
Removed |
Parameters: |
* eax = 21 - function number |
* ebx = 4 - subfunction number |
* ecx = number of the base port |
Returned value: |
* eax = 0 - success |
* eax = -1 - erratic port number |
Remarks: |
* Number of the port must satisfy to conditions 0x100<=ecx<=0xFFFF. |
* The installation of the base is necessary for |
functions 25, 28, 55. |
* To get base port use subfunction 4 of function 26. |
====================================================================== |
========== Function 21, subfunction 5 - set system language. ========= |
1193,7 → 1204,16 |
====================================================================== |
======== Function 21, subfunction 10 - set sound DMA channel. ======== |
====================================================================== |
Removed |
Parameters: |
* eax = 21 - function number |
* ebx = 10 - subfunction number |
* ecx = number of channel (from 0 up to 3 inclusively) |
Returned value: |
* eax = 0 - success |
* eax = -1 - incorrect channel number |
Remarks: |
* Number of DMA channel is used in subfunction 1 of function 55. |
* To get sound DMA channel use subfunction 10 of function 26. |
====================================================================== |
Function 21, subfunction 11 - enable/disable low-level access to HD. |
1485,7 → 1505,22 |
====================================================================== |
=================== Function 25 - set SBPro volume. ================== |
====================================================================== |
Removed |
Parameters: |
* eax = 25 - function number |
* ebx = what to set: |
* 1 - set common volume |
* 2 - set CD-audio volume |
* cl = volume level: high 4 bits for the left column, |
low 4 bits for the right one |
Returned value: |
* eax = 0 - success |
* eax = 1 - SB base is not defined |
* eax = 2 - incorrect subfunction |
Remarks: |
* Previously SB base port must be defined by |
subfunction 4 of function 21. |
* See also function 28 which sets |
volume for the later standard SB16. |
====================================================================== |
======== Function 26, subfunction 1 - get MPU MIDI base port. ======== |
1549,7 → 1584,14 |
====================================================================== |
====== Function 26, subfunction 4 - get Sound Blaster base port. ===== |
====================================================================== |
Removed |
Parameters: |
* eax = 26 - function number |
* ebx = 4 - subfunction number |
Returned value: |
* eax = base port number |
Remarks: |
* Bae port is used by functions 25, 55. |
* To set base port use subfunction 4 of function 21. |
====================================================================== |
========== Function 26, subfunction 5 - get system language. ========= |
1616,7 → 1658,14 |
====================================================================== |
======== Function 26, subfunction 10 - get sound DMA channel. ======== |
====================================================================== |
Removed |
Parameters: |
* eax = 26 - function number |
* ebx = 10 - subfunction number |
Returned value: |
* eax = number of the channel (from 0 to 3 inclusive) |
Remarks: |
* Number of the DMA channel is used by subfunction 1 of function 55. |
* To set the sound DMA channel use subfunction 10 of function 21. |
====================================================================== |
===================== Function 26, subfunction 11 ==================== |
1648,7 → 1697,20 |
====================================================================== |
=================== Function 28 - set SB16 volume. =================== |
====================================================================== |
Removed |
Parameters: |
* eax = 28 - function number |
* ebx = what to install: |
* 1 - install common volume |
* 2 - install CD-audio volume |
* cl = volume level (0=off, 0xFF=max) |
Returned value: |
* eax = 0 - success |
* eax = 1 - SB base is not defined |
* eax = 2 - incorrect subfunction |
Remarks: |
* Previously SB base port must be defined by |
subfunction 4 of function 21. |
* This function gives more variants for volume, that function 25. |
====================================================================== |
=================== Function 29 - get system date. =================== |
/kernel/trunk/kernel32.inc |
---|
207,6 → 207,7 |
; sound |
include "sound/sb16.inc" ; playback for Sound Blaster 16 |
include "sound/playnote.inc" ; player Note for Speaker PC |
; display |
/kernel/trunk/sound/playnote.inc |
---|
18,29 → 18,7 |
$Revision$ |
align 4 |
sound_interface: |
cmp eax, edi ; this is subfunction #55 ? |
jne retFunc55 ; if no then return. |
cmp byte [sound_flag],0 |
jne retFunc55 |
movzx eax, byte [countDelayNote] |
or al, al ; player is busy ? |
jnz retFunc55 ; return counter delay Note |
mov [memAdrNote],edx |
call get_pid |
mov [pidProcessNote],eax |
xor eax, eax ; Ok! EAX = 0 |
retFunc55: |
mov [esp+36], eax ; return value EAX for application |
ret |
iglobal |
align 4 |
kontrOctave dw 0x4742, 0x4342, 0x3F7C, 0x3BEC, 0x388F, 0x3562 |
dw 0x3264, 0x2F8F, 0x2CE4, 0x2A5F, 0x2802, 0x25BF |
memAdrNote dd 0 |
49,7 → 27,6 |
count_timer_Note dd 1 |
mem8253r42 dw 0 |
countDelayNote db 0 |
endg |
playNote: |
; jmp NotPlayNotes |
/kernel/trunk/sound/sb16.inc |
---|
0,0 → 1,354 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; SB16.INC ;; |
;; ;; |
;; Sound Blaster 16 functions for MenuetOS ;; |
;; ;; |
;; Copyright 2002 Paolo Minazzi, paolo.minazzi@inwind.it ;; |
;; ;; |
;; See file COPYING for details ;; |
;; ;; |
;; - 11.07.2002 8 bit stereo mode - Ville Turjanmaa ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
$Revision$ |
SB16_load_music equ 0xc0000000 |
SB16_play_music equ 0xc0000001 |
DMAPage equ 0x2A |
Rate equ 44100 |
;SB16_Status equ SB16Buffer+65536 |
iglobal |
sound_data_format dd 0x1 |
sound_data_length dd 65536 |
sound_data_freq dd 44100 |
endg |
sound_interface: |
cmp eax,0 ; Load data |
jne no_SB16_load_music |
mov edi,[TASK_BASE] |
add edi,TASKDATA.mem_start |
add ebx,[edi] |
call code_SB16_load_music |
ret |
no_SB16_load_music: |
cmp eax,1 ; Play data |
jne no_SB16_play_music |
call code_SB16_play_music |
ret |
no_SB16_play_music: |
cmp eax,2 ; Set data formats |
jne no_SB16_data_format |
cmp ebx,0 ; ebx=0 play format |
jne no_sound_format |
mov [sound_data_format],ecx ; 1=8b mono, 2=8b stereo |
ret |
no_sound_format: |
cmp ebx,1 ; ebx=1 data length |
jne no_sound_length |
mov [sound_data_length],ecx ; |
ret |
no_sound_length: |
cmp ebx,2 ; ebx=2 sound data frequency |
jne no_sound_freq |
mov [sound_data_freq],ecx |
ret |
no_sound_freq: |
ret |
no_SB16_data_format: |
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
cmp eax, edi ; this is subfunction #55 ? |
jne retFunc55 ; if no then return. |
cmp byte [sound_flag],0 |
jne retFunc55 |
movzx eax, byte [countDelayNote] |
or al, al ; player is busy ? |
jnz retFunc55 ; return counter delay Note |
; mov eax, [TASK_BASE] |
; mov eax, [eax+0x10] ; address application im memory |
; add eax, edx ; add offset Delay-Note string |
; mov [memAdrNote], eax |
mov [memAdrNote],edx |
mov eax,[TASK_BASE] |
mov eax,[eax+TASKDATA.pid] |
mov [pidProcessNote],eax |
xor eax, eax ; Ok! EAX = 0 |
retFunc55: |
mov [esp+36], eax ; return value EAX for application |
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
ret |
code_SB16_play_music: |
cmp [sound_data_format],1 |
jne no_sound_8bm |
call sb_play_8b_mono |
ret |
no_sound_8bm: |
cmp [sound_data_format],2 |
jne no_sound_8bs |
call sb_play_8b_stereo |
ret |
no_sound_8bs: |
ret |
Blaster_command: |
push eax |
push ecx |
push edx |
mov dx,word [sb16] |
add dx,0xc |
mov cx,1000 |
bcl1: |
in al,dx |
and al,128 |
jz bcl2 |
loop bcl1 |
bcl2: |
mov al,[esp+8] |
mov dx,[esp+0] |
add dx,word [sb16] |
out dx,al |
pop edx |
pop ecx |
pop eax |
ret |
sb_play_8b_stereo: |
pusha |
call sb_set_dma |
call sb_set_stereo |
mov dx,0xc |
mov al,0xa8 |
call Blaster_command |
mov al,0x40 |
call Blaster_command |
mov al,245 |
call Blaster_command |
mov al,0x48 |
call Blaster_command |
mov al,0xff |
call Blaster_command |
call Blaster_command |
mov al,0x91 |
call Blaster_command |
popa |
ret |
sb_set_stereo: |
push eax |
push edx |
call sb_wait |
mov dx,word [sb16] |
add dx,0x4 |
mov al,0xe |
out dx,al |
inc dx |
in al,dx |
and al,253 |
or al,2 ; stereo |
out dx,al |
pop edx |
pop eax |
ret |
code_SB16_load_music: |
cmp byte [SB16_Status],1 |
je nol |
mov edi,SB16Buffer |
mov esi,ebx |
mov ecx,65536/4 |
cld |
rep movsd |
nol: ret |
iglobal |
dma_table db 0x87,0x83,0x81,0x82 |
endg |
;-------------------------------- |
; program dma |
;-------------------------------- |
sb_set_dma: |
pusha |
mov eax,[sound_dma] |
add eax,4 |
out 0xa,al |
mov al,0 |
out 0xc,al |
mov eax,[sound_dma] |
add eax,0x48 |
out 0xb,al |
mov edx,[sound_dma] |
shl edx,1 |
mov al,0 |
out dx,al |
mov al,0 |
out dx,al |
mov edx,[sound_dma] |
add edx,dma_table |
movzx edx,byte [edx] |
mov al,DMAPage |
out dx,al |
mov edx,[sound_dma] |
shl edx,1 |
inc edx |
mov eax,[sound_data_length] |
dec eax |
and eax,0xff |
; mov al,(DataLength-1) and 0xff |
out dx,al |
mov eax,[sound_data_length] |
dec eax |
shr eax,8 |
; mov al,(DataLength-1) shr 8 |
out dx,al |
mov eax,[sound_dma] ; DMA |
out 0xa,al |
popa |
ret |
sb_play_8b_mono: |
call sb_set_dma |
cmp byte [SB16_Status],1 |
jne contsb16 |
jmp retserve |
contsb16: |
mov dx,word [sb16] |
add dx,4 |
mov ecx,[sound_dma] |
mov ax,0x01 |
shl ax,cl |
shl ax,8 |
add ax,0x81 |
out dx,ax |
mov ax,0f280h ;enable irq5 |
out dx,ax |
adr1_SB: mov dx,word [sb16] |
add dx,0ch |
in al,dx |
and al,080h |
jnz adr1_SB |
call sb_set_stereo |
mov al,0d1h |
out dx,al |
mov dx,word [sb16] |
add dx,0ch |
call sb_wait |
mov al,40h ; Rate |
out dx,al |
call sb_wait |
mov al,256-1000000/Rate |
out dx,al |
call sb_wait |
mov al,14h ; Datalength |
out dx,al |
call sb_wait |
mov eax,[sound_data_length] |
dec eax |
and eax,0xff |
;mov al,(DataLength-1) and 0xff |
out dx,al |
call sb_wait |
mov eax,[sound_data_length] |
dec eax |
shr eax,8 |
;mov al,(DataLength-1) shr 8 |
out dx,al |
retserve: |
ret |
sb_wait: in al,dx ;wait |
and al,080h |
jnz sb_wait |
ret |
;**************************************** |
; END CODE SB16 by Minazzi Paolo |
;*************************************** |
Property changes: |
Added: svn:keywords |
+Rev |
\ No newline at end of property |