Author Topic: [QUESTION] About SDL for the GCW0.  (Read 3443 times)

the_gama (OP)

  • *
  • Posts: 155
[QUESTION] About SDL for the GCW0.
« on: September 02, 2013, 03:07:24 pm »
Hi, I'm working on porting an SDL app for the zero but have a couple of questions,

The app uses 32 bit video mode.  Is it supported natively by the zero?  If not, will there be a significant difference in performance using a 16 bit mode?

I hope someone can help me here ;P.

johnnyonflame

  • *
  • Posts: 212
Re: [QUESTION] About SDL for the GCW0.
« Reply #1 on: September 02, 2013, 06:07:29 pm »
Both 16bpp and 32bpp are handled natively, no performance drop there.

Shin-NiL

  • *
  • Posts: 375
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: [QUESTION] About SDL for the GCW0.
« Reply #2 on: September 02, 2013, 06:16:22 pm »
Hello johnnyonflame!
Is there any performance difference using SDL_FULLSCREEN or windowed mode at 320x240?

Thanks!

RodrigoCard

  • *
  • Posts: 314
    • Mac Joystick Apps
Re: [QUESTION] About SDL for the GCW0.
« Reply #3 on: September 02, 2013, 07:46:46 pm »
I was about to create a thread to ask this, but this one seems apropriate :)

Did anyone build SDL2 and its sattellite libraries for gcw without issues already?
Will the next opendingux update ship with SDL2?

I am asking that because it is mentioned here http://www.gcw-zero.com/articles/pax2013

zear

  • * Moderator
  • Posts: 2379
Re: [QUESTION] About SDL for the GCW0.
« Reply #4 on: September 02, 2013, 08:14:01 pm »
SDL2 is ported, but not properly tested yet.

the_gama (OP)

  • *
  • Posts: 155
Re: [QUESTION] About SDL for the GCW0.
« Reply #5 on: September 02, 2013, 08:32:11 pm »
Both 16bpp and 32bpp are handled natively, no performance drop there.

Oh, that's great :).  Thanks.

About SDL_Joystick, is it working already? How does one read the analog controller input?

And a bit offtopic, is there any link to see status, updates from the gcw0 toolchain.  Are there new libraries being worked on? How about opengl and ffmpeg.

zear

  • * Moderator
  • Posts: 2379
Re: [QUESTION] About SDL for the GCW0.
« Reply #6 on: September 02, 2013, 08:43:40 pm »
SDL_Joystick is part of SDL, so when SDL works, it works as well :)

The buttons are seen as the following keyboard events:
* D-PAD Left - SDLK_LEFT
* D-PAD Right - SDLK_RIGHT
* D-PAD Up - SDLK_UP
* D-PAD Down - SDLK_DOWN
* Y button - SDLK_SPACE
* X button - SDLK_LSHIFT
* A button - SDLK_LCTRL
* B button - SDLK_LALT
* START button - SDLK_RETURN
* SELECT button - SDLK_ESC
* L shoulder - SDLK_TAB
* R shoulder - SDLK_BACKSPACE
* Power slider in up position - SDLK_POWER (not encouraged to map in game, as it's used by the pwswd daemon)
* Power slider in down position - SDLK_PAUSE

The analog nub is a joystick device. When no external USB gamepads are plugged, it is joystick #0. When USB gamepads are connected, it is not guaranteed to be joystick #0, so it's advised to check the device number with a different method (ie. joystick device name string).
More about joysticks in SDL 1.2 here: http://sdl.beuc.net/sdl.wiki/Handling_Joysticks

RodrigoCard

  • *
  • Posts: 314
    • Mac Joystick Apps
Re: [QUESTION] About SDL for the GCW0.
« Reply #7 on: September 03, 2013, 04:46:34 am »
SDL2 is ported, but not properly tested yet.

Thanks for the info,
I would help to test if I had a GCW Zero already. :/

The analog nub is a joystick device. When no external USB gamepads are plugged, it is joystick #0. When USB gamepads are connected, it is not guaranteed to be joystick #0, so it's advised to check the device number with a different method (ie. joystick device name string).
More about joysticks in SDL 1.2 here: http://sdl.beuc.net/sdl.wiki/Handling_Joysticks

wouldn't be a good idea do patch SDL to hard code the nub to #0?
So it would be guaranteed to work normally even with any usb gamepad connected.
« Last Edit: September 03, 2013, 04:48:15 am by RodrigoCard »

the_gama (OP)

  • *
  • Posts: 155
Re: [QUESTION] About SDL for the GCW0.
« Reply #8 on: September 03, 2013, 04:50:52 am »
This is a bit offtopic, what is the correct -march option when building apps for the zero?  I have seen many Makefiles using something like -march=mips32 -mtune=-mips32r2, but for the zero shouldn't be -march=mips32r2?

The snes9x4p Makefile uses -march=mips32 -mtune=r4600. Is that right?

I ask this, because zero's mipsel-linux-gcc failed to compile some asm files using -march=mips32, but compiled fine using -march=mipsr232.  So I guess that should be the one to use for the zero.
« Last Edit: September 03, 2013, 04:54:45 am by the_gama »

pcercuei

  • ***
  • Posts: 1428
    • My devblog
Re: [QUESTION] About SDL for the GCW0.
« Reply #9 on: September 05, 2013, 01:23:18 pm »
You don't have to set any arch-specific CFLAGS: the toolchain has been properly configured to compile with the best flags.

Here is what I use:
CFLAGS = -Wall -O3

You don't need anything more really.

the_gama (OP)

  • *
  • Posts: 155
Re: [QUESTION] About SDL for the GCW0.
« Reply #10 on: September 05, 2013, 04:36:47 pm »
Thanks, that's what I supposed.  Right not, I'm only using -O3 too.

 

Post a new topic
Post a new topic