Bell sound (with floppy fix)
Posted: Tue Sep 01, 2020 1:04 am
tldr: Grab the attachment, unzip it, rename it as boot0.rom and place it in the ao486 folder to get a system bell sound.
Updated to Floppy fix ROM
When I tried to test the PC Speaker sound, I first entered 'echo ^G'. I was disappointed when I noticed that it didn't work. So I tried some program that used the PC speaker, and that one worked. The conclusion: the system bell is broken!
So I began digging into the cause, and realized that the Tseng VGA BIOS passes responsibility to the system BIOS (via INT 42h) in case of beep, and the system BIOS assumes in turn that INT 10h is implemented by the VGA BIOS and therefore implements nothing. It's a classic case of mutual someone-else-will-do-it.
Well, the beeper is a system peripheral that is not related to video, so I thought its correct place is the system BIOS. And so I implemented it. Taking this file as a base: https://github.com/MiSTer-devel/ao486_M ... /boot0.rom I patched it to add the bell. It's attached below. Rename it to boot0.rom and place it in the ao486 folder.
I assembled it directly with symdeb, so I there aren't any sources. But since the license imposes releasing the source code, here's a disassembly of the fragment that I modified (in place of an iret at F065 followed by zeros):
This snippet is donated to the public domain.
The full BIOS is GPL, and since I'm distributing a binary, I also must point to the source. The source code of the BIOS prior to patching can be obtained from https://github.com/MiSTer-devel/ao486_M ... sw/sysbios
Edit: Note that if you're using the open source VGA BIOS instead of the Tseng one, it won't work, because it neither transfers back to the system BIOS nor implements beeping: https://github.com/MiSTer-devel/ao486_M ... os.c#L2086
Updated to Floppy fix ROM
When I tried to test the PC Speaker sound, I first entered 'echo ^G'. I was disappointed when I noticed that it didn't work. So I tried some program that used the PC speaker, and that one worked. The conclusion: the system bell is broken!
So I began digging into the cause, and realized that the Tseng VGA BIOS passes responsibility to the system BIOS (via INT 42h) in case of beep, and the system BIOS assumes in turn that INT 10h is implemented by the VGA BIOS and therefore implements nothing. It's a classic case of mutual someone-else-will-do-it.
Well, the beeper is a system peripheral that is not related to video, so I thought its correct place is the system BIOS. And so I implemented it. Taking this file as a base: https://github.com/MiSTer-devel/ao486_M ... /boot0.rom I patched it to add the bell. It's attached below. Rename it to boot0.rom and place it in the ao486 folder.
I assembled it directly with symdeb, so I there aren't any sources. But since the license imposes releasing the source code, here's a disassembly of the fragment that I modified (in place of an iret at F065 followed by zeros):
Code: Select all
F065 3D070E cmp ax,0e07
F068 7401 jz f06b
F06A CF iret
F06B 51 push cx
F06C B0B6 mov al,b6
F06E E643 out 43,al
F070 B005 mov al,05
F072 E642 out 42,al
F074 E642 out 42,al
F076 E461 in al,61
F078 88C4 mov ah,al
F07A 0C03 or al,03
F07C E661 out 61,al
F07E B9000E mov cx,0e00
F081 E461 in al,61
F083 A810 test al,10
F085 75FA jnz f081
F087 E461 in al,61
F089 A810 test al,10
F08B 74FA jz f087
F08D E2F2 loop f081
F08F 88E0 mov al,ah
F091 E661 out 61,al
F093 59 pop cx
F094 B8070E mov ax,0e07
F097 CF iret
The full BIOS is GPL, and since I'm distributing a binary, I also must point to the source. The source code of the BIOS prior to patching can be obtained from https://github.com/MiSTer-devel/ao486_M ... sw/sysbios
Edit: Note that if you're using the open source VGA BIOS instead of the Tseng one, it won't work, because it neither transfers back to the system BIOS nor implements beeping: https://github.com/MiSTer-devel/ao486_M ... os.c#L2086