#140844 - Opus - Thu Sep 20, 2007 5:08 am
Hey fellas.
So I made a really simple tweak to the open source code for Nethack (I made the boulders appear more visible by changing the default character for them)
Now all I need to do is compile this bugger.
On Stuart's webpage it states:
Unzip the source, then compile for your computer - not the DS. This is to get makedefs and friends to generate everything you need to compile it for the DS. (This is known to work on Win32 and Linux, not sure about MacOS) Once this is done, from the nethack-3.4.3 directory, run 'make -f sys/nds/Makefile'.
I've got Programmer's Notepad, Palib, and Devkitpro all on my computer but I don't have a clue as to follow his directions to compile this all together to get a final version that can run on my DS.
Could a friendly face here please give me a hand as to how this is exactly done?
If so, be as descriptive as possible since this is my first attempt at doing something like this.
Hope someone here has the time to help me.
Cheers. :o)
#140880 - tepples - Thu Sep 20, 2007 11:38 am
If you have MSYS from devkitPro, you can use it with MinGW. MinGW is a GCC port that runs on Windows and compiles for Windows, just as devkitARM is a GCC port that runs on Windows and compiles for GBA or DS.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#140919 - Opus - Thu Sep 20, 2007 5:49 pm
Hey Tepples, thanks for the post. :o)
So I believe that I was able to compile it correctly for windows using MinGW.
It gave me a new "binary" folder that now features a playable Window's XP version of Nethack with my new custom graphic for boulders.
The last thing to do now states:
Once this is done, from the nethack-3.4.3 directory, run 'make -f sys/nds/Makefile'. This should compile everything and copy the binaries to the binary directory.
Sorry, but I've read this over time and time again but it just sounds like jibberish to me.
One more helpful suggestion on what to do next and I'll be on my way.
Thanks. :o)
#140935 - tepples - Thu Sep 20, 2007 8:44 pm
Opus wrote: |
The last thing to do now states:
Once this is done, from the nethack-3.4.3 directory, run 'make -f sys/nds/Makefile'. This should compile everything and copy the binaries to the binary directory.
Sorry, but I've read this over time and time again but it just sounds like jibberish to me. |
How well do you know the Windows command prompt?
Code: |
E:\> cd \ds\nethack-3.4.3
E:\ds\nethack-3.4.3> make -f sys/nds/Makefile |
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#140944 - Opus - Thu Sep 20, 2007 9:11 pm
Nuts, I almost had it....
Then depression sets in. :o)
So this is my log thingie after following all of the directions to a T.
make -f sys/nds/Makefile.arm7 all
make[1]: Entering directory `/c/n'
arm7_main.c
arm-eabi-gcc -MMD -MP -MF build/arm7_main.d -g -Wall -O2 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/c/devkitPro/libnds/include -I/c/n/build -DARM7 -c sys/nds/arm7/src/arm7_main.c -o build/arm7_main.o
sys/nds/arm7/src/arm7_main.c: In function 'VblankHandler':
sys/nds/arm7/src/arm7_main.c:119: warning: comparison is always false due to limited range of data type
sys/nds/arm7/src/arm7_main.c:120: warning: comparison is always false due to limited range of data type
linking NetHackDS.arm7.elf
built ... NetHackDS.arm7
make[1]: Leaving directory `/c/n'
built ... NetHackDS.arm7
sh -c "unset CC; [ -f src/tile.c ] || make -C util ../src/tile.c"
make[1]: Entering directory `/c/n/util'
make[1]: *** No rule to make target `../src/tile.c'. Stop.
make[1]: Leaving directory `/c/n/util'
make: *** [build/NetHackDS.arm9.elf] Error 2
Okay, I give up. Why is this giving me grief? Please help me one last time to get over this final bump.
You would not believe how excited I'll get if I'm able to compile this by the end of the night.
Cheers. :o)
#140985 - Opus - Fri Sep 21, 2007 4:09 am
Apparently I need two files called tile.c and tile.o for this to build correctly for the DS. Well, Duh! :o)
How do I go about finding/creating/downloading these two files since they're not found in the original source code?
The tileset I would like to use is called text_c.bin found here
http://stuartp.commixus.com/nhds/tileset.html
I'm so right there, but I need just that little bit of extra guidance to get me through this.
Help me out dudes! :o)
#141014 - mml - Fri Sep 21, 2007 9:16 am
tile.o will be automatically created from tile.c by the make bits. Where tile.c comes from, I have no idea. But don't spend a lot of time worrying about tile.o itself for now -- spend your effort working out why tile.c is missing and how to fix that, and tile.o *should* just come along for the ride. :)
#141066 - Opus - Fri Sep 21, 2007 7:29 pm
Is there a way to convert text_c.bin to text.c through some amazingly nerdy program?
If that were possible, then my life would be perfect. :o)
#141069 - strager - Fri Sep 21, 2007 8:21 pm
Opus wrote: |
Is there a way to convert text_c.bin to text.c through some amazingly nerdy program?
If that were possible, then my life would be perfect. :o) |
raw2c is provided with DKA r20, as well as some earlier versions. Maybe you could try that.
#141073 - Opus - Fri Sep 21, 2007 9:09 pm
Okay, I was able to use raw2c and make the tiles.bin into tiles.c and then I renamed that file to text.c .
This is the log file thingie after trying to compile:
Paige@KRISTIN /c/nethack-3.4.3
$ make -f sys/nds/Makefile
sh -c "unset CC; [ -f src/tile.c ] || make -C util ../src/tile.c"
make -f sys/nds/Makefile.src all
make[1]: Entering directory `/c/nethack-3.4.3'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/c/nethack-3.4.3'
make -f sys/nds/Makefile.arm9 all
make[1]: Entering directory `/c/nethack-3.4.3'
linking NetHackDS.arm9.elf
build/ds_gfx.o: In function `nds_load_tiles':
sys/nds/arm9/src/ds_gfx.c:190: undefined reference to `total_tiles_used'
build/ds_win.o: In function `nds_clear_nhwindow':
sys/nds/arm9/src/ds_win.c:680: undefined reference to `total_tiles_used'
build/ds_win.o: In function `nds_print_glyph':
sys/nds/arm9/src/ds_win.c:170: undefined reference to `glyph2tile'
build/do.o: In function `goto_level':
src/do.c:1077: undefined reference to `substitute_tiles'
build/o_init.o: In function `shuffle_tiles':
src/o_init.c:41: undefined reference to `glyph2tile'
build/restore.o: In function `dorecover':
src/restore.c:647: undefined reference to `substitute_tiles'
collect2: ld returned 1 exit status
make[1]: *** [build/NetHackDS.arm9.elf] Error 1
make[1]: Leaving directory `/c/nethack-3.4.3'
make: *** [build/NetHackDS.arm9.elf] Error 2
Apparently this can only mean one thing....
I am too stupid to live!!!! :o/
#141078 - Quirky - Fri Sep 21, 2007 10:10 pm
Code: |
< set DEVKITARM and DEVKITPRO, extract source tar ball >
cd nethack-3.4.3
cd sys/unix
sh setup.sh
cd -
make
< error - missing curses.h>
sudo apt-get install ncurses-dev
make
< error in termcap.c, tparm redefined >
vi include/unixconf.h
< make sure #define LINUX is not commented >
make
<done!>
make -f sys/nds/Makefile
<done! except for an error that dat/nhdat didn't exist>
|
There, what was so hard about that? ;-)
#141088 - wintermute - Fri Sep 21, 2007 11:55 pm
#141089 - Opus - Fri Sep 21, 2007 11:58 pm
Darn it Quirky, you're making this look too easy!
I deserve to be shot just on general principle! :o/
So here's what I typed using MINGW32 while trying to follow what I think that you did in your last post.
Code: |
Paige@KRISTIN ~
$ cd /c/nethack-3.4.3
Paige@KRISTIN /c/nethack-3.4.3
$ cd sys/unix
Paige@KRISTIN /c/nethack-3.4.3/sys/unix
$ sh setup.sh
Copying Makefiles.
Paige@KRISTIN /c/nethack-3.4.3/sys/unix
$ cd -
/c/nethack-3.4.3
Paige@KRISTIN /c/nethack-3.4.3
$ make
( cd src ; make )
make[1]: Entering directory `/c/nethack-3.4.3/src'
|
Everything is looking good until I get to the end.
Code: |
gcc -O -I../include -c -o zap.o zap.c
gcc -O -I../include -c ../sys/share/ioctl.c
../sys/share/ioctl.c:50:62: termio.h: No such file or directory
../sys/share/ioctl.c: In function `getioctls':
../sys/share/ioctl.c:125: error: `TCGETA' undeclared (first use in this function)
../sys/share/ioctl.c:125: error: (Each undeclared identifier is reported only once
../sys/share/ioctl.c:125: error: for each function it appears in.)
../sys/share/ioctl.c: In function `setioctls':
../sys/share/ioctl.c:147: error: `TCSETAW' undeclared (first use in this function)
../sys/share/ioctl.c: At top level:
../sys/share/ioctl.c:54: error: storage size of `termio' isn't known
make[1]: *** [ioctl.o] Error 1
make[1]: Leaving directory `/c/nethack-3.4.3/src'
make: *** [nethack] Error 2
|
From there I continue to go on and type out this junk
Code: |
Paige@KRISTIN /c/nethack-3.4.3
$ make -f sys/nds/Makefile
make -f sys/nds/Makefile.arm7 all
|
Everything seems to be going real nice, but at the very end I get these errors of unhappiness
Code: |
make[1]: *** [build/version.o] Error 1
make[1]: Leaving directory `/c/nethack-3.4.3'
make: *** [build/NetHackDS.arm9.elf] Error 2
|
Then the little bugger just squibs on me and takes me back to the command prompt.
Help learn me English and teach program for me to use!
This seriously is making me look more stupider with each successive post.
Can you help a brother out? There's must be something really simple that I'm missing.
#141091 - wintermute - Sat Sep 22, 2007 12:27 am
The simple thing you're probably missing is a linux box ...
Try this,
1. Delete the nethack folder and re-extract the archive. Using the linux build process on a windows machine has probably broken things beyond repair.
Read the file sys/winnt/install.nt
follow those instructions as best you can. See if that helps any
You don't look stupid at all, this sort of build process tends to be incredibly difficult. Personally I don't think the "build for host machine first" part of this should be at all necessary. The problem is the combination of an odd build system and a lazy porter. Not that I'm blaming him for being lazy - the build process doesn't make a lot of sense.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog
#141103 - Opus - Sat Sep 22, 2007 5:17 am
Permission to swear excessively?!!?!?
I'm about two steps away from having a nervous drunken rage meltdown just trying to compile this stupid bugger.
Thank God I actually pride myself on my innumerable mistakes otherwise depression would be setting in by now. :o)
So here's some things in the install.nt document that's really tripping me up.
Quote: |
It almost goes without saying that you should make sure that your tools are set up and running correctly. For the GCC Makefile, add <mingw>\bin to your path, where <mingw> is your MinGW root directory.)
|
To me this is written in Sputnik, I have no idea what this means.
Quote: |
Compiling.
Now that everything is set up, change your current directory to src. |
Should I be running msys at this stage and change the directory inside the msys program? This stupid bastardized document just says change the darn directory but it doesn't say what program to use or how to do that.
Lastly
Quote: |
For GCC: mingw32-make -f Makefile.gcc install |
Again should I be using msys, or choose RUN under the windows start menu, or should I be using something inside the MinGW folder that it told me to download earlier?
Well, I'm off to get drunk now and hopefully pass out in a tepid pool of my own filth. :o)
I'll check back tomorrow to see if I get any responses or find myself banned from ever posting at this site again.
Cheers.
#141138 - mml - Sat Sep 22, 2007 2:08 pm
Can't help directly; I'm not on Windows myself. But maybe I can help you find the information yourself...
Opus wrote: |
Quote: | It almost goes without saying that you should make sure that your tools are set up and running correctly. For the GCC Makefile, add <mingw>\bin to your path, where <mingw> is your MinGW root directory.)
|
To me this is written in Sputnik, I have no idea what this means.
|
This bit means to add the path to the mingw "bin" folder to your PATH environment variable. The PATH environment variable is how Windows finds programs when you invoke them by name only -- it searches for the program in the directories that are listed in your PATH variable. There should be plenty of information about how to set this on the web, try googling for something like {set windows path "environment variable"}.
Quote: |
Quote: | Compiling.
Now that everything is set up, change your current directory to src. |
Should I be running msys at this stage and change the directory inside the msys program? This stupid bastardized document just says change the darn directory but it doesn't say what program to use or how to do that. |
These steps all appear to be assuming you are inside a command prompt. I don't know if msys provides one of these, or if they expect you to be in cmd (start->run->"cmd"). In any case, the command you're looking for is something like "cd \path\to\nethack\stuff\src". You've used this a few times in previous posts - the "cd" command changes the current directory to the argument you give it.
Quote: |
Lastly
Quote: | For GCC: mingw32-make -f Makefile.gcc install |
Again should I be using msys, or choose RUN under the windows start menu, or should I be using something inside the MinGW folder that it told me to download earlier? |
Again, sounds like you need to be at a command prompt. Start->run->"cmd", or start up the msys command prompt if such a thing exists, then use cd to navigate to the directory where you've extracted the nethack stuff, and finally run the mingw32-make... command as listed in the instructions.
Hope this helps
#141141 - wintermute - Sat Sep 22, 2007 2:37 pm
It's probably worth noting that mingw32-make should be run from a DOS shell ( start->run->cmd ) rather than the bash shell provided with MSYS. Furthermore this tool has problems when MSYS is installed and in the system path as is the case with a standard devkitARM install.
The most productive approach here would be to rework the build process so that a native compile is not required in order to compile for the DS. Right now I don't have sufficient time to investigate fully but, having said that, if someone does understand what's going on I might be able to offer guidance in achieving that objective.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog
#141159 - tepples - Sat Sep 22, 2007 7:32 pm
mml wrote: |
This bit means to add the path to the mingw "bin" folder to your PATH environment variable. The PATH environment variable is how Windows finds programs when you invoke them by name only -- it searches for the program in the directories that are listed in your PATH variable. There should be plenty of information about how to set this on the web, try googling for something like {set windows path "environment variable"}. |
It's possible to set the path using My Computer > Properties > Advanced > Environment Variables, but I don't especially recommend doing it this way for compilers such as MinGW and devkitARM. Instead, you can open Command Prompt (either under Start > [All] Programs > Command Prompt or under Start > [All] Programs > Accessories > Command Prompt) and do the following to set the PATH for one Command Prompt session only:
Code: |
set PATH=C:\mingw\bin;%PATH% |
wintermute wrote: |
The most productive approach here would be to rework the build process so that a native compile is not required in order to compile for the DS. |
Ideally, you shouldn't need to build the PC version of the game in order to build the DS version of the game. But does the build process require preprocessing of source files or binary files into other intermediate source files that are included in the project? Isn't a native compiler required for compiling the tools that do this preprocessing?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#141222 - Opus - Sun Sep 23, 2007 8:42 am
Okay, let's find out what I'm still doing wrong on this. Sound like fun? :o)
So I first double click on the nhsetup under c:\nethack-3.4.3\sys\winnt and get this screen
[Images not permitted - Click here to view it]
I follow Tepples instructions and find myself with this screen
[Images not permitted - Click here to view it]
I now have a shiny new build of Nethack for Windows XP that plays perfectly and features a new character and color for boulders so they stand out more clearly.
I try to build for the DS immediately after it's done compiling for the computer but I get this screen
[Images not permitted - Click here to view it]
So I close the COMMAND PROMPT and then go back to the COMMAND PROMPT and I'm treated with this screen
[Images not permitted - Click here to view it]
I'm now back to the same original problem with the tile.c error
Dear Lord, why must I have been born with such a debilitating mental disorder?!?!?!
I just don't get it.
And no, I'm not talking about my sex life, that's a whole other deficient issue for me. :o)
Am I compiling for the wrong system? Should I choose to compile for Linux instead since it was so easy for Quirky?
Thanks a bunch for putting up with me on this guys. I seriously appreciate your level of patience towards me. :o)
#141292 - Quirky - Sun Sep 23, 2007 9:13 pm
Might be able to help you properly now. After compiling on Linux, there are some more files in src. Looks like monstrc, vis_tab.c and tile.c are generated during compilation. I've stuck them up on here (non clickable since I don't want "lazy clickers" using up the limited bandwidth - just add http and remove the space!) See how you get on... ideally they should exist on the Win build too though.
quirkysoft.netfirms.com/ nethack-gen.zip
#141324 - Opus - Mon Sep 24, 2007 2:40 am
Thanks for the compiled files Quirky.
It managed to crunch everything much longer this time around and even built a rom of the project but I still ended with this screen.
[Images not permitted - Click here to view it]
It also turns out that it won't run on my DS either, stating that it couldn't find the keyboard graphics and some other whiny junk.
So here's the thing. On Stuart's webpage he states that it's been tested for Win32 and Linnux. This whole time I've been following the advice that wintermute gave me which was to read the sys/winnt/install.nt document and follow the directions from there.
I think that's what has been tripping me up.
So I guess I'll take some time and try to figure out how to build starting from the nethack-3.4.3\win\win32 folder instead of the winnt folder and see if that gets many anywhere. Hopefully that will put me on the right track.
As for right now, I feel like my brain is beginning to leak so I'll probably give it another shot in a day or two.
Cheers. :o)
#141369 - Quirky - Mon Sep 24, 2007 7:26 pm
Aha! To build the nhdat file you have to do
That builds the nhdat file, at least it does here in Linuxland. It appears that "all" is not the default target (this could explain the missing c files at your end too).
#141390 - Opus - Mon Sep 24, 2007 10:20 pm
Way to go Quirky!
Now all you need to do is better explain what you just stated so a retard gorilla like myself can understand. :o)
I'm still using the command prompts like Tepples suggested.
So this is my typical routine:
Double click nhdat from c:\nethack-3.4.3\sys\winnt
Then in the command prompt it's:
Code: |
set PATH=C:\MinGW\bin;C:\MinGW\bin
cd c:\nethack-3.4.3\src
mingw32-make -f Makefile.gcc install
|
So at what stage am I typing make all and in what folder at the command prompt should I be in at that time?
For the first time, I'm having feelings of hope that I can finally do this. Joy!
Cheers. :o)
#141453 - Opus - Tue Sep 25, 2007 7:55 pm
Don't leave me hanging dude!
I searched the internet for several hours trying to figure out how simple is was for you to compile like you did, but I just ended up more confused than ever.
One last post to help me out?
If not, could you at least let me download the nhsetup file that you were able to create?
Thanks. :o)
#141537 - Quirky - Wed Sep 26, 2007 7:09 pm
I did "make all" in the top level directory. This required bison and flex as well (the GNU parser/lexer tools). Now on windows, I'm not sure if it works the same.
Quote: |
Double click nhdat from c:\nethack-3.4.3\sys\winnt |
nhdat is a file that is created in the nethack-3.4.3/dat/ directory. Do you mean double clikc nhsetup.bat? What does that do? Seems like it copies the makefiles to the specific dirs to build for Windows.
Then I gues you open a shell and cd to c:\nethack-3.4.3 - here is where I did the "make all" thing. However, looking at Makefile.gcc, it seems that "all" is an alias for "install", which you already did. In fact, "install" should create the missing nhdat file for you (according to the Makefile at least :-/ ) It's looking a bit bleak...
Of course, I still haven't tried out the compiled nethack.nds here - it might not even work!
#143381 - Opus - Sat Oct 20, 2007 4:52 pm
Sorry for such the long delay in responding to the last post Quirky, I just really needed to step away from this for awhile due to all of the frustration it was giving me.
I finally was able to compile on my own, but it will only compile the graphic tileset instead of the ASCII tiles which is my preference.
All I would like is to have boulders displayed as a red capital letter "O".
The default is a gray "," which is so difficult for me to see since my eyesight is not all too good.
Is there anyone that is smart enough to figure this out?
I'd even be happy if someone could just edit or give me a link on how to edit the text_c.bin file and change the "," graphic with a filled in letter "O" if that makes any sense.
I thought I would ask one last time to see if I could get any help on this, if not, I'll just let this topic die out.
Thanks. :o)
#144327 - theli - Wed Oct 31, 2007 5:06 pm
Opus wrote: |
Is there anyone that is smart enough to figure this out?
I'd even be happy if someone could just edit or give me a link on how to edit the text_c.bin file and change the "," graphic with a filled in letter "O" if that makes any sense.
I thought I would ask one last time to see if I could get any help on this, if not, I'll just let this topic die out.
Thanks. :o) |
why won't you just use something like this
http://www.olywa.net/cook/pictures/tiles20x10.bmp
?
edit it to your liking :)
or find some other tileset you like