Page 4 of 5

Posted: Wed Jan 04, 2006 9:14 am
by Diedel
SimX,

can you do me a favor: Create a zip file containing the OS X d2x-xl install in the format you have proposed, and e-mail it to karx11erx at h0tmail d0t c0m?

Posted: Wed Jan 04, 2006 3:21 pm
by simX
Diedel --

Sure, I can do that. Do you want me to do it with version 1.5.70, or with some other version?

-- simX

Posted: Wed Jan 04, 2006 5:59 pm
by Diedel
If possible with the latest version (1.5.77). I have just committed the source code.

If you use that code, could you check folder detection? I have added detection for './' (e.g. './data') and '../../../' (e.g. '../../../data').

Re:

Posted: Wed Jan 04, 2006 8:39 pm
by simX
Diedel wrote:If possible with the latest version (1.5.77). I have just committed the source code.

If you use that code, could you check folder detection? I have added detection for './' (e.g. './data') and '../../../' (e.g. '../../../data').
I just downloaded the source code for 1.5.77 from here. The included Xcode project compiles all the files successfully (albeit with a bunch of warnings), but then when in the linking stage I get the following errors:

Code: Select all

/usr/bin/ld: Undefined symbols:
_ogl_ubitblt
_ogl_ubitblt_copy
_ogl_ubitblt_i
_ogl_ubitblt_tolinear
_ogl_ubitmapm
_ogl_ubitmapm_c
_g3_draw_poly
_g3_draw_tmap
_gr_upoly_tmap
_ogl_end_frame
_ogl_start_frame
_ogl_swap_buffers
_r_upixelc
_bsphereh
_circleh10
_circleh5
_cross_lh
_glExitTMU
_glInitTMU
_primary_lh
_secondary_lh
_ssphereh
_g3_draw_line
_g3_draw_sphere
_nInMenu
_ogl_set_fov
_glFOV
_ogl_draw_reticle
_draw_tmap_flat
_g3_draw_bitmap
_g3_draw_tmap_2
_g3_draw_transp_poly
_glAspect
_tmap_color
_vert_colors
collect2: ld returned 1 exit status
Not sure how to fix this. I also noticed that the d2x-xl icon for Mac OS X wasn't included in the downloaded source code, but I filched it from the previous Mac OS X binary to include in the project.

Posted: Thu Jan 05, 2006 4:25 pm
by Diedel
There should be a new file arch/ogl/ogl_render.c containing the missing functions (at least I hope it was added to the SVN repos with my latest commits). Please add that file to your project.

Edit:

I hadn't added it, but just did so.

Posted: Thu Jan 05, 2006 6:49 pm
by simX
Diedel --

OK, I added that file to the project and now it builds successfully. However, I was testing out the new Data folder detection code as you requested, and it seems D2X-XL doesn't start up AT ALL now. I tried putting it in /Applications/Games/D2X-XL/ as before to make it start up, but it still shows a black window very briefly and quits. I put in the previous 1.5.70 version in /Applications/Games/D2X-XL/ and it starts up fine, so there's something weird going on with the new executable.

Can you check to make sure everything's OK in the code?

-- simX

Posted: Fri Jan 06, 2006 4:19 am
by Diedel
dangit. Problem is that I simply cannot test the OS X code. You can start d2x-xl using the -debug-printlog switch and look for a file named 'd2x.log' after program termination. It will contain info about the folders it tries to use. Post it here to give me a hint.

Edit:

I have fiddled around with folder detection code again and committed the new stuff (its in main/inferno.c::GetAppFolders()).

Re:

Posted: Fri Jan 06, 2006 7:10 am
by simX
Diedel wrote:dangit. Problem is that I simply cannot test the OS X code.
Well, that's what I'm here for, right? Donate money so you can buy a Mac and help you test the code in the meantime. ;)
You can start d2x-xl using the -debug-printlog switch and look for a file named 'd2x.log' after program termination. It will contain info about the folders it tries to use. Post it here to give me a hint.

Edit:

I have fiddled around with folder detection code again and committed the new stuff (its in main/inferno.c::GetAppFolders()).
I d/led the source code after your edit. Still doesn't start up at all, even if it's in /Applications/Games/D2X-XL/ . Here's the debug log as requested:

