GithubHelp home page GithubHelp logo

Comments (17)

viti95 avatar viti95 commented on June 7, 2024 1

Well I've discovered another big problem while converting all the code to DJGPP. The sound library (Apogee Sound System) uses two libraries prebuilt external libraries (PAWE32.LIB and GF1_OSF.LIB), but those can't be converted to COFF format as they aren't built for a flat model (O2C only supports flat code). So for now it's impossible to convert all the code, we need a new sound library that supports DJGPP.

from fastdoom.

maximilien-noal avatar maximilien-noal commented on June 7, 2024

I'm still on my sound problem before considering looking into what's described above.
But still, every FPS counts when DOOM runs inside DOSBox compiled for WASM (JS-DOS).

from fastdoom.

viti95 avatar viti95 commented on June 7, 2024

I think Visual C is only able to generate 16-bit executables, DOOM requires 32 bit support (DOS extender). Porting to other compilers is not that easy, but i'll try to update the builds with new versions of OpenWatcom, and see if that way is faster. I was also considering port the whole code to GCC, but as you said, there is a lot of ASM code that has to be ported (GCC doesn't support Borland TASM objs).

Anyway thanks for posting this information, any new ideas are always welcome!

from fastdoom.

RamonUnch avatar RamonUnch commented on June 7, 2024

If the only problem for switching to gcc is Tasm assembly then there are converters around here. such as a somewhat old perl script:
http://www.devoresoftware.com/nomyso/
Tasm -> nasm
I have never tried them for myself though.

from fastdoom.

maximilien-noal avatar maximilien-noal commented on June 7, 2024

Can GCC compile for a DOS 32 bit app ?

from fastdoom.

RamonUnch avatar RamonUnch commented on June 7, 2024

Yes but not exactly GCC but DJGPP that is a GCC for MsDOS and is 32bit only.
It uses CWSDPMI instead of the DOS/4GW extender.

from fastdoom.

RamonUnch avatar RamonUnch commented on June 7, 2024

Someone managed to build the original Doom using DJGPP:
https://virtuallyfun.com/wordpress/2017/07/29/null-doom-gcc-1-39-go32-dpmi/

from fastdoom.

viti95 avatar viti95 commented on June 7, 2024

Someone managed to build the original Doom using DJGPP:
https://virtuallyfun.com/wordpress/2017/07/29/null-doom-gcc-1-39-go32-dpmi/

This is really interesting, i will analyze that port and see how did they port it. I'm really curious how did they port the sound library.

If the only problem for switching to gcc is Tasm assembly then there are converters around here. such as a somewhat old perl script:
http://www.devoresoftware.com/nomyso/
Tasm -> nasm
I have never tried them for myself though.

I tested that script trying to convert the code but it was generating errors due to the self-modifying code that it's used in the R_DrawColumn functions.

from fastdoom.

RamonUnch avatar RamonUnch commented on June 7, 2024

I was thinking about another solution:
Use GCC to generate assembly language from the .c files or at least some critical c routines.
link them all with Watcom.
Someone was doing this with Yasm (that supports GAS syntax) but wanted to generate 16bit code that Yasm cannot do. in Doom this should not be an issue. and it should work.
https://stackoverflow.com/questions/30191000/how-do-i-assemble-gas-assembly-and-link-it-with-the-open-watcom-c-library
EDIT: Also Yasm claims to have partial TASM support...

from fastdoom.

RamonUnch avatar RamonUnch commented on June 7, 2024

Actually when reading OpenWatcom changelog it seems they support COFF so it means that DJGPP object files could be linked with Watcom? I probably misunderstood something, it seems too nice to be true.

from fastdoom.

RamonUnch avatar RamonUnch commented on June 7, 2024

I build FastDoom using Open Watcom 2.0 and there is no speed differences compared to version 1.9
Is there any reason you use only one pass for tasm in your makefile?
Do you use any other flags than those in the makefile? I still have a very slightly slower build after removing /d2 flag, compared to the release 0.7. I am testing under DOSBox.

from fastdoom.

viti95 avatar viti95 commented on June 7, 2024

For FastDoom 0.7 I'm using Open Watcom 2.0, there is no difference in performance. The /d2 flag is used to generate .obj files that can be disassembled better (IDA Pro) so I can see where the compiler makes better code or not. The extra debugging information is later discarded so it doesn't make the executable bigger.

I'll check the YASM assembler, if it can build correctly the self-modifying code it will be awesome. My idea is to use the latest version of DJGPP (GCC 10) and YASM (or other assembler) for the TASM code.

EDIT:

Tested YASM and it doesn't compile none of the assembly TASM files 😭

from fastdoom.

RamonUnch avatar RamonUnch commented on June 7, 2024

I think you could then compile the asm with tasm and then convert the OMF32 generated .obj files in COFF32 .o files using objconv. (I had to build objconv for my Win32 but it is easy and you should be able to build it using djgpp under DOS).
I tried to do the opposite: compile with gcc then convert COFF32 to OMF32 ant link with watcom, however the name mangling is different, gcc puts underscore prefixes and wcc puts suffixes, It should not be hard to convert but I had no time yet.
Converting obj files like this should work but you have to be careful that about the calling convention matches.

from fastdoom.

viti95 avatar viti95 commented on June 7, 2024

I've found a way to convert the OMF objects to COFF without problem. There is a converter called Object to Coff (O2C) that supports the TASM created objects and converts them. I've created a new branch (djgpp), with all the ASM files converted to the new format. The idea is to convert the project to DJGPP (GCC 10), as i've checked that it generates much much better code than the old OpenWatcom.

from fastdoom.

RamonUnch avatar RamonUnch commented on June 7, 2024

I think Boom used Allegro.
https://liballeg.org/old.html
For you only the sound library would be useful for you.
Allegro can be compiled with both Watcom and djgpp.
Latest DOS version seems to be 4.2.3.1 (2009)
I also found this Git to get started: https://github.com/msikma/allegro-dos-example
EDIT: the GIT contains almost nothing...
Doc: for Allegro 4: http://www.glost.eclipse.co.uk/gfoot/vivace/

Maybe you could first compile FastDoom without sound support with djgpp, then add back sound support with Allegro.
This way if djgpp migration ends up being a dead-end you will not have lost so much time.

from fastdoom.

neozeed avatar neozeed commented on June 7, 2024

MSC would require something like PharLap TNT. I have a copy of 6 in the box. I gutted it to scan the manuals. MSC + TNT could totally be a thing.

from fastdoom.

neozeed avatar neozeed commented on June 7, 2024

Well I've discovered another big problem while converting all the code to DJGPP. The sound library (Apogee Sound System) uses two libraries prebuilt external libraries (PAWE32.LIB and GF1_OSF.LIB), but those can't be converted to COFF format as they aren't built for a flat model (O2C only supports flat code). So for now it's impossible to convert all the code, we need a new sound library that supports DJGPP.

PAWE32.LIB is for the AWE32. it can be omitted, just as GF1_OSF is for part of the Gravis Ultra Sound. I forget what exactly.

DMA is the thing that always tripped me up, but interrupt and IO is usually straight forward to port.

from fastdoom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.