First post, by Nabsterikz
Hi, i'm trying programing DSP for Auto-Init record with DMA, but i have a trouble, don't know because of my hands or dosbox:). Procs:
setupdma08 proc nearpush axmov al,00000101b;mask 1 dma channelout 0Ah,almov al,01010101b;dma-mode single transfer, addr increasing, auto-init, device2mem, 1 channelout 0Bh,alxor al,alout 0Ch,al;switch to Lo-Hipush cspop axmov bx,10hmul bxadd ax,offset sbuf08push axadc dl,00hmov al,dlout 83h,al;page, first 4bit in 24bit addrpop ax;offsetout 02h,almov al,ahout 02h,almov ax,537Ch;sizedec axout 03h,almov al,ahout 03h,almov al,00000001b;unmaskout 0Ah,alpop axsetupdma08 endpsetupdsp08 proc nearpush axmov ah,00CEh;dsp cmd Cxh,6-playback,E-recordingcall dspcmdxor ah,ahcall dspcmd;unsigned,monomov ax,29BEh;sizedec axxchg ah,alcall dspcmdmov ah,alcall dspcmdpop axretsetupdsp08 endpdspinit proc nearpush dx ax cxmov dx,226h;resetmov al,01hout dx,al
mov cx,99h;delaywaitffin:xor al,alloop waitffinout dx,alcall dspreadatamov ah,09hcmp al,00AAhje dspinitedmov dx,offset mninitedint 21hjmp dspinitextdspinited:mov dx,offset minitedint 21hmov ah,41h;frequency for outputcall dspcmdmov ah,1Fhcall dspcmdmov ah,40hcall dspcmdmov ah,42h;frequency for inputcall dspcmdmov ah,1Fh;hicall dspcmdmov ah,40h;locall dspcmddspinitext:pop cx ax dxretdspinit endpdspcmd proc nearpush dx axwaitfacmd:mov dx,022Chin al,dxand al,10000000bjnz waitfacmdmov al,ahout dx,alpop ax dxretdspcmd endpdspreadata proc nearpush dxmov dx,022Ehwaitfrdata:in al,dxand al,10000000bjz waitfrdatamov dx,022Ahin al,dxpop dxretdspreadata endp
I am coding chat,like skype under dos, and at the same time, program must record and playback data, so i am using 8bit for playback and 16bit for record(on higth sample,8bit-record). When i wrote 16bit recording, i heard a noise, then i corrected 8bit to recoding, and load wav-file to buffer, and i heard this music. I try to change dma mode,etc..But same thing, every time it's playback. I compared with another program, they are same.