User talk:SimonKagstrom

From WiiBrew
Jump to: navigation, search

how about....

sdlmame? that would be something. I understand the reason for uaewii, but sdlmame would be something. The have a bit weird building system, and doesn't seem to be much documentation for it. I was able to compile it tough to get a black screen :) Time didn't permit me to play with it more... -- Spec 21:18, 21 May 2009 (UTC)

SDL joystick mapping

Hello Simon,

I've read your source of uae-wii with SDL joystick mapping, and i tried to compile that little piece but it doens't work. Programmers Notepad says KEY_UP, KEY_DOWN, KEY_RIGHT and KEY_LEFT has not been declared. I understand I have to declare them (Ow, im so smart) but how?

Maybe you can make a little example of how I can use joystick mapping because I don't understand it in your source code. Just a little .c/.cpp with like pressing the home button and it then exits to the homebrew channel.

GabberNL 13:40, 27 May 2009 (UTC)

Well, that's not strange because this is what the code does: Set the keys variable to a value depending on which SDL_Joystick buttons and dpad directions are pressed. So simply focus on the stuff which starts with SDL_, all the rest is my implementation :-)
Thank you very much. It compiled but i dont have time to play it on the wii. I'll give you an update when i did that. GabberNL 18:20, 27 May 2009 (UTC)
Hmm, didnt work. I'm using this code. I just want to show a simple blue screen when I push the A button. It compiles with no problems but when I want to play it on the Wii nothing happens. Also the if(held & WPAD_BUTTON_HOME) doesnt work anymore. Whats wrong?
int nr;
	for (nr = 0; nr < SDL_NumJoysticks(); nr++) {		
 
		joy = SDL_JoystickOpen(nr);
 
		// if button A was pressed it needs to make a blue screen
		if (SDL_JoystickGetButton(joy, 0) != 0){
			SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 0, 255));
		}
 
		// as a back-up if Joystickgetbutton doesn't work
		if(held & WPAD_BUTTON_HOME){
			done=true;
			SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 0, 0));
		}
 
		SDL_Flip(screen);
	}
GabberNL 11:28, 28 May 2009 (UTC)
Did you pass SDL_INIT_JOYSTICK to your SDL_Init? Anyway, there are probably better discussion forums for SDL issues than my user page (remember that nothing of this is Wii-specific!) --SimonKagstrom 16:30, 28 May 2009 (UTC)
Personal tools
Resources
Community