1
0
Fork 0

Implement BIOS beep sound for ASCII character 7.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3968
This commit is contained in:
ripsaw8080 2016-02-14 04:02:09 +00:00
parent 9035510f06
commit ca9049cce5

View file

@ -589,9 +589,21 @@ static void INT10_TeletypeOutputAttr(Bit8u chr,Bit8u attr,bool useattr,Bit8u pag
Bit8u cur_row=CURSOR_POS_ROW(page);
Bit8u cur_col=CURSOR_POS_COL(page);
switch (chr) {
case 7:
//TODO BEEP
break;
case 7: /* Beep */
// Prepare PIT counter 2 for ~900 Hz square wave
IO_Write(0x43,0xb6);
IO_Write(0x42,0x28);
IO_Write(0x42,0x05);
// Speaker on
IO_Write(0x61,IO_Read(0x61)|3);
// Idle for 1/3rd of a second
double start;
start=PIC_FullIndex();
while ((PIC_FullIndex()-start)<333.0) CALLBACK_Idle();
// Speaker off
IO_Write(0x61,IO_Read(0x61)&~3);
// No change in position
return;
case 8:
if(cur_col>0) cur_col--;
break;