#32766 - mike260 - Mon Dec 27, 2004 3:58 pm
I wrote a metroid model-viewer over Christmas (I was pretty bored and my DS hasn't arrived yet), it was a fairly pointless exercise but it showed up a few things about the hardware.
If anyone wants a copy then PM me (I haven't got any webspace to host it); it would probably be useful to anyone writing an emulator since models are basically raw register write lists.
#32781 - Roamin - Mon Dec 27, 2004 9:12 pm
Thanx for the proggie , most models are viewable.
The e3 level crashed the program :(
Still .. nice to see people can work that fast during holidays
Keep it up!
_________________
Mario DS High Score:
Wanted : 316 and counting
#32799 - loading - Tue Dec 28, 2004 12:34 am
yes great job :)
#32848 - Roamin - Tue Dec 28, 2004 5:31 pm
here's 2 source to d/l gbgraph.rar for now , but a windows friendly version should be posted later on today or tomorrow.
http://s17.yousendit.com/d.aspx?id=1416R7FWO2BM505YS566M78FQ
http://www.auby.no/dill/dsgraph.rar
_________________
Mario DS High Score:
Wanted : 316 and counting
#32855 - Lupin - Tue Dec 28, 2004 7:58 pm
How did you extract the metroid model? I really would like to try it out =)
_________________
Team Pokeme
My blog and PM ASM tutorials
#32860 - Roamin - Tue Dec 28, 2004 8:41 pm
darkfader.net has the tool you need , ndstool.exe , but you will still need cygwin1.dll (i tried 4 versions before i got one that worked)
_________________
Mario DS High Score:
Wanted : 316 and counting
#32863 - abilyk - Tue Dec 28, 2004 9:38 pm
Roamin, could you link to the version of cygwin1.dll that worked for you? I've tried a couple myself to no avail.
#32865 - tepples - Tue Dec 28, 2004 9:44 pm
In order to use a program that depends on cygwin1.dll, you need Cygwin and the program's source code (to recompile it against your Cygwin installation).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#32866 - Seiru - Tue Dec 28, 2004 9:45 pm
http://img95.exs.cx/img95/6438/metroiddsmodels5zq.jpg
W00t. Sorry for the useless post, just excited that I finally got it to work... :-P
#32872 - SmileyDude - Tue Dec 28, 2004 10:10 pm
heh -- at this point, I would think that the Metroid demo cart image has to be one of the most analysed ROM dumps ever. Pretty neat stuff seeing the models extracted from there :D
_________________
dennis
#32911 - zazery - Wed Dec 29, 2004 4:44 am
I've tried this program and it works great. I think this is a really good step towards homebrew on the DS. Great job on the program it works perfectly, though I can't load the e3 level either.
#32916 - ravuya - Wed Dec 29, 2004 5:40 am
It built fine under Mac OS X with XCode, but I haven't been able to find a model to try it out with. I guess I may have to find a spare demo card and make a card dumper.
_________________
Rav (Win/Mac/Linux games for free)
#32936 - phantomdjp - Wed Dec 29, 2004 12:40 pm
#32946 - ras - Wed Dec 29, 2004 2:30 pm
anyone (perhaps ravuya?) who has XCode that can build it for me?
thanks
#32951 - SmileyDude - Wed Dec 29, 2004 5:13 pm
i was able to build it for Linux (Fedora Core 3) by making a few small changes to the source:
change #include "glut.h" to #include <GL/glut.h>
change main() to return an int, and add a return 0 to the end of the function.
compile with g++ -o dsgraph dsgraph.cpp -lGL -lglut
seems to work good, but I get a segmentation fault on some files (sorry, haven't made a list of which ones it does it on)
_________________
dennis
#32954 - dagamer34 - Wed Dec 29, 2004 5:28 pm
Texture filtering needed... :(
_________________
Little kids and Playstation 2's don't mix. :(
#32957 - tepples - Wed Dec 29, 2004 5:57 pm
Neither the PlayStation nor the Nintendo DS has texture filtering except possibly by jittering the texture coordinates frame-to-frame.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#32971 - Seiru - Wed Dec 29, 2004 7:01 pm
While most of the time when the program crashes it's because you loaded an animation or some other unsupported file, some of the files I'm at a loss for. Like metroid_Model.bin. Sounds simple enough, but the model viewer crashes....
#32985 - dagamer34 - Wed Dec 29, 2004 10:28 pm
tepples wrote: |
Neither the PlayStation nor the Nintendo DS has texture filtering except possibly by jittering the texture coordinates frame-to-frame. |
It just looks so "bleh" when you blow up the size of the models on a computer screen. Though scaled down and in motion, they look decent.
_________________
Little kids and Playstation 2's don't mix. :(
#32997 - mike260 - Thu Dec 30, 2004 12:04 am
dagamer34 wrote: |
tepples wrote: | Neither the PlayStation nor the Nintendo DS has texture filtering except possibly by jittering the texture coordinates frame-to-frame. |
It just looks so "bleh" when you blow up the size of the models on a computer screen. Though scaled down and in motion, they look decent. |
'F' toggles texture filtering. It's off by default because that's closer to what the DS does.
Other keys are 'W' for wireframe, 'C' for vertex-colours, 'T' for texturing and 'B' for backface-culling.
As regards the crashes, I was a bit drunk when I wrote it so it's no doubt quite buggy (although I've never had a crash myself with a *_model.bin file). It's not meant to be a fully-featured app, I wrote it more to explore and document the DS display-list and texture formats.
#33004 - abilyk - Thu Dec 30, 2004 1:06 am
I played with it a bit last night after recompiling ndstool to work with my Cygwin setup (thanks for the tip, Tepples). The program is great, Mike. I'm curious to see your documentation regarding the model formats. Do you plan to release it to the public anytime soon?
#33007 - mike260 - Thu Dec 30, 2004 1:38 am
abilyk wrote: |
I'm curious to see your documentation regarding the model formats. Do you plan to release it to the public anytime soon? |
There's no documentation, I meant that the source itself documents the texture/dlist formats a little. If you're *very* curious, the code to parse models lives at 0x0201BB48 in the metroid arm9 bin. Pretty dry stuff though.
#33015 - ravuya - Thu Dec 30, 2004 4:20 am
Trying to port this to Mac OS X, but there's so much endian crap I'm not sure if I'm up to the task.
_________________
Rav (Win/Mac/Linux games for free)
#33037 - SmileyDude - Thu Dec 30, 2004 9:03 am
Seiru wrote: |
While most of the time when the program crashes it's because you loaded an animation or some other unsupported file, some of the files I'm at a loss for. Like metroid_Model.bin. Sounds simple enough, but the model viewer crashes.... |
i just did a quick look at it with gdb under linux, and it seems to be crashing when it tries to create the window. Why for some files and not for others is what's confusing me. I see that the loading is being done before hand, but nothing appears to be off -- unless you're corrupting the stack somehow....
anyway, here is the output from gdb...
Code: |
(gdb) run metroid/data/models/metroid_Model.bin
Starting program: /home/dennis/dev/ds/utility/dsgraph metroid/data/models/metroid_Model.bin
[Thread debugging using libthread_db enabled]
[New Thread -151099712 (LWP 4665)]
Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread -151099712 (LWP 4665)]
0x006baa4c in _mesa_test_os_sse_exception_support () from /usr/X11R6/lib/modules/dri/r128_dri.so
(gdb) where
#0 0x006baa4c in _mesa_test_os_sse_exception_support () from /usr/X11R6/lib/modules/dri/r128_dri.so
#1 0x006ba93d in _mesa_init_all_x86_transform_asm () from /usr/X11R6/lib/modules/dri/r128_dri.so
#2 0x00634719 in _math_init () from /usr/X11R6/lib/modules/dri/r128_dri.so
#3 0x005b729e in _mesa_initialize_context () from /usr/X11R6/lib/modules/dri/r128_dri.so
#4 0x005b76c5 in _mesa_create_context () from /usr/X11R6/lib/modules/dri/r128_dri.so
#5 0x006c4cf8 in r128CreateContext () from /usr/X11R6/lib/modules/dri/r128_dri.so
#6 0x006c3a8e in driCreateNewContext () from /usr/X11R6/lib/modules/dri/r128_dri.so
#7 0x0015d642 in __indirect_glCompressedTexSubImage3D () from /usr/X11R6/lib/libGL.so.1
#8 0x0015da87 in glXCreateContext () from /usr/X11R6/lib/libGL.so.1
#9 0x00df8351 in fgOpenWindow () from /usr/lib/libglut.so.3
#10 0x00df6e85 in fgCreateWindow () from /usr/lib/libglut.so.3
#11 0x00df86df in glutCreateWindow () from /usr/lib/libglut.so.3
#12 0x0804a3f9 in main (argc=2, argv=0xfef00ba4) at dsgraph.cpp:658
(gdb) |
_________________
dennis
#33044 - netdroid9 - Thu Dec 30, 2004 10:09 am
SmileyDude wrote: |
I just did a quick look at it with gdb under linux, and it seems to be crashing when it tries to create the window. Why for some files and not for others is what's confusing me. |
The answer is probably simple: Either A) Some models are different formats, B) Some models are compressed, C) Only models of a certain size work in the viewer or D) Some models use a palette of some sort that the viewer can't handle.
#33055 - scknight - Thu Dec 30, 2004 2:49 pm
abilyk wrote: |
I played with it a bit last night after recompiling ndstool to work with my Cygwin setup (thanks for the tip, Tepples). The program is great, Mike. I'm curious to see your documentation regarding the model formats. Do you plan to release it to the public anytime soon? |
A much easier alternative to cygwin is MingW http://www.mingw.org/
It has gcc and all other tools but will compile real executables for windows no dependencies on cygwin dll's.
That's what I used to compile ndstool and I'm could give it to any windows user and it wouldn't need a cygwin dll. It's also a lot less to download than cygwin.
I just thought I'd throw that out there if some people are thinking they need to install cygwin, it might be easier to just install mingw.
#33060 - revo - Thu Dec 30, 2004 4:37 pm
scknight wrote: |
I just thought I'd throw that out there if some people are thinking they need to install cygwin, it might be easier to just install mingw. |
If someone wants to compile ndstool under VC++ .net 2003, change few things:
- remove #include <sys/types.h> and #include <sys/stat.h>
- add #include <direct.h>
- change mkdir(strbuf, S_IRWXU) to mkdir(strbuf)
- change mkdir(extractdir, S_IRWXU) to mkdir(extractdir)
and that's all ;)
// EDIT: Also works on Dev-Cpp (tried ver. 4.9.9.1)
// if there is error with MAX_PATH, just comment line #define MAX_PATH 2048
Last edited by revo on Sat Jan 01, 2005 10:52 am; edited 2 times in total
#33133 - windwakr - Fri Dec 31, 2004 2:07 am
How do I get the models? I have ndstool but what do i need to extract them from the game? Cables?
#33140 - TJ - Fri Dec 31, 2004 3:36 am
You need to extract it from the ROM.
#33193 - windwakr - Fri Dec 31, 2004 5:12 pm
using what?
#33199 - revo - Fri Dec 31, 2004 7:02 pm
windwakr wrote: |
using what? |
You need rom and ndstool. Then type:
ndstool.exe -x rom_name.nds output_directory
in command line or console, and you get all files - models are in models and levels subdirectories.
#33200 - windwakr - Fri Dec 31, 2004 7:19 pm
I geuss I wasnt saying the right words. How do I dump it?
#33201 - revo - Fri Dec 31, 2004 7:42 pm
windwakr wrote: |
I geuss I wasnt saying the right words. How do I dump it? |
I think you can't :P Only DarkFader (as far as I know) have dumped rom from DS. You can find some info here.
#33203 - windwakr - Fri Dec 31, 2004 8:01 pm
Is he giving it away or something? How does everyone have it?
#33204 - revo - Fri Dec 31, 2004 8:08 pm
[Removed by MOD: no warez talk. last warning]
#33205 - windwakr - Fri Dec 31, 2004 8:10 pm
[removed by MOD: Take your warez elsewhere. last warning]
#33233 - Mr. Ploppy - Fri Dec 31, 2004 11:32 pm
Seiru wrote: |
While most of the time when the program crashes it's because you loaded an animation or some other unsupported file, some of the files I'm at a loss for. Like metroid_Model.bin. Sounds simple enough, but the model viewer crashes.... |
Roamin wrote: |
The e3 level crashed the program :( |
That's strange, both of those models work for me. [Images not permitted - Click here to view it]
Perhaps it has to do with your Cygwin setup?
On another note, does anyone know what program is needed to compile the source? I wanted to make a few adjustments, but Cygwin is unfamiliar territory for me and I'm not sure how to turn my modified .cpp into an .exe
_________________
I'm just off to Hartleypool to buy some exploding trousers. Cluck, cluck, gibber, gibber, "my old man's a mushroom", et cetera.
#33252 - windwakr - Sat Jan 01, 2005 2:51 am
1 thing. I dont remember a war wasp in the demo but theres a model of it?
#33306 - ?b$$w?! - Sat Jan 01, 2005 8:26 pm
thats pretty sweet... im not gonna try to use this prog right now... because ill just wait untill there is better proggies cuz i dont like dos
#33307 - windwakr - Sat Jan 01, 2005 8:35 pm
another thing. I think I know why metroid_model.bin, mochtroid_model.bin, and e3Level_Model.bin dont work. They use transparancy!
#33310 - Seiru - Sat Jan 01, 2005 9:11 pm
Also, I believe the Samus models are being read wrong...only the gun shows up, and wireframe is very distorted....
#33311 - mike260 - Sat Jan 01, 2005 9:17 pm
Seiru wrote: |
Also, I believe the Samus models are being read wrong...only the gun shows up, and wireframe is very distorted.... |
That's because they're skinned, and I'm making no attempt to figure out the bone matrices. Skeletally animated models are drawn as if all the bones were positioned at the origin, which is why they look screwed up.
#33353 - AdamtehGreat - Sun Jan 02, 2005 6:05 am
[warez blah removed by MOD]
Really, I am astounded at the genius of you coders out there. Great work guys!