Project settings gecorrigeerd en basis voor wiimote speaker functionaliteit toegevoegd.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.mingw.so.debug.1116435574">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.so.debug.1116435574" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<macros>
|
||||
<stringMacro name="target" type="VALUE_TEXT" value="wiiuse"/>
|
||||
<stringMacro name="jdk" type="VALUE_PATH_DIR" value="C:\Program Files (x86)\Java\jdk1.6.0_26"/>
|
||||
</macros>
|
||||
<externalSettings>
|
||||
@@ -23,24 +24,26 @@
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="dll" artifactName="wiiuse" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.so.debug.1116435574" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.so.debug" postbuildStep="./copy.bat">
|
||||
<configuration artifactExtension="dll" artifactName="${target}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.so.debug.1116435574" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.so.debug" postbuildStep="./copy.bat">
|
||||
<folderInfo id="cdt.managedbuild.config.gnu.mingw.so.debug.1116435574." name="/" resourcePath="">
|
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.so.debug.540248766" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.so.debug">
|
||||
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.so.debug.763602244" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.so.debug"/>
|
||||
<builder buildPath="${workspace_loc:/Wiiuse/Debug}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.1458906080" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.so.debug.1226602461" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.so.debug">
|
||||
<tool command="as" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" id="cdt.managedbuild.tool.gnu.assembler.mingw.so.debug.1226602461" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.so.debug">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.131768531" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1802027" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug.1760584596" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug">
|
||||
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.so.debug.option.optimization.level.655662583" name="Optimization Level" superClass="gnu.c.compiler.mingw.so.debug.option.optimization.level" valueType="enumerated"/>
|
||||
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.so.debug.option.optimization.level.655662583" name="Optimization Level" superClass="gnu.c.compiler.mingw.so.debug.option.optimization.level" value="gnu.c.optimization.level.most" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.mingw.so.debug.option.debugging.level.277209318" name="Debug Level" superClass="gnu.c.compiler.mingw.so.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.option.include.paths.203394821" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/include}""/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.993291047" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.993291047" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="WIIUSE_COMPILE_LIB"/>
|
||||
<listOptionValue builtIn="false" value="WITH_WIIUSE_DEBUG"/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.misc.other.650784187" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0" valueType="string"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.2123798748" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.so.debug.2136680964" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.so.debug">
|
||||
@@ -50,10 +53,13 @@
|
||||
<listOptionValue builtIn="false" value="Ws2_32"/>
|
||||
<listOptionValue builtIn="false" value="Setupapi"/>
|
||||
</option>
|
||||
<option id="gnu.c.link.option.ldflags.1119328813" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="" valueType="string"/>
|
||||
<option id="gnu.c.link.option.implname.339020882" name="Import Library name (-Wl,--out-implib=)" superClass="gnu.c.link.option.implname" value="${target}.lib" valueType="string"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.119816846" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
<outputType id="cdt.managedbuild.tool.gnu.c.linker.mingw.so.debug.output.556110947" outputPrefix="" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.so.debug.output"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug.1884243654" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug">
|
||||
<option id="gnu.cpp.compiler.mingw.so.debug.option.optimization.level.1243107261" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.so.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
|
||||
@@ -820,6 +826,10 @@
|
||||
</cconfiguration>
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.mingw.so.release.1074641339">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.so.release.1074641339" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<macros>
|
||||
<stringMacro name="target" type="VALUE_TEXT" value="wiiusegrapje"/>
|
||||
<stringMacro name="jdk" type="VALUE_PATH_DIR" value="C:\Program Files (x86)\Java\jdk1.6.0_26"/>
|
||||
</macros>
|
||||
<externalSettings>
|
||||
<externalSetting>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/Wiiuse"/>
|
||||
@@ -835,7 +845,7 @@
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="dll" artifactName="wiiuse" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.so.release.1074641339" name="Release" parent="cdt.managedbuild.config.gnu.mingw.so.release" postbuildStep="./copy.bat" prebuildStep="">
|
||||
<configuration artifactExtension="dll" artifactName="${target}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.so.release.1074641339" name="Release" parent="cdt.managedbuild.config.gnu.mingw.so.release" postbuildStep="./copy.bat" prebuildStep="">
|
||||
<folderInfo id="cdt.managedbuild.config.gnu.mingw.so.release.1074641339." name="/" resourcePath="">
|
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.so.release.1012515545" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.so.release">
|
||||
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.so.release.834409978" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.so.release"/>
|
||||
@@ -847,7 +857,7 @@
|
||||
<outputType id="cdt.managedbuild.tool.gnu.archiver.output.1238104425" outputPrefix="" superClass="cdt.managedbuild.tool.gnu.archiver.output"/>
|
||||
</tool>
|
||||
<tool command="gcc" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" id="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.release.982483224" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.release">
|
||||
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.so.release.option.optimization.level.508635058" name="Optimization Level" superClass="gnu.c.compiler.mingw.so.release.option.optimization.level" valueType="enumerated"/>
|
||||
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.so.release.option.optimization.level.508635058" name="Optimization Level" superClass="gnu.c.compiler.mingw.so.release.option.optimization.level" value="gnu.c.optimization.level.most" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.mingw.so.release.option.debugging.level.818549324" name="Debug Level" superClass="gnu.c.compiler.mingw.so.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.option.include.paths.489733690" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/include}""/>
|
||||
@@ -865,6 +875,8 @@
|
||||
<listOptionValue builtIn="false" value="Ws2_32"/>
|
||||
<listOptionValue builtIn="false" value="Setupapi"/>
|
||||
</option>
|
||||
<option id="gnu.c.link.option.ldflags.1077843674" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="" valueType="string"/>
|
||||
<option id="gnu.c.link.option.implname.1912270887" name="Import Library name (-Wl,--out-implib=)" superClass="gnu.c.link.option.implname" value="${target}.lib" valueType="string"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1240500014" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#Wed Jul 20 20:10:42 CEST 2011
|
||||
#Wed Jul 20 23:54:48 CEST 2011
|
||||
eclipse.preferences.version=1
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.so.debug.1116435574/CPATH/delimiter=;
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.so.debug.1116435574/CPATH/operation=remove
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
copy ..\src\wiiuse.h ..\..\WiiuseJ\src\wiiuse.h
|
||||
copy ..\src\speaker.h ..\..\WiiuseJ\src\speaker.h
|
||||
copy wiiuse.dll ..\..\WiiuseJ\lib\wiiuse.dll
|
||||
copy wiiuse.lib ..\..\WiiuseJ\lib\wiiuse.lib
|
||||
copy wiiuse.dll ..\..\Mimis\wiiuse.dll
|
||||
@@ -1,4 +1,3 @@
|
||||
copy ..\src\wiiuse.h ..\..\WiiuseJ\src\wiiuse.h
|
||||
copy ..\src\speaker.h ..\..\WiiuseJ\src\speaker.h
|
||||
copy wiiuse.dll ..\..\WiiuseJ\lib\wiiuse.dll
|
||||
copy wiiuse.lib ..\..\WiiuseJ\lib\wiiuse.lib
|
||||
copy wiiuse.dll ..\..\Mimis\wiiuse.dll
|
||||
@@ -39,8 +39,6 @@
|
||||
|
||||
#define WIIMOTE_PI 3.14159265f
|
||||
|
||||
//#define WITH_WIIUSE_DEBUG
|
||||
|
||||
/* Error output macros */
|
||||
#define WIIUSE_ERROR(fmt, ...) //fprintf(stderr, "[ERROR] " fmt "\n", ##__VA_ARGS__)
|
||||
|
||||
@@ -57,6 +55,7 @@
|
||||
int i = strlen(file) - 1; \
|
||||
for (; i && (file[i] != '\\'); --i); \
|
||||
fprintf(stderr, "[DEBUG] %s:%i: " fmt "\n", file+i+1, __LINE__, ##__VA_ARGS__); \
|
||||
fflush(stderr); \
|
||||
} while (0)
|
||||
#else
|
||||
#define WIIUSE_DEBUG(fmt, ...) fprintf(stderr, "[DEBUG] " __FILE__ ":%i: " fmt "\n", __LINE__, ##__VA_ARGS__)
|
||||
|
||||
@@ -480,10 +480,11 @@ static void event_data_read(struct wiimote_t* wm, byte* msg) {
|
||||
#ifdef WITH_WIIUSE_DEBUG
|
||||
{
|
||||
int i = 0;
|
||||
printf("Read: ");
|
||||
fprintf(stderr, "[DEBUG] Read: ");
|
||||
for (; i < req->size - req->wait; ++i)
|
||||
printf("%x ", req->buf[i]);
|
||||
printf("\n");
|
||||
fprintf(stderr, "%x ", req->buf[i]);
|
||||
fprintf(stderr, "\n");
|
||||
fflush(stderr);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -24,30 +24,17 @@ void wiiuse_speaker_unmute(struct wiimote_t* wm) {
|
||||
wiiuse_send(wm, WM_CMD_SPEAKER_MUTE, &buf, 1);
|
||||
}
|
||||
|
||||
void wiiuse_speaker_config(struct wiimote_t* wm, unsigned short freq, byte vol) {
|
||||
if (freq > 0x0000) {
|
||||
cfg[2] = freq & 0x00ff;
|
||||
cfg[3] = (freq & 0xff00) >> 8;
|
||||
}
|
||||
printf("speaker 0x%02x%02x\n", cfg[2], cfg[3]);
|
||||
fflush(stdout);
|
||||
if (vol > 0x00) {
|
||||
cfg[4] = vol;
|
||||
}
|
||||
wiiuse_write_data(wm, WM_REG_SPEAKER, cfg, 9);
|
||||
}
|
||||
|
||||
void wiiuse_speaker_data(struct wiimote_t* wm, byte* data) {
|
||||
byte buf[21];
|
||||
buf[0] = sizeof(data) << 3;
|
||||
memcpy(buf + 1, data, 20);
|
||||
wiiuse_send(wm, WM_CMD_STREAM_DATA, buf, 21);
|
||||
}
|
||||
|
||||
void wiiuse_speaker_activate(struct wiimote_t* wm) {
|
||||
wiiuse_speaker_enable(wm);
|
||||
wiiuse_speaker_mute(wm);
|
||||
byte buf = 0x01;
|
||||
wiiuse_write_data(wm, WM_REG_SPEAKER + 8, &buf, 1);
|
||||
buf = 0x08;
|
||||
wiiuse_write_data(wm, WM_REG_SPEAKER, &buf, 1);
|
||||
wiiuse_speaker_config(wm);
|
||||
buf = 0x01;
|
||||
wiiuse_write_data(wm, WM_REG_SPEAKER + 7, &buf, 1);
|
||||
wiiuse_speaker_unmute(wm);
|
||||
wiiuse_speaker_config(wm, 0x00, 0x00);
|
||||
}
|
||||
|
||||
void wiiuse_speaker_deactivate(struct wiimote_t* wm) {
|
||||
@@ -55,10 +42,28 @@ void wiiuse_speaker_deactivate(struct wiimote_t* wm) {
|
||||
wiiuse_speaker_disable(wm);
|
||||
}
|
||||
|
||||
void wiiuse_speaker_frequency(struct wiimote_t* wm, unsigned short freq) {
|
||||
wiiuse_speaker_config(wm, freq, 0x00);
|
||||
void wiiuse_speaker_format(struct wiimote_t* wm, byte format) {
|
||||
wm->speaker.format = format;
|
||||
}
|
||||
|
||||
void wiiuse_speaker_volume(struct wiimote_t* wm, byte vol) {
|
||||
wiiuse_speaker_config(wm, 0x0000, vol);
|
||||
void wiiuse_speaker_rate(struct wiimote_t* wm, double rate) {
|
||||
// Check: pcm_sample_rate = 12000000 / rate_value adpcm_sample_rate = 6000000 / rate_value
|
||||
wm->speaker.rate = 48000 / rate;
|
||||
}
|
||||
|
||||
void wiiuse_speaker_volume(struct wiimote_t* wm, double vol) {
|
||||
wm->speaker.vol = vol * WIIMOTE_GET_SPEAKER_MAX_VOLUME(wm);
|
||||
}
|
||||
|
||||
void wiiuse_speaker_config(struct wiimote_t* wm) {
|
||||
byte cfg[7] = {wm->speaker.format, 0x00, 0x00, wm->speaker.rate, wm->speaker.vol, 0x00, 0x00};
|
||||
wiiuse_write_data(wm, WM_REG_SPEAKER, cfg, 7);
|
||||
}
|
||||
|
||||
void wiiuse_speaker_data(struct wiimote_t* wm, byte* data) {
|
||||
/* Todo: add data length dynamically */
|
||||
//byte buf[21];
|
||||
//WIIUSE_DEBUG("data length %d", sizeof(buf) / sizeof(byte));
|
||||
//memcpy(buf, data, 21);
|
||||
wiiuse_send(wm, WM_CMD_STREAM_DATA, data, 21);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "wiiuse.h"
|
||||
|
||||
#define WIIMOTE_GET_RUMBLE(wm) (WIIMOTE_IS_SET(wm, WIIMOTE_STATE_RUMBLE) ? 0x01 : 0x00)
|
||||
#define WIIMOTE_GET_RUMBLE(wm) (WIIMOTE_IS_SET(wm, WIIMOTE_STATE_RUMBLE) ? 0x01 : 0x00)
|
||||
#define WIIMOTE_GET_SPEAKER_MAX_VOLUME(wm) (wm->speaker.format == 0x00 ? 0x40 : 0xff)
|
||||
|
||||
#define WM_CMD_SPEAKER_ENABLE 0x14
|
||||
#define WM_CMD_STREAM_DATA 0x18
|
||||
@@ -8,16 +9,4 @@
|
||||
|
||||
#define WM_CTRL_STATUS_BYTE1_SPEAKER_MUTE 0x04
|
||||
|
||||
#define WM_REG_SPEAKER 0x04a20001
|
||||
|
||||
static byte cfg[9] = {0x00, 0x00, 0x00, 0xdd, 0x40, 0x00, 0x00, 0x01, 0x01};
|
||||
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_enable(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_disable(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_mute(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_unmute(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_activate(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_deactivate(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_volume(struct wiimote_t* wm, byte vol);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_frequency(struct wiimote_t* wm, unsigned short freq);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_data(struct wiimote_t* wm, byte* data);
|
||||
#define WM_REG_SPEAKER 0x04a20001
|
||||
|
||||
@@ -538,10 +538,11 @@ int wiiuse_write_data(struct wiimote_t* wm, unsigned int addr, byte* data, byte
|
||||
#ifdef WITH_WIIUSE_DEBUG
|
||||
{
|
||||
int i = 0;
|
||||
printf("Write data is: ");
|
||||
fprintf(stderr, "[DEBUG} Write data is: ");
|
||||
for (; i < len; ++i)
|
||||
printf("%x ", data[i]);
|
||||
printf("\n");
|
||||
fprintf(stderr, "%x ", data[i]);
|
||||
fprintf(stderr, "\n");
|
||||
fflush(stderr);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -607,14 +608,15 @@ int wiiuse_send(struct wiimote_t* wm, byte report_type, byte* msg, int len) {
|
||||
#ifdef WITH_WIIUSE_DEBUG
|
||||
{
|
||||
int x = 2;
|
||||
printf("[DEBUG] (id %i) SEND: (%x) %.2x ", wm->unid, buf[0], buf[1]);
|
||||
fprintf(stderr, "[DEBUG] (id %i) SEND: (%x) %.2x ", wm->unid, buf[0], buf[1]);
|
||||
#ifndef WIN32
|
||||
for (; x < len+2; ++x)
|
||||
#else
|
||||
for (; x < len+1; ++x)
|
||||
#endif
|
||||
printf("%.2x ", buf[x]);
|
||||
printf("\n");
|
||||
fprintf(stderr, "%.2x ", buf[x]);
|
||||
fprintf(stderr, "\n");
|
||||
fflush(stderr);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -371,6 +371,16 @@ typedef struct ir_t {
|
||||
} ir_t;
|
||||
|
||||
|
||||
/**
|
||||
* @struct speaker_t
|
||||
*/
|
||||
typedef struct speaker_t {
|
||||
byte format;
|
||||
byte vol;
|
||||
byte rate;
|
||||
} speaker_t;
|
||||
|
||||
|
||||
/**
|
||||
* @struct joystick_t
|
||||
* @brief Joystick calibration structure.
|
||||
@@ -563,6 +573,7 @@ typedef struct wiimote_t {
|
||||
WCONST struct gforce_t gforce; /**< current gravity forces on each axis */
|
||||
|
||||
WCONST struct ir_t ir; /**< IR data */
|
||||
WCONST struct speaker_t speaker; /**< speaker */
|
||||
|
||||
WCONST unsigned short btns; /**< what buttons have just been pressed */
|
||||
WCONST unsigned short btns_held; /**< what buttons are being held down */
|
||||
@@ -643,6 +654,18 @@ WIIUSE_EXPORT extern void wiiuse_set_ir_sensitivity(struct wiimote_t* wm, int le
|
||||
WIIUSE_EXPORT extern void wiiuse_set_nunchuk_orient_threshold(struct wiimote_t* wm, float threshold);
|
||||
WIIUSE_EXPORT extern void wiiuse_set_nunchuk_accel_threshold(struct wiimote_t* wm, int threshold);
|
||||
|
||||
/* speaker.c */
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_enable(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_disable(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_mute(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_unmute(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_activate(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_deactivate(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_format(struct wiimote_t* wm, byte format);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_volume(struct wiimote_t* wm, double vol);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_rate(struct wiimote_t* wm, double freq);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_config(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_speaker_data(struct wiimote_t* wm, byte* data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user