News:

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

Main Menu

masm2c seems to work better and better

Started by llm, February 12, 2022, 08:47:51 AM

Previous topic - Next topic


Daniel3D

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 February 12, 2022, 09:51:00 AM
Quote from: llm on February 12, 2022, 08:47:51 AM
https://github.com/xor2003/masm2c/issues/10#issuecomment-1037026893

QuoteFor example I already ported Test drive 3...
llm, could you do it for stunts?

Im a fullblown system developer, i can do nearly everything :)
My biggest problem that i have nearly no free time for anything except writing small forum posts :(
i hope xor2003 will also test his converter on stunts (he already used the asm source for testing)

Daniel3D

Quote from: llm on February 12, 2022, 05:12:47 PM
Quote from: Daniel3D on February 12, 2022, 09:51:00 AM
Quote from: llm on February 12, 2022, 08:47:51 AM
https://github.com/xor2003/masm2c/issues/10#issuecomment-1037026893

QuoteFor example I already ported Test drive 3...
llm, could you do it for stunts?
Im a fullblown system developer, i can do nearly everything :)
I know. That's why I asked 😂
But it seems that everyone who is even slightly capable is very busy.
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)

alanrotoi

Quote from: llm on February 12, 2022, 05:12:47 PM
Quote from: Daniel3D on February 12, 2022, 09:51:00 AM
Quote from: llm on February 12, 2022, 08:47:51 AM
https://github.com/xor2003/masm2c/issues/10#issuecomment-1037026893

QuoteFor example I already ported Test drive 3...
llm, could you do it for stunts?

Im a fullblown system developer, i can do nearly everything :)
My biggest problem that i have nearly no free time for anything except writing small forum posts :(
i hope xor2003 will also test his converter on stunts (he already used the asm source for testing)

Maybe if we make a paypal donation ::) ::) ::) Kidding  ;D

llm

xor2003 is showing a small game and his Test Driver 3 Port:

https://www.youtube.com/watch?v=MzK9RVgeWGM

mas2c converts assembler or emulated code to assembler looking C code
that means the game still needs to be ported slowly - but that can be done under 64bit Windows/Linux in your prefered IDE/Editor

its runs partially on a special version of dosbox for hardware support etc. but nearly to no emulation

llm

#7
xor2003 ported restunts! that means its nearly (game/sound code 100% but still using hardware emulation for sound/input/drawing) pure asm-looking C code but running pure under Windows

https://github.com/xor2003/libdosbox/tree/masm2c/src/custom/src_restunts

there are two flavors of masm2c

1. run the game in dosbox emulation, trace the code and then creates a "port" on the fly based on this trace
pro: it will more or less work with any game thats not to evil programmed
con: NO symbols like names etc. - the resulting C code looks more or less like assembler with just number offsets

2. parse MASM assembler source code and create the "port"
pro: symbols from the asm code are preserved so variables/labels etc. got the same name as in original asm
con: the source needs to be MASM/UASM compatible - currently that is not 100% the case - im working on that

current port is a in-between of 1 and 2

i hope he releases later a demo of his work so real stunts-pros can give it a try :)


Daniel3D

Does that mean we can build a version of stunts that is free from the 640k memory constraint?
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 February 19, 2022, 11:15:20 AM
Does that mean we can build a version of stunts that is free from the 640k memory constraint?

no - the C code still fakes 16bit assembler behavior - so we are constraint the same way as were running under dos

but its not real 16bit code anymore - its just C code that looks like it

no ancient builds tools need, but a normal C/C++ compiler+debugger can be used, it runs nativly on windows/linux

that eases the porting alot

lets see how good the assembler-source will look

Daniel3D

If it can be freed from the memory constraints, then I think there are updates possible that are now unthinkable.
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 February 19, 2022, 01:34:57 PM
If it can be freed from the memory constraints, then I think there are updates possible that are now unthinkable.

Your question makes not really sense, the current code is 16bit so the code itself constraint it to 640k, this can be only removed by porting the 16bit asm over to C, there are only micro differences between 16bit or 32bit C, but 16bit asm is totaly different to 32bit asm, because you directly doing the memory oprations in asm and C hides that

masm2c just make it able to copy over the semantic of the game code by replicating the original behavior in asm like functions but then the game code runs in 32bit

So its more or less the first step to ease porting or adding code, but only a full C port will get rid of all constraints







Daniel3D

Quote from: llm on February 19, 2022, 02:10:01 PM
Quote from: Daniel3D on February 19, 2022, 01:34:57 PM
If it can be freed from the memory constraints, then I think there are updates possible that are now unthinkable.

Your question makes not really sense,
That's probably because of my poor understanding of it.. but thank you for answering like you did.
Quote
So its more or less the first step to ease porting or adding code, but only a full C port will get rid of all constraints
Can't wait. I have plans for the code that might give the game another 30 years.
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

#13
first demo: https://filetransfer.io/data-package/ejyAdiV6#link

copy the files into a folder with a clean stunts 1.1 installation

the complete game-code (3d engine, sound) is running in 32/64bit (based on this very asm-looking C code that gets generated by masm2c)

only the sound/gfx hardware stuff is emulated by libdosbox (special fork of dosbox for masm2c)


xor2003

#14
Converted source code is here https://github.com/xor2003/libdosbox/tree/masm2c/src/custom/src_restunts

Yes, you can modify converted source code and it will be able to use more memory.
By default data is inside 640k memory structure but you can create new data outside. The asm-like code does not care there the data is located.