diff --git a/desmume/src/gl_vertex.c b/desmume/src/gl_vertex.c index 06862bf69..081756889 100755 --- a/desmume/src/gl_vertex.c +++ b/desmume/src/gl_vertex.c @@ -65,10 +65,12 @@ Table shows Port Address, Command ID, Number of Parameters, and Clock Cycles. #define print(a) printf a //#define print(a) +BOOL attempted_3D_op=FALSE; int mtx_mode=0; void gl_MTX_MODE (u32 val) { +CHECK_3D_ATTEMPT mtx_mode = val; switch(val) { case MTX_MODE_PROJECTION: @@ -134,6 +136,7 @@ void gl_MTX_mult(float* m) { } void gl_MTX_IDENTITY () { +CHECK_3D_ATTEMPT print(("MTX_IDENTITY\n")); gl_MTX_load(mUnit); } @@ -141,6 +144,7 @@ void gl_MTX_IDENTITY () { void gl_MTX_LOAD_4x4 (u32 val) { static int mtx_nbparams = 0; _MTX_val mval; +CHECK_3D_ATTEMPT mval.val = val; switch(mtx_nbparams) { case 0: case 1: case 2: case 3: @@ -163,6 +167,7 @@ void gl_MTX_LOAD_4x4 (u32 val) { void gl_MTX_MULT_4x4 (u32 val) { static int mtx_nbparams = 0; _MTX_val mval; +CHECK_3D_ATTEMPT mval.val = val; switch(mtx_nbparams) { case 0: case 1: case 2: case 3: @@ -187,6 +192,7 @@ void gl_MTX_MULT_4x4 (u32 val) { void gl_MTX_LOAD_4x3 (u32 val) { static int mtx_nbparams = 0; _MTX_val mval; +CHECK_3D_ATTEMPT mval.val = val; switch(mtx_nbparams) { case 3: case 7: case 11: @@ -211,6 +217,7 @@ void gl_MTX_LOAD_4x3 (u32 val) { void gl_MTX_MULT_4x3 (u32 val) { static int mtx_nbparams = 0; _MTX_val mval; +CHECK_3D_ATTEMPT mval.val = val; switch(mtx_nbparams) { case 3: case 7: case 11: @@ -236,6 +243,7 @@ void gl_MTX_MULT_4x3 (u32 val) { void gl_MTX_LOAD_3x3 (u32 val) { static int mtx_nbparams = 0; _MTX_val mval; +CHECK_3D_ATTEMPT mval.val = val; switch(mtx_nbparams) { case 3: case 7: case 11: @@ -259,6 +267,7 @@ void gl_MTX_LOAD_3x3 (u32 val) { void gl_MTX_MULT_3x3 (u32 val) { static int mtx_nbparams = 0; _MTX_val mval; +CHECK_3D_ATTEMPT mval.val = val; switch(mtx_nbparams) { case 3: case 7: case 11: @@ -286,6 +295,7 @@ void gl_MTX_MULT_3x3 (u32 val) { void gl_TEXCOORD(u32 val) { _TEXCOORD tx; float s,t; +CHECK_3D_ATTEMPT tx.val = val; s = tx.bits.low / 2048.; t = tx.bits.high / 2048.; @@ -301,6 +311,7 @@ static s16 vx=0,vy=0,vz=0; INLINE void gl_VTX_one() { float vfx,vfy,vfz; +CHECK_3D_ATTEMPT vfx = vx / 4096.; vfy = vy / 4096.; vfz = vz / 4096.; @@ -309,6 +320,7 @@ INLINE void gl_VTX_one() { void gl_VTX_begin(u32 val) { //see 4000500h - Cmd 40h - BEGIN_VTXS - Start of Vertex List (W) +CHECK_3D_ATTEMPT vx=vy=vz=0; print(("VTX_begin : ")); switch(val) { @@ -332,6 +344,7 @@ void gl_VTX_begin(u32 val) { } void gl_VTX_end() { //see 4000504h - Cmd 41h - END_VTXS - End of Vertex List (W) +CHECK_3D_ATTEMPT print(("VTX_end.\n")); } @@ -340,6 +353,7 @@ void gl_VTX_16 (u32 val) { _VTX_16 vval; static int vtx_16_nbparams = 0; +CHECK_3D_ATTEMPT vval.val = val; switch(vtx_16_nbparams) { case 0: @@ -360,6 +374,7 @@ void gl_VTX_16 (u32 val) { void gl_VTX_10 (u32 xyz) { //see 4000490h - Cmd 24h - VTX_10 - Set Vertex XYZ Coordinates (W) _VTX_10 vt; +CHECK_3D_ATTEMPT vt.val = xyz; vx = vt.bits.low << 6; vy = vt.bits.mid << 6; @@ -371,6 +386,7 @@ void gl_VTX_10 (u32 xyz) { void gl_VTX_XY (u32 xy) { //see 4000494h - Cmd 25h - VTX_XY - Set Vertex XY Coordinates (W) _VTX_16 vt; +CHECK_3D_ATTEMPT vt.val = xy; vx = vt.bits.low ; vy = vt.bits.high; @@ -379,6 +395,7 @@ void gl_VTX_XY (u32 xy) { void gl_VTX_XZ (u32 xz) { //see 4000498h - Cmd 26h - VTX_XZ - Set Vertex XZ Coordinates (W) _VTX_16 vt; +CHECK_3D_ATTEMPT vt.val = xz; vx = vt.bits.low ; vz = vt.bits.high; @@ -387,6 +404,7 @@ void gl_VTX_XZ (u32 xz) { void gl_VTX_YZ (u32 yz) { //see 400049Ch - Cmd 27h - VTX_YZ - Set Vertex YZ Coordinates (W) _VTX_16 vt; +CHECK_3D_ATTEMPT vt.val = yz; vy = vt.bits.low ; vz = vt.bits.high; @@ -397,6 +415,7 @@ void gl_VTX_YZ (u32 yz) { void gl_VTX_DIFF (u32 diff) { //see 40004A0h - Cmd 28h - VTX_DIFF - Set Relative Vertex Coordinates (W) _VTX_10 vt; +CHECK_3D_ATTEMPT vt.val = diff; vx += vt.bits.low << 3; vy += vt.bits.mid << 3; diff --git a/desmume/src/gl_vertex.h b/desmume/src/gl_vertex.h index a3e42c89e..f35393b65 100755 --- a/desmume/src/gl_vertex.h +++ b/desmume/src/gl_vertex.h @@ -25,6 +25,9 @@ #include "types.h" #include "registers.h" +#define CHECK_3D_ATTEMPT attempted_3D_op=TRUE; +BOOL attempted_3D_op; + #define MTX_MODE_PROJECTION 0 #define MTX_MODE_POSITION 1 #define MTX_MODE_POS_VECTOR 2 @@ -93,6 +96,7 @@ void gl_VTX_DIFF (u32 diff); case n : printf("cmd " #n "\n"); break; INLINE static void gl_print_cmd(u32 adr) { +CHECK_3D_ATTEMPT switch (adr) { GL_CMD_NAME(eng_3D_RDLINES_COUNT ) GL_CMD_NAME(eng_3D_EDGE_COLOR ) diff --git a/desmume/src/gtk-glade/desmume.c b/desmume/src/gtk-glade/desmume.c index d51accef8..69ee920f5 100755 --- a/desmume/src/gtk-glade/desmume.c +++ b/desmume/src/gtk-glade/desmume.c @@ -121,7 +121,6 @@ gboolean EmuLoop(gpointer data) if(desmume_running()) /* Si on est en train d'executer le programme ... */ { - fps_FrameCount += Frameskip + 1; if(!fps_SecStart) fps_SecStart = SDL_GetTicks(); if(SDL_GetTicks() - fps_SecStart >= 1000) diff --git a/desmume/src/gtk-glade/gdk_gl.c b/desmume/src/gtk-glade/gdk_gl.c index a61937e5b..4088c21c1 100755 --- a/desmume/src/gtk-glade/gdk_gl.c +++ b/desmume/src/gtk-glade/gdk_gl.c @@ -232,6 +232,13 @@ gboolean screen (GtkWidget * widget, int viewportscreen) { float bright_color = 0.0f; // blend with black float bright_alpha = 0.0f; // don't blend struct _MASTER_BRIGHT * mBright; + static BOOL noticed_3D=FALSE; + + if (!noticed_3D && attempted_3D_op) { + GtkWidget * dlg = glade_xml_get_widget(xml, "w3Dop"); + gtk_widget_show(dlg); + noticed_3D=TRUE; + } // we take care to draw the right thing the right place // we need to rearrange widgets not to use this trick diff --git a/desmume/src/gtk-glade/glade/DeSmuMe.glade b/desmume/src/gtk-glade/glade/DeSmuMe.glade index 4301f9e79..34ec2c82c 100755 --- a/desmume/src/gtk-glade/glade/DeSmuMe.glade +++ b/desmume/src/gtk-glade/glade/DeSmuMe.glade @@ -1317,9 +1317,7 @@ False - GTK_WIN_POS_MOUSE DeSmuME - 0.6.1 Nintendo DS emulator based on work by Yopyop False http://desmume.sf.net @@ -2255,4 +2253,84 @@ Contributors: + + 3D rom + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + True + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 250 + 20 + True + 3D operation detected + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 10 + True + True + + + + + + diff --git a/desmume/src/gtk-glade/globals.h b/desmume/src/gtk-glade/globals.h index 956f71449..1fbb67755 100755 --- a/desmume/src/gtk-glade/globals.h +++ b/desmume/src/gtk-glade/globals.h @@ -90,6 +90,7 @@ typedef union _callback_arg{ #include "../ctrlssdl.h" #include "../types.h" #include "../saves.h" +#include "../gl_vertex.h" #include "desmume.h" #include "gdk_gl.h"