Author Topic: masm2c seems to work better and better  (Read 1073 times)

llm

  • Otto's Student
  • **
  • Posts: 376
    • View Profile
masm2c seems to work better and better
« on: February 12, 2022, 08:47:51 AM »
https://github.com/xor2003/masm2c/issues/10#issuecomment-1037026893

Quote
For example I already ported Test drive 3...

Ryoma

  • Corkscrew Cad
  • ***
  • Posts: 1084
    • View Profile
Re: masm2c seems to work better and better
« Reply #1 on: February 12, 2022, 09:36:32 AM »
Build more than 100 cars in the past but people prefers Skoda Felicia Kompressor.......

Daniel3D

  • Highway Horror
  • ****
  • Posts: 1431
  • so many ideas....
    • View Profile
    • Stunts resources.
Re: masm2c seems to work better and better
« Reply #2 on: February 12, 2022, 09:51:00 AM »
https://github.com/xor2003/masm2c/issues/10#issuecomment-1037026893

Quote
For example I already ported Test drive 3...
llm, could you do it for stunts?
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 or 4D Sports Driving.

llm

  • Otto's Student
  • **
  • Posts: 376
    • View Profile
Re: masm2c seems to work better and better
« Reply #3 on: February 12, 2022, 05:12:47 PM »
https://github.com/xor2003/masm2c/issues/10#issuecomment-1037026893

Quote
For 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

  • Highway Horror
  • ****
  • Posts: 1431
  • so many ideas....
    • View Profile
    • Stunts resources.
Re: masm2c seems to work better and better
« Reply #4 on: February 12, 2022, 05:58:38 PM »
https://github.com/xor2003/masm2c/issues/10#issuecomment-1037026893

Quote
For 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 or 4D Sports Driving.

alanrotoi

  • Makes love with Stunts
  • ******
  • Posts: 4782
  • Suck my Indy!
    • View Profile
    • Maite Zaitut, La Vengadora Oscura
Re: masm2c seems to work better and better
« Reply #5 on: February 13, 2022, 12:19:01 AM »
https://github.com/xor2003/masm2c/issues/10#issuecomment-1037026893

Quote
For 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

  • Otto's Student
  • **
  • Posts: 376
    • View Profile
Re: masm2c seems to work better and better
« Reply #6 on: February 14, 2022, 12:27:22 PM »
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

  • Otto's Student
  • **
  • Posts: 376
    • View Profile
Re: masm2c seems to work better and better
« Reply #7 on: February 19, 2022, 07:24:33 AM »
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 :)

« Last Edit: February 19, 2022, 07:32:29 AM by llm »

Daniel3D

  • Highway Horror
  • ****
  • Posts: 1431
  • so many ideas....
    • View Profile
    • Stunts resources.
Re: masm2c seems to work better and better
« Reply #8 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?
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 or 4D Sports Driving.

llm

  • Otto's Student
  • **
  • Posts: 376
    • View Profile
Re: masm2c seems to work better and better
« Reply #9 on: February 19, 2022, 12:39:46 PM »
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

  • Highway Horror
  • ****
  • Posts: 1431
  • so many ideas....
    • View Profile
    • Stunts resources.
Re: masm2c seems to work better and better
« Reply #10 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.
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 or 4D Sports Driving.

llm

  • Otto's Student
  • **
  • Posts: 376
    • View Profile
Re: masm2c seems to work better and better
« Reply #11 on: February 19, 2022, 02:10:01 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

  • Highway Horror
  • ****
  • Posts: 1431
  • so many ideas....
    • View Profile
    • Stunts resources.
Re: masm2c seems to work better and better
« Reply #12 on: February 19, 2022, 02:22:36 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 or 4D Sports Driving.

llm

  • Otto's Student
  • **
  • Posts: 376
    • View Profile
Re: masm2c seems to work better and better
« Reply #13 on: February 21, 2022, 05:39:28 PM »
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)

« Last Edit: February 21, 2022, 05:41:24 PM by llm »

xor2003

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: masm2c seems to work better and better
« Reply #14 on: February 21, 2022, 05:53:59 PM »
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.
« Last Edit: February 21, 2022, 05:57:28 PM by xor2003 »