Code: Select all

GetAppFolder ('', '', '/Applications/Games/D2X-XL', '')
GetAppFolder (/Applications/Games/D2X-XL) = '/Applications/Games/D2X-XL' (0)
GetAppFolder ('.', '', 'data', 'descent2.hog')
GetAppFolder (data) = './data' (0)
expected game folder = '/Applications/Games/D2X-XL'
GetAppFolder ('.', './data', 'data', 'descent2.hog')
GetAppFolder (data) = './data' (0)
GetAppFolder ('.', '.', 'profiles', '*plr')
GetAppFolder (profiles) = '.' (-1)
GetAppFolder ('.', '.', 'movies', '*.mvl')
GetAppFolder (movies) = '.' (-1)
GetAppFolder ('.', '.', 'savegames', '')
GetAppFolder (savegames) = '.' (-1)
GetAppFolder ('.', '.', 'screenshots', '')
GetAppFolder (screenshots) = '.' (-1)
GetAppFolder ('.', '/Applications/Games/D2X-XL', 'config', '*.cfg')
GetAppFolder (config) = '.' (-1)
cfile_get_filehandle(): error opening ./data/descent2.hog
cfile_get_filehandle(): error opening ./data/descent.tex
cfopen(): error opening descent.tex
cfile_get_filehandle(): error opening ./data/descent.txb
cfopen(): error opening descent.txb
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/missions/d2x.hog
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/descentw.cfg
cfopen(): error opening descentw.cfg
cfile_get_filehandle(): error opening ./data/default.256
cfopen(): error opening default.256
cfile_get_filehandle(): error opening ./data/groupa.256
cfopen(): error opening groupa.256
Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.
Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.

Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.

Posted: Fri Jan 06, 2006 6:03 pm
by Diedel
I have fixed that bug and committed the fix to the source repos.

Hmm..

Posted: Fri Jan 06, 2006 9:27 pm
by simX
Sorry, the only access I can find to the source code is that one \"D2X Source\" link on the D2X-XL project page on descent2.de, and it appears that that's still the source for 1.5.77, even though you've updated D2X-XL to 1.5.80.

Could you give me the URL to the source repository so I can download any changes you commit without requiring you to update that link on the D2X-XL project page? I looked high and low, but I couldn't find a URL for the repository anywhere on this forum or on the descent2.de site.

[UPDATE: Found a link here.]

Posted: Fri Jan 06, 2006 9:46 pm
by simX
Heh, OK, sorry, but now the project is complaining that the file sdl_mixer.h is not found. I can't find it in the current svn revision, or in any of the previous source archives that I downloaded.

Any chance that you could include that file in the repository? :)

Posted: Fri Jan 06, 2006 9:59 pm
by simX
OK, another update. I found an sdl_mixer.c file in the SDL 1.2.9 code, and filched that, but there were multiple sdl_mixer.h files: SDL_mixer_MMX.h, SDL_mixer_MMX_VC.h, and SDL_Mixer_m68k.h . I managed to get the project built with SDL_Mixer_m68k.h after renaming it to SDL_mixer.h, but D2X-XL still doesn't start up and it gave me a different set of errors. Here's the log:

Code: Select all

