mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-11-25 02:09:36 +03:00
from Nable: Sound Blaster driver
git-svn-id: svn://kolibrios.org@802 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
e080f21757
commit
77a4ede567
@ -19,58 +19,39 @@ conf_fname db '/sys/sys.conf',0
|
||||
|
||||
; set soke kernel configuration
|
||||
proc set_kernel_conf
|
||||
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
|
||||
pop eax
|
||||
stdcall strtoint,eax
|
||||
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
|
||||
pop eax
|
||||
stdcall strtoint,eax
|
||||
mov [mouse_speed_factor], ax
|
||||
|
||||
;mouse_delay
|
||||
lea eax,[par]
|
||||
push eax
|
||||
invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay, eax,30, ugui_mouse_delay_def
|
||||
pop eax
|
||||
stdcall strtoint,eax
|
||||
|
||||
;mouse_delay
|
||||
lea eax,[par]
|
||||
push eax
|
||||
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
|
||||
invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def
|
||||
pop eax
|
||||
stdcall strtoint,eax
|
||||
|
||||
;midibase
|
||||
lea eax,[par]
|
||||
push eax
|
||||
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
|
||||
@ -80,9 +61,8 @@ endl
|
||||
inc eax
|
||||
mov [midisp], eax
|
||||
@@:
|
||||
|
||||
popad
|
||||
ret
|
||||
popad
|
||||
ret
|
||||
endp
|
||||
|
||||
ugui db 'gui',0
|
||||
@ -92,10 +72,6 @@ ugui_mouse_delay db 'mouse_delay',0
|
||||
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
|
||||
|
||||
@ -105,7 +81,7 @@ locals
|
||||
par db 30 dup(?)
|
||||
endl
|
||||
pushad
|
||||
|
||||
|
||||
;[net]
|
||||
;active
|
||||
lea eax,[par]
|
||||
@ -117,7 +93,7 @@ endl
|
||||
add eax, 3
|
||||
mov [stack_config], eax
|
||||
call ash_eth_enable
|
||||
|
||||
|
||||
;addr
|
||||
lea eax,[par]
|
||||
push eax
|
||||
@ -125,7 +101,7 @@ endl
|
||||
pop eax
|
||||
stdcall do_inet_adr,eax
|
||||
mov [stack_ip], eax
|
||||
|
||||
|
||||
;mask
|
||||
lea eax,[par]
|
||||
push eax
|
||||
@ -133,7 +109,7 @@ endl
|
||||
pop eax
|
||||
stdcall do_inet_adr,eax
|
||||
mov [subnet_mask], eax
|
||||
|
||||
|
||||
;gate
|
||||
lea eax,[par]
|
||||
push eax
|
||||
@ -141,7 +117,7 @@ endl
|
||||
pop eax
|
||||
stdcall do_inet_adr,eax
|
||||
mov [gateway_ip], eax
|
||||
.do_not_set_net:
|
||||
.do_not_set_net:
|
||||
popad
|
||||
ret
|
||||
|
||||
@ -158,7 +134,7 @@ unet_def db 0
|
||||
; convert string to DWord
|
||||
proc strtoint stdcall,strs
|
||||
pushad
|
||||
|
||||
|
||||
mov eax,[strs]
|
||||
inc eax
|
||||
mov bl,[eax]
|
||||
@ -177,7 +153,7 @@ proc strtoint stdcall,strs
|
||||
.exit:
|
||||
mov [esp+28],eax
|
||||
popad
|
||||
ret
|
||||
ret
|
||||
endp
|
||||
|
||||
; convert string to DWord for decimal value
|
||||
@ -206,16 +182,16 @@ proc strtoint_dec stdcall,strs
|
||||
|
||||
xchg ebx,ecx
|
||||
|
||||
|
||||
xor ecx,ecx
|
||||
|
||||
|
||||
@@:
|
||||
xor ecx,ecx
|
||||
|
||||
|
||||
@@:
|
||||
xor eax,eax
|
||||
lodsb
|
||||
cmp al,0
|
||||
je .eend
|
||||
|
||||
|
||||
sub al,30h
|
||||
imul ebx
|
||||
add ecx,eax
|
||||
@ -226,7 +202,7 @@ proc strtoint_dec stdcall,strs
|
||||
xchg eax,ebx
|
||||
pop ecx
|
||||
jmp @b
|
||||
|
||||
|
||||
.eend:
|
||||
mov [esp+28],ecx
|
||||
popad
|
||||
@ -252,12 +228,12 @@ proc strtoint_hex stdcall,strs
|
||||
xor ecx,ecx
|
||||
mov esi,[strs]
|
||||
|
||||
@@:
|
||||
@@:
|
||||
xor eax,eax
|
||||
lodsb
|
||||
cmp al,0
|
||||
je .eend
|
||||
|
||||
|
||||
cmp al,'a'
|
||||
jae .bm
|
||||
cmp al,'A'
|
||||
@ -266,15 +242,15 @@ proc strtoint_hex stdcall,strs
|
||||
.bm: ; 57h
|
||||
sub al,57h
|
||||
jmp .do
|
||||
|
||||
|
||||
.bb: ; 37h
|
||||
sub al,37h
|
||||
jmp .do
|
||||
|
||||
.cc: ; 30h
|
||||
sub al,30h
|
||||
|
||||
.do:
|
||||
|
||||
.do:
|
||||
imul ebx
|
||||
add ecx,eax
|
||||
shr ebx,4
|
||||
@ -285,13 +261,13 @@ proc strtoint_hex stdcall,strs
|
||||
mov [esp+28],ecx
|
||||
popad
|
||||
ret
|
||||
endp
|
||||
endp
|
||||
|
||||
|
||||
; convert string to DWord for IP addres
|
||||
proc do_inet_adr stdcall,strs
|
||||
pushad
|
||||
|
||||
|
||||
mov esi,[strs]
|
||||
mov ebx,0
|
||||
.next:
|
||||
|
@ -17,10 +17,10 @@ PID_KERNEL equ 1 ;os_idle thread
|
||||
align 4
|
||||
proc attach_int_handler stdcall, irq:dword, handler:dword, access_rights:dword
|
||||
|
||||
mov ebx, [irq] ;irq num
|
||||
mov ebx, [irq] ;irq num
|
||||
test ebx, ebx
|
||||
jz .err
|
||||
cmp ebx, 15 ; hidnplayr says: we only have 16 IRQ's
|
||||
cmp ebx, 15 ; hidnplayr says: we only have 16 IRQ's
|
||||
ja .err
|
||||
mov eax, [handler]
|
||||
test eax, eax
|
||||
@ -28,24 +28,20 @@ proc attach_int_handler stdcall, irq:dword, handler:dword, access_rights:dword
|
||||
cmp [irq_owner + 4 * ebx], 0
|
||||
je @f
|
||||
|
||||
mov ecx, [irq_rights + 4 * ebx] ; Rights : 0 - full access, 1 - read only, 2 - forbidden
|
||||
mov ecx, [irq_rights + 4 * ebx] ; Rights : 0 - full access, 1 - read only, 2 - forbidden
|
||||
test ecx, ecx
|
||||
jnz .err
|
||||
|
||||
@@:
|
||||
@@:
|
||||
mov [irq_tab+ebx*4], eax
|
||||
|
||||
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 ;eax
|
||||
;pop eax
|
||||
mov [irq_owner + 4 * ebx], PID_KERNEL ; all handlers belong to a kernel
|
||||
|
||||
stdcall enable_irq, [irq]
|
||||
mov eax, 1
|
||||
ret
|
||||
.err:
|
||||
xor eax, eax
|
||||
|
@ -15,7 +15,6 @@ $Revision$
|
||||
|
||||
align 32
|
||||
irq0:
|
||||
; pushfd
|
||||
pushad
|
||||
mov ax, app_data ;
|
||||
mov ds, ax
|
||||
@ -42,7 +41,6 @@ irq0:
|
||||
mov [DONT_SWITCH], byte 0
|
||||
|
||||
popad
|
||||
; popfd
|
||||
iretd
|
||||
|
||||
.change_task:
|
||||
@ -227,9 +225,6 @@ do_change_task:
|
||||
@@:
|
||||
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
|
||||
|
||||
|
@ -128,10 +128,10 @@ iglobal
|
||||
dd sys_settime ; 22-setting date,time,clock and alarm-clock
|
||||
dd 0
|
||||
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist
|
||||
dd sys_sb16 ; 25-SetSb16
|
||||
dd 0 ;
|
||||
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,.
|
||||
dd 0
|
||||
dd sys_sb16II ; 28-SetSb16
|
||||
dd 0 ;
|
||||
dd 0
|
||||
dd sys_current_directory ; 30-Get/SetCurrentDirectory
|
||||
dd 0
|
||||
@ -208,10 +208,10 @@ iglobal
|
||||
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 cross_order ; 25-SetSb16
|
||||
dd undefined_syscall ; 25-reserved
|
||||
dd cross_order ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,.
|
||||
dd undefined_syscall ; 27-reserved
|
||||
dd cross_order ; 28-SetSb16
|
||||
dd undefined_syscall ; 28-reserved
|
||||
dd sys_date ; 29-GetDate
|
||||
dd cross_order ; 30-Get/SetCurrentDirectory
|
||||
dd undefined_syscall ; 31-reserved
|
||||
@ -258,5 +258,5 @@ iglobal
|
||||
dd cross_order ; 72-Send window message
|
||||
times 255 - ( ($-servetable2) /4 ) dd undefined_syscall
|
||||
dd sys_end ; -1-end application
|
||||
|
||||
|
||||
endg
|
||||
|
@ -90,6 +90,7 @@ szHwMouse db 'ATI2D',0
|
||||
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
|
||||
@ -146,7 +147,6 @@ putpixel dd __sys_putpixel
|
||||
|
||||
align 4
|
||||
keyboard dd 1
|
||||
sound_dma dd 1
|
||||
syslang dd 1
|
||||
|
||||
boot_y dd 10
|
||||
@ -283,7 +283,9 @@ irq_tab rd 16
|
||||
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
|
||||
@ -364,8 +366,6 @@ hdpos rd 1 ; for boot 0x1
|
||||
fat32part rd 1 ; for boot 0x1
|
||||
cdpos rd 1
|
||||
|
||||
sb16 rd 1
|
||||
|
||||
;CPUID information
|
||||
cpu_vendor rd 3
|
||||
cpu_sign rd 1
|
||||
|
@ -41,7 +41,7 @@
|
||||
* esi = 0xXYRRGGBB - 梥⠧ £®«®¢ª
|
||||
* RR, GG, BB ®¯à¥¤¥«ïîâ á ¬ 梥â
|
||||
* Y=0 - ®¡ë箥 ®ª®, Y=1 - ¥¯¥à¥¬¥é ¥¬®¥ ®ª®
|
||||
* X ®¯à¥¤¥«ï¥â £à ¤¨¥â § £®«®¢ª : X=0 - ¥â £à ¤¨¥â ,
|
||||
* X ®¯à¥¤¥«ï¥â £à ¤¨¥â § £®«®¢ª : X=0 - ¥â £à ¤¨¥â ,
|
||||
X=8 - ®¡ëçë© £à ¤¨¥â,
|
||||
¤«ï ®ª® ⨯ II X=4 - ¥£ â¨¢ë© £à ¤¨¥â
|
||||
* ¯à®ç¨¥ § 票ï X ¨ Y § १¥à¢¨à®¢ ë
|
||||
@ -67,7 +67,7 @@
|
||||
ª®®à¤¨ â (¨«¨, ¢®§¬®¦®, ®¡¥) áç¨â ¥âáï ã«¥¬, ¥á«¨ ¨ íâ®
|
||||
¥ ¯®¬®£ ¥â, ⮠ᮮ⢥âáâ¢ãî騩 à §¬¥à (¨«¨, ¢®§¬®¦®, ®¡ )
|
||||
ãáâ ¢«¨¢ ¥âáï ¢ à §¬¥à íªà .
|
||||
|
||||
|
||||
„ «¥¥ ®¡®§ 稬 xpos,ypos,xsize,ysize - § 票ï, ¯¥à¥¤ ¢ ¥¬ë¥
|
||||
¢ ebx,ecx. Š®®à¤¨ âë ¯à¨¢®¤ïâáï ®â®á¨â¥«ì® «¥¢®£® ¢¥à奣®
|
||||
㣫 ®ª , ª®â®àë©, â ª¨¬ ®¡à §®¬, § ¤ ¥âáï ª ª (0,0), ª®®à¤¨ âë
|
||||
@ -661,7 +661,7 @@
|
||||
* “§ âì, ª ª®¥ ®ª® ï¥âáï ªâ¨¢ë¬, ¬®¦® ¢ë§®¢®¬ ¯®¤äãªæ¨¨ 7.
|
||||
|
||||
======================================================================
|
||||
”ãªæ¨ï 18, ¯®¤äãªæ¨ï 4 - ¯®«ãç¨âì áçñâ稪 ¯ãáâëå ⠪⮢ ¢ ᥪã¤ã.
|
||||
”ãªæ¨ï 18, ¯®¤äãªæ¨ï 4 - ¯®«ãç¨âì áçñâ稪 ¯ãáâëå ⠪⮢ ¢ ᥪã¤ã.
|
||||
======================================================================
|
||||
<EFBFBD>®¤ ¯ãáâ묨 ⠪⠬¨ ¯®¨¬ ¥âáï ¢à¥¬ï, ¢ ª®â®à®¥ ¯à®æ¥áá®à ¯à®áâ ¨¢ ¥â
|
||||
¢ ®¦¨¤ ¨¨ ¯à¥àë¢ ¨ï (¢ ¨áâàãªæ¨¨ hlt).
|
||||
@ -682,7 +682,7 @@
|
||||
* eax = ⠪⮢ ï ç áâ®â (¯® ¬®¤ã«î 2^32 ⠪⮢ = 4ƒƒæ)
|
||||
|
||||
======================================================================
|
||||
”ãªæ¨ï 18, ¯®¤äãªæ¨ï 6 - á®åà ¨âì à ¬¤¨áª ¢ ä ©« ¦ñá⪮¬ ¤¨áª¥.
|
||||
”ãªæ¨ï 18, ¯®¤äãªæ¨ï 6 - á®åà ¨âì à ¬¤¨áª ¢ ä ©« ¦ñá⪮¬ ¤¨áª¥.
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 18 - ®¬¥à äãªæ¨¨
|
||||
@ -763,7 +763,7 @@
|
||||
‡ ¬¥ç ¨ï:
|
||||
* Œ¨¨¬¨§¨à®¢ ®¥ ®ª® á â®çª¨ §à¥¨ï äãªæ¨¨ 9 á®åà ï¥â ¯®«®¦¥¨¥
|
||||
¨ à §¬¥àë.
|
||||
* ‚®ááâ ®¢«¥¨¥ ®ª ¯à¨«®¦¥¨ï ¯à®¨á室¨â ¯à¨ ªâ¨¢¨§¨à®¢ ¨¨
|
||||
* ‚®ááâ ®¢«¥¨¥ ®ª ¯à¨«®¦¥¨ï ¯à®¨á室¨â ¯à¨ ªâ¨¢¨§¨à®¢ ¨¨
|
||||
¯®¤äãªæ¨¥© 3.
|
||||
* Ž¡ëç® ¥â ¥®¡å®¤¨¬®á⨠ ᢮à 稢 âì/à §¢®à 稢 âì ᢮ñ ®ª®:
|
||||
᢮à 稢 ¨¥ ®ª ®áãé¥á⢫ï¥âáï á¨á⥬®© ¯à¨ ¦ ⨨ ª®¯ªã
|
||||
@ -1026,7 +1026,7 @@ dd 638
|
||||
* ¨ ç¥ eax = ®¬¥à á«®â
|
||||
|
||||
======================================================================
|
||||
”ãªæ¨ï 18, ¯®¤äãªæ¨ï 22 - ®¯¥à 樨 á ®ª®¬ ¤à㣮£® ¯à®æ¥áá /¯®â®ª .
|
||||
”ãªæ¨ï 18, ¯®¤äãªæ¨ï 22 - ®¯¥à 樨 á ®ª®¬ ¤à㣮£® ¯à®æ¥áá /¯®â®ª .
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 18 - ®¬¥à äãªæ¨¨
|
||||
@ -1063,7 +1063,7 @@ dd 638
|
||||
* eax = 0 - ãᯥè®
|
||||
* eax = 1 - ¥ ®¯à¥¤¥«ñ ¡ §®¢ë© ¯®àâ
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20>।¢ à¨â¥«ì® ¤®«¦¥ ¡ëâì ®¯à¥¤¥«ñ ¡ §®¢ë© ¯®à⠢맮¢®¬
|
||||
* <20>।¢ à¨â¥«ì® ¤®«¦¥ ¡ëâì ®¯à¥¤¥«ñ ¡ §®¢ë© ¯®à⠢맮¢®¬
|
||||
¯®¤äãªæ¨¨ 1 äãªæ¨¨ 21.
|
||||
|
||||
======================================================================
|
||||
@ -1079,7 +1079,7 @@ dd 638
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20>®¬¥à ¯®àâ ¤®«¦¥ 㤮¢«¥â¢®àïâì ãá«®¢¨ï¬ 0x100<=ecx<=0xFFFF.
|
||||
* “áâ ®¢ª ¡ §ë 㦠¤«ï à ¡®âë äãªæ¨¨ 20.
|
||||
* <20>®«ãç¨âì ãáâ ®¢«¥ë© ¡ §®¢ë© ¯®àâ ¬®¦® ¢ë§®¢®¬
|
||||
* <20>®«ãç¨âì ãáâ ®¢«¥ë© ¡ §®¢ë© ¯®àâ ¬®¦® ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 1 äãªæ¨¨ 26.
|
||||
|
||||
======================================================================
|
||||
@ -1109,7 +1109,7 @@ dd 638
|
||||
®à¬ «ì ï à ᪫ ¤ª , ¯®á«¥ 祣® ¨§ ª®¤ ¢ëç¨â ¥âáï 0x60;
|
||||
¥á«¨ ¥ ¦ â ¨ ®¤ ¨§ ã¯à ¢«ïîé¨å ª« ¢¨è, â® ¨á¯®«ì§ã¥âáï
|
||||
®à¬ «ì ï à ᪫ ¤ª .
|
||||
* <20>®«ãç¨âì à ᪫ ¤ª¨ ¨ ¨¤¥â¨ä¨ª â®à áâà ë ¬®¦® á ¯®¬®éìî
|
||||
* <20>®«ãç¨âì à ᪫ ¤ª¨ ¨ ¨¤¥â¨ä¨ª â®à áâà ë ¬®¦® á ¯®¬®éìî
|
||||
¯®¤äãªæ¨¨ 2 äãªæ¨¨ 26.
|
||||
* ˆ¤¥â¨ä¨ª â®à áâà ë - £«®¡ «ì ï á¨á⥬ ï ¯¥à¥¬¥ ï, ª®â®à ï
|
||||
á ¬¨¬ ï¤à®¬ ¥ ¨á¯®«ì§ã¥âáï; ®¤ ª® ¯à¨«®¦¥¨¥ @panel ®â®¡à ¦ ¥â
|
||||
@ -1127,24 +1127,13 @@ dd 638
|
||||
* eax = 0
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20> § CD ¨á¯®«ì§ã¥âáï äãªæ¨¥© 24.
|
||||
* <20>®«ãç¨âì ãáâ ®¢«¥ãî ¡ §ã CD ¬®¦® ¢ë§®¢®¬
|
||||
* <20>®«ãç¨âì ãáâ ®¢«¥ãî ¡ §ã CD ¬®¦® ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 3 äãªæ¨¨ 26.
|
||||
|
||||
======================================================================
|
||||
== ”ãªæ¨ï 21, ¯®¤äãªæ¨ï 4 - ãáâ ®¢¨âì ¡ §®¢ë© ¯®àâ Sound Blaster. =
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 21 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 4 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
* ecx = ®¬¥à ¡ §®¢®£® ¯®àâ
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = 0 - ãᯥè®
|
||||
* eax = -1 - ®è¨¡®çë© ®¬¥à ¯®àâ
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20>®¬¥à ¯®àâ ¤®«¦¥ 㤮¢«¥â¢®àïâì ãá«®¢¨ï¬ 0x100<=ecx<=0xFFFF.
|
||||
* “áâ ®¢ª ¡ §ë 㦠¤«ï à ¡®âë äãªæ¨© 25, 28, 55.
|
||||
* <20>®«ãç¨âì ãáâ ®¢«¥ë© ¡ §®¢ë© ¯®àâ ¬®¦® ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 4 äãªæ¨¨ 26.
|
||||
“¤ «¥
|
||||
|
||||
======================================================================
|
||||
========= ”ãªæ¨ï 21, ¯®¤äãªæ¨ï 5 - ãáâ ®¢¨âì ï§ëª á¨á⥬ë. ========
|
||||
@ -1181,7 +1170,7 @@ dd 638
|
||||
* <20>¥ á«¥¤ã¥â ¨§¬¥ïâì ¡ §ã, ª®£¤ ª ª®¥-¨¡ã¤ì ¯à¨«®¦¥¨¥ à ¡®â ¥â
|
||||
á ¦ñá⪨¬ ¤¨áª®¬. …᫨ ¥ å®â¨â¥ £«îª®¢ á¨á⥬ë.
|
||||
* <20>®«ãç¨âì ãáâ ®¢«¥ãî ¡ §ã ¬®¦® ¢ë§®¢®¬ ¯®¤äãªæ¨¨ 7 äãªæ¨¨ 26.
|
||||
* ‘«¥¤ã¥â â ª¦¥ ®¯à¥¤¥«¨âì ¨á¯®«ì§ã¥¬ë© à §¤¥« ¦ñá⪮£® ¤¨áª
|
||||
* ‘«¥¤ã¥â â ª¦¥ ®¯à¥¤¥«¨âì ¨á¯®«ì§ã¥¬ë© à §¤¥« ¦ñá⪮£® ¤¨áª
|
||||
¯®¤äãªæ¨¥© 8.
|
||||
|
||||
======================================================================
|
||||
@ -1204,26 +1193,15 @@ dd 638
|
||||
* <20>®«ãç¨âì ãáâ ®¢«¥ë© à §¤¥« ¬®¦® ¢ë§®¢®¬ ¯®¤äãªæ¨¨ 8
|
||||
äãªæ¨¨ 26.
|
||||
* <20>஢¥à®ª ª®à४â®áâì ¥ ¤¥« ¥âáï.
|
||||
* “§ âì ç¨á«® à §¤¥«®¢ ¦ñá⪮¬ ¤¨áª¥ ¬®¦® ¢ë§®¢®¬
|
||||
* “§ âì ç¨á«® à §¤¥«®¢ ¦ñá⪮¬ ¤¨áª¥ ¬®¦® ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 11 äãªæ¨¨ 18.
|
||||
* ‘«¥¤ã¥â â ª¦¥ ®¯à¥¤¥«¨âì ¨á¯®«ì§ã¥¬ãî ¡ §ã ¦ñá⪮£® ¤¨áª
|
||||
* ‘«¥¤ã¥â â ª¦¥ ®¯à¥¤¥«¨âì ¨á¯®«ì§ã¥¬ãî ¡ §ã ¦ñá⪮£® ¤¨áª
|
||||
¯®¤äãªæ¨¥© 7.
|
||||
|
||||
======================================================================
|
||||
===== ”ãªæ¨ï 21, ¯®¤äãªæ¨ï 10 - ãáâ ®¢¨âì ª « DMA ¤«ï §¢ãª . ====
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 21 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 10 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
* ecx = ®¬¥à ª « (®â 0 ¤® 3 ¢ª«îç¨â¥«ì®)
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = 0 - ãᯥè®
|
||||
* eax = -1 - ¥¢¥àë© ®¬¥à ª «
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20>®¬¥à ª « DMA ¨á¯®«ì§ã¥âáï ¢
|
||||
¯®¤äãªæ¨¨ 1 äãªæ¨¨ 55.
|
||||
* <20>®«ãç¨âì ª « DMA ¤«ï §¢ãª ¬®¦® ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 10 äãªæ¨¨ 26.
|
||||
“¤ «¥ :
|
||||
|
||||
======================================================================
|
||||
====================== ”ãªæ¨ï 21, ¯®¤äãªæ¨ï 11 =====================
|
||||
@ -1308,13 +1286,13 @@ dd 638
|
||||
* ebx = ç áâ®â ¢¥à⨪ «ì®© à §¢ñà⪨ (¢ ƒæ)
|
||||
* ecx = ®¬¥à ⥪ã饣® ¢¨¤¥®à¥¦¨¬
|
||||
‡ ¬¥ç ¨ï:
|
||||
* „à ©¢¥à ¯à¥¤¢ à¨â¥«ì® ¤®«¦¥ ¡ëâì ¨¨æ¨ «¨§¨à®¢ ¢ë§®¢®¬
|
||||
* „à ©¢¥à ¯à¥¤¢ à¨â¥«ì® ¤®«¦¥ ¡ëâì ¨¨æ¨ «¨§¨à®¢ ¢ë§®¢®¬
|
||||
äãªæ¨¨ ¤à ©¢¥à 1.
|
||||
* …᫨ ã¦ë ⮫쪮 à §¬¥àë íªà , 楫¥á®®¡à §¥© ¨á¯®«ì§®¢ âì
|
||||
äãªæ¨î 14 á ãçñ⮬ ⮣®, çâ® ® ¢®§¢à é ¥â à §¬¥àë 1 ¬¥ìè¥.
|
||||
|
||||
======================================================================
|
||||
= ”ãªæ¨ï 21, ¯®¤äãªæ¨ï 13, ¯®¤¯®¤äãªæ¨ï 3 - ãáâ ®¢¨âì ¢¨¤¥®à¥¦¨¬.
|
||||
= ”ãªæ¨ï 21, ¯®¤äãªæ¨ï 13, ¯®¤¯®¤äãªæ¨ï 3 - ãáâ ®¢¨âì ¢¨¤¥®à¥¦¨¬.
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 21 - ®¬¥à äãªæ¨¨
|
||||
@ -1327,7 +1305,7 @@ dd 638
|
||||
* eax = 0 - ãᯥè®
|
||||
* ebx, ecx à §àãè îâáï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* „à ©¢¥à ¯à¥¤¢ à¨â¥«ì® ¤®«¦¥ ¡ëâì ¨¨æ¨ «¨§¨à®¢ ¢ë§®¢®¬
|
||||
* „à ©¢¥à ¯à¥¤¢ à¨â¥«ì® ¤®«¦¥ ¡ëâì ¨¨æ¨ «¨§¨à®¢ ¢ë§®¢®¬
|
||||
äãªæ¨¨ ¤à ©¢¥à 1.
|
||||
* <20>®¬¥à ¢¨¤¥®à¥¦¨¬ ¨ ç áâ®â ¤®«¦ë ¡ëâì ¢ â ¡«¨æ¥, ¢®§¢à é ¥¬®©
|
||||
äãªæ¨¥© ¤à ©¢¥à 1.
|
||||
@ -1346,7 +1324,7 @@ dd 638
|
||||
* eax = 0 - ãᯥè®
|
||||
* ebx, ecx à §àãè îâáï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* „à ©¢¥à ¯à¥¤¢ à¨â¥«ì® ¤®«¦¥ ¡ëâì ¨¨æ¨ «¨§¨à®¢ ¢ë§®¢®¬
|
||||
* „à ©¢¥à ¯à¥¤¢ à¨â¥«ì® ¤®«¦¥ ¡ëâì ¨¨æ¨ «¨§¨à®¢ ¢ë§®¢®¬
|
||||
äãªæ¨¨ ¤à ©¢¥à 1.
|
||||
|
||||
======================================================================
|
||||
@ -1366,7 +1344,7 @@ dd 638
|
||||
* eax = 0 - ãᯥè®
|
||||
* ebx, ecx à §àãè îâáï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* „à ©¢¥à ¯à¥¤¢ à¨â¥«ì® ¤®«¦¥ ¡ëâì ¨¨æ¨ «¨§¨à®¢ ¢ë§®¢®¬
|
||||
* „à ©¢¥à ¯à¥¤¢ à¨â¥«ì® ¤®«¦¥ ¡ëâì ¨¨æ¨ «¨§¨à®¢ ¢ë§®¢®¬
|
||||
äãªæ¨¨ ¤à ©¢¥à 1.
|
||||
* ”ãªæ¨ï ¢«¨ï¥â ⮫쪮 䨧¨ç¥áª¨© à §¬¥à ¨§®¡à ¦¥¨ï
|
||||
¬®¨â®à¥; «®£¨ç¥áª¨© à §¬¥à (ç¨á«® ¯¨ªá¥«¥©) ¥ ¬¥ï¥âáï.
|
||||
@ -1447,7 +1425,7 @@ dd 638
|
||||
* eax = 0 - ãᯥè®
|
||||
* eax = 1 - ¥ ®¯à¥¤¥«¥ ¡ § CD
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20>।¢ à¨â¥«ì® 㦮 ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ CD ¢ë§®¢®¬
|
||||
* <20>।¢ à¨â¥«ì® 㦮 ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ CD ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 3 äãªæ¨¨ 21.
|
||||
* ‚ ᥪ㤥 75 ä३¬®¢, ¢ ¬¨ã⥠60 ᥪã¤.
|
||||
* ”ãªæ¨ï á¨åà® (¢®§¢à é ¥â ã¯à ¢«¥¨¥, ª®£¤ ç «®áì
|
||||
@ -1468,7 +1446,7 @@ dd 638
|
||||
* ”®à¬ â â ¡«¨æë á ¨ä®à¬ 樥© ® ¤®à®¦ª å â ª®© ¦¥, ª ª ¨ ¤«ï
|
||||
ATAPI-CD ª®¬ ¤ë 43h (READ TOC), ®¡ë箩 â ¡«¨æë (¯®¤ª®¬ ¤ 00h).
|
||||
€¤à¥á ¢®§¢à é îâáï ¢ ä®à¬ ⥠MSF.
|
||||
* <20>।¢ à¨â¥«ì® 㦮 ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ CD ¢ë§®¢®¬
|
||||
* <20>।¢ à¨â¥«ì® 㦮 ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ CD ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 3 äãªæ¨¨ 21.
|
||||
* ”ãªæ¨ï ¢®§¢à é ¥â ¨ä®à¬ æ¨î ⮫쪮 ® ¥ ¡®«¥¥ 祬 100
|
||||
¯¥à¢ëå ¤®à®¦ª å. ‚ ¡®«ìè¨á⢥ á«ãç ¥¢ í⮣® ¤®áâ â®ç®.
|
||||
@ -1483,7 +1461,7 @@ dd 638
|
||||
* eax = 0 - ãᯥè®
|
||||
* eax = 1 - ¥ ®¯à¥¤¥«¥ ¡ § CD
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20>।¢ à¨â¥«ì® 㦮 ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ CD ¢ë§®¢®¬
|
||||
* <20>।¢ à¨â¥«ì® 㦮 ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ CD ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 3 äãªæ¨¨ 21.
|
||||
|
||||
======================================================================
|
||||
@ -1521,22 +1499,7 @@ dd 638
|
||||
======================================================================
|
||||
============== ”ãªæ¨ï 25 - ãáâ ®¢¨âì £à®¬ª®áâì SBPro. ==============
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 25 - ®¬¥à äãªæ¨¨
|
||||
* ebx = çâ® ãáâ ¢«¨¢ âì:
|
||||
* 1 - ãáâ ®¢¨âì ®¡éãî £à®¬ª®áâì
|
||||
* 2 - ãáâ ®¢¨âì £à®¬ª®áâì CD-audio
|
||||
* cl = ã஢¥ì £à®¬ª®áâ¨: áâ à訥 4 ¡¨â ¤«ï «¥¢®© ª®«®ª¨,
|
||||
¬« ¤è¨¥ 4 - ¤«ï ¯à ¢®©
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = 0 - ãᯥè®
|
||||
* eax = 1 - ¥ ®¯à¥¤¥«¥ ¡ § SB
|
||||
* eax = 2 - ¥¢¥à ï ¯®¤äãªæ¨ï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20>।¢ à¨â¥«ì® 㦮 ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ SB ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 4 äãªæ¨¨ 21.
|
||||
* ‘¬®âਠ⠪¦¥ äãªæ¨î 28
|
||||
ãáâ ®¢ª¨ §¢ãª ¤«ï ¡®«¥¥ ¯®§¤¥£® áâ ¤ àâ SB16.
|
||||
“¤ «¥
|
||||
|
||||
======================================================================
|
||||
===== ”ãªæ¨ï 26, ¯®¤äãªæ¨ï 1 - ¯®«ãç¨âì ¡ §®¢ë© ¯®àâ MPU MIDI. =====
|
||||
@ -1547,7 +1510,7 @@ dd 638
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = ®¬¥à ¯®àâ
|
||||
‡ ¬¥ç ¨ï:
|
||||
* “áâ ®¢¨âì ¡ §®¢ë© ¯®àâ ¬®¦® ¢ë§®¢®¬
|
||||
* “áâ ®¢¨âì ¡ §®¢ë© ¯®àâ ¬®¦® ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 1 äãªæ¨¨ 21.
|
||||
|
||||
======================================================================
|
||||
@ -1580,7 +1543,7 @@ dd 638
|
||||
®à¬ «ì ï à ᪫ ¤ª , ¯®á«¥ 祣® ¨§ ª®¤ ¢ëç¨â ¥âáï 0x60;
|
||||
¥á«¨ ¥ ¦ â ¨ ®¤ ¨§ ã¯à ¢«ïîé¨å ª« ¢¨è, â® ¨á¯®«ì§ã¥âáï
|
||||
®à¬ «ì ï à ᪫ ¤ª .
|
||||
* “áâ ®¢¨âì à ᪫ ¤ª¨ ¨ ¨¤¥â¨ä¨ª â®à áâà ë ¬®¦® á ¯®¬®éìî
|
||||
* “áâ ®¢¨âì à ᪫ ¤ª¨ ¨ ¨¤¥â¨ä¨ª â®à áâà ë ¬®¦® á ¯®¬®éìî
|
||||
¯®¤äãªæ¨¨ 2 äãªæ¨¨ 21.
|
||||
* ˆ¤¥â¨ä¨ª â®à áâà ë - £«®¡ «ì ï á¨á⥬ ï ¯¥à¥¬¥ ï, ª®â®à ï
|
||||
á ¬¨¬ ï¤à®¬ ¥ ¨á¯®«ì§ã¥âáï; ®¤ ª® ¯à¨«®¦¥¨¥ @panel ®â®¡à ¦ ¥â
|
||||
@ -1603,14 +1566,7 @@ dd 638
|
||||
======================================================================
|
||||
=== ”ãªæ¨ï 26, ¯®¤äãªæ¨ï 4 - ¯®«ãç¨âì ¡ §®¢ë© ¯®àâ Sound Blaster. ==
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 26 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 4 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = ®¬¥à ¡ §®¢®£® ¯®àâ
|
||||
‡ ¬¥ç ¨ï:
|
||||
* “áâ ®¢ª ¡ §ë 㦠¤«ï à ¡®âë äãªæ¨© 25, 55.
|
||||
* “áâ ®¢¨âì ¡ §®¢ë© ¯®àâ ¬®¦® ¢ë§®¢®¬ ¯®¤äãªæ¨¨ 4 äãªæ¨¨ 21.
|
||||
“¤ «¥
|
||||
|
||||
======================================================================
|
||||
========== ”ãªæ¨ï 26, ¯®¤äãªæ¨ï 5 - ¯®«ãç¨âì ï§ëª á¨á⥬ë. =========
|
||||
@ -1679,15 +1635,7 @@ dd 638
|
||||
======================================================================
|
||||
====== ”ãªæ¨ï 26, ¯®¤äãªæ¨ï 10 - ¯®«ãç¨âì ª « DMA ¤«ï §¢ãª . =====
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 26 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 10 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = ®¬¥à ª « (®â 0 ¤® 3 ¢ª«îç¨â¥«ì®)
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20>®¬¥à ª « DMA ¨á¯®«ì§ã¥âáï ¢ ¯®¤äãªæ¨¨ 1 äãªæ¨¨ 55.
|
||||
* “áâ ®¢¨âì ª « DMA ¤«ï §¢ãª ¬®¦® ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 10 äãªæ¨¨ 21.
|
||||
“¤ «¥
|
||||
|
||||
======================================================================
|
||||
====================== ”ãªæ¨ï 26, ¯®¤äãªæ¨ï 11 =====================
|
||||
@ -1700,7 +1648,7 @@ dd 638
|
||||
* eax = 0/1 - § ¯à¥éñ/à §à¥èñ
|
||||
‡ ¬¥ç ¨ï:
|
||||
* ˆá¯®«ì§ã¥âáï ¯à¨ LBA-ç⥨¨ (¯®¤äãªæ¨ï 8 äãªæ¨¨ 58).
|
||||
* “áâ ®¢¨âì ⥪ã饥 á®áâ®ï¨¥ ¬®¦® ¢ë§®¢®¬
|
||||
* “áâ ®¢¨âì ⥪ã饥 á®áâ®ï¨¥ ¬®¦® ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 11 äãªæ¨¨ 21.
|
||||
|
||||
======================================================================
|
||||
@ -1715,27 +1663,13 @@ dd 638
|
||||
‡ ¬¥ç ¨ï:
|
||||
* ˆá¯®«ì§ã¥âáï ¯à¨ à ¡®â¥ á 訮© PCI (äãªæ¨ï 62).
|
||||
* ’¥ªãé ï ॠ«¨§ æ¨ï ¨á¯®«ì§ã¥â ⮫쪮 ¬« ¤è¨© ¡¨â ecx.
|
||||
* “áâ ®¢¨âì ⥪ã饥 á®áâ®ï¨¥ ¬®¦® ¢ë§®¢®¬
|
||||
* “áâ ®¢¨âì ⥪ã饥 á®áâ®ï¨¥ ¬®¦® ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 12 äãªæ¨¨ 21.
|
||||
|
||||
======================================================================
|
||||
=============== ”ãªæ¨ï 28 - ãáâ ®¢¨âì £à®¬ª®áâì SB16. ==============
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 28 - ®¬¥à äãªæ¨¨
|
||||
* ebx = çâ® ãáâ ¢«¨¢ âì:
|
||||
* 1 - ãáâ ®¢¨âì ®¡éãî £à®¬ª®áâì
|
||||
* 2 - ãáâ ®¢¨âì £à®¬ª®áâì CD-audio
|
||||
* cl = ã஢¥ì £à®¬ª®á⨠(0=off, 0xFF=max)
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = 0 - ãᯥè®
|
||||
* eax = 1 - ¥ ®¯à¥¤¥«¥ ¡ § SB
|
||||
* eax = 2 - ¥¢¥à ï ¯®¤äãªæ¨ï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20>।¢ à¨â¥«ì® 㦮 ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ SB ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 4 äãªæ¨¨ 21.
|
||||
* <20>â äãªæ¨ï ¯à¥¤®áâ ¢«ï¥â ¡®«ìè¥ ¢ ਠ⮢ ¤«ï £à®¬ª®áâ¨,
|
||||
祬 äãªæ¨ï 25.
|
||||
“¤ «¥
|
||||
|
||||
======================================================================
|
||||
================ ”ãªæ¨ï 29 - ¯®«ãç¨âì á¨á⥬ãî ¤ âã. ===============
|
||||
@ -1919,7 +1853,7 @@ dd 638
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = [è¨à¨ ]*65536 + [¢ëá®â ]
|
||||
‡ ¬¥ç ¨ï:
|
||||
* …áâì ¯ à ï ª®¬ ¤ ãáâ ®¢ª¨ à §¬¥à®¢ ä®®¢®£® ¨§®¡à ¦¥¨ï -
|
||||
* …áâì ¯ à ï ª®¬ ¤ ãáâ ®¢ª¨ à §¬¥à®¢ ä®®¢®£® ¨§®¡à ¦¥¨ï -
|
||||
¯®¤äãªæ¨ï 1 äãªæ¨¨ 15. <20>®á«¥ ª®â®à®©, à §ã¬¥¥âáï, á«¥¤ã¥â
|
||||
§ ®¢® ®¯à¥¤¥«¨âì á ¬® ¨§®¡à ¦¥¨¥.
|
||||
|
||||
@ -1938,7 +1872,7 @@ dd 638
|
||||
* <20>¥ á«¥¤ã¥â ¯®« £ âìáï ¢®§¢à é ¥¬®¥ § 票¥ ¢ á«ãç ¥ ¥¢¥à®£®
|
||||
ᬥ饨ï, ®® ¬®¦¥â ¨§¬¥¨âìáï ¢ á«¥¤ãîé¨å ¢¥àá¨ïå ï¤à .
|
||||
* ‘¬¥é¥¨¥ â®çª¨ á ª®®à¤¨ â ¬¨ (x,y) ¢ëç¨á«ï¥âáï ª ª (x+y*xsize)*3.
|
||||
* …áâì ¯ à ï äãªæ¨ï ãáâ ®¢ª¨ â®çª¨ ä®®¢®¬ ¨§®¡à ¦¥¨¨ -
|
||||
* …áâì ¯ à ï äãªæ¨ï ãáâ ®¢ª¨ â®çª¨ ä®®¢®¬ ¨§®¡à ¦¥¨¨ -
|
||||
¯®¤äãªæ¨ï 2 äãªæ¨¨ 15.
|
||||
|
||||
======================================================================
|
||||
@ -1951,7 +1885,7 @@ dd 638
|
||||
* eax = 1 - § ¬®áâ¨âì
|
||||
* eax = 2 - à áâïãâì
|
||||
‡ ¬¥ç ¨ï:
|
||||
* …áâì ¯ à ï äãªæ¨ï ãáâ ®¢ª¨ ०¨¬ ®âà¨á®¢ª¨ ä® -
|
||||
* …áâì ¯ à ï äãªæ¨ï ãáâ ®¢ª¨ ०¨¬ ®âà¨á®¢ª¨ ä® -
|
||||
¯®¤äãªæ¨ï 4 äãªæ¨¨ 15.
|
||||
|
||||
======================================================================
|
||||
@ -1992,7 +1926,7 @@ dd 638
|
||||
------------------------ —⥨¥ ¤ ëå -------------------------------
|
||||
<EFBFBD>ਠ¢®§¨ª®¢¥¨¨ IRQ á¨á⥬ ¬®¦¥â áç¨âë¢ âì ¤ ë¥ ¨§ 㪠§ ëå
|
||||
à ¥¥ äãªæ¨¥© 44 ¯®à⮢ ¨ § ¯¨áë¢ âì í⨠¤ ë¥ ¢ ¡ãä¥à.
|
||||
Ž¯¨áë¢ ¥¬ ï äãªæ¨ï áç¨âë¢ ¥â ¤ ë¥ ¨§ í⮣® ¡ãä¥à ¢ ¡ãä¥à
|
||||
Ž¯¨áë¢ ¥¬ ï äãªæ¨ï áç¨âë¢ ¥â ¤ ë¥ ¨§ í⮣® ¡ãä¥à ¢ ¡ãä¥à
|
||||
㪠§ ë© ¢ ª ç¥á⢥ ¯ à ¬¥âà .
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 42 - ®¬¥à äãªæ¨¨
|
||||
@ -2102,7 +2036,7 @@ dd 638
|
||||
¢á¥ § १¥à¢¨à®¢ ë¥ ¨¬ IRQ.
|
||||
|
||||
======================================================================
|
||||
= ”ãªæ¨ï 46 - § १¥à¢¨à®¢ âì/®á¢®¡®¤¨âì £à㯯㠯®à⮢ ¢¢®¤ /¢ë¢®¤ .
|
||||
= ”ãªæ¨ï 46 - § १¥à¢¨à®¢ âì/®á¢®¡®¤¨âì £à㯯㠯®à⮢ ¢¢®¤ /¢ë¢®¤ .
|
||||
======================================================================
|
||||
Š § १¥à¢¨à®¢ ë¬ ¯®àâ ¬ ¬®¦® ®¡à é âìáï ¯àï¬ãî ¨§ ¯à¨«®¦¥¨ï
|
||||
ª®¬ ¤ ¬¨ in/out (४®¬¥¤ã¥¬ë© ᯮᮡ) ¨ ¢ë§®¢®¬ äãªæ¨¨ 43
|
||||
@ -2197,7 +2131,7 @@ dd 638
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* äãªæ¨ï ¥ ¢®§¢à é ¥â § 票ï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20>®á«¥ ¢ë§®¢ ®¯¨áë¢ ¥¬®© äãªæ¨¨ á«¥¤ã¥â ¯¥à¥à¨á®¢ âì íªà
|
||||
* <20>®á«¥ ¢ë§®¢ ®¯¨áë¢ ¥¬®© äãªæ¨¨ á«¥¤ã¥â ¯¥à¥à¨á®¢ âì íªà
|
||||
¯®¤äãªæ¨¥© 0.
|
||||
* ’¨¯ ª®¯®ª ¢«¨ï¥â ⮫쪮 ¨å ¯à®à¨á®¢ªã äãªæ¨¥© 8.
|
||||
|
||||
@ -2214,7 +2148,7 @@ dd 638
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* äãªæ¨ï ¥ ¢®§¢à é ¥â § 票ï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20>®á«¥ ¢ë§®¢ ®¯¨áë¢ ¥¬®© äãªæ¨¨ á«¥¤ã¥â ¯¥à¥à¨á®¢ âì íªà
|
||||
* <20>®á«¥ ¢ë§®¢ ®¯¨áë¢ ¥¬®© äãªæ¨¨ á«¥¤ã¥â ¯¥à¥à¨á®¢ âì íªà
|
||||
¯®¤äãªæ¨¥© 0.
|
||||
* ’ ¡«¨æ áâ ¤ àâëå 梥⮢ ¢«¨ï¥â ⮫쪮 ¯à¨«®¦¥¨ï,
|
||||
ª®â®àë¥ íâã â ¡«¨æã ï¢ë¬ ®¡à §®¬ ¯®«ãç îâ (¯®¤äãªæ¨¥© 3) ¨
|
||||
@ -2328,7 +2262,7 @@ dword-
|
||||
€ «®£¨ç® ¯® ®á¨ y.
|
||||
* ‘¬®âਠ⠪¦¥ äãªæ¨î 14,
|
||||
¯®§¢®«ïîéãî ®¯à¥¤¥«¨âì à §¬¥àë ¢á¥£® íªà .
|
||||
* …áâì ¯ à ï äãªæ¨ï ¯®«ã票ï à ¡®ç¥© ®¡« á⨠-
|
||||
* …áâì ¯ à ï äãªæ¨ï ¯®«ã票ï à ¡®ç¥© ®¡« á⨠-
|
||||
¯®¤äãªæ¨ï 5.
|
||||
* <20>â äãªæ¨ï ¢â®¬ â¨ç¥áª¨ ¯¥à¥à¨á®¢ë¢ ¥â íªà , ¯® 室㠤¥«
|
||||
®¡®¢«ï¥â ª®®à¤¨ âë ¨ à §¬¥àë ¬ ªá¨¬¨§¨à®¢ ëå ®ª®.
|
||||
@ -2452,7 +2386,7 @@ dword-
|
||||
* ¨ ç¥ eax = TID - ¨¤¥â¨ä¨ª â®à ¯®â®ª
|
||||
|
||||
======================================================================
|
||||
= ”ãªæ¨ï 52, ¯®¤äãªæ¨ï 0 - ¯®«ãç¨âì ª®ä¨£ãà æ¨î á¥â¥¢®£® ¤à ©¢¥à .
|
||||
= ”ãªæ¨ï 52, ¯®¤äãªæ¨ï 0 - ¯®«ãç¨âì ª®ä¨£ãà æ¨î á¥â¥¢®£® ¤à ©¢¥à .
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 52 - ®¬¥à äãªæ¨¨
|
||||
@ -2477,7 +2411,7 @@ dword-
|
||||
* ‹®ª «ìë© IP- ¤à¥á ãáâ ¢«¨¢ ¥âáï ¯®¤äãªæ¨¥© 3.
|
||||
|
||||
======================================================================
|
||||
”ãªæ¨ï 52, ¯®¤äãªæ¨ï 2 - ãáâ ®¢¨âì ª®ä¨£ãà æ¨î á¥â¥¢®£® ¤à ©¢¥à .
|
||||
”ãªæ¨ï 52, ¯®¤äãªæ¨ï 2 - ãáâ ®¢¨âì ª®ä¨£ãà æ¨î á¥â¥¢®£® ¤à ©¢¥à .
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 52 - ®¬¥à äãªæ¨¨
|
||||
@ -2825,7 +2759,7 @@ dword-
|
||||
* <20>஢¥àª¨ ¯à ¢¨«ì®áâì åí¤« ¥ ¤¥« ¥âáï.
|
||||
|
||||
======================================================================
|
||||
”ãªæ¨ï 53, ¯®¤äãªæ¨ï 255 - ®â« ¤®ç ï ¨ä®à¬ æ¨ï á¥â¥¢®£® ¤à ©¢¥à .
|
||||
”ãªæ¨ï 53, ¯®¤äãªæ¨ï 255 - ®â« ¤®ç ï ¨ä®à¬ æ¨ï á¥â¥¢®£® ¤à ©¢¥à .
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 53 - ®¬¥à äãªæ¨¨
|
||||
@ -3120,8 +3054,8 @@ dword-
|
||||
* <20> §¬¥à ¡«®ª - 512 ¡ ©â; ç¨â ¥âáï ®¤¨ ¡«®ª.
|
||||
* <20>¥ á«¥¤ã¥â ¯®« £ âìáï ¢®§¢à é ¥¬®¥ § 票¥,
|
||||
®® ¬®¦¥â ¨§¬¥¨âìáï ¢ á«¥¤ãîé¨å ¢¥àá¨ïå.
|
||||
* ’ॡã¥âáï, çâ®¡ë ¡ë« à §à¥èñ LBA-¤®áâ㯠ª ãáâனá⢠¬
|
||||
¯®¤äãªæ¨¥© 11 äãªæ¨¨ 21. “§ âì íâ® ¬®¦® ¢ë§®¢®¬
|
||||
* ’ॡã¥âáï, çâ®¡ë ¡ë« à §à¥èñ LBA-¤®áâ㯠ª ãáâனá⢠¬
|
||||
¯®¤äãªæ¨¥© 11 äãªæ¨¨ 21. “§ âì íâ® ¬®¦® ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¥© 11 äãªæ¨¨ 26.
|
||||
* LBA-ç⥨¥ ¤¨áª¥âë ¥ ¯®¤¤¥à¦¨¢ ¥âáï.
|
||||
* ”ãªæ¨ï áç¨âë¢ ¥â ¤ ë¥ ä¨§¨ç¥áª®£® ¦ñá⪮£® ¤¨áª ;
|
||||
@ -3135,7 +3069,7 @@ dword-
|
||||
íâ® ¡ã¤¥â áç¨â âìáï ãᯥ宬 (eax=0).
|
||||
|
||||
======================================================================
|
||||
= ”ãªæ¨ï 58, ¯®¤äãªæ¨ï 15 - ¯®«ãç¨âì ¨ä®à¬ æ¨î ® ä ©«®¢®© á¨á⥬¥.
|
||||
= ”ãªæ¨ï 58, ¯®¤äãªæ¨ï 15 - ¯®«ãç¨âì ¨ä®à¬ æ¨î ® ä ©«®¢®© á¨á⥬¥.
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 58 - ®¬¥à äãªæ¨¨
|
||||
@ -4016,7 +3950,7 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
|
||||
®¡é¥¬ ®¯¨á ¨¨).
|
||||
|
||||
======================================================================
|
||||
”ãªæ¨ï 69, ¯®¤äãªæ¨ï 7 - § ¯¨á âì ¢ ¯ ¬ïâì ®â« ¦¨¢ ¥¬®£® ¯à®æ¥áá .
|
||||
”ãªæ¨ï 69, ¯®¤äãªæ¨ï 7 - § ¯¨á âì ¢ ¯ ¬ïâì ®â« ¦¨¢ ¥¬®£® ¯à®æ¥áá .
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 69 - ®¬¥à äãªæ¨¨
|
||||
|
@ -1128,18 +1128,7 @@ Remarks:
|
||||
======================================================================
|
||||
====== Function 21, subfunction 4 - set Sound Blaster base port. =====
|
||||
======================================================================
|
||||
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.
|
||||
Removed
|
||||
|
||||
======================================================================
|
||||
========== Function 21, subfunction 5 - set system language. =========
|
||||
@ -1204,16 +1193,7 @@ Remarks:
|
||||
======================================================================
|
||||
======== Function 21, subfunction 10 - set sound DMA channel. ========
|
||||
======================================================================
|
||||
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.
|
||||
Removed
|
||||
|
||||
======================================================================
|
||||
Function 21, subfunction 11 - enable/disable low-level access to HD.
|
||||
@ -1505,22 +1485,7 @@ Remarks:
|
||||
======================================================================
|
||||
=================== Function 25 - set SBPro volume. ==================
|
||||
======================================================================
|
||||
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.
|
||||
Removed
|
||||
|
||||
======================================================================
|
||||
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
|
||||
@ -1584,14 +1549,7 @@ Remarks:
|
||||
======================================================================
|
||||
====== Function 26, subfunction 4 - get Sound Blaster base port. =====
|
||||
======================================================================
|
||||
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.
|
||||
Removed
|
||||
|
||||
======================================================================
|
||||
========== Function 26, subfunction 5 - get system language. =========
|
||||
@ -1658,14 +1616,7 @@ Remarks:
|
||||
======================================================================
|
||||
======== Function 26, subfunction 10 - get sound DMA channel. ========
|
||||
======================================================================
|
||||
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.
|
||||
Removed
|
||||
|
||||
======================================================================
|
||||
===================== Function 26, subfunction 11 ====================
|
||||
@ -1697,20 +1648,7 @@ Remarks:
|
||||
======================================================================
|
||||
=================== Function 28 - set SB16 volume. ===================
|
||||
======================================================================
|
||||
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.
|
||||
Removed
|
||||
|
||||
======================================================================
|
||||
=================== Function 29 - get system date. ===================
|
||||
|
@ -7,6 +7,8 @@
|
||||
|
||||
format MS COFF
|
||||
|
||||
DEBUG equ 1
|
||||
|
||||
include 'proc32.inc'
|
||||
include 'imports.inc'
|
||||
|
||||
@ -14,8 +16,6 @@ R500_HW2D equ 0
|
||||
|
||||
API_VERSION equ 0x01000100
|
||||
|
||||
DEBUG equ 1
|
||||
|
||||
STRIDE equ 8
|
||||
|
||||
VID_ATI equ 0x1002
|
||||
|
@ -11,14 +11,12 @@
|
||||
|
||||
format MS COFF
|
||||
|
||||
API_VERSION equ 5 ;debug
|
||||
DEBUG equ 0
|
||||
|
||||
include 'proc32.inc'
|
||||
include 'imports.inc'
|
||||
|
||||
OS_BASE equ 0x80000000;
|
||||
new_app_base equ 0x0
|
||||
PROC_BASE equ OS_BASE+0x0080000
|
||||
API_VERSION equ 5 ;debug
|
||||
|
||||
struc IOCTL
|
||||
{ .handle dd ?
|
||||
@ -36,7 +34,6 @@ end virtual
|
||||
public START
|
||||
public version
|
||||
|
||||
DEBUG equ 0
|
||||
|
||||
DRV_ENTRY equ 1
|
||||
DRV_EXIT equ -1
|
||||
|
@ -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 íåäîñòóïíû
|
||||
|
@ -6,8 +6,10 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
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
|
||||
}
|
||||
@ -19,6 +21,7 @@ kernel_export \
|
||||
GetService,\
|
||||
ServiceHandler,\
|
||||
AttachIntHandler,\
|
||||
GetIntHandler,\
|
||||
FpuSave,\
|
||||
FpuRestore,\
|
||||
ReservePortArea,\
|
||||
|
@ -10,6 +10,13 @@
|
||||
|
||||
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
|
||||
@ -18,13 +25,6 @@ API_VERSION equ (COMPATIBLE_API shl 16) or CURRENT_API
|
||||
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,9 +33,6 @@ FORCE_MMX_128 equ 0 ;integer sse2 extensions
|
||||
|
||||
USE_SSE2_MIXER equ 0 ;floating point mixer. Disabled by default
|
||||
|
||||
DEBUG equ 1
|
||||
|
||||
|
||||
OS_BASE equ 0x80000000
|
||||
|
||||
CAPS_SSE2 equ 26
|
||||
@ -1209,7 +1206,7 @@ resampler_params:
|
||||
;r_size r_dt resampler_func
|
||||
dd 0,0,0 ; 0 PCM_ALL
|
||||
dd 16384, 0, copy_stream ; 1 PCM_2_16_48
|
||||
dd 16384, 0, m16_stereo ; 2 PCM_1_16_48
|
||||
dd 8192, 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
|
||||
|
@ -71,7 +71,7 @@ macro epiloguedef procname,flag,parmbytes,localbytes,reglist
|
||||
if parmbytes | localbytes
|
||||
leave
|
||||
end if
|
||||
if (flag and 10000b) | (parmbytes=0)
|
||||
if flag and 10000b
|
||||
retn
|
||||
else
|
||||
retn parmbytes
|
||||
|
@ -1,5 +1,7 @@
|
||||
format MS COFF
|
||||
|
||||
DEBUG equ 0
|
||||
|
||||
include 'proc32.inc'
|
||||
include 'imports.inc'
|
||||
|
||||
@ -47,12 +49,12 @@ proc START stdcall, state:dword
|
||||
test eax,eax
|
||||
jnz .stop_try
|
||||
mov [MouseType],MT_3BScroll
|
||||
|
||||
|
||||
call try_mode_ID4
|
||||
test eax,eax
|
||||
jnz .stop_try
|
||||
mov [MouseType],MT_5BScroll
|
||||
|
||||
|
||||
.stop_try:
|
||||
|
||||
mov bl, 0x20 ; read command byte
|
||||
@ -81,7 +83,7 @@ proc START stdcall, state:dword
|
||||
|
||||
mov bl, 0xAE ; enable keyboard interface
|
||||
call kbd_cmd
|
||||
|
||||
|
||||
stdcall AttachIntHandler, 12, irq_handler, dword 0
|
||||
stdcall RegService, my_service, service_proc
|
||||
ret
|
||||
|
41
kernel/trunk/drivers/sb16/CONFIG.INC
Normal file
41
kernel/trunk/drivers/sb16/CONFIG.INC
Normal file
@ -0,0 +1,41 @@
|
||||
;flags------------------------------------------------------------
|
||||
DEBUG equ 1 ;show messages at debug board
|
||||
use_cli_sti equ 1 ;driver come more stable (theoretically)
|
||||
|
||||
;constants--------------------------------------------------------
|
||||
API_VERSION equ 0 ;debug
|
||||
|
||||
OS_BASE equ 0x80000000
|
||||
new_app_base equ 0x0
|
||||
PROC_BASE equ (OS_BASE+0x080000)
|
||||
SB16Buffer equ (OS_BASE+0x2A0000)
|
||||
SB16_Status equ (OS_BASE+0x2B0000)
|
||||
DMAPage equ ((SB16Buffer-OS_BASE) shr 16)
|
||||
|
||||
SB16Buffer0 equ SB16Buffer
|
||||
SB16Buffer1 equ (SB16Buffer+16384)
|
||||
SB16Buffer2 equ (SB16Buffer+(2*16384))
|
||||
SB16Buffer3 equ (SB16Buffer+(3*16384))
|
||||
|
||||
sb_irq_num equ 5
|
||||
sb_dma_num equ 5
|
||||
sb_buffer_size equ 32768 ;really it needs code modifications to change
|
||||
;buffer size
|
||||
sb_out_rate equ 44100
|
||||
;time constant for cards older than SB16
|
||||
|
||||
sb_tc equ (256-(1000000/(sb_out_rate*2)))
|
||||
|
||||
SRV_GETVERSION equ 0
|
||||
DEV_PLAY equ 1
|
||||
DEV_STOP equ 2
|
||||
DEV_CALLBACK equ 3
|
||||
DEV_SET_BUFF equ 4
|
||||
DEV_NOTIFY equ 5
|
||||
DEV_SET_MASTERVOL equ 6
|
||||
DEV_GET_MASTERVOL equ 7
|
||||
DEV_GET_INFO equ 8
|
||||
|
||||
DRV_ENTRY equ 1
|
||||
DRV_EXIT equ -1
|
||||
|
239
kernel/trunk/drivers/sb16/SB16.INC
Normal file
239
kernel/trunk/drivers/sb16/SB16.INC
Normal file
@ -0,0 +1,239 @@
|
||||
;--------------------------------
|
||||
; program dma
|
||||
;--------------------------------
|
||||
sb_set_dma:
|
||||
mov ebx,[sound_dma]
|
||||
lea eax,[ebx+4] ;mask required channel
|
||||
cmp bl,4
|
||||
ja .use_second_dma_controller
|
||||
jb @f
|
||||
.dma_setup_error:
|
||||
if DEBUG
|
||||
mov esi,msgErrDMAsetup
|
||||
call SysMsgBoardStr
|
||||
end if
|
||||
mov dword[esp],START.stop
|
||||
ret
|
||||
@@:
|
||||
if use_cli_sti
|
||||
cli ;here to minimize time with disabled ints
|
||||
end if
|
||||
out 0xA,al ;mask required channel
|
||||
|
||||
xor eax,eax
|
||||
out 0xC,al ;clear byte pointer flip-flop register
|
||||
|
||||
lea eax,[ebx+0x58] ;auto-init mode for channel (ebx)
|
||||
out 0xB,al ;DMA channel 0-3 mode register
|
||||
|
||||
movzx edx,byte[ebx+dma_table] ;page register
|
||||
mov al,DMAPage
|
||||
out dx,al
|
||||
|
||||
lea edx,[ebx*2] ;DMA channel 0-3 base address
|
||||
|
||||
mov al,0 ;LSB is 0
|
||||
out dx,al
|
||||
|
||||
; mov al,0 ;MSB is 0 too
|
||||
out dx,al
|
||||
|
||||
inc edx ;DMA channel 0-3 byte count
|
||||
|
||||
mov al,((sb_buffer_size-1) and 0xff)
|
||||
out dx,al
|
||||
|
||||
mov al,((sb_buffer_size-1) shr 8) ;it is the same
|
||||
out dx,al
|
||||
|
||||
mov eax,ebx ;unmask DMA channel
|
||||
out 0xA,al
|
||||
|
||||
if use_cli_sti
|
||||
sti
|
||||
end if
|
||||
ret
|
||||
|
||||
.use_second_dma_controller:
|
||||
cmp bl,7
|
||||
ja .dma_setup_error
|
||||
|
||||
sub bl,4
|
||||
sub al,4
|
||||
if use_cli_sti
|
||||
cli ;here to minimize time with disabled ints
|
||||
end if
|
||||
out 0xD4,al ;mask required channel
|
||||
|
||||
xor eax,eax
|
||||
out 0xD8,al ;clear byte pointer flip-flop register
|
||||
|
||||
lea eax,[ebx+0x58] ;auto-init mode for channel (ebx+4)
|
||||
out 0xD6,al ;DMA channel 4-7 mode register
|
||||
|
||||
movzx edx,byte[ebx+dma_table+4] ;page register
|
||||
mov al,DMAPage
|
||||
out dx,al
|
||||
|
||||
lea edx,[ebx*4+0xC0] ;DMA channel 4-7 base address
|
||||
|
||||
mov al,0 ;LSB is 0 ;for 16bit DMA this contains
|
||||
out dx,al ;A1-A8 lines of address bus, A0 is zero
|
||||
|
||||
; mov al,0 ;MSB is 0 too ;for 16bit DMA this contains
|
||||
out dx,al ;A9-A16 lines of address bus
|
||||
|
||||
inc edx
|
||||
inc edx ;DMA channel 4-7 16bit word count
|
||||
|
||||
mov al,(((sb_buffer_size/2)-1) and 0xff)
|
||||
out dx,al
|
||||
|
||||
mov al,(((sb_buffer_size/2)-1) shr 8)
|
||||
out dx,al
|
||||
|
||||
mov eax,ebx ;unmask DMA channel
|
||||
out 0xD4,al
|
||||
|
||||
if use_cli_sti
|
||||
sti
|
||||
end if
|
||||
ret
|
||||
;-------------------------------------------------------------------------------
|
||||
; out byte to SB DSP's write port
|
||||
;-------------------------------------------------------------------------------
|
||||
macro sb_out data_to_out {
|
||||
@@:
|
||||
in al,dx
|
||||
test al,al ;is DSP busy?
|
||||
js @b ;it's busy
|
||||
mov al,data_to_out ;it's free
|
||||
out dx,al
|
||||
}
|
||||
;-------------------------------------------------------------------------------
|
||||
; stop playing
|
||||
;-------------------------------------------------------------------------------
|
||||
proc sb_stop
|
||||
mov edx,[sb_base_port]
|
||||
add dl,0xC
|
||||
sb_out 0xD3 ;turn the speaker off
|
||||
sb_out 0xDA ;exit 8bit DMA
|
||||
sb_out 0xD9 ;exit 16bit DMA
|
||||
ret
|
||||
endp
|
||||
;-------------------------------------------------------------------------------
|
||||
; start playing
|
||||
;-------------------------------------------------------------------------------
|
||||
proc sb_play
|
||||
and [int_flip_flop],0
|
||||
mov edx,[sb_base_port]
|
||||
add dl,0xC
|
||||
sb_out 0xD1 ;turn speaker on
|
||||
; sb_out 0x48 ;set DSP transfer size ;for older cards
|
||||
|
||||
; mov ax,32767 ;(64k)/2-1
|
||||
;@@: ;out the low byte...
|
||||
; in al,dx
|
||||
; test al,al ;is DSP busy?
|
||||
; js @b ;it's busy
|
||||
; out dx,al
|
||||
|
||||
; mov al,ah ;...then the high byte
|
||||
;@@:
|
||||
; in al,dx
|
||||
; test al,al ;is DSP busy?
|
||||
; js @b ;it's busy
|
||||
; out dx,al
|
||||
|
||||
; sb_out 0x1C ;auto-init 8bit playback
|
||||
|
||||
; 0xBXh - 16 bit DMA mode
|
||||
; ||||
|
||||
sb_out 10110110b ;bCommand
|
||||
; ||||
|
||||
; |||+-reserved
|
||||
; ||+--turn FIFO on (0 for off)
|
||||
; |+---auto-init mode on (0 for off)
|
||||
; +----A/D: 0-output, 1-input
|
||||
; +------stereo on
|
||||
; |+-----unsigned (1 for signed)
|
||||
; ||
|
||||
sb_out 00110000b ;bMode
|
||||
; || ||||
|
||||
; ---------reserved
|
||||
;wSize is a number of 16bit samples less 1. For auto-init mode each half
|
||||
;buffer is (64k)/2 bytes long and, obviously, contains ((64k)/2)/2 bytes
|
||||
sb_out (((sb_buffer_size/2/2)-1) and 0xFF) ;wSize.LowByte
|
||||
sb_out (((sb_buffer_size/2/2)-1) shr 8) ;wSize.HighByte
|
||||
ret
|
||||
endp
|
||||
;-------------------------------------------------------------------------------
|
||||
; reset DSP
|
||||
;-------------------------------------------------------------------------------
|
||||
proc sb_reset
|
||||
and [int_flip_flop],0
|
||||
mov edx,[sb_base_port]
|
||||
add dl,6
|
||||
mov al,1 ;start DSP reset
|
||||
|
||||
if use_cli_sti
|
||||
cli ;here to minimize time with disabled ints
|
||||
end if
|
||||
out dx,al
|
||||
mov ecx,40 ;wait at least 3 microsec.
|
||||
@@:
|
||||
in al,dx
|
||||
loop @b
|
||||
|
||||
xor eax,eax ;stop DSP reset
|
||||
if use_cli_sti
|
||||
sti
|
||||
end if
|
||||
out dx,al
|
||||
ret
|
||||
endp
|
||||
;-------------------------------------------------------------------------------
|
||||
; set the rate for playing, enable stereo
|
||||
;-------------------------------------------------------------------------------
|
||||
proc sb_setup
|
||||
mov edx,[sb_base_port]
|
||||
add dl,0xC
|
||||
sb_out 40h ;set time constant, this is for old cards
|
||||
sb_out sb_tc
|
||||
|
||||
sb_out 41h ;set sound rate, this can only SB16
|
||||
sb_out (sb_out_rate shr 8) ;first high byte (MSB)
|
||||
sb_out (sb_out_rate and 0xff) ;then low byte (LSB)
|
||||
; mov al,0xE
|
||||
; sub dl,(0xC-4) ;talk to SB's mixer
|
||||
; out dx,al ;select this register of the mixer
|
||||
; mov ecx,6 ;wait for the chip
|
||||
;@@:
|
||||
; in al,dx
|
||||
; loop @b
|
||||
|
||||
; inc edx ;now read the data port
|
||||
; in al,dx
|
||||
; or al,22h ;turn on stereo
|
||||
; mov ah,al
|
||||
|
||||
; mov al,0xE
|
||||
; dec edx ;talk to SB's mixer
|
||||
; out dx,al ;select this register of the mixer
|
||||
|
||||
; mov ecx,6 ;wait for the chip
|
||||
;@@:
|
||||
; in al,dx
|
||||
; loop @b
|
||||
|
||||
; inc edx ;now send data to the data port
|
||||
; mov al,ah
|
||||
; out dx,al
|
||||
|
||||
; dec edx
|
||||
; mov ecx,35 ;wait for the chip
|
||||
;@@:
|
||||
; in al,dx
|
||||
; loop @b
|
||||
ret
|
||||
endp
|
375
kernel/trunk/drivers/sb16/sb16.asm
Normal file
375
kernel/trunk/drivers/sb16/sb16.asm
Normal file
@ -0,0 +1,375 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
format MS COFF
|
||||
|
||||
include 'config.inc'
|
||||
|
||||
;structs----------------------------------------------------------
|
||||
struc IOCTL
|
||||
{ .handle dd ?
|
||||
.io_code dd ?
|
||||
.input dd ?
|
||||
.inp_size dd ?
|
||||
.output dd ?
|
||||
.out_size dd ?
|
||||
}
|
||||
|
||||
virtual at 0
|
||||
IOCTL IOCTL
|
||||
end virtual
|
||||
|
||||
;something--------------------------------------------------------
|
||||
public START
|
||||
public service_proc
|
||||
public version
|
||||
|
||||
include '..\proc32.inc'
|
||||
include '..\imports.inc'
|
||||
|
||||
section '.flat' code readable align 16
|
||||
|
||||
include 'sb16.inc'
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
proc START stdcall, state:dword
|
||||
|
||||
cmp [state], 1
|
||||
jne .stop
|
||||
.entry:
|
||||
|
||||
if DEBUG
|
||||
mov esi, msgInit
|
||||
call SysMsgBoardStr
|
||||
end if
|
||||
|
||||
call detect ;returns DSP version or zero if
|
||||
test eax,eax ;SB card not found
|
||||
jz .exit
|
||||
|
||||
if DEBUG
|
||||
movzx eax,al ;major version
|
||||
dec eax
|
||||
jz .sb_say_about_found_dsp
|
||||
mov dword[sb_DSP_description],'2.x '
|
||||
dec eax
|
||||
jz .sb_say_about_found_dsp
|
||||
mov dword[sb_DSP_description],'Pro '
|
||||
dec eax
|
||||
jz .sb_say_about_found_dsp
|
||||
mov dword[sb_DSP_description],'16 '
|
||||
.sb_say_about_found_dsp:
|
||||
mov esi,msgDSPFound
|
||||
call SysMsgBoardStr
|
||||
end if
|
||||
xor eax,eax
|
||||
mov ebx,[sb_base_port]
|
||||
lea ecx,[ebx+0xF]
|
||||
call ReservePortArea ;these ports must be mine!
|
||||
if DEBUG
|
||||
dec eax
|
||||
jnz @f
|
||||
mov esi,msgErrRsrvPorts
|
||||
call SysMsgBoardStr
|
||||
@@:
|
||||
end if
|
||||
|
||||
call sb_setup ;clock it, etc
|
||||
|
||||
stdcall AttachIntHandler, sb_irq_num, sb_irq, 0
|
||||
|
||||
if DEBUG
|
||||
test eax,eax
|
||||
jnz @f
|
||||
|
||||
mov esi,msgErrAtchIRQ
|
||||
call SysMsgBoardStr
|
||||
|
||||
stdcall GetIntHandler, sb_irq_num
|
||||
call SysMsgBoardNum
|
||||
|
||||
jmp .stop
|
||||
@@:
|
||||
mov esi,msgSucAtchIRQ
|
||||
call SysMsgBoardStr
|
||||
end if
|
||||
stdcall RegService, my_service, service_proc
|
||||
ret
|
||||
.stop:
|
||||
call sb_reset
|
||||
.exit:
|
||||
|
||||
if DEBUG
|
||||
mov esi,msgExit
|
||||
call SysMsgBoardStr
|
||||
end if
|
||||
|
||||
xor eax, eax
|
||||
ret
|
||||
endp
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
handle equ IOCTL.handle
|
||||
io_code equ IOCTL.io_code
|
||||
input equ IOCTL.input
|
||||
inp_size equ IOCTL.inp_size
|
||||
output equ IOCTL.output
|
||||
out_size equ IOCTL.out_size
|
||||
|
||||
align 4
|
||||
proc service_proc stdcall, ioctl:dword
|
||||
mov edi,[ioctl]
|
||||
mov eax,[edi+io_code]
|
||||
cmp eax,SRV_GETVERSION
|
||||
jne @F
|
||||
|
||||
mov eax,[edi+output]
|
||||
cmp [edi+out_size],4
|
||||
jne .fail
|
||||
mov [eax],dword API_VERSION
|
||||
xor eax,eax
|
||||
ret
|
||||
@@:
|
||||
cmp eax,DEV_PLAY
|
||||
jne @f
|
||||
if DEBUG
|
||||
mov esi,msgPlay
|
||||
call SysMsgBoardStr
|
||||
end if
|
||||
call sb_stop ;to play smth new we must stop smth old
|
||||
|
||||
call pre_fill_data ;fill first and second half of the buffer
|
||||
call pre_fill_data ;
|
||||
|
||||
call sb_set_dma ;is it really needed here? Paranoia.
|
||||
call sb_play
|
||||
xor eax,eax
|
||||
ret
|
||||
;@@: ;all this commented stuff in service proc
|
||||
; cmp eax,DEV_STOP ;is never used. Mixer do this virtually,
|
||||
; jne @f ;e.g. instead of stopping driver it
|
||||
;if DEBUG ;outputs silence
|
||||
; mov esi,msgStop
|
||||
; call SysMsgBoardStr
|
||||
;end if
|
||||
; call sb_stop
|
||||
; xor eax,eax
|
||||
; ret
|
||||
@@:
|
||||
cmp eax,DEV_CALLBACK
|
||||
jne @f
|
||||
if DEBUG
|
||||
mov esi,msgCallback
|
||||
call SysMsgBoardStr
|
||||
end if
|
||||
mov edi,[edi+input]
|
||||
mov eax,[edi]
|
||||
mov [callback],eax
|
||||
if DEBUG
|
||||
call SysMsgBoardNum
|
||||
end if
|
||||
ret
|
||||
@@:
|
||||
; cmp eax,DEV_SET_MASTERVOL
|
||||
; jne @F
|
||||
;if DEBUG
|
||||
; mov esi,msgSetVol
|
||||
; call SysMsgBoardStr
|
||||
;end if
|
||||
; mov eax,[edi+input]
|
||||
; mov eax,[eax]
|
||||
; mov [sb_master_vol],eax
|
||||
; ret
|
||||
;@@:
|
||||
; cmp eax,DEV_GET_MASTERVOL
|
||||
; jne @F
|
||||
;if DEBUG
|
||||
; mov esi,msgGetVol
|
||||
; call SysMsgBoardStr
|
||||
;end if
|
||||
; mov eax,[edi+output]
|
||||
; mov edx,[sb_master_vol]
|
||||
; mov [eax],edx
|
||||
; ret
|
||||
|
||||
.fail:
|
||||
or eax, -1
|
||||
ret
|
||||
endp
|
||||
|
||||
restore handle
|
||||
restore io_code
|
||||
restore input
|
||||
restore inp_size
|
||||
restore output
|
||||
restore out_size
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
align 4
|
||||
proc sb_irq
|
||||
mov edx,[sb_base_port] ;tell the DSP that we have processed IRQ
|
||||
add dl,0xF ;0xF for 16 bit sound, 0xE for 8 bit sound
|
||||
in al,dx ;for non-stop sound
|
||||
|
||||
pre_fill_data:
|
||||
mov eax,int_flip_flop
|
||||
not dword[eax]
|
||||
mov eax,[eax]
|
||||
test eax,eax
|
||||
jns .fill_second_half
|
||||
|
||||
stdcall [callback],SB16Buffer0 ;for 32k buffer
|
||||
; stdcall [callback],SB16Buffer0 ;for 64k buffer
|
||||
; stdcall [callback],SB16Buffer1 ;for 64k buffer
|
||||
|
||||
xor eax,eax
|
||||
ret
|
||||
|
||||
.fill_second_half:
|
||||
stdcall [callback],SB16Buffer1 ;for 32k buffer
|
||||
; stdcall [callback],SB16Buffer2 ;for 64k buffer
|
||||
; stdcall [callback],SB16Buffer3 ;for 64k buffer
|
||||
|
||||
xor eax,eax
|
||||
ret
|
||||
endp
|
||||
;-------------------------------------------------------------------------------
|
||||
align 4
|
||||
proc detect
|
||||
.sb_detect_next_port:
|
||||
if DEBUG
|
||||
inc dword[port_second_digit_num]
|
||||
end if
|
||||
mov edx,sb_base_port
|
||||
add byte[edx],10h
|
||||
cmp byte[edx],80h
|
||||
jbe .sb_try_to_detect_at_specified_port
|
||||
;error - no SB card detected
|
||||
.sb_not_found_err:
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
.sb_try_to_detect_at_specified_port:
|
||||
call sb_reset
|
||||
add dl,8
|
||||
mov ecx,100
|
||||
.sb_check_port:
|
||||
in al,dx
|
||||
test al,al ;is DSP port ready to be read?
|
||||
jns .sb_port_not_ready
|
||||
|
||||
sub dl,4
|
||||
in al,dx ;check for AAh response
|
||||
add dl,4
|
||||
cmp al,0xAA
|
||||
jne .sb_port_not_ready
|
||||
.sb_card_found:
|
||||
and dl,0xF0
|
||||
add dl,0xC
|
||||
sb_out 0xE1 ;get DSP version
|
||||
add dl,2
|
||||
@@:
|
||||
in al,dx
|
||||
test al,al ;is DSP port ready to be read?
|
||||
jns @b
|
||||
sub dl,4
|
||||
in al,dx ;get major version
|
||||
ror eax,16
|
||||
add dl,4
|
||||
@@:
|
||||
in al,dx
|
||||
test al,al ;is DSP port ready to be read?
|
||||
jns @b
|
||||
sub dl,4
|
||||
in al,dx ;get minor version
|
||||
xor edx,edx
|
||||
mov dl,10
|
||||
div dl
|
||||
ror eax,16
|
||||
xor ah,ah
|
||||
if DEBUG
|
||||
add [sb_DSP_version],eax
|
||||
end if
|
||||
ret
|
||||
|
||||
.sb_port_not_ready:
|
||||
loop .sb_check_port ;100 retries (~100 microsec.)
|
||||
jmp .sb_detect_next_port
|
||||
endp
|
||||
;-------------------------------------------------------------------------------
|
||||
if DEBUG
|
||||
proc SysMsgBoardNum
|
||||
mov ebx,eax
|
||||
mov ecx,8
|
||||
mov esi,(number_to_out+1)
|
||||
.1:
|
||||
mov eax,ebx
|
||||
and eax,0xF
|
||||
add al,'0'
|
||||
cmp al,(10+'0')
|
||||
jb @f
|
||||
add al,('A'-'0'-10)
|
||||
@@:
|
||||
mov [esi+ecx],al
|
||||
shr ebx,4
|
||||
loop .1
|
||||
dec esi
|
||||
call SysMsgBoardStr
|
||||
ret
|
||||
endp
|
||||
end if
|
||||
;all initialized data place here
|
||||
|
||||
align 4
|
||||
version dd (5 shl 16) or (API_VERSION and 0xFFFF)
|
||||
|
||||
sb_base_port: dd 200h
|
||||
|
||||
;pTempBuf dd 0
|
||||
|
||||
callback dd 0
|
||||
|
||||
int_flip_flop dd 0
|
||||
|
||||
sound_dma dd sb_dma_num
|
||||
|
||||
;note that 4th DMA channel doesn't exist, it is used for cascade
|
||||
;plugging the first DMA controler to the second
|
||||
dma_table db 0x87,0x83,0x81,0x82,0xFF,0x8B,0x89,0x8A
|
||||
|
||||
;sb_master_vol dd 0
|
||||
|
||||
my_service db 'SOUND',0 ;max 16 chars include zero
|
||||
|
||||
if DEBUG
|
||||
number_to_out db '0x00000000',13,10,0
|
||||
|
||||
msgInit db 'detecting hardware...',13,10,0
|
||||
msgExit db 'exiting... May be some problems found?',13,10,0
|
||||
msgPlay db 'start play',13,10,0
|
||||
;msgStop db 'stop play',13,10,0
|
||||
msgCallback db 'set_callback received from the mixer!',13,10
|
||||
db 'callback handler is: ',0
|
||||
msgErrAtchIRQ db 'failed to attach IRQ',(sb_irq_num+'0'),13,10
|
||||
db 'owner',39,'s handler: ',0
|
||||
msgSucAtchIRQ db 'succesfully attached IRQ',(sb_irq_num+'0')
|
||||
db ' as hardcoded',13,10,0
|
||||
msgErrRsrvPorts db 'failed to reserve needed ports.',13,10
|
||||
db 'Driver may work unstable',13,10,0
|
||||
;msgSetVol db 'DEV_SET_MASTERVOL call came',13,10,0
|
||||
;msgGetVol db 'DEV_GET_MASTERVOL call came',13,10,0
|
||||
msgErrDMAsetup db 'failed to setup DMA - bad channel',13,10,0
|
||||
;-------------------------------------------------------------------------------
|
||||
msgDSPFound db 'DSP found at port 2'
|
||||
label port_second_digit_num dword at $
|
||||
db '00h',13,10,'DSP version '
|
||||
sb_DSP_version: db '0.00 - SB'
|
||||
sb_DSP_description: db 32,32,32,32,13,10,0
|
||||
;-------------------------------------------------------------------------------
|
||||
end if
|
||||
;section '.data' data readable writable align 16
|
||||
;all uninitialized data place here
|
@ -9,6 +9,8 @@
|
||||
|
||||
format MS COFF
|
||||
|
||||
DEBUG equ 1
|
||||
|
||||
API_VERSION equ 0 ;debug
|
||||
|
||||
include 'proc32.inc'
|
||||
@ -35,8 +37,6 @@ public START
|
||||
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
|
||||
|
@ -7,12 +7,13 @@
|
||||
|
||||
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
|
||||
|
@ -7,13 +7,13 @@
|
||||
|
||||
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
|
||||
|
@ -114,29 +114,25 @@ save_draw_mouse:
|
||||
|
||||
movzx edx, byte [display_data+ebx+eax]
|
||||
shl edx, 8
|
||||
mov ecx, [edx+SLOT_BASE+APPDATA.cursor]
|
||||
mov esi, [edx+SLOT_BASE+APPDATA.cursor]
|
||||
|
||||
cmp ecx, [current_cursor]
|
||||
cmp esi, [current_cursor]
|
||||
je .draw
|
||||
|
||||
cmp [ecx+CURSOR.magic], 'CURS'
|
||||
jne .fail
|
||||
; cmp [esi+CURSOR.magic], 'CURS'
|
||||
; jne .fail
|
||||
|
||||
push ecx
|
||||
push esi
|
||||
call [select_hw_cursor]
|
||||
mov [current_cursor], ecx
|
||||
|
||||
; cmp [ecx+CURSOR.size], CURSOR_SIZE
|
||||
; jne .fail
|
||||
|
||||
mov [current_cursor], esi
|
||||
.draw:
|
||||
stdcall [set_hw_cursor], ecx
|
||||
stdcall [set_hw_cursor], esi
|
||||
popad
|
||||
ret
|
||||
.fail:
|
||||
mov ecx, [def_cursor]
|
||||
mov [edx+SLOT_BASE+APPDATA.cursor], ecx
|
||||
stdcall [set_hw_cursor], ecx
|
||||
stdcall [set_hw_cursor], ecx ; stdcall: [esp]=ebx,eax
|
||||
popad
|
||||
ret
|
||||
|
||||
|
@ -345,8 +345,6 @@ high_code:
|
||||
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
|
||||
@ -712,7 +710,7 @@ no_lib_load:
|
||||
mov [TASK_DATA+TASKDATA.mem_start], 0 ; process base address
|
||||
|
||||
call init_cursors
|
||||
mov eax, [def_cursor]
|
||||
mov eax, [def_cursor]
|
||||
mov [SLOT_BASE+APPDATA.cursor],eax
|
||||
mov [SLOT_BASE+APPDATA.cursor+256],eax
|
||||
|
||||
@ -1032,7 +1030,6 @@ reserve_irqs_ports:
|
||||
|
||||
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
|
||||
@ -1104,8 +1101,7 @@ set_variables:
|
||||
mov [MOUSE_X],eax
|
||||
pop eax
|
||||
|
||||
mov byte [SB16_Status],0 ; Minazzi Paolo
|
||||
mov [BTN_ADDR],dword BUTTON_INFO ; address of button list
|
||||
mov [BTN_ADDR],dword BUTTON_INFO ; address of button list
|
||||
|
||||
;!! IP 04.02.2005:
|
||||
mov [next_usage_update], 100
|
||||
@ -1183,106 +1179,6 @@ sys_outport:
|
||||
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
|
||||
@ -1472,7 +1368,6 @@ sys_setup:
|
||||
; 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
|
||||
@ -1543,7 +1438,7 @@ endg
|
||||
ret
|
||||
nsyse2:
|
||||
cmp eax,3 ; CD
|
||||
jnz nsyse3
|
||||
jnz nsyse4
|
||||
test ebx,ebx
|
||||
jz nosesl
|
||||
cmp ebx, 4
|
||||
@ -1573,17 +1468,6 @@ endg
|
||||
|
||||
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
|
||||
@ -1638,7 +1522,7 @@ iglobal
|
||||
hd_base db 0
|
||||
endg
|
||||
|
||||
nsyse7:
|
||||
nsyse7:
|
||||
|
||||
cmp eax,8 ; HD PARTITION
|
||||
jne nsyse8
|
||||
@ -1652,24 +1536,16 @@ endg
|
||||
popa
|
||||
mov [hd1_status],0 ; free
|
||||
ret
|
||||
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:
|
||||
|
||||
nsyse8:
|
||||
cmp eax,11 ; ENABLE LBA READ
|
||||
jne no_set_lba_read
|
||||
and ebx,1
|
||||
mov [lba_read_enabled],ebx
|
||||
ret
|
||||
no_set_lba_read:
|
||||
|
||||
cmp eax,12 ; ENABLE PCI ACCESS
|
||||
no_set_lba_read:
|
||||
cmp eax,12 ; ENABLE PCI ACCESS
|
||||
jne no_set_pci_access
|
||||
and ebx,1
|
||||
mov [pci_access_enabled],ebx
|
||||
@ -1691,7 +1567,6 @@ sys_getsetup:
|
||||
; 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
|
||||
@ -1702,7 +1577,7 @@ sys_getsetup:
|
||||
movzx eax,[midi_base]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
ngsyse1:
|
||||
ngsyse1:
|
||||
|
||||
cmp eax,2
|
||||
jne ngsyse2
|
||||
@ -1715,7 +1590,7 @@ sys_getsetup:
|
||||
mov ecx,128
|
||||
call memmove
|
||||
ret
|
||||
kbnobaseret:
|
||||
kbnobaseret:
|
||||
cmp ebx,2
|
||||
jnz kbnoshiftret
|
||||
mov edi,[TASK_BASE]
|
||||
@ -1725,7 +1600,7 @@ sys_getsetup:
|
||||
mov ecx,128
|
||||
call memmove
|
||||
ret
|
||||
kbnoshiftret:
|
||||
kbnoshiftret:
|
||||
cmp ebx,3
|
||||
jne kbnoaltret
|
||||
mov edi,[TASK_BASE]
|
||||
@ -1735,70 +1610,56 @@ sys_getsetup:
|
||||
mov ecx,128
|
||||
call memmove
|
||||
ret
|
||||
kbnoaltret:
|
||||
kbnoaltret:
|
||||
cmp ebx,9
|
||||
jnz ngsyse2
|
||||
movzx eax,word [keyboard]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
ngsyse2:
|
||||
ngsyse2:
|
||||
|
||||
cmp eax,3
|
||||
jnz ngsyse3
|
||||
movzx eax,[cd_base]
|
||||
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]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
ngsyse5:
|
||||
cmp eax,3
|
||||
jnz ngsyse3
|
||||
movzx eax,[cd_base]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
ngsyse3:
|
||||
cmp eax,5
|
||||
jnz ngsyse5
|
||||
mov eax,[syslang]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
ngsyse5:
|
||||
cmp eax,7
|
||||
jnz ngsyse7
|
||||
movzx eax,[hd_base]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
ngsyse7:
|
||||
ngsyse7:
|
||||
cmp eax,8
|
||||
jnz ngsyse8
|
||||
mov eax,[fat32part]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
ngsyse8:
|
||||
ngsyse8:
|
||||
cmp eax,9
|
||||
jne ngsyse9
|
||||
mov eax,[timer_ticks] ;[0xfdf0]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
ngsyse9:
|
||||
cmp eax,10
|
||||
jnz ngsyse10
|
||||
mov eax,[sound_dma]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
ngsyse10:
|
||||
ngsyse9:
|
||||
cmp eax,11
|
||||
jnz ngsyse11
|
||||
mov eax,[lba_read_enabled]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
ngsyse11:
|
||||
ngsyse11:
|
||||
cmp eax,12
|
||||
jnz ngsyse12
|
||||
mov eax,[pci_access_enabled]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
ngsyse12:
|
||||
ngsyse12:
|
||||
mov [esp+36],dword 1
|
||||
ret
|
||||
|
||||
@ -2528,7 +2389,9 @@ nosb6:
|
||||
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
|
||||
|
@ -207,7 +207,6 @@ include "fs/iso9660.inc" ; read for iso9660 filesystem CD
|
||||
|
||||
; sound
|
||||
|
||||
include "sound/sb16.inc" ; playback for Sound Blaster 16
|
||||
include "sound/playnote.inc" ; player Note for Speaker PC
|
||||
|
||||
; display
|
||||
|
@ -18,15 +18,38 @@
|
||||
|
||||
$Revision$
|
||||
|
||||
align 4
|
||||
sound_interface:
|
||||
|
||||
kontrOctave dw 0x4742, 0x4342, 0x3F7C, 0x3BEC, 0x388F, 0x3562
|
||||
dw 0x3264, 0x2F8F, 0x2CE4, 0x2A5F, 0x2802, 0x25BF
|
||||
memAdrNote dd 0
|
||||
pidProcessNote dd 0
|
||||
slotProcessNote dd 0
|
||||
count_timer_Note dd 1
|
||||
mem8253r42 dw 0
|
||||
countDelayNote db 0
|
||||
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
|
||||
pidProcessNote dd 0
|
||||
slotProcessNote dd 0
|
||||
count_timer_Note dd 1
|
||||
mem8253r42 dw 0
|
||||
countDelayNote db 0
|
||||
endg
|
||||
|
||||
playNote:
|
||||
; jmp NotPlayNotes
|
||||
|
@ -1,354 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; 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
|
||||
;***************************************
|
@ -468,6 +468,8 @@ proc init_cursors
|
||||
.init:
|
||||
mov [cur_def_interl], ebx
|
||||
|
||||
; stdcall load_pe_driver, szAtiHW
|
||||
|
||||
stdcall load_driver, szHwMouse
|
||||
mov [hw_cursor], eax
|
||||
test eax, eax
|
||||
|
Loading…
Reference in New Issue
Block a user