home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Acorn User 10
/
AU_CD10.iso
/
Updates
/
DigitalCD
/
!DigitalCD
/
Copy
/
PowerBars
/
c
/
DCDswi
next >
Wrap
Text File
|
1999-12-03
|
1KB
|
72 lines
#include "DCDswi.h"
static int Player = -1;
static int PlugIn = -1;
void DCDUtils_SetPlayer(int player)
{
Player = player;
}
_kernel_oserror* DCDUtils_RegisterPlugIn(int task, bool bFullScreen)
{
_kernel_swi_regs regs;
_kernel_oserror* err;
regs.r[1] = Player;
regs.r[2] = task;
regs.r[3] = (bFullScreen) ? 1: 0;
/* DCDUtils_RegisterPlugIn */
if ((err = _kernel_swi(0x072783, ®s, ®s)) != NULL)
return err;
PlugIn = regs.r[0];
return NULL;
}
_kernel_oserror* DCDUtils_DeregisterPlugIn(void)
{
_kernel_swi_regs regs;
regs.r[0] = PlugIn;
/* DCDUtils_DeregisterPlugIn */
return _kernel_swi(0x072784, ®s, ®s);
}
void DCDUtils_GetInfo(int* window, int* count, int* volume, const char** title)
{
_kernel_swi_regs regs;
regs.r[0] = Player;
/* DCDUtils_GetPlayerInfo */
if(_kernel_swi(0x072786, ®s, ®s))
{
*window = -1;
*count = 0;
*volume = 256;
title = NULL;
}
else
{
*window = regs.r[1];
*count = regs.r[2];
*volume = regs.r[3];
*title = (const char*) regs.r[4];
}
}
int DCDUtils_GetBuffer(char2* buffer, char2* buffer_end)
{
_kernel_swi_regs regs;
regs.r[0] = Player;
regs.r[1] = (int) buffer;
regs.r[2] = (int) buffer_end;
regs.r[3] = 4; /* 8-bit, volume scaled */
/* DCDUtils_FillABuffer */
_kernel_swi(0x07278E, ®s, ®s);
buffer_end = (char2*) regs.r[2];
return buffer_end - buffer;
}