testsuite: convert printf to std::cout(now all output should appear in dolphin) and add more checks to exi

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2073 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2009-02-02 22:11:49 +00:00
parent 4f44afcb04
commit 82d510e252
6 changed files with 279 additions and 194 deletions

View File

@ -11,20 +11,22 @@
static void *xfb = NULL;
static GXRModeObj *rmode = NULL;
void *Initialise();
void Initialise();
#define NUM_BLOCKS 10
u32 aram_blocks[NUM_BLOCKS];
u32 start_addr = -1;
int main(int argc, char **argv) {
xfb = Initialise();
int main(int argc, char **argv)
{
Initialise();
start_addr = AR_Init(aram_blocks, NUM_BLOCKS);
while(1) {
while(1)
{
PAD_ScanPads();
VIDEO_ClearFrameBuffer(rmode, xfb, 0);
std::cout<<"\x1b[2;0H"; // Position the cursor (on 2nd row)
std::cout << "Aram is " << (AR_GetDMAStatus() ? "In Progress" : "Idle") << std::endl;
std::cout << "Aram Start is 0x" << std::setbase(16) << start_addr << ", Allocated 0x" << AR_GetSize() << " Of memory" << std::setbase(10) << std::endl;
std::cout << "Internal Size is 0x" << std::setbase(16) << AR_GetInternalSize() << std::setbase(10) << std::endl;
@ -34,25 +36,37 @@ int main(int argc, char **argv) {
return 0;
}
void * Initialise() {
void *framebuffer;
void Initialise()
{
// Initialise the video system
VIDEO_Init();
// This function initialises the attached controllers
PAD_Init();
// Obtain the preferred video mode from the system
// This will correspond to the settings in the Wii menu
rmode = VIDEO_GetPreferredMode(NULL);
framebuffer = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
console_init(framebuffer,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
// Allocate memory for the display in the uncached region
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
// Initialise the console, required for printf
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
// Set up the video registers with the chosen mode
VIDEO_Configure(rmode);
VIDEO_SetNextFramebuffer(framebuffer);
// Tell the video hardware where our display memory is
VIDEO_SetNextFramebuffer(xfb);
// Make the display visible
VIDEO_SetBlack(FALSE);
// Flush the video register changes to the hardware
VIDEO_Flush();
// Wait for Video setup to complete
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
return framebuffer;
}

View File

@ -3,8 +3,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <ogcsys.h>
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include <iostream>
#include <iomanip>
@ -15,64 +14,90 @@ static void *xfb = NULL;
u32 first_frame = 1;
GXRModeObj *rmode;
void Initialise();
int main()
{
VIDEO_Init();
rmode = VIDEO_GetPreferredMode(NULL);
PAD_Init();
Initialise();
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
VIDEO_Configure(rmode);
VIDEO_SetNextFramebuffer(xfb);
VIDEO_SetBlack(FALSE);
VIDEO_Flush();
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*2);
time_t gc_time;
gc_time = time(NULL);
srand(gc_time);
while(1)
{
s32 Size;
s32 SSize;
u32 ID;
s32 error;
s32 getIDerr;
s32 CARDerr;
s32 EXIerr;
VIDEO_ClearFrameBuffer(rmode, xfb, 0);
EXI_GetID(0, 0, &ID);
error = CARD_ProbeEx(0, &Size, &SSize);
// Can't use printf since Dolphin overrides it
if(error >= 0) // All is good
std::cout << "Card A has a size of " << Size << " and a Sector Size of " << SSize;
else if( error == -2) // Device isn't Memory card
std::cout << "Device isn't Mem card in Slot A";
else
std::cout << "Got an error of " << error << " with slot A";
std::cout << " ID of 0x" << std::setbase(16) << ID << std::endl;
std::cout << std::setbase(10);
EXI_GetID(1, 0, &ID);
error = CARD_ProbeEx(1, &Size, &SSize);
if(error >= 0) // All is good
std::cout << "Card B has a size of " << Size << " and a Sector Size of " << SSize;
else if( error == -2) // Device isn't Memory card
std::cout << "Device isn't Mem card in Slot B";
else
std::cout << "Got an error of " << error << " with slot B";
std::cout << " ID of 0x" << std::setbase(16) << ID << std::endl;
std::cout<<"\x1b[0;0H"; // Position the cursor (at 0, 0)
for (int channel = 0; channel < EXI_CHANNEL_MAX; ++channel)
for (int device = 0; device < EXI_DEVICE_MAX; ++device)
{
if (getIDerr = EXI_GetID(channel, device, &ID) == 1)
{
std::cout<<"Channel "<<channel<<" Device "<<device<<"\tID = 0x"<<std::setbase(16)<<ID<<std::endl;
if ((channel == 0 && device == 0)||(channel == 1 && device == 0))
{
// It's a memcard slot
if (CARDerr = CARD_ProbeEx(channel, &Size, &SSize) >= 0)
{
std::cout<<"\tMemcard has a size of "<<std::setbase(10)<<Size<<" and a Sector Size of "<<std::setbase(10)<<SSize<<std::endl;
}
else if (CARDerr == -2)
std::cout<<"\tNot a Memcard!"<<std::endl;
else
std::cout<<"\tCARD Error "<<CARDerr<<std::endl;
}
else
{
// It's not a memcard, what to do? - Just probe for now
if (EXIerr = EXI_ProbeEx(channel)){}
else
std::cout<<"\tEXI Error "<<EXIerr<<std::endl;
}
}
else
std::cout<<"Channel "<<channel<<" Device "<<device<<std::endl<<"\tEXI_GetID Error "<<getIDerr<<std::endl;
}
VIDEO_WaitVSync();
}
return 0;
}
void Initialise()
{
// Initialise the video system
VIDEO_Init();
// This function initialises the attached controllers
PAD_Init();
// Obtain the preferred video mode from the system
// This will correspond to the settings in the Wii menu
rmode = VIDEO_GetPreferredMode(NULL);
// Allocate memory for the display in the uncached region
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
// Initialise the console, required for printf
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
// Set up the video registers with the chosen mode
VIDEO_Configure(rmode);
// Tell the video hardware where our display memory is
VIDEO_SetNextFramebuffer(xfb);
// Make the display visible
VIDEO_SetBlack(FALSE);
// Flush the video register changes to the hardware
VIDEO_Flush();
// Wait for Video setup to complete
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
}

View File

@ -3,15 +3,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <ogcsys.h>
#include <time.h>
#include <sys/time.h>
#include <iostream>
#include <debug.h>
#include <math.h>
static u32* xfb = NULL;
static void* xfb = NULL;
u32 first_frame = 1;
GXRModeObj *rmode;
@ -21,63 +19,80 @@ vu16 keydown;
vu16 keyup;
PADStatus pad[4];
int main() {
VIDEO_Init();
rmode = VIDEO_GetPreferredMode(NULL);
PAD_Init();
xfb = (u32*)MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
VIDEO_Configure(rmode);
VIDEO_SetNextFramebuffer(xfb);
VIDEO_SetBlack(FALSE);
VIDEO_Flush();
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE)
VIDEO_WaitVSync();
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*2);
void Initialise();
time_t gc_time;
gc_time = time(NULL);
int main()
{
Initialise();
srand(gc_time);
while(1) {
gc_time = time(NULL);
while(1)
{
VIDEO_ClearFrameBuffer(rmode, xfb, 0);
std::cout<<"\x1b[0;0H"; // Position the cursor (at 0, 0)
PAD_Read(pad);
for(int a = 0; a < 4;a ++)
{
if(pad[a].err & PAD_ERR_NO_CONTROLLER)
continue; // Controller not connected
printf("pad[%d] Sticks, Main[ %d, %d ] Sub[ %d, %d ]\n", a, pad[a].stickX, pad[a].stickY, pad[a].substickX, pad[a].substickY);
printf("pad[%d] LTrigger is %s, LTrigger Analog %d\n", a, pad[a].button & PAD_TRIGGER_L ? "pressed" : "not pressed", pad[a].triggerL);
printf("pad[%d] RTrigger is %s, RTrigger Analog %d\n", a, pad[a].button & PAD_TRIGGER_R ? "pressed" : "not pressed", pad[a].triggerR);
printf("pad[%d] Trigger Z is %s\n", a, pad[a].button & PAD_TRIGGER_Z ? "pressed" : "not pressed");
printf("pad[%d] Button A %s, Analog A %d\n", a, pad[a].button & PAD_BUTTON_A ? "pressed" : "not pressed", pad[a].analogA);
printf("pad[%d] Button B %s, Analog B %d\n", a, pad[a].button & PAD_BUTTON_B ? "pressed" : "not pressed", pad[a].analogB);
printf("pad[%d] Button X is %s\n", a, pad[a].button & PAD_BUTTON_X ? "pressed" : "not pressed");
printf("pad[%d] Button Y is %s\n", a, pad[a].button & PAD_BUTTON_Y ? "pressed" : "not pressed");
printf("pad[%d] Button Start is %s\n", a, pad[a].button & PAD_BUTTON_START ? "pressed" : "not pressed");
printf("pad[%d] DPad is [up, down, left, right](%d, %d, %d, %d)\n", a, pad[a].button & PAD_BUTTON_UP ? 1 : 0, pad[a].button & PAD_BUTTON_DOWN ? 1 : 0, pad[a].button & PAD_BUTTON_LEFT ? 1 : 0, pad[a].button & PAD_BUTTON_RIGHT ? 1 : 0);
}
{
std::cout<<"pad["<<a<<"] Not Connected\n";
continue;
}
std::cout<<"pad["<<a<<"] Sticks: Main[ "<<(int)pad[a].stickX<<", "<<(int)pad[a].stickY<<" ] Sub[ "<<(int)pad[a].substickX<<", "<<(int)pad[a].substickX<<" ]\n";
std::cout<<"pad["<<a<<"] Analog Triggers: Left "<<(int)pad[a].triggerL<<" Right "<<(int)pad[a].triggerL<<"\n";
std::cout<<"pad["<<a<<"] Buttons: "<<
(pad[a].button & PAD_BUTTON_START? "Start " : "")<<
(pad[a].button & PAD_BUTTON_A ? "A " : "")<<
(pad[a].button & PAD_BUTTON_B ? "B " : "")<<
(pad[a].button & PAD_BUTTON_X ? "X " : "")<<
(pad[a].button & PAD_BUTTON_Y ? "Y " : "")<<
(pad[a].button & PAD_TRIGGER_Z? "Z " : "")<<
(pad[a].button & PAD_TRIGGER_L? "L " : "")<<
(pad[a].button & PAD_TRIGGER_R? "R " : "")<<std::endl;
std::cout<<"pad["<<a<<"] DPad: "<<
(pad[a].button & PAD_BUTTON_UP ? "Up " : "")<<
(pad[a].button & PAD_BUTTON_DOWN ? "Down " : "")<<
(pad[a].button & PAD_BUTTON_LEFT ? "Left " : "")<<
(pad[a].button & PAD_BUTTON_RIGHT ? "Right " : "")<<std::endl;
}
VIDEO_WaitVSync();
int buttonsDown = PAD_ButtonsDown(0);
if (buttonsDown & PAD_BUTTON_START) {
exit(0);
}
}
}
void Initialise()
{
// Initialise the video system
VIDEO_Init();
// This function initialises the attached controllers
PAD_Init();
// Obtain the preferred video mode from the system
// This will correspond to the settings in the Wii menu
rmode = VIDEO_GetPreferredMode(NULL);
// Allocate memory for the display in the uncached region
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
// Initialise the console, required for printf
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
// Set up the video registers with the chosen mode
VIDEO_Configure(rmode);
// Tell the video hardware where our display memory is
VIDEO_SetNextFramebuffer(xfb);
// Make the display visible
VIDEO_SetBlack(FALSE);
// Flush the video register changes to the hardware
VIDEO_Flush();
// Wait for Video setup to complete
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
}

View File

@ -10,46 +10,63 @@
#include <debug.h>
#include <math.h>
static void *xfb = NULL;
u32 first_frame = 1;
GXRModeObj *rmode;
void Initialise();
int main() {
VIDEO_Init();
rmode = VIDEO_GetPreferredMode(NULL);
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
VIDEO_Configure(rmode);
VIDEO_SetNextFramebuffer(xfb);
VIDEO_SetBlack(FALSE);
VIDEO_Flush();
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*2);
int main()
{
Initialise();
time_t gc_time;
gc_time = time(NULL);
srand(gc_time);
while(1) {
while(1)
{
gc_time = time(NULL);
printf("\x1b[10;0HRTC time is %s ",ctime(&gc_time));
std::cout<<"\x1b[10;0HRTC time is"<<ctime(&gc_time);
VIDEO_WaitVSync();
}
}
void Initialise()
{
// Initialise the video system
VIDEO_Init();
// This function initialises the attached controllers
PAD_Init();
// Obtain the preferred video mode from the system
// This will correspond to the settings in the Wii menu
rmode = VIDEO_GetPreferredMode(NULL);
// Allocate memory for the display in the uncached region
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
// Initialise the console, required for printf
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
// Set up the video registers with the chosen mode
VIDEO_Configure(rmode);
// Tell the video hardware where our display memory is
VIDEO_SetNextFramebuffer(xfb);
// Make the display visible
VIDEO_SetBlack(FALSE);
// Flush the video register changes to the hardware
VIDEO_Flush();
// Wait for Video setup to complete
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
}

View File

@ -6,52 +6,65 @@
#include <gccore.h>
#include <iostream>
#include <iomanip>
#include <unistd.h>
static void *xfb = NULL;
static GXRModeObj *rmode = NULL;
static void *xfb;
static GXRModeObj *rmode;
void *Initialise();
void Initialise();
int main(int argc, char **argv) {
xfb = Initialise();
int main(int argc, char **argv)
{
Initialise();
while(1) {
PAD_ScanPads();
VIDEO_ClearFrameBuffer(rmode, xfb, 0);
std::cout<<"\x1b[0;0H"; // Position the cursor (at 0, 0)
for(int Chan = 0; Chan < 4; Chan++)
{
std::cout << "Chan " << Chan << std::endl;
std::cout << "Status is " << SI_GetStatus(Chan) << std::endl;
std::cout << "Type is 0x" << std::setbase(16) << SI_GetType(Chan) << std::setbase(10) << std::endl << std::endl;
}
VIDEO_WaitVSync();
}
return 0;
}
void * Initialise() {
void *framebuffer;
void Initialise()
{
// Initialise the video system
VIDEO_Init();
// This function initialises the attached controllers
PAD_Init();
// Obtain the preferred video mode from the system
// This will correspond to the settings in the Wii menu
rmode = VIDEO_GetPreferredMode(NULL);
framebuffer = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
console_init(framebuffer,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
// Allocate memory for the display in the uncached region
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
// Initialise the console, required for printf
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
// Set up the video registers with the chosen mode
VIDEO_Configure(rmode);
VIDEO_SetNextFramebuffer(framebuffer);
// Tell the video hardware where our display memory is
VIDEO_SetNextFramebuffer(xfb);
// Make the display visible
VIDEO_SetBlack(FALSE);
// Flush the video register changes to the hardware
VIDEO_Flush();
// Wait for Video setup to complete
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
return framebuffer;
}

View File

@ -3,6 +3,7 @@
//code by WinterMute
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string.h>
#include <malloc.h>
#include <ogcsys.h>
@ -76,48 +77,48 @@ void countevs(int chan, const WPADData *data) {
void print_wiimote_connection_status(int wiimote_connection_status) {
switch(wiimote_connection_status) {
case WPAD_ERR_NO_CONTROLLER:
printf(" Wiimote not connected\n");
std::cout<<" Wiimote not connected\n";
break;
case WPAD_ERR_NOT_READY:
printf(" Wiimote not ready\n");
std::cout<<" Wiimote not ready\n";
break;
case WPAD_ERR_NONE:
printf(" Wiimote ready\n");
std::cout<<" Wiimote ready\n";
break;
default:
printf(" Unknown Wimote state %d\n",wiimote_connection_status);
std::cout<<" Unknown Wimote state "<<wiimote_connection_status<<"\n";
}
}
void print_wiimote_buttons(WPADData *wd) {
printf(" Buttons down:\n ");
if(wd->btns_h & WPAD_BUTTON_A) printf("A ");
if(wd->btns_h & WPAD_BUTTON_B) printf("B ");
if(wd->btns_h & WPAD_BUTTON_1) printf("1 ");
if(wd->btns_h & WPAD_BUTTON_2) printf("2 ");
if(wd->btns_h & WPAD_BUTTON_MINUS) printf("MINUS ");
if(wd->btns_h & WPAD_BUTTON_HOME) printf("HOME ");
if(wd->btns_h & WPAD_BUTTON_PLUS) printf("PLUS ");
printf("\n ");
if(wd->btns_h & WPAD_BUTTON_LEFT) printf("LEFT ");
if(wd->btns_h & WPAD_BUTTON_RIGHT) printf("RIGHT ");
if(wd->btns_h & WPAD_BUTTON_UP) printf("UP ");
if(wd->btns_h & WPAD_BUTTON_DOWN) printf("DOWN ");
printf("\n");
std::cout<<" Buttons down:\n ";
if(wd->btns_h & WPAD_BUTTON_A) std::cout<<"A ";
if(wd->btns_h & WPAD_BUTTON_B) std::cout<<"B ";
if(wd->btns_h & WPAD_BUTTON_1) std::cout<<"1 ";
if(wd->btns_h & WPAD_BUTTON_2) std::cout<<"2 ";
if(wd->btns_h & WPAD_BUTTON_MINUS) std::cout<<"MINUS ";
if(wd->btns_h & WPAD_BUTTON_HOME) std::cout<<"HOME ";
if(wd->btns_h & WPAD_BUTTON_PLUS) std::cout<<"PLUS ";
std::cout<<"\n ";
if(wd->btns_h & WPAD_BUTTON_LEFT) std::cout<<"LEFT ";
if(wd->btns_h & WPAD_BUTTON_RIGHT) std::cout<<"RIGHT ";
if(wd->btns_h & WPAD_BUTTON_UP) std::cout<<"UP ";
if(wd->btns_h & WPAD_BUTTON_DOWN) std::cout<<"DOWN ";
std::cout<<"\n";
}
void print_and_draw_wiimote_data(void *screen_buffer) {
//Makes the var wd point to the data on the wiimote
WPADData *wd = WPAD_Data(0);
printf(" Data->Err: %d\n",wd->err);
printf(" IR Dots:\n");
std::cout<<" Data->Err: "<<wd->err<<"\n";
std::cout<<" IR Dots:\n";
int i;
for(i=0; i<4; i++) {
if(wd->ir.dot[i].visible) {
printf(" %4d, %3d\n", wd->ir.dot[i].rx, wd->ir.dot[i].ry);
std::cout<<" "<<wd->ir.dot[i].rx<<", "<<wd->ir.dot[i].ry<<"\n";
drawdot(screen_buffer, rmode, 1024, 768, wd->ir.dot[i].rx, wd->ir.dot[i].ry, COLOR_YELLOW);
} else {
printf(" None\n");
std::cout<<" None\n";
}
}
//ir.valid - TRUE is the wiimote is pointing at the screen, else it is false
@ -126,31 +127,31 @@ void print_and_draw_wiimote_data(void *screen_buffer) {
//ir.x/ir.y - The x/y coordinates that the wiimote is pointing to, relative to the screen.
//ir.angle - how far (in degrees) the wiimote is twisted (based on ir)
printf(" Cursor: %.02f,%.02f\n",wd->ir.x, wd->ir.y);
printf(" @ %.02f deg\n",wd->ir.angle);
std::cout<<" Cursor: "<<wd->ir.x<<","<<wd->ir.y<<"\n";
std::cout<<" @ "<<wd->ir.angle<<" deg\n";
drawdot(screen_buffer, rmode, rmode->fbWidth, rmode->xfbHeight, wd->ir.x, wd->ir.y, COLOR_RED);
drawdot(screen_buffer, rmode, rmode->fbWidth, rmode->xfbHeight, wd->ir.x + 10*sinf(theta), wd->ir.y - 10*cosf(theta), COLOR_BLUE);
} else {
printf(" No Cursor\n\n");
std::cout<<" No Cursor\n\n";
}
if(wd->ir.raw_valid) {
//ir.z - How far away the wiimote is from the screen in meters
printf(" Distance: %.02fm\n", wd->ir.z);
std::cout<<" Distance: "<<wd->ir.z<<"m\n";
//orient.yaw - The left/right angle of the wiimote to the screen
printf(" Yaw: %.02f deg\n", wd->orient.yaw);
std::cout<<" Yaw: "<<wd->orient.yaw<<" deg\n";
} else {
printf("\n\n");
std::cout<<"\n\n";
}
printf(" Accel:\n");
std::cout<<" Accel:\n";
//accel.x/accel.y/accel.z - analog values for the accelleration of the wiimote
//(Note: Gravity pulls downwards, so even if the wiimote is not moving,
//one(or more) axis will have a reading as if it is moving "upwards")
printf(" XYZ: %3d,%3d,%3d\n",wd->accel.x,wd->accel.y,wd->accel.z);
std::cout<<" XYZ: "<<wd->accel.x<<","<<wd->accel.y<<","<<wd->accel.z<<"\n";
//orient.pitch - how far the wiimote is "tilted" in degrees
printf(" Pitch: %.02f\n",wd->orient.pitch);
std::cout<<" Pitch: "<<wd->orient.pitch<<"\n";
//orient.roll - how far the wiimote is "twisted" in degrees (uses accelerometer)
printf(" Roll: %.02f\n",wd->orient.roll);
std::cout<<" Roll: "<<wd->orient.roll<<"\n";
print_wiimote_buttons(wd);
@ -194,12 +195,12 @@ int main(int argc, char **argv) {
while(!doreload && !dooff) {
CON_Init(xfb[fbi],0,0,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
//VIDEO_ClearFrameBuffer(rmode,xfb[fbi],COLOR_BLACK);
printf("\n\n\n");
std::cout<<"\n\n\n";
WPAD_ReadPending(WPAD_CHAN_ALL, countevs);
int wiimote_connection_status = WPAD_Probe(0, &type);
print_wiimote_connection_status(wiimote_connection_status);
printf(" Event count: %d\n",evctr);
std::cout<<" Event count: "<<evctr<<"\n";
if(wiimote_connection_status == WPAD_ERR_NONE) {
print_and_draw_wiimote_data(xfb[fbi]);
}