GetAppFolder ('', '', '/Applications/Games/D2X-XL', '')
GetAppFolder (/Applications/Games/D2X-XL) = '/Applications/Games/D2X-XL' (0)
GetAppFolder ('../../..', '', 'data', 'descent2.hog')
GetAppFolder (data) = '../../..' (-1)
GetAppFolder ('', '../../..', '../../..', 'descent2.hog')
GetAppFolder (../../..) = '../../..' (-1)
GetAppFolder ('.', '../../..', 'data', 'descent2.hog')
GetAppFolder (data) = './data' (0)
GetAppFolder ('.', './data', 'data', 'descent2.hog')
GetAppFolder (data) = './data' (0)
expected game app folder = '/Applications/Games/D2X-XL'
expected game data folder = './data'
GetAppFolder ('.', '.', 'profiles', '*plr')
GetAppFolder (profiles) = '.' (-1)
GetAppFolder ('.', '.', 'movies', '*.mvl')
GetAppFolder (movies) = '.' (-1)
GetAppFolder ('.', '.', 'savegames', '')
GetAppFolder (savegames) = '.' (-1)
GetAppFolder ('.', '.', 'screenshots', '')
GetAppFolder (screenshots) = '.' (-1)
GetAppFolder ('.', '/Applications/Games/D2X-XL', 'config', '*.cfg')
GetAppFolder (config) = '.' (-1)
cfile_get_filehandle(): error opening ./data/descent2.hog
cfile_get_filehandle(): error opening ./data/descent.tex
cfopen(): error opening descent.tex
cfile_get_filehandle(): error opening ./data/descent.txb
cfopen(): error opening descent.txb
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/missions/d2x.hog
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/descentw.cfg
cfopen(): error opening descentw.cfg
cfile_get_filehandle(): error opening ./data/default.256
cfopen(): error opening default.256
cfile_get_filehandle(): error opening ./data/groupa.256
cfopen(): error opening groupa.256
Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.
Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.

Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.
Clearly it's looking for ../../../Data now, but it seems there's still a problem with actually opening the files themselves or something. I still have the game in /Applications/Games/D2X-XL/ , but it's still not recognizing the data folder even though both /Applications/Games/D2X-XL/ and ../../../Data are valid data directories.

Posted: Sat Jan 07, 2006 1:57 pm
by simX
Another update, which might clarify the problem. I was fiddling around with D2X-XL and found that it would successfully open if I used the \"-hogdir\" command line option, so D2X-XL could successfully open files on the Mac.

So then I used the printlog to test D2X-XL again with the Data at /Applications/Games/D2X-XL/Data/ . Here's what I get in the log:

Code: Select all

GetAppFolder ('', '', '/Applications/Games/D2X-XL', '')
GetAppFolder (/Applications/Games/D2X-XL) = '/Applications/Games/D2X-XL' (0)
GetAppFolder ('../../..', '', 'data', 'descent2.hog')
GetAppFolder (data) = '../../..' (-1)
GetAppFolder ('', '../../..', '../../..', 'descent2.hog')
GetAppFolder (../../..) = '../../..' (-1)
GetAppFolder ('.', '../../..', 'data', 'descent2.hog')
GetAppFolder (data) = './data' (0)
GetAppFolder ('.', './data', 'data', 'descent2.hog')
GetAppFolder (data) = './data' (0)
expected game app folder = '/Applications/Games/D2X-XL'
expected game data folder = './data'
GetAppFolder ('.', '.', 'profiles', '*plr')
GetAppFolder (profiles) = '.' (-1)
GetAppFolder ('.', '.', 'movies', '*.mvl')
GetAppFolder (movies) = '.' (-1)
GetAppFolder ('.', '.', 'savegames', '')
GetAppFolder (savegames) = '.' (-1)
GetAppFolder ('.', '.', 'screenshots', '')
GetAppFolder (screenshots) = '.' (-1)
GetAppFolder ('.', '/Applications/Games/D2X-XL', 'config', '*.cfg')
GetAppFolder (config) = '.' (-1)
cfile_get_filehandle(): error opening ./data/descent2.hog
cfile_get_filehandle(): error opening ./data/descent.tex
cfopen(): error opening descent.tex
cfile_get_filehandle(): error opening ./data/descent.txb
cfopen(): error opening descent.txb
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/missions/d2x.hog
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/descentw.cfg
cfopen(): error opening descentw.cfg
cfile_get_filehandle(): error opening ./data/default.256
cfopen(): error opening default.256
cfile_get_filehandle(): error opening ./data/groupa.256
cfopen(): error opening groupa.256
Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.
Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.

Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.
Note how it seems to be looking for the ./data folder instead of /Applications/Games/D2X-XL/Data/ . So I tried putting the Data folder on the same level as the executable file (which means inside the application package). Here's the debug log for that:

Code: Select all

GetAppFolder ('', '', '/Applications/Games/D2X-XL', '')
GetAppFolder (/Applications/Games/D2X-XL) = '/Applications/Games/D2X-XL' (0)
GetAppFolder ('../../..', '', 'data', 'descent2.hog')
GetAppFolder (data) = '../../..' (-1)
GetAppFolder ('', '../../..', '../../..', 'descent2.hog')
GetAppFolder (../../..) = '../../..' (-1)
GetAppFolder ('.', '../../..', 'data', 'descent2.hog')
GetAppFolder (data) = '.' (-1)
GetAppFolder ('', '.', '.', 'descent2.hog')
GetAppFolder (.) = '.' (-1)
GetAppFolder ('/Applications/Games/D2X-XL', '.', 'data', 'descent2.hog')
GetAppFolder (data) = '/Applications/Games/D2X-XL' (-1)
expected game app folder = '/Applications/Games/D2X-XL'
expected game data folder = '/Applications/Games/D2X-XL'
GetAppFolder ('/Applications/Games/D2X-XL', '/Applications/Games/D2X-XL', 'profiles', '*plr')
GetAppFolder (profiles) = '/Applications/Games/D2X-XL' (-1)
GetAppFolder ('/Applications/Games/D2X-XL', '/Applications/Games/D2X-XL', 'movies', '*.mvl')
GetAppFolder (movies) = '/Applications/Games/D2X-XL' (-1)
GetAppFolder ('/Applications/Games/D2X-XL', '/Applications/Games/D2X-XL', 'savegames', '')
GetAppFolder (savegames) = '/Applications/Games/D2X-XL' (-1)
GetAppFolder ('/Applications/Games/D2X-XL', '/Applications/Games/D2X-XL', 'screenshots', '')
GetAppFolder (screenshots) = '/Applications/Games/D2X-XL' (-1)
GetAppFolder ('/Applications/Games/D2X-XL', '/Applications/Games/D2X-XL', 'config', '*.cfg')
GetAppFolder (config) = '/Applications/Games/D2X-XL' (-1)
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/descent2.hog
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/descent.tex
cfopen(): error opening descent.tex
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/descent.txb
cfopen(): error opening descent.txb
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/missions/d2x.hog
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/descentw.cfg
cfopen(): error opening descentw.cfg
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/default.256
cfopen(): error opening default.256
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/groupa.256
cfopen(): error opening groupa.256
Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.
Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.

Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.
Note how when the data is at /Applications/Games/D2X-XL/Data/ , D2X-XL looks for ./Data/ . But when the data folder is at ./Data/ , D2X-XL looks for /Applications/Games/D2X-XL/Data/ . So it looks like the folder detection is reversed from what it's supposed to be.

If I take the D2X-XL application out of /Applications/Games/D2X-XL/ and put it into /Games/D2X-XL/ instead with the data folder at /Games/D2X-XL/Data/ , the debug log is the same as the first one, above. If the application is in /Games/D2X-XL/ and the data folder is at ./Data relative to the executable application, it's also the same as the first debug log.

So from what I can tell, D2X-XL seems to look for ./Data/ first, but if it finds ./Data/ , it also is looking for /Applications/Games/D2X-XL/Data/ .

Posted: Sun Jan 08, 2006 12:15 am
by Diedel
simX,

D2X-XL does a lot of folder checking there, but look for the two lines starting with \"expecting\": That's were D2X-XL will finally expect game exe and data to be.

GetAppFolder always prints two lines:

Line #1 contains the arguments the function receives when called, line #2 contains the result; so GetAppFolder('data') = '/Applications/Games/D2X-XL' (-1) means that it has looked for the data in 'Applications/Games/D2X-XL/data', but not found it there (return code -1). A return code of 0 denotes a success.

There is still a bug though in the OS X folder detection which I have just taken out. I will also take care of the SDL_mixer.h include statements.

Edit:

Fixes committed.

No dice...

Posted: Sun Jan 08, 2006 3:58 am
by simX
Diedel: thanks for the explanation about the debug log. Everything makes more sense now. However, the recent fixes still doesn't solve the problem -- D2X-XL still doesn't start up at all.

When the data folder is in /Applications/Games/D2X-XL/ :

Code: Select all

GetAppFolder ('', '', '/Applications/Games/D2X-XL', '')
GetAppFolder (/Applications/Games/D2X-XL) = '/Applications/Games/D2X-XL' (0)
GetAppFolder ('../../..', '', 'data', 'descent2.hog')
GetAppFolder (data) = '../../..' (-1)
GetAppFolder ('', '', '../../..', 'descent2.hog')
GetAppFolder (../../..) = '' (-1)
GetAppFolder ('.', '', 'data', 'descent2.hog')
GetAppFolder (data) = './data' (0)
GetAppFolder ('.', './data', 'data', 'descent2.hog')
GetAppFolder (data) = './data' (0)
expected game app folder = '/Applications/Games/D2X-XL'
expected game data folder = './data'
GetAppFolder ('.', '.', 'profiles', '*plr')
GetAppFolder (profiles) = '.' (-1)
GetAppFolder ('.', '.', 'movies', '*.mvl')
GetAppFolder (movies) = '.' (-1)
GetAppFolder ('.', './savegames', 'savegames', '')
GetAppFolder (savegames) = './savegames' (0)
GetAppFolder ('.', '.', 'screenshots', '')
GetAppFolder (screenshots) = '.' (-1)
GetAppFolder ('.', '/Applications/Games/D2X-XL', 'config', '*.cfg')
GetAppFolder (config) = '.' (-1)
cfile_get_filehandle(): error opening ./data/descent2.hog
cfile_get_filehandle(): error opening ./data/descent.tex
cfopen(): error opening descent.tex
cfile_get_filehandle(): error opening ./data/descent.txb
cfopen(): error opening descent.txb
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/missions/d2x.hog
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/descentw.cfg
cfopen(): error opening descentw.cfg
cfile_get_filehandle(): error opening ./data/default.256
cfopen(): error opening default.256
cfile_get_filehandle(): error opening ./data/groupa.256
cfopen(): error opening groupa.256
Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.
Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.

Error: Can open neither palette file <default.256> nor default palette file <groupa.256>
When the data folder is at ./Data/ in relation to the executable:

Code: Select all

GetAppFolder ('', '', '/Applications/Games/D2X-XL', '')
GetAppFolder (/Applications/Games/D2X-XL) = '/Applications/Games/D2X-XL' (0)
GetAppFolder ('../../..', '', 'data', 'descent2.hog')
GetAppFolder (data) = '../../..' (-1)
GetAppFolder ('', '', '../../..', 'descent2.hog')
GetAppFolder (../../..) = '' (-1)
GetAppFolder ('.', '', 'data', 'descent2.hog')
GetAppFolder (data) = '.' (-1)
GetAppFolder ('', '', '.', 'descent2.hog')
GetAppFolder (.) = '' (-1)
GetAppFolder ('/Applications/Games/D2X-XL', '', 'data', 'descent2.hog')
GetAppFolder (data) = '/Applications/Games/D2X-XL' (-1)
expected game app folder = '/Applications/Games/D2X-XL'
expected game data folder = '/Applications/Games/D2X-XL'
GetAppFolder ('/Applications/Games/D2X-XL', '/Applications/Games/D2X-XL', 'profiles', '*plr')
GetAppFolder (profiles) = '/Applications/Games/D2X-XL' (-1)
GetAppFolder ('/Applications/Games/D2X-XL', '/Applications/Games/D2X-XL', 'movies', '*.mvl')
GetAppFolder (movies) = '/Applications/Games/D2X-XL' (-1)
GetAppFolder ('/Applications/Games/D2X-XL', '/Applications/Games/D2X-XL/savegames', 'savegames', '')
GetAppFolder (savegames) = '/Applications/Games/D2X-XL/savegames' (0)
GetAppFolder ('/Applications/Games/D2X-XL', '/Applications/Games/D2X-XL', 'screenshots', '')
GetAppFolder (screenshots) = '/Applications/Games/D2X-XL' (-1)
GetAppFolder ('/Applications/Games/D2X-XL', '/Applications/Games/D2X-XL', 'config', '*.cfg')
GetAppFolder (config) = '/Applications/Games/D2X-XL' (-1)
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/descent2.hog
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/descent.tex
cfopen(): error opening descent.tex
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/descent.txb
cfopen(): error opening descent.txb
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/missions/d2x.hog
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/descentw.cfg
cfopen(): error opening descentw.cfg
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/default.256
cfopen(): error opening default.256
cfile_get_filehandle(): error opening /Applications/Games/D2X-XL/groupa.256
cfopen(): error opening groupa.256
Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.
Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.

Error: Can open neither palette file <default.256> nor default palette file <groupa.256>.

Posted: Sun Jan 08, 2006 8:10 am
by Diedel
simX,

The 'expected' lines are the result of GetAppFolder() finding 'd2x-xl' (game folder) and 'descent.hog' (data folder) in the locations it reports there.

The only thing I can think of here is case sensitivity. GetAppFolder() works case insensitive, cfile_get_filehandle() doesn't. So while GetAppFolder() would find './Data/Descent2.Hog' when looking for './data/descent2.hog', cfile_get_filehandle() wouldn't find it.

I am also asking myself if you accidentally exchanged the two debug logs, and the lower one is the one for the data being in './Data' and the upper one is for the data being in '/Applications/Games/D2X-XL'.

Edit:

I have changed d2x-xl subdirectory names to start with a capital letter on OS X, and submitted this and a few bug fixes to the source repos.

Posted: Sun Jan 08, 2006 4:08 pm
by simX
Diedel --

Yeah, see that's why I was confused about the debug logs. I definitely did not have the logs switched (I thought about that myself and made sure I didn't switch them); I just tried it again with revision 88 and the behavior is exactly the same, with the same debug logs. I'm concerned that maybe I've been doing something wrong in the compilation -- if someone else on Mac OS X could confirm this from the source repos, that would make me feel a bit better. (It seems kind of hard that I would screw up, though, because it's just downloading the latest revision, opening the Xcode project, adding \"ogl_render.c\" to the project, and then pressing build.)

By the way, the default file system on Mac OS X is case-insensitive, so I don't think it should matter whether or not the folders are capitalized or not. (I tested it just to be sure, and it doesn't seem to have an effect.)

I'm going to try downloading the source for the latest revision I know worked (revision 70, I think), and see if it works as I expect if I compile it.

[UPDATE: I downloaded revision 70 directly from the svn source repository, and it works as expected. That is, it launches and reads the data correctly from /Applications/Games/D2X-XL/Data/ . So I'm inclined to believe that there's still some problem with the latest revisions. Is there any other command line argument that might give any more clues?]

[UPDATE 2: OK, heck with it. I'm going to download every revision between 70 and 77 to see when the problem started occurring. I'll let you know in a bit.]

-- simX

Posted: Sun Jan 08, 2006 4:47 pm
by Diedel
simX,

if the log file says \"expected game data folder = './data'\", d2x-xl must have found './data/descent.hog'.

If it says \"expected game data folder = '/Applications/Games/D2X-XL'\" it may either have found '/Applications/Games/D2X-XL/descent2.hog' or may not have found descent2.hog in any of the other locations it looks for it and therefore assumes the default location (application folder).

I cannot say more about this w/o debugging this on OS X - which I cannot, as I don't have an OS X machine available.

If you know how to handle a debugger, just step through main/inferno.c::GetAppFolders() and look whats happening there.

In your place, I would also delete all d2x.log files before creating a new one to make dead sure you haven't got an old one accidentally.

You should be able to override all folder tests of d2x-xl by specifying the app folder with -userdir <folder> and the data folder with -hogdir <folder>.

Posted: Sun Jan 08, 2006 7:55 pm
by Mugz
Okay. I have tried run at Mac OS X for x86, and i have nothing. No errors, no games. May be someone try recompile with XCode 2.0??? Dual platforms?

Posted: Mon Jan 09, 2006 1:27 am
by Diedel
You cannot run an OS X executable for the PowerPC hardware on an x86 computer.

Mac OS X folder detection

Posted: Mon Jan 09, 2006 4:28 am
by simX
Diedel --

OK, I figured out the problem with the Mac OS X folder detection. It goes back to one of the original problems you were having -- it turns out that the method you're using starts with the hard drive's root directory (\"/\") instead of the executable's directory. (This is an artifact of how Mac OS X launches executables that are housed inside an application package.) So detecting folders by using \"..\" is useless since the method starts out with the root directory anyway.

I figured this out by simply feeding \"../../../Data\" to the szDataDir variable, and it still wouldn't find the data folder when it was in the correct folder. Then I tried putting the data folder at the root folder of the hard drive, and then \"../../../Data\" resolves to \"/Data\" which was a valid folder -- and D2X-XL worked.

I wrote some code to use Mac OS X's native APIs to detect the data folder, and have tested it successfully with D2X-XL. The only problem is that it is written in Objective-C, and I had to recompile D2X-XL with gcc which accepts C and Objective-C code in the same .c files interchangeably. I'm not sure if you can/want to compile this way for the other architectures, though.

Let me know.

Posted: Mon Jan 09, 2006 7:17 am
by Diedel
I would prefer not to mix standard C and C++/Objective C in D2X-XL. C++ can always be rewritten to standard C though.

You wrote however that v1.5.7X detected the folders, so wouldn't it be sufficient to revert to that code version, folder detection wise?

Posted: Mon Jan 09, 2006 7:27 am
by simX
Well, it would be sufficient, but it would require that the data folder would have to be present in /Applications/Games/D2X-XL/ . That is, it wouldn't be able to detect the data folder that's on the same level as the application package (and it actually wouldn't be able to detect any data on the same level as the executable file inside the application package -- that actually doesn't work even in 1.5.7x). So for now you can probably revert the Mac OS X folder detection code to 1.5.70 (somewhere in version 1.5.71 the problem occurred).

I'll see what I can do about rewriting the code in standard C if possible -- I'm not 100% sure if it can be done, but I'll look into it. If I was able to separate the Mac OS X folder detection code into a separate file or two but leave it in Objective-C (and use a C call in the inferno.c file), would that be acceptable? That way the file would only be needed if you wanted to compile for Mac OS X, and the other archs wouldn't need to be recompiled to accept Objective-C code.

Posted: Mon Jan 09, 2006 8:05 am
by Mugz
Diedel i can. Using with Rosseta... :) Problem with SDL.framrwork. Need recompile

Re:

Posted: Mon Jan 09, 2006 8:13 am
by Shadowfury333
Diedel wrote:You cannot run an OS X executable for the PowerPC hardware on an x86 computer.
You can, although the processors have to be specially modified for Apple. IIRC though, the Intel Macs haven't hit the market yet.

Posted: Mon Jan 09, 2006 10:55 am
by Diedel
SF333,

PowerPC has inverse byte order of x86; i.e. for numbers composed of several bytes, the most significant byte has the lowest memory address for the PowerPC (comes) first. For x86, it's the other way round. No way unless you use some converter or emulator.

simX,

you could put the OS X specific code in an extra file and include that file in the OS X project. Please send me the file to karx11erx at hotmail d0t com so that I can check it into the source repos.

It would be great to get d2x-xl v1.5.85 OS X from you to the same address (please put the app and the SDL framework in the same dmg and give me some installation instructions I can publish on my D2 site, ok? :))

Posted: Mon Jan 09, 2006 3:59 pm
by kaelan
As far as Intel Mac support, the code should work. I've tried to make the configuration file so that all the byte-swapping code should be selected appropriately. Though, since my full-time day job is not Mac Development, I don't have an Intel Dev Kit to try it on. :)

Posted: Mon Jan 09, 2006 5:49 pm
by Mugz
Diedel try with XCode 2.1 (or something) this support with crossplatform.

Posted: Mon Jan 09, 2006 6:14 pm
by Diedel
Mugz,

I don't have a Mac, so I am not doing the OS X port. I try to support it as good as I can, but that's it. If ppl ever donate enough, I will buy a used one to fix the remaining d2x-xl OS X bugs, but currently it looks like that will take another 5 years. ;)

Posted: Mon Jan 09, 2006 6:16 pm
by Mugz
If you want, i can get you Mac OS X for x86 10.4.3 and help you to install :)

Posted: Mon Jan 09, 2006 6:24 pm
by kaelan
I have Xcode 2.2, though I don't have the universal SDK installed. I have a desktop on the way that will have much more disk space. I'll load up the tools and give it a try then.

It would make sense to ship a universal binary soon, as Intel Macs may be available as soon as tomorrow. :)

Re:

Posted: Mon Jan 09, 2006 6:34 pm
by Diedel
Mugz wrote:If you want, i can get you Mac OS X for x86 10.4.3 and help you to install :)
On a regular Windoze machine? And legally? That would be cool!

Posted: Mon Jan 09, 2006 6:36 pm
by Mugz
Legally? You r joke? :) I'm russian fella :) I don't know what is is 'LEGALY' :) (shutka)

Ok. OS X can run on Intel machines. See: http://www.hdz.ru/.lj/osx.jpg
It's my second computer.

If you want know more, please write me email or go in ICQ :) Or PM me :)

Posted: Mon Jan 09, 2006 6:42 pm
by Diedel
I am German. It has to be legal.

Ok, I lied. Germans aren't what they once were (or what ppl believed they are).

Still has to be legal for me though.

;)

Please PM me your e-mail addy.

Posted: Tue Jan 10, 2006 2:48 am
by simX
Heh, the only way it would be legal is if you bought an Apple Developer Transition Kit, which is $1000, and you might even have to buy an Apple Developer Account. There's no way it could be legal otherwise.

Just a thought. :P

Posted: Tue Jan 10, 2006 3:04 am
by Diedel
That's what I thought, too. There cannot be a legal way to get OS X x86 for little or no money right now. But once it is available (and not horrendously expensive), I'll definitely purchase it. I am eager to get to know OS X first hand. From all I know, Apple' Macs and OS X are the Mercedes Benz' of the PC world.

Posted: Tue Jan 10, 2006 3:10 am
by simX
It's likely that Mac OS X will never be available for purchase and installation on general x86 computers. Currently it has protections that only allow it to run on Developer Transition Kits (which have a hardware chip specifically designed for this purpose), and it's likely that this will continue when Apple releases new Intel Macs.

So you're still going to likely have to purchase a Mac to get access to Mac OS X unless you want to go the illegal route.

Posted: Tue Jan 10, 2006 3:13 am
by Diedel
If mugz is right, it can run on GP x86 hardware though. If you were right, imo that would be darn stupid product policy on behalf of Apple. I bet a lot of ppl would purchase OS X x86 if it would run on current x86 hardware. It certainly wouldn't hurt Apple. Look at MS: They are doing great w/o a hardware branch. The computer hardware isn't exactly Apple's greatest source of profit anyway.

Re:

Posted: Tue Jan 10, 2006 3:26 am
by simX
Diedel wrote:Look at MS: They are doing great w/o a hardware branch. The computer hardware isn't exactly Apple's greatest source of profit anyway.
Actually, computer hardware is a significant portion of Apple's revenue. Take a look at these notes from Apple's 2005 Q3 quarter. (I couldn't find any notes from the fourth quarter showing the revenue breakdown.) Computer hardware (laptop and desktops) comprised $1.565 billion of $3.52 billion in total revenue. That represents 44% of total revenue. The iPod generated $1.1 billion of that $3.52 billion, which is less than what computer hardware generated.

Apple doesn't untether its operating system from its hardware because that way the operating system is much more stable and predictable since it doesn't have to deal with so many hardware configurations.

While it would be nice to run Mac OS X on any old x86 hardware, it'd really put a significant dent in revenue. Boxed copies of Mac OS X sell for $129, and the least expensive Mac (the Mac mini) sells for $499. I don't think that price could outweigh the loss in hardware revenue that it would incur.

D2X-XL 1.5.86 for Mac OS X!

Posted: Tue Jan 10, 2006 4:16 am
by simX
Diedel --

As requested, I sent the source code files required for Mac OS X folder detection to the e-mail you specified. Also included is the disk image for D2X-XL 1.5.86 with my modifications, structured as I specified before.

Let me know if you have any problems, and I'll be glad to help. Hopefully this will finally put to rest this problem in D2X-XL for Mac OS X. :)

-- simX