News:

Herr Otto Partz says you're all nothing but pipsqueaks!

Main Menu

Restunts repository - Git mirror

Started by dreadnaut, March 19, 2021, 12:00:36 AM

Previous topic - Next topic

dreadnaut

Quote from: Daniel3D on October 28, 2021, 07:29:52 PM
Especially because half the time I barely know what I'm doing and the other half I talk nonsense.

You'll need a BitBucket account then ;)

llm

Quote from: Daniel3D on October 28, 2021, 07:37:33 PM
Quote from: llm on October 28, 2021, 01:15:06 PM
just to make it clear: the exe_combiner tool was developed for one reason: for beeing able to disassemble the game code - its impossible without (no disassembler can disassemble runtime loaded code)
Lightbulb
For game.exe and the separate executables for the new mod 1.0.
Did you just use execombiner to create those?

1. Alle the to combine files need to get unpacked with dstiens unpacker
2. The exe_combiner creates based on the different files hrd,cod,... a exe variant
3. Manually unpacke the resulting exes with unp (get rid of exepack)
4. Patch the password check with a hex editor

Daniel3D

#32
Quote from: dreadnaut on October 28, 2021, 08:17:44 PM
Quote from: Daniel3D on October 28, 2021, 07:29:52 PM
Especially because half the time I barely know what I'm doing and the other half I talk nonsense.

You'll need a BitBucket account then ;)
I'll make one and send you a PM in a couple of hours. (Done)
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Daniel3D

#33
Quote from: llm on October 28, 2021, 08:36:24 PM
Quote from: Daniel3D on October 28, 2021, 07:37:33 PM
Quote from: llm on October 28, 2021, 01:15:06 PM
just to make it clear: the exe_combiner tool was developed for one reason: for beeing able to disassemble the game code - its impossible without (no disassembler can disassemble runtime loaded code)
Lightbulb
For game.exe and the separate executables for the new mod 1.0.
Did you just use execombiner to create those?

1. Alle the to combine files need to get unpacked with dstiens unpacker
2. The exe_combiner creates based on the different files hrd,cod,... a exe variant
3. Manually unpacke the resulting exes with unp (get rid of exepack)
4. Patch the password check with a hex editor
So if I understand correctly,
The makefile in the readme that is used to compile a stunts executable is aimed at research.
It adds debugging data and that is why it is so big.

I verified the contents (manually) and besides a difference in header (and a lot of stuff behind) the compiled version is exactly the same as the execombined version.
so thats a good thing.
But can somebody tell me how to make compile a clean version without debug data?
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

llm

#34
Quote from: Daniel3D on October 29, 2021, 11:05:12 AM
I verified the contents (manually) and besides a difference in header (and a lot of stuff behind) the compiled version is exactly the same as the execombined version.
so thats a good thing.

Quote from: Daniel3D on October 29, 2021, 11:05:12 AM
But can somebody tell me hou to make compile a clean version without debug data?

your are using this makefile with "make restunts-original" or "make asmorig"?

https://bitbucket.org/dreadnaut/restunts/src/master/src/restunts/makefile
the names with : behind are the target names that can be made - i think default is all

the top makefile uses then this one
https://bitbucket.org/dreadnaut/restunts/src/master/src/restunts/asmorig/makefile

this defines the assembler call
ASM = tasmbox /m2 /s /zi

http://bitsavers.informatik.uni-stuttgart.de/pdf/borland/turbo_assembler/Turbo_Assembler_Version_5_Users_Guide.pdf
Page 11, "Turbo Assembler command line"

/m2 --> /m# Allow # mUltiple passes to resolve forward references (be very time consuming) - nowerdays assembler doing that per default
/s  --> Source-code segment ordering (generate the code in the order in the file - not alphabetic) - keeps it very very near to the original
/zi --> Debug info: zi=ful

/zi is very relevant for your work - that means you can Debug the Assembler-Code on Source-Code-Level with the Turbo Debugger
(its part of the repo: https://bitbucket.org/dreadnaut/restunts/src/master/tools/bin/, but the very latest dos version can be found here: https://winworldpc.com/product/borland-c/5x)
its called TD.EXE or TD386.EXE

it should be possible to get rid of the Dosbox -> tasmbox.bat -> tasmx.exe call to a 16bit version of the assembler
tasm32.exe is 32/64bit able without dosbox, and the linker is also not needed to run under dosbox - only the debugger if someone want to debug under a x64 system
or should work from window if using a real 32bit system

latest tasm: https://winworldpc.com/product/turbo-assembler/5x

btw: "make clean" cleansup everything




Daniel3D

I will have to read that a couple of times   ;D
Thanks for the explanation. I'll be busy with this for a while.

But I used "make restunts-original".
What does make asmorig do?
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

llm

Quote from: Daniel3D on October 29, 2021, 12:32:09 PM
I will have to read that a couple of times   ;D
Thanks for the explanation. I'll be busy with this for a while.

But I used "make restunts-original".
What does make asmorig do?

asmorig only builds the pure assembler stuff
restunts-original seems to combine the original asm code with C based startup code (but all in-game routines are still original asm)


Daniel3D

I'll try that. It only takes about 10 minutes on my laptop.
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

llm

Quote from: Daniel3D on October 29, 2021, 07:13:05 PM
I'll try that. It only takes about 10 minutes on my laptop.

It would take some seconds using 32bit versions of the tools without dosbox

Daniel3D

I want to try that. I'll will see how far I can get.
But I will probably need some help setting up.
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Daniel3D

Quote from: llm on October 29, 2021, 06:16:43 PM
Quote from: Daniel3D on October 29, 2021, 12:32:09 PM
I will have to read that a couple of times   ;D
Thanks for the explanation. I'll be busy with this for a while.

But I used "make restunts-original".
What does make asmorig do?

asmorig only builds the pure assembler stuff
restunts-original seems to combine the original asm code with C based startup code (but all in-game routines are still original asm)
If I "make asmorig", then all i get are the obj filles.
To make a executable out if it i looked at the make file and with "make restunts-original" it calls an other makefile that starts linkbox
call tlinkbox /s /P- /v /js:\tools\lib\ @restunts.lnk
tried that in various way but always get the 808kb file.
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Daniel3D

#41
Quote from: llm on October 29, 2021, 11:41:21 AM
/zi --> Debug info: zi=ful
Got rid of that [and even changed it to zn]. Down to 300kb for the executable [both times]. so that certainly helps. Still, it is close but not the same as game exe.
the header is 386 bits larger (to start of the game code). But at the end of the game code it is 1040 bits smaller.
So somewhere in the code 1408 bits are missing. The file runs though. No errors.
Also still unwanted crap in the last 100.000 bits.
Quote
it should be possible to get rid of the Dosbox -> tasmbox.bat -> tasmx.exe call to a 16bit version of the assembler
tasm32.exe is 32/64bit able without dosbox, and the linker is also not needed to run under dosbox - only the debugger if someone want to debug under a x64 system
or should work from window if using a real 32bit system
I have a real 64bit system, and although I have NTVDM running and can run some 16bit programs, tlink is not one of them.
Tasm32 however works super. that safes a lot of time.

EDIT ___
I analysed the compiled exe and compared it with game.exe.
Besides about 100kb at the end that is not needed the file is clean.
in game exe there is some code in near the end that is not in the compiled one.
Bits 187008 > 188423..  ???
so am I comparing the result against the wrong file?
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Daniel3D

Its, 1:30 AM, i'm getting a bit tired  8)

But I made progress.
I cleared all debugging parameters out of TASM and TLink. and now i have a clean compiled executable.

It is not perfect.
the bits I talked about in the previous post.
QuoteEDIT ___
in game exe there is some code in near the end that is not in the compiled one.
Bits 187008 > 188423..  ???
so am I comparing the result against the wrong file?
That i have located the bits in my new file. But not inside the game part but at the end of the file ...
So, maybe one segment is in the wrong location or someting...

its for an other day though.
i need sleep...
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Cas

Like Daniël, I managed to compile all OBJ files out of the ASM files in the asmorig directory; however, I'm not certain on the best way to link this. I am trying to do the whole thing inside a single DOSBox, like I would do it in pure DOS, since outside, I have a GNU/Linux OS.

So is there no entry point in any of the ASM files in asmorig?  In other words, can I not just link from the ASM and get a running executable?  I understand from this thread that the resulting binary, if I did that, would not work because it would still be needing to be combined with the graphics. Am I right?
Earth is my country. Science is my religion.

Daniel3D

No, it is combined with graphics.
Restunts is based on the mcga version of stunts 1.1.
And only that version.

Changes to the code will only be available for those users. CGA, EGA, Tandy and Hercules graphics are not supported.
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)