MathewWi / desmumewii

Automatically exported from code.google.com/p/desmumewii
GNU General Public License v3.0
0 stars 0 forks source link

3D Crash/Bug #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Ok, so I've tried a whole bunch of things.  Here's where I'm at.

Firstly to stop the crash in gfx3d.cpp put a return in the gfx3d_execute
function.  This will stop the crash and you you can play the game but there
will be NO 3D.

like :-

static void gfx3d_execute(u8 cmd, u32 param)
{
    return;
......
}

I'm still suspect of the stack as there's several functions calling other
functions.  It could also be the Wii does not like a certain task one of
these functions is doing, but without a gecko it will take time to identify
which.

baby.lueshi I checked lowering the VERTLIST_SIZE and POLYLIST_SIZE but
there are sanity checks in the vert functions that don't allow more than
the defined number to be added..  I'd image it would stop drawing 3D when
it reached the max.... But having said that. the count is stored as an
"int" and the SIZE's are defined as more than the max of an int (assuming
int's are 32767).  If this is a bug ... It should be reported to the main
desmume project.

i.e. You can see VERTLIST_SIZE is larger than the "count" variable as it's
an int.  I am allocating these the original desmume project puts them on
the stack.

#define VERTLIST_SIZE 400000
//#define VERTLIST_SIZE 10000
struct VERTLIST {
    VERTLIST()
    {
        list = new VERT[VERTLIST_SIZE];
    };
    ~VERTLIST()
    {
        delete [] list;
        list = 0;
    };

    VERT* list;
    int count;
};

Original issue reported on code.google.com by iamsca...@gmail.com on 31 Mar 2010 at 7:04

GoogleCodeExporter commented 9 years ago
The stack dumps I get point to line 650 of gfx3d.cpp, in the SetVertex() 
function. It
looks like a reference to a null variable, but there's already a check to make 
sure
it references a VERT object in range of what the maximum is, so I don't know 
what's
going on there.

Original comment by baby.lueshi@gmail.com on 31 Mar 2010 at 8:49

GoogleCodeExporter commented 9 years ago
I noticed that gfx3d appears to be messing with OpenGL judging by comments and 
naming
conventions of some of the functions. Perhaps we should try converting as much 
of it
to GX as possible?

Original comment by castleva...@yahoo.com on 31 Mar 2010 at 1:07

GoogleCodeExporter commented 9 years ago
Alright, I found the problem. Its the SetVertex() in gfx3d.cpp Commenting out 
the
contents makes all 3D games work, but not all 3D rendered. In NSMB, it actually
renders some 3D like the goombas and some blocks in the first level (I didnt 
play
past the first level).

Original comment by castleva...@yahoo.com on 31 Mar 2010 at 1:52

GoogleCodeExporter commented 9 years ago
UPDATE: scanff and I were able to fix the crashing. Now, simply no 3D at all 
appears.
Any ideas anyone?

Original comment by castleva...@yahoo.com on 31 Mar 2010 at 11:00

GoogleCodeExporter commented 9 years ago
I'll start learning GX!

Original comment by dancinninjac on 1 Apr 2010 at 2:18

GoogleCodeExporter commented 9 years ago
Just so everyone knows, we have 3D working now. The problem is that not all 
textures
appear.

Original comment by castleva...@yahoo.com on 1 Apr 2010 at 7:49

GoogleCodeExporter commented 9 years ago
Right now we are using the software render in rasterize.cpp.  The plan is to 
create
our own GX stub.  If anyone has good GX 3D experience and wants to start this 
then
let us know.  The OpenGL stub is in the unusedsource folder and could be used to
understand what needs to happen.

Original comment by iamsca...@gmail.com on 1 Apr 2010 at 8:23

GoogleCodeExporter commented 9 years ago
For updating purposes, I wish to explain we've got 3D rendering now but most 
models
have clear or non-existant textures. Our priority now is getting all of the 
textures
to appear.

Original comment by castleva...@yahoo.com on 4 Apr 2010 at 7:25

GoogleCodeExporter commented 9 years ago
I hope I can close this as discussion has moved into the GPU bug issue and we no
longer have crashes and 3D rendering is near perfect.

Original comment by castleva...@yahoo.com on 22 Apr 2010 at 12:15