[fpc-pascal]CRT unit (was: Beep in Windows)
Andreas K. Foerster
AKFoerster at nikocity.de
Thu Aug 2 19:33:26 CEST 2001
On Wed, Aug 01, 2001 at 02:29:01PM -0400, James_Wilson at i2.com wrote:
> > long time I didn't know how to get a sound under Windows.
> > Sending a #7 doesn't work anymore, when the CRT unit is used.
> What version of Windows are you referring to? I don't have that problem
> with NT4 or 2000.
The problem seems not to be in the Windows-Version but more in the
version of FPC. I took a brief look into the souce code of the CRT unit -
version 1.0.4: the code for handling #7 is explicitly commented out -
I don't understand why.
some other comments to the code of the CRT unit (Win32, 1.0.4):
- The variables "ScreenHeight" and "ScreenWidth" are calculated, but not
exported. That's a pity for they'd be very usefull - In the Linux version
they are exported. (I always recreate them from WindMax at startup)
- The command "clreol" doesn't work correctly. It clears the rest of the
line as it should, but it doesn't set the color. (That's what I need
this command mostly for)
- Anything is done by calling API codes. That's why it is so slow!
As far as I understand it, Windows uses a buffer that's built up equal to
the screenbuffer as it is directly used under DOS, so that you can write
directly to that buffer as in Dos. Just with the difference, that you have
to fetch the starting point and size from the API.
- There are many procedures wich are simply empty. What about putting
something like this into them:
"If DEBUG then RunError(DebugError);" ???
More information about the fpc-pascal