Disassembly "Adding New Assembly Language Code To Duke3D"
#1 Posted 13 November 2010 - 07:24 PM
From what I understand when Apogee first developed Duke3D they wrote it in what's called Assembly Language.
The 3 Con files that allow editing can only be edited in relation to what has already been written in Assembly code in the Duke3D.exe.
Case in point,Meaning that you cannot add new perimeters to the game unless you get a hold of a good Disassembler and know what your doing, then after adding new assembly code you get an Assembler to reassemble the whole thing over again.
Without attempting this most complex endeavor I'm speaking of, I tried some things in the Con files a while back,it isn't like the program wouldn't run it ran splendidly it's just that, that's as far as it would go period, run.Because the stock assembly language just didn't understand what in the hell this new line in there was trying to say.Believe it or not there seems to be some actually really good Free Disassembly/Assembly Programs on the net but from what I've seen, unless you've gone to MIT or something you really are going to have fun trying to figure out how to run these things.One time I read a tutorial on fixing a Wacom bug a lot of people where having in relation to using the drawing pad with PSP and Gimp, no problem with Photoshop though because, I'm just guessing here, that Wacom designed it's interface based off of Photoshop originally.Anyhow the author said,to get a hold of HxD in which I did,turn a few 1's to 0's and off you go and sure enough it did the trick.Now of course that would obviously be considered a simple fix by most in comparison.Disassembling and Reassembling a program is a new one to me,that's why I'm asking. I don't really know what Apogee used but if you can picture what the dashboard of a 747 looks like to a pilot,then that picture would come the closest in comparison to what I saw as far as a free Disassembler and free Assembler looks like.Besides the fact that there isn't really any HowTo programs available out there for operating these things.Again,Just Askin,
Thanks for reading
This post has been edited by Nukester10: 13 November 2010 - 07:45 PM
#2 Posted 13 November 2010 - 08:07 PM
#3 Posted 14 November 2010 - 08:14 AM
EDuke32 (and it's parent port JFDuke3D), with everyone that has worked on the chain, including Matt Saettler, Ken Silverman (original programmer on Duke's engine), JonoF, TerminX, Plagman, Hunter_rus, Helixhorned, Qbix, etc, has improved on this released source for 7 years, adding tons to the programming.
This post has been edited by Hendricks266: 14 November 2010 - 08:20 AM
#4 Posted 14 November 2010 - 02:49 PM
Hendricks266, on Nov 14 2010, 11:14 AM, said:
EDuke32 (and it's parent port JFDuke3D), with everyone that has worked on the chain, including Matt Saettler, Ken Silverman (original programmer on Duke's engine), JonoF, TerminX, Plagman, Hunter_rus, Helixhorned, Qbix, etc, has improved on this released source for 7 years, adding tons to the programming.
Not quite. Ken Silverman re-wrote the assembly portions to c. The source I've got, has assembly and c in it. The catch was that you needed Watcom to compile it.
EDuke32, is now so flexible that you can use any C compiler, including Visual Studio Express (free), you can use OpenGL and DirectX, you have one of the best sound engines in it, you have a setup and those guys like TerminX, Plagman and Helixhorned and more are still improving on it as we speak. Forget assembly
This post has been edited by Hank: 14 November 2010 - 02:52 PM
#5 Posted 14 November 2010 - 06:57 PM
Hank, on Nov 14 2010, 04:49 PM, said:
True, although the assembly code only affected the classic renderer, and IIRC is still used when EDuke32 is compiled for x86.
#6 Posted 14 November 2010 - 09:11 PM
then once I got to an IDE help file,I started reading that one.
Within one of the subdirectorys contained herein there was a how to called,"Getting Started With A Short Tutorial"
next,"A Simple Executable".
Under Simple Executable it wasn't quite so simple,I got up to step 4 and that was it,
(1)Double-click on the IDE icon in the Open Watcom Tools window.
The Open Watcom IDE Project window appears
(2) Choose New Project from the File menu.
The Enter Project Filename dialog appears. The default project name is noname.wpj
(3) Enter the filename \project\first in the File Name field and click on OK.
Figure 4. Enter the filename in the Enter Project Filename dialog.
This is the name of the project you are creating. If you enter a directory that doesn't exist (in this case, \project), the IDE reveals a message box asking if you want to create the specified directory. Click on OK to create the specified directory and project file.
Note:
The IDE looks for existing projects with the new name. If a project with the specified name already exists, the IDE will prompt youthe IDE will prompt you rather than simply overwriting the existing project.
The project name appears in the title bar of the Open Watcom IDE Project window. Note that the IDE added the extension ".wpj" to the project name. The New Target dialog appears on the screen where you define a target for the new project.
Yea,it wasn't quite that simple though,what happened was that box popped up alright but it didn't say,LOOK IN Project Folder,it said look in my documents like it was random or something,like the program really didn't know where to look in the first place.In the File name it said "noname"but that was normal though and I was supposed to change it to,
"\project\first" in which I did and click "OK"
.........Notice it doesn't say, OK up there
For "Files of type" it did say what it says up there,"Project Files(*.wpj)
Now that one up there is what the 2003 Enter project filename Gui looks like,
this is what mine looks like for XP
The only reason now it says,Look in: Wacom folder is because I changed it.
So anyways what what was supposed to happen after I hit the OK button.....or in this case OPEN and what actually did happen are two different
stories,notice it said what should happen and that the "IDE will prompt you"
Well,I can tell you for sure no prompt popped up at all so there was NO prompting.At the most all it would do is create a shortcut and/or either a file called,project or first,depending on how I typed it when I was debugging and once I found the folder or folders, it/they would be empty anyhow.
Besides starting to see typos if I even got the bugs out of this setup,i don't know..... maybe there'll be more probs later on down the road too,what do you think?.
That's why I'm thinking about using something a little newer like,Visual Studio Express (free) but I checked and this deal seems to kinda suck too because even though its free it's only free for 90 days!?
Like I said in an earlier post,this kind of thing is all new to me,
Thanks for reading
This post has been edited by Nukester10: 14 November 2010 - 09:22 PM
#7 Posted 14 November 2010 - 09:19 PM
Also a newer then the specific version of Watcom this was written in will be more work then you are doing now. Work that has already been done in other source ports.
This post has been edited by Omni: 14 November 2010 - 09:22 PM
#8 Posted 14 November 2010 - 09:59 PM
Quote
Well in order to do that you would have to get the program running in the first place wouldn't you think?
Quote
doing now
I don't know exactly what your talking about but this version I'm using does happen to be the current stable
version 1.9 and was released in June 2010.
#9 Posted 14 November 2010 - 10:50 PM
#10 Posted 15 November 2010 - 10:55 AM
If you are attempting to compile the original Duke3d source code and you have no programming experience or very little experience you would be better off with basic "Hello World" tutorials and progress from that point. If you are determined to learn by the Duke3d source you are better off doing that with Eduke32 or something in a more modern environment.
If you are absolutely determined to compile the original Duke3d source you will need Watcom 11 I think it is. This is the version from the mid 90's.
#11 Posted 15 November 2010 - 02:44 PM
#12 Posted 15 November 2010 - 03:25 PM
.
.
.
Captain Awesome, on Nov 15 2010, 03:44 PM, said:
0) Not entirely sure, but my understanding is that certain portions of the Duke source tree are held together by scotch. Lots of scotch.
1) We don't need no steeeenkin' comments! (EDIT: reference to the code, not CA)
2) All kidding aside, you are absolutely right. This would explain why Duke is always out of gum.
This post has been edited by Mr. Pink: 16 November 2010 - 09:46 PM
#13 Posted 16 November 2010 - 11:56 AM
This is a screebgrab taken of the Duke3D.exe within Notepad ++.
Notepad++ has many different language settings to chose from when viewing.
If you click on the Language tab right off as soon as you load the exe,it will highlight that what your looking at is not Assembly or any other language,it won't even tell you what language this is either,all that's ticked off is "normal text",if you wish to see what it looks like,click on another language but it won't look much different than it does here.
See,I had hoped that after viewing this in HxD originally that HxD could have also had shown this in C where it could have been edited more easily,but unfortunately that's not the way it seems to work. You'd figure by now that someone would
have come up with such a simplified program,rather than having to do the same old same old procedure of having to use a compiler to edit files like this.
Now heres a screengrab of the same Duke3D.exe within HxD
One slight difference between the two programs being,HxD calls this an RTS file,whereas Notepad++ calls this an exe file.
#14 Posted 16 November 2010 - 12:13 PM
You can also find the source code for EDuke32 there: http://eduke32.svn.sourceforge.net/viewvc/...eduke32/source/
#16 Posted 16 November 2010 - 01:31 PM
here and now and state that,"Yes HxD does actually show exe files also".
I would like to add though,that there's seems to be a lot of talk on HOW and WHERE to retrieve the original
Sourcecode for one to edit for oneself, but not really any posts by anyone on what they ended up with AFTER they compiled it and what compiler they actually used etc. etc. and for that matter not even any step by step details, how to's so to speak on the subject matter.
Now I'm not saying that it can't be done,all I'm doing is asking everyone if you know what you need to do it,
and you know how to do it.What did you come up with and could you enlighten me and everyone else with
that information after you did it?
#17 Posted 16 November 2010 - 01:41 PM
If you want to edit a binary program there are a few ways...
Easiest: If you have the source, adjust and compile it. THIS IS THE BEST/EASIEST WAY.
Hard: Decompiling a BINARY or machine language file. You will need alot of technical knowledge to do it this way properly.
The great thing about wanting to edit Duke3d is the source is available, you just want the version of Watcom they used 13 years ago...
I believe Watcom 10.0 or 11.0c work. Openwatcom may work if you can find a version old enough.
Edit: I worked on the post while doing other things and you posted before me. I am including a link to OpenWatcom. I suggest you get the duke3d source from 3drealms site under downloads and read the README.TXT in the zip.
Now getting it to compile is if I remember is tedious but straight forward if you know what your doing.
Now that I covered all that no one will hold your hand with this due to the fact no one messes with THIS VERSION of the source any more. If you want more help and a bigger community with a more in depth build process in the wiki then I suggest Eduke32. If this is still complicated you need beginner classes or Tutorials on the subject of programing.
ftp://ftp.openwatcom...m-win32-1.0.exe
This post has been edited by Omni: 16 November 2010 - 01:48 PM
#18 Posted 16 November 2010 - 04:36 PM
Nukester10, on Nov 16 2010, 04:31 PM, said:
and you know how to do it.What did you come up with and could you enlighten me and everyone else with
that information after you did it?
That's what I did. I contacted the original maker of the Build engine.
http://www.advsys.net/ken/build.htm
Than as Captain Awesome suggested, had a lot of scotch, actually Bourbon, went to the library and took every book about c. After a lot of coffee, I decided, c is not my language. - Ken Silverman himself suggest to use the farther developed source code written by JonoF http://www.jonof.id.au/jfduke3d . This will be the closest workable Build source code there is, for anyone to learn, because it's supported and activly developed, even so slowly.
Yet, I stand behind what I wrote also! Eduke32 is it, it's better, has more features, and has much more room for individuals to get into.
Added 9:00hr 17 Nov. 2010 after reading the below:
The above statement is based on my first approach to Build ten years ago and reading the current source code. I do not claim to be right, simply giving my opinion. In other words, if you need to know all the details on who did what and where and how on this code, and who is working on it – contact the current team. The Eduke team needs me like a hole in the head.
This post has been edited by Hank: 17 November 2010 - 06:26 AM
#19 Posted 16 November 2010 - 05:49 PM
#20 Posted 16 November 2010 - 06:54 PM
Nukester10, on Nov 16 2010, 01:31 PM, said:
Sourcecode for one to edit for oneself, but not really any posts by anyone on what they ended up with AFTER they compiled it and what compiler they actually used etc. etc. and for that matter not even any step by step details, how to's so to speak on the subject matter.
There's a text file that describes what to do with it inside the source archive, IIRC. Basically, it involves installing some outdated version of the Watcom C compiler and it should compile right. After compiling all the C and assembly code to machine code, it links it into a DOS DUKE3D.EXE binary that you can use just like the one on the Duke3D CD.
However, that's all very old stuff. From this original source code people have branched source ports that support modern operating systems and compilers. See:
http://wiki.eduke32....ke32_on_Windows
#21 Posted 16 November 2010 - 09:14 PM
sticking with a version of Dos so that I could run it through Dosbox. Also being able to add to the sourcecode,making the original code not necessarily better but bigger later on possibly. I don't want to have to download some 7 or 800MB program with better graphics and fancy map editors,call me Retro.
I'm really a big fan of the original look and sound of the original game,to me THAT'S DUKE NUKEM, one exception though
as far as modernization goes and that would be DUKE NUKEM FOREVER but that's a whole other story.
In case your wondering what features offhand I'm talking about I can only think of a very few at the moment.
Adding your own sound effects would be one.Placing one window over another would be nice also,
maybe even adding models to Dosbuild might be interesting,from what I understand you already can
do this with JFDuke but Dosbox doesn't support JFDuke so once again a dilemma stands.
This post has been edited by Nukester10: 16 November 2010 - 09:27 PM
#22 Posted 16 November 2010 - 09:21 PM
This post has been edited by Omni: 16 November 2010 - 09:24 PM
#23 Posted 16 November 2010 - 09:24 PM
@Omni; Aye, Retro is when you have a load of DOS machines lying around and run it on one of those, IMHO DosBOX does a poor job at emulating some of the features available in MS-DOS, for example, the AdLib. Ah, MS-DOS...
This post has been edited by High Treason: 16 November 2010 - 09:26 PM
#24 Posted 16 November 2010 - 09:27 PM
Edit: What he wants can already be done in Eduke32 with con code but he can not use Eduke32 because it does not run in dosbox.
This post has been edited by Omni: 16 November 2010 - 09:30 PM
#27 Posted 16 November 2010 - 09:38 PM
#28 Posted 16 November 2010 - 09:44 PM
This post has been edited by Omni: 16 November 2010 - 09:44 PM
#29 Posted 16 November 2010 - 09:45 PM
Quote
What i basically want is to have what looks and sounds like the original Dos game,yet
be able to have newer features and run it specifically through Dosbox only.
Tetsuo said,
Quote
I don't know what your talking about and yes I do want to use it.
#30 Posted 16 November 2010 - 09:46 PM
Hendricks266, on Nov 16 2010, 06:49 PM, said: