#78030 - sofakng - Tue Apr 04, 2006 6:49 pm
I'm very interested in porting Nethack to the DS but this thing looks MASSIVE and incredibly hard to port.
If nobody is trying to port it, can anybody give me and tips on how to port it myself? (eg. where to start)
#78036 - Roc - Tue Apr 04, 2006 8:02 pm
Nothing productive to say other than it would be absolutely amazing to have a DS Nethack port =)
#78047 - headspin - Tue Apr 04, 2006 9:16 pm
Nethack was too much for the GBA from memory (pardon the pun). But I remember Rogue was ported to it, and then there is Powder. Some guy was porting Angband a while back. These are just a few Nethack type ports. Probably worth doing a bit of research into these port and perhaps contact the authors for some help.
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game
#78053 - josath - Tue Apr 04, 2006 10:16 pm
I ported Hack a while ago, but it requires DSLinux...
http://davr.drunkencoders.com/linux/#hack
I don't know if it still works on the latest dslinux.
#78054 - sofakng - Tue Apr 04, 2006 10:30 pm
Would you be able to give me some pointers on porting it over to native DS?
I'm a Delphi (eg. pascal) Database developer and should have sufficient programming knowledge to port it. I've already looked at the code and some of the C-specific code looks a bit confusing (FDECL, NDECL [what do they mean?]) but I shouldn't have a problem if I get some advice.. :)
#78215 - Wosret - Wed Apr 05, 2006 11:46 pm
I actually had the same idea and started working on porting Nethack to the DS just a few days ago. Here are some ideas that may be helpful to you. (Note: I'm nowhere close to finishing this project yet, so any of these could be completely wrong)
Since Nethack will refuse to run if it can't find certain files, the first thing to do is to write some functions that emulate standard file I/O functions by using chishm's FAT library. A good tip for writing those is to look at sys/wince/celib.c. It contains all the I/O functions that the FAT library does not support, rewritten to use Windows CE file I/O APIs (which is fairly easy to fix).
I finished those functions yesterday (you can see them here if you want) so now I'm working on the interface functions that are described in doc/window.doc. You cannot use a tiled background for the map because Nethack uses a total of 1037 tiles, and the DS only supports 1024. For this, use framebuffer mode or have it draw ASCII graphics.
Finally, about the *DECLs: (from include/tradstdc.h:114)
Quote: |
* NDECL() is used for functions with zero arguments;
* FDECL() is used for functions with a fixed number of arguments;
* VDECL() is used for functions with a variable number of arguments.
|
So far, I haven't needed to change these at all to get it to compile.
#78235 - tepples - Thu Apr 06, 2006 2:31 am
Wosret wrote: |
I'm working on the interface functions that are described in doc/window.doc. You cannot use a tiled background for the map because Nethack uses a total of 1037 tiles, and the DS only supports 1024. For this, use framebuffer mode or have it draw ASCII graphics. |
That or compromise: find the 13 tiles that are most similar to other tiles.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#78239 - sofakng - Thu Apr 06, 2006 2:46 am
How are you getting it to compile? Are you using anything from the sys or win directories? I was trying to start over from scratch (eg. not using anything from sys/share, sys/winnt, or /win/win32), but maybe thats not the right approach either.
Would you be willing to share your skeleton port code? (eg. the one that compiles at least)
To be honest, I really doubt I can port this thing but I'm still interested in trying. What you already have done in ds_io is a bit above my experience, but what the heck :)
#78246 - Wosret - Thu Apr 06, 2006 4:04 am
So far I haven't needed anything from the sys and win directories, except for copying fscanf, fprintf, and vfprintf from sys/wince/celib.c.
The instructions to get it to compile are a bit long, so I uploaded them to my website: Instructions
I also uploaded everything I have so far: Source (4MB)
Just so you know, it isn't the official release - when I started working on this, I used the patched version that I play. You can remove almost all of the patch code by commenting the #defines in section 5 of config.h.
If it dies when you try to compile, try moving or deleting src/ds_win.c and src/ds_gfx.c - they weren't supposed to be in the .zip and it takes too long to upload it again.
#78257 - sofakng - Thu Apr 06, 2006 4:45 am
Excellent, thanks!
I'll take a look through the sourcecode to see what you have...
If I have any questions, would it be OK to e-mail you?
Oh... and what are you using to compile this?
#78338 - Wosret - Thu Apr 06, 2006 11:32 pm
I'm compiling it with DevKitPro r17, libnds-20060201, and the makefile from the combined template from nds-examples-20051019, all of which came from the latest DevKitPro Updater. If you have questions, feel free to email me at gbadev@stuartp.commixus.com