BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
risoundlib.c File Reference
#include "blitzlib.h"
#include "blitzobj.h"

Macros

#define ID(a, b, c, d)
#define LONGAT(p)
#define WORDAT(p)
#define MAXBODY   131071

Functions

void risoundlib_loadsounds (void)
static void _libinit (void)
 init: RTS (nothing to set up).
static void _libfinit (void)
 finit: RTS (nothing to free).
static BB_BOOL loadsounds_c (ULONG sound, UBYTE *sram, struct bb_sound *saddr)
 CludgeSound sound#,address: an IFF 8SVX sample in memory as an audiolib sound object.

Macro Definition Documentation

◆ ID

#define ID ( a,
b,
c,
d )
Value:
((ULONG)(a) << 24 | (ULONG)(b) << 16 | (c) << 8 | (d))
ULONG WORD UWORD c
Definition 2dlib.c:2491
static struct @065163037313156332013005143365272036211065172003 d

◆ LONGAT

#define LONGAT ( p)
Value:
(*(ULONG *)(p))

◆ MAXBODY

#define MAXBODY   131071

◆ WORDAT

#define WORDAT ( p)
Value:
(*(UWORD *)(p))

Function Documentation

◆ _libfinit()

void _libfinit ( void )
static

finit: RTS (nothing to free).

◆ _libinit()

void _libinit ( void )
static

init: RTS (nothing to set up).

◆ loadsounds_c()

BB_BOOL loadsounds_c ( ULONG sound,
UBYTE * sram,
struct bb_sound * saddr )
static

CludgeSound sound#,address: an IFF 8SVX sample in memory as an audiolib sound object.

Checks "8SVX"/"VHDR" at address+8/+12, takes the sample rate (samplesPerSec, fixed: #832), finds the BODY chunk among the first seven chunks of the FORM (with the IFF pad bytes, fixed: #828), then frees the object's old sample and clears its pointer (memlib globfree; not DecodeSound's in-place "cL" data, fixed: #945; after the checks, fixed: #831), copies all of the BODY into chip memory (memlib globalloc; fixed: #829) and fills the object: sample, period 3579545 / rate, length in words, no loop, the "cL" mark cleared.

Parameters
soundd0: the sound number (globfree gets d0 with the old length in its low word)
sramd1: the 8SVX file
saddra0: the sound object (!libs audiolib,ia0|pd0)
Returns
d0: BB_TRUE, BB_FALSE if it is no 8SVX/VHDR file, its rate is 0 (fixed: #830), it has no BODY among the first seven chunks of the FORM, the BODY is empty or 131072 bytes or longer (fixed: #829) - the sound unchanged (fixed: #831) - or the chip memory is missing (the sound then has no sample)

◆ risoundlib_loadsounds()

void risoundlib_loadsounds ( void )