popup when 3D is used (fixme : do it for all games)
This commit is contained in:
parent
fc4a4e8cb5
commit
d02b38ad4c
|
@ -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;
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1317,9 +1317,7 @@
|
|||
|
||||
<widget class="GtkAboutDialog" id="wAboutDlg">
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="window_position">GTK_WIN_POS_MOUSE</property>
|
||||
<property name="name" translatable="yes">DeSmuME</property>
|
||||
<property name="version" translatable="no">0.6.1</property>
|
||||
<property name="comments" translatable="yes">Nintendo DS emulator based on work by Yopyop</property>
|
||||
<property name="wrap_license">False</property>
|
||||
<property name="website">http://desmume.sf.net</property>
|
||||
|
@ -2255,4 +2253,84 @@ Contributors:
|
|||
</child>
|
||||
</widget>
|
||||
|
||||
<widget class="GtkDialog" id="w3Dop">
|
||||
<property name="title" translatable="yes">3D rom</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_CENTER</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<property name="urgency_hint">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
<signal name="response" handler="gtk_widget_hide" last_modification_time="Fri, 23 Feb 2007 20:20:09 GMT"/>
|
||||
<signal name="delete_event" handler="gtk_widget_hide" last_modification_time="Fri, 23 Feb 2007 20:20:23 GMT"/>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area3">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="okbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-5</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<property name="width_request">250</property>
|
||||
<property name="height_request">20</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">3D operation detected</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">10</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</glade-interface>
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in New Issue