D2X-XL on Mac OS X
Moderators: Grendel, Aus-RED-5
Re:
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: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').
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
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
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
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()).
Edit:
I have fiddled around with folder detection code again and committed the new stuff (its in main/inferno.c::GetAppFolders()).
Re:
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.Diedel wrote:dangit. Problem is that I simply cannot test the OS X code.
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: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()).
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>.
Hmm..
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.]
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.]
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:
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.
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>.
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:
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:
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/ .
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>.
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>.
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/ .
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.
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...
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/ :
When the data folder is at ./Data/ in relation to the executable:
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>
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>.
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.
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.
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
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
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>.
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>.
Mac OS X folder detection
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.
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.
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.
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.
- Shadowfury333
- DBB Ace
- Posts: 326
- Joined: Mon Aug 09, 2004 8:36 pm
Re:
You can, although the processors have to be specially modified for Apple. IIRC though, the Intel Macs haven't hit the market yet.Diedel wrote:You cannot run an OS X executable for the PowerPC hardware on an x86 computer.
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? )
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? )
Re:
On a regular Windoze machine? And legally? That would be cool!Mugz wrote:If you want, i can get you Mac OS X for x86 10.4.3 and help you to install
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
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
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.
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.
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.
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:
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.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.
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!
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
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