Openglide on MacOS X

Developer's Forum, for discussion of bugs, code, and other developmental aspects of OpenGLide.

Re: Glide patch

Postby Dominus » 2009-10-20 @ 11:50

to move the discussion of the dosbox glide patch to the right discussion... :)
When I start Dosbox, with the [glide]glide=true in the config, Dosbox crashes with
Glide:LFB access: read-write
Bus error

I guess I need to change the grport. But to what?

Just for the record, this is under OS X 10.6.1 :) AND I've been using the CVS of Dosbox.
I'm attaching the error report, maybe this helps...
Attachments
dosboxerror.txt
(30.09 KiB) Downloaded 552 times
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Glide patch

Postby gulikoza » 2009-10-20 @ 12:42

From a quick look at it, it crashes in Openglide, so it could stay there :)
When openglide starts, it performs some rdtsc calls to get some timing information. I'll see if it is possible to skip that...
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Glide patch

Postby gulikoza » 2009-10-20 @ 18:21

seem like reading /proc/cpuinfo does not work. Clock frequency is used just for some debugging info, so you could safely disable complete ClockFrequency(void) function in clock.cpp
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Glide patch

Postby Dominus » 2009-10-20 @ 20:59

Hmm, I just commented out the the whole thing in clock.cpp and then had to comment out ClockFreq = ClockFrequency( ); in glutil.cpp as well.
Now 3DFX Tomb Raider exits with the message "No PCI bus detected"
At least something, neither Dosbox nor Tomb Raider crashed :)

console output:
CONFIG:Loading primary settings from config file /users/dominus/library/preferences/DOSBox 0.73 Preferences
CONFIG:Loading additional settings from config file /users/dominus/documents/dosbox/tomb.conf
MIDI:Opened device:coremidi
Glide:LFB access: read-write
Glide:GLIDE_PageHandler installed at 0x60000000 (384 pages)
One joystick reported, initializing with 4axis
Using joystick Adaptoid with 2 axes, 14 buttons and 0 hat(s)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Glide patch

Postby gulikoza » 2009-10-21 @ 06:22

That means it is loading the original 3dfx glide2x.ovl not the dosbox modified one. Put the dosbox glide2x.ovl in the game directory. Make sure it matches the version of the patch (if you got the patch from this thread, take the ovl as well)
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Glide patch

Postby Dominus » 2009-10-21 @ 14:28

I have ONLY the glide2x.ovl from the first post of this thread on my system. I even copied the one from the debug folder in the zip and get the following log:

Code: Select all
--------------------------------------------------------
OpenGLide Log File
--------------------------------------------------------
***** OpenGLide 0.09rc9 *****
--------------------------------------------------------
Date: 21 Oct 2009
Time: 16:26:32
--------------------------------------------------------
--------------------------------------------------------
Clock Frequency: 0.00 Mhz
--------------------------------------------------------
--------------------------------------------------------
Configuration file is OpenGLid.ini
--------------------------------------------------------
Time: 16:27:14
--------------------------------------------------------
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Glide patch

Postby gulikoza » 2009-10-21 @ 14:42

Then you got the wrong TR patch, the one that has the ovl already built in...you need to get the Voodoo rush patch, tomb3dfx.exe should be 873739 bytes (or similar).
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Glide patch

Postby Dominus » 2009-10-21 @ 16:17

Oops my answer got lost...

Ok, I found the correct Tomb Raider patch (I didn't know there were two voodoo patches, I got the first one from the eidos pages).
Tomb Raider starts now, but after the videos, when it starts to render it crashes again with a bus error.
Console looks like this:

Glide:Activated
Bus error

Same happens with Lands of Lore 2.
Attached again the apple error log (don't wonder, I named the openglided dosbox, glidebox)
Attachments
glidebox.txt
(29.16 KiB) Downloaded 505 times
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Glide patch

Postby gulikoza » 2009-10-21 @ 16:52

It seems to crash in openglide again. Perhaps you can activate the logging (uncomment #define OGL_ALL in GlOgl.h, recompile and then post the contents of Openglid.log). Maybe add some more logging in grSstWinOpen() to see exactly where it crashes. I'm afraid grSstWinOpen + 181 doesn't tell me too much :)
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Glide patch

Postby Dominus » 2009-10-21 @ 17:09

grGlideInit( )
Configuration file is OpenGLid.ini
grSstQueryHardware( --- )
grSstSelect( 0 )

is what I get after that.

Maybe add some more logging in grSstWinOpen() to see exactly where it crashes.

That's where my knowledge ends. I have no idea how to do that. Sorry...
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Glide patch

Postby gulikoza » 2009-10-21 @ 17:15

Just add a couple of those GlideMsg() calls. It behaves just like printf and the message should end in openglid.log. You can add messages like:

GlideMsg("Here");
...
GlideMsg("Still here");
...

and try to figure out where exactly it crashes :happyhappy:

Since there is no grSstWinOpen message, I assume it crashes before or somewhere in InitWindow().
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Glide patch

Postby Dominus » 2009-10-21 @ 17:23

which file? I am a little lost there...
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Glide patch

Postby gulikoza » 2009-10-21 @ 17:37

sorry, grSstWinOpen() is in grguSstGlide.cpp
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Glide patch

Postby Dominus » 2009-10-22 @ 09:36

Really except for doing simple tasks I'm lost in code.
I have no idea where in that code I should throw in some GlideMsg();
When I try I only make Dosbox crash with a "Glide:grSstWinOpen failed!" before the Bus Error, but not with an entry in Openglide. I'm really sorry for being that slow but I need some holding hands now :)
Could you give me an example of where and how in grSstWinOpen() I should enter some glidemsg()?
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Glide patch

Postby gulikoza » 2009-10-22 @ 10:30

Ok, first let's try to copy the existing

Code: Select all
GlideMsg( "grSstWinOpen( %d, %d, %d, %d, %d, %d, %d )\n",
        hwnd, res, ref, cformat, org_loc, num_buffers, num_aux_buffers );


to the top of the function (line 249) so that we can see what parameters get passed. I still don't see where the code could crash with a null pointer dereference if the parameters are sane. So you could just add a simple

GlideMsg("1"); (increment the counter later)

after every line of code (just until before the original GlideMsg( "grSstWinOpen...") we know it doesn't come that far). The code after the last msg will be the problem :)

If some moderator has some time, perhaps these last few posts could be split into a seperate topic Openglide on OS X in the Openglide development forum :happy:
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Glide patch

Postby Dominus » 2009-10-22 @ 10:41

grSstQueryHardware( --- )
grSstSelect( 0 )
grSstWinOpen( 0, 7, 0, 0, 0, 2, 1 )

is the output in the log when I just copy the glidemsg from your post there.
I'll see about the other stuff either tonight or tomorrow, now I gotta go :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Glide patch

Postby HunterZ » 2009-10-22 @ 18:14

gulikoza wrote:If some moderator has some time, perhaps these last few posts could be split into a seperate topic Openglide on OS X in the Openglide development forum :happy:

Done.
User avatar
HunterZ
l33t++
 
Posts: 6075
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: Openglide on MacOS X

Postby Dominus » 2009-10-22 @ 18:26

Thanks, HunterZ.
@gulikoza
Code: Select all
OpenGL.WindowWidth  = Glide.WindowWidth;
    OpenGL.WindowHeight = Glide.WindowHeight;
    Glide.WindowTotalPixels = Glide.WindowWidth * Glide.WindowHeight;

    OpenGL.WaitSignal = (int)( 1000 / OpenGL.Refresh );

After that it breaks. Anything I can do now?
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-10-23 @ 07:41

It crashes after these lines? Then it must be InitWindow. Perhaps you can add some msg lines in InitWindow()? Also just below the InitialiseOpenGLWindow() in Glide.cpp (line 79), you can add:

Code: Select all
   
    if(glGetString( GL_RENDERER ) == NULL) {
        GlideMsg( "glGetString( GL_RENDERER ) returned NULL!");
        return false;
    }

    if ( !strcmp( (char*)glGetString( GL_RENDERER ), "GDI Generic" ) )
        ReportWarning("You are running in a Non-Accelerated OpenGL!!!\nThings can become really slow");


That strcmp might crash if it comes that far and OpenGL wasn't initialized properly.
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-10-23 @ 10:17

Perhaps you can add some msg lines in InitWindow()?

Already did, nothing happens in there...

Also just below the InitialiseOpenGLWindow() in Glide.cpp (line 79), you can add

Hmm, doesn't seem to come that far, the log says the same:
Code: Select all
grGlideInit( )
Configuration file is OpenGLid.ini
grSstQueryHardware( --- )
grSstSelect( 0 )
grSstWinOpen( 0, 7, 0, 0, 0, 2, 1 )
6789

(the last lines are the glide msg from grSstWinOpen())

Just for making sure, when compiling I get the following warnings:
Code: Select all
grguDepth.cpp: In function ‘void grDepthBufferMode(GrDepthBufferMode_t)’:
grguDepth.cpp:85: warning: deprecated conversion from string constant to ‘char*’
grguDepth.cpp: In function ‘void grDepthMask(FxBool)’:
grguDepth.cpp:106: warning: deprecated conversion from string constant to ‘char*’
grguDepth.cpp: In function ‘void grDepthBufferFunction(GrCmpFnc_t)’:
grguDepth.cpp:131: warning: deprecated conversion from string constant to ‘char*’
grguDepth.cpp: In function ‘void grDepthBiasLevel(FxI16)’:
grguDepth.cpp:163: warning: deprecated conversion from string constant to ‘char*

...
Code: Select all
grguMisc.cpp: In function ‘void grCullMode(GrCullMode_t)’:
grguMisc.cpp:78: warning: deprecated conversion from string constant to ‘char*’

...
Code: Select all
grguSstGlide.cpp: In function ‘FxBool grSstWinOpen(FxU, GrScreenResolution_t, GrScreenRefresh_t, GrColorFormat_t, GrOriginLocation_t, int, int)’:
grguSstGlide.cpp:391: warning: deprecated conversion from string constant to ‘char*’
grguSstGlide.cpp: In function ‘void grSstOrigin(GrOriginLocation_t)’:
grguSstGlide.cpp:571: warning: deprecated conversion from string constant to ‘char*’
grguSstGlide.cpp: In function ‘void grSstIdle()’:
grguSstGlide.cpp:703: warning: deprecated conversion from string constant to ‘char*’

....
Code: Select all
grguTex.cpp: In function ‘void grTexClampMode(GrChipID_t, GrTextureClampMode_t, GrTextureClampMode_t)’:
grguTex.cpp:207: warning: deprecated conversion from string constant to ‘char*’
grguTex.cpp: In function ‘void grTexFilterMode(GrChipID_t, GrTextureFilterMode_t, GrTextureFilterMode_t)’:
grguTex.cpp:280: warning: deprecated conversion from string constant to ‘char*’
grguTex.cpp: In function ‘void grTexMipMapMode(GrChipID_t, GrMipMapMode_t, FxBool)’:
grguTex.cpp:310: warning: deprecated conversion from string constant to ‘char*’

...
Code: Select all
grguLfb.cpp: In function ‘FxBool grLfbReadRegion(GrBuffer_t, FxU32, FxU32, FxU32, FxU32, FxU32, void*)’:
grguLfb.cpp:237: warning: deprecated conversion from string constant to ‘char*’
grguLfb.cpp: In function ‘FxBool grLfbWriteRegion(GrBuffer_t, FxU32, FxU32, GrLfbSrcFmt_t, FxU32, FxU32, FxI32, void*)’:
grguLfb.cpp:297: warning: deprecated conversion from string constant to ‘char*’

...
Code: Select all
GLRender.cpp: In function ‘void RenderUpdateArrays()’:
GLRender.cpp:129: warning: deprecated conversion from string constant to ‘char*’
GLRender.cpp: In function ‘void RenderDrawTriangles()’:
GLRender.cpp:330: warning: deprecated conversion from string constant to ‘char*’
GLRender.cpp: In function ‘void RenderAddTriangle(const GrVertex*, const GrVertex*, const GrVertex*, bool)’:
GLRender.cpp:712: warning: deprecated conversion from string constant to ‘char*’
GLRender.cpp: In function ‘void RenderAddLine(const GrVertex*, const GrVertex*, bool)’:
GLRender.cpp:1197: warning: deprecated conversion from string constant to ‘char*’
GLRender.cpp: In function ‘void RenderAddPoint(const GrVertex*, bool)’:
GLRender.cpp:1567: warning: deprecated conversion from string constant to ‘char*’

...
Code: Select all
libtool: compile:  /usr/bin/g++-4.2 -DHAVE_CONFIG_H -I. -I/opt/local/include -I /usr/local/include/openglide/ -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/usr/include -arch i386 -mmmx -D__unix__ -D__linux__ -I./platform/linux -MT FormatConversion.lo -MD -MP -MF .deps/FormatConversion.Tpo -c FormatConversion.cpp  -fno-common -DPIC -o .libs/FormatConversion.o
/var/folders/zd/zd2LYc3pEZup1o0dxuhWVU+++TI/-Tmp-//ccOhPHaV.s:113:Alignment too large: 15. assumed.
/var/folders/zd/zd2LYc3pEZup1o0dxuhWVU+++TI/-Tmp-//ccOhPHaV.s:141:Alignment too large: 15. assumed.
/var/folders/zd/zd2LYc3pEZup1o0dxuhWVU+++TI/-Tmp-//ccOhPHaV.s:173:Alignment too large: 15. assumed.
/var/folders/zd/zd2LYc3pEZup1o0dxuhWVU+++TI/-Tmp-//ccOhPHaV.s:205:Alignment too large: 15. assumed.
/var/folders/zd/zd2LYc3pEZup1o0dxuhWVU+++TI/-Tmp-//ccOhPHaV.s:233:Alignment too large: 15. assumed.

...
Code: Select all
grguBuffer.cpp: In function ‘void grBufferClear(GrColor_t, GrAlpha_t, FxU16)’:
grguBuffer.cpp:74: warning: deprecated conversion from string constant to ‘char*’
grguBuffer.cpp: In function ‘void grBufferSwap(int)’:
grguBuffer.cpp:112: warning: deprecated conversion from string constant to ‘char*’
grguBuffer.cpp: In function ‘void grRenderBuffer(GrBuffer_t)’:
grguBuffer.cpp:150: warning: deprecated conversion from string constant to ‘char*’

...
Code: Select all
grguColorAlpha.cpp: In function ‘void grDitherMode(GrDitherMode_t)’:
grguColorAlpha.cpp:49: warning: deprecated conversion from string constant to ‘char*’
grguColorAlpha.cpp: In function ‘void grColorMask(FxBool, FxBool)’:
grguColorAlpha.cpp:109: warning: deprecated conversion from string constant to ‘char*’
grguColorAlpha.cpp: In function ‘void grAlphaTestReferenceValue(GrAlpha_t)’:
grguColorAlpha.cpp:296: warning: deprecated conversion from string constant to ‘char*’
grguColorAlpha.cpp: In function ‘void grAlphaTestFunction(GrCmpFnc_t)’:
grguColorAlpha.cpp:322: warning: deprecated conversion from string constant to ‘char*’
grguColorAlpha.cpp: In function ‘void grAlphaBlendFunction(GrAlphaBlendFnc_t, GrAlphaBlendFnc_t, GrAlphaBlendFnc_t, GrAlphaBlendFnc_t)’:
grguColorAlpha.cpp:424: warning: deprecated conversion from string constant to ‘char*’
grguColorAlpha.cpp: In function ‘void grGammaCorrectionValue(float)’:
grguColorAlpha.cpp:570: warning: deprecated conversion from string constant to ‘char*’

...
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Next

Return to OpenGLide Development

Who is online

Users browsing this forum: No registered users and 1 guest