Skip to content

Commit

Permalink
Added __playSound() and _vbpif_sound() stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Dec 23, 1999
1 parent 4fe5afb commit 11dba23
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions BASIClib/ConsoleFunctions.c
Expand Up @@ -17,6 +17,7 @@
#warning Need structure for driver entry points!

/* variable function pointers... */

void (*__getConsoleDriverName)(__byte *buf, __integer size) = NULL;
void (*__deinitConsoleDriver)(void) = NULL;
void (*__printNewLine)(void) = NULL;
Expand All @@ -33,6 +34,7 @@ void (*_vbpii_locate)(__integer newY, __integer newX) = NULL;
void (*_vbpNi_locate)(__integer newX) = NULL;
void (*_vbpiN_locate)(__integer newY) = NULL;
void (*_vbp_locate)(void) = NULL;
void (*__playSound)(__integer freq, __single duration) = NULL;
void (*_vbp_beep)(void) = NULL;


Expand Down Expand Up @@ -63,6 +65,7 @@ void __deinitConsoleFunctions(void)
__deinitConsoleDriver = NULL;
__printNewLine = NULL;
__printNChars = NULL;
__playSound = NULL;
_vbpii_viewPrint = NULL;
_vbp_viewPrint = NULL;
_vbp_cls = NULL;
Expand Down Expand Up @@ -123,6 +126,22 @@ void __printAsciz(__byte *str)
} /* __printAsciz */


void _vbpif_sound(__integer frequency, __single duration)
{
if (__playSound != NULL)
{
/* These are the valid ranges according to VBDOS 1.0 ... */
if (frequency < 37)
__runtimeError(ERR_ILLEGAL_FUNCTION_CALL);

if ((duration < 0.0) || (duration > 65535.0))
__runtimeError(ERR_ILLEGAL_FUNCTION_CALL);

__playSound(frequency, duration);
} /* if */
} /* _vbpil_sound */


/* qbcolor */
/* color */
/* write */
Expand All @@ -133,6 +152,7 @@ void __printAsciz(__byte *str)
/* key */
/* print using */
/* tab */
/* beep */

/* -- graphics ... -- */
/* circle */
Expand Down
2 changes: 2 additions & 0 deletions BASIClib/ConsoleFunctions.h
Expand Up @@ -29,6 +29,7 @@ extern void (*_vbpii_locate)(__integer newY, __integer newX);
extern void (*_vbpNi_locate)(__integer newX);
extern void (*_vbpiN_locate)(__integer newY);
extern void (*_vbp_locate)(void);
extern void (*__playSound)(__integer freq, __single duration);
extern void (*_vbp_beep)(void);


Expand All @@ -38,6 +39,7 @@ void __deinitConsoleFunctions(void);
void _vbpV_print(PVariant pVar);
void _vbpS_print(PBasicString str);
void __printAsciz(__byte *str);
void _vbpif_sound(__integer frequency, __single duration);

#ifdef __cplusplus
}
Expand Down

0 comments on commit 11dba23

Please sign in to comment.