Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
The Goonies
 Brain Games Forums : The Goonies
Subject Topic: Wii port Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
amoreira
Newbie
Newbie


Joined: 04 January 2010
Location: Brazil
Posts: 25
Posted: 17 January 2010 at 01:23 | IP Logged Quote amoreira

Hi folks.

As some of you might know, I finished a Wii port of Road Fighter, which has been released for download via Homebrew Browser.

As I have already announced in the "Road Fighter" topic, my next attempt at a Wii Port would be "The Goonies".

Right now, I finished compiling and linking it (what required some work on gl2gx - the OpenGL wrapper for Wii and Gamecube). After getting past some exit() calls and segmentation faults, I can actually see something on the screen.

Well, it's just the "fade-to-blue" transition that appears right before the MSX logo, but this is at least an indication that glClearColor() and glClear() are working.

Right now, I'm trying to figure out a way to make the debugging process less "blind". For some reason, output_debug_message()'s original code leads to a segmentation fault in Wii, with the stack frame pointing to vprintf.

When this code is disabled, I can see the fade transition that I mentioned, and just get stuck in the blue screen (maybe SDL fails on loading the MSX logo, or maybe glScissor() does not work correctly - it was one of the missing functions in gl2gx).

I had the same problem with Road Fighter regarding output_debug_message(), but I was surprisingly lucky at getting the game to work in a short time (especially because it used only SDL).

Well, I think that sums up the progress for now. This is going to be a much harder task than "Road Fighter", since I am a complete noob at OpenGL, the gl2gx wrapper is incomplete and discontinued. But the opportunity to learn and contribute motivates me a lot.

If you guys have any suggestions, debugging tips, general hints on how the game deals with OpenGL, please feel free to post. Thanks in advance.
Back to Top View amoreira's Profile Search for other posts by amoreira Send Private Message Add to Buddy List
 
Jorito
Admin Group
Admin Group
Avatar

Joined: 30 December 2002
Location: Netherlands
Posts: 1869
Posted: 17 January 2010 at 19:25 | IP Logged Quote Jorito

Hmm, for this I think you need some help from Santi. He coded the game and know all about the OpenGL part. I mailed him about this, he will probably stop by here

As to give you a general idea: the game basically uses the 2D principles we used in Road Fighter, but now each object is an OpenGL object. IIRC, they all use the GLTile class. We don't use the Z axis, only X and Y and a bit of zooming/rotating.

First place to look would probably be if the MSX logo image is properly placed in a GLTile and can be rendered. If that works, the rest shouldn't be too hard.

However, some effects (like the water refraction effect or the lightning effect) might give some problems. I'd leave them be first and focus on the other parts of the game .

Hope this helps.
Back to Top View Jorito's Profile Search for other posts by Jorito Visit Jorito's Homepage Send Private Message Add to Buddy List
 
Popolon
Admin Group
Admin Group
Avatar

Joined: 05 November 2002
Location: Spain
Posts: 3076
Posted: 18 January 2010 at 10:51 | IP Logged Quote Popolon

Hi amoreira,

I Agree with Jorito that the problem has to be in loading the msx.png file.

Loading this file is made through the method get(char *) of the class GLTManager. So, let me walk you through how this happens:
- check the code in line 47 of GLTManager.cpp. This calls the get(Symbol *) method, in line 58 of the same file (which actually loads the image)
- The most scary part of this process I think is line 75: t = new GLTile(filename). This actually loads the file, creates an OpenGL texture, etc. So, it's where the problem will be, most likely. The constructor called is the one in line 59 of file GLTile.cpp
- This constructor calls the method set(char *) (line 412 of file GLTile.cpp), which does all the work
- If the file is not found, then the error will come in lines 422 or 423, which is where the IML_load call of the SDL_image library is called.
- If the problem is because of creating the OpenGL texture, then the problem sill come after calling the "createTexture" method (line 456)
- createTexture can be found in line 35 of the file SDL_glutaux.cpp and does all the OpenGL necessary stuff to create a texture out of an SDL surface

I hope this helps , let me know!
-
Back to Top View Popolon's Profile Search for other posts by Popolon Visit Popolon's Homepage Send Private Message Add to Buddy List
 
amoreira
Newbie
Newbie


Joined: 04 January 2010
Location: Brazil
Posts: 25
Posted: 20 January 2010 at 21:56 | IP Logged Quote amoreira

Hi Popolon and Jorito.

Thank you very much for the detailed information. Everything is OK with the SDL part, IMG_Load's and the related stuff return successfully.

The problem resides in OpenGL, more specifically in glGenTextures(), which is called by SDL_glutaux.cpp.

This function never writes a non-zero value in the output parameter 'tname'. Therefore, createTexture() always return zero.

The weird thing is that the implementation of glGenTextures() in gl2gx uses a plain malloc! Either Wii ran out of memory, or it failed to allocate for some other reason.

Anyway, I'll have to study a little bit deeper inside the code of gl2gx and its dependencies.

The only thing strange that I've got from the logs, pointing to the game code, is that there are several calls to createTexture()* even before the MSX logo and texts are loaded. Is this normal?

Thanks again for the help!

* Those calls also return 0 in the handle.
Back to Top View amoreira's Profile Search for other posts by amoreira Send Private Message Add to Buddy List
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.01
Copyright ©2001-2003 Web Wiz Guide

This page was generated in 0,2031 seconds.