Porting Voxlap

Miscellaneous projects by the Build and Shoot community.
222 posts Page 3 of 15 First unread post
Sonarpulse
Coder
Coder
Posts: 443
Joined: Thu Dec 13, 2012 7:18 pm


Thanks for giving it a shot. Ah, I had that builtin_unreachable error before I think. It's some obtuse preprocessor thing. I'll post when I figure it out. What is your gcc version btw? IIRC, you have Debian, and this is a pretty new feature. I have 4.7.1 on Linux, but I think something a bit older with mingw.

Yeah the align definitions are not where they usually are, but where MSVC expects them. However I wasn't getting any warnings since I chainged align to aligned. If they are getting ignored, this could explain why nothing renders so I'll be sure to take another look at that.

Also, while master now has a good enough make file. It probably won't build with gcc due to linking errors even in the best of cases. I have now rebased no_asm on the new master (they are only 28 commits apart. Yeah!). I'll push it to github in a few minutes.

Lastly, Remeber that the assembly will only work in a 32 bit build, and I have yet to try to compile it on a 64 bit computer.
Cajun Style
Deuced Up
Posts: 145
Joined: Fri Dec 07, 2012 11:04 am


Indeed gcc-4.4, while __builtin_unreachable was introduced in 4.5. (But why does it infer it from assume(0) then?) No backport for gcc either...
As I don't know assembly, I wondered whether it would be OK to prune all unused variables. There's quite a few. Almost looks intentional.
Sonarpulse
Coder
Coder
Posts: 443
Joined: Thu Dec 13, 2012 7:18 pm


Yeah, I'm not sure why there are so many, so I'd just leave them for now. There is more important things to work on with this too. Eventually once we have a basic port, I might fork no_asm to make more substantial changes, and i would certainly get them then.

So is my built-in-unreachable definition not making it a a no-op for <gcc 4.5? I should fix that. If you get on IRC, I can help you with errors in real-time.

EDIT: no_asm and master both have their improved histories up on github. Master should have normal development, but many plan is to constantly rebase no_asm on it, as if no_asm was a mercurial queue, so expect some force updates there. If everybody who collaborates also updates their master and rebases their no_asm before commiting, this shouldn't cause any issues.
Cajun Style
Deuced Up
Posts: 145
Joined: Fri Dec 07, 2012 11:04 am


There is gcc_unreachable. AFAIK its purpose is actually for internal development, but might be a good fall-back for gcc < 4.5.
Windows box with MinGW gcc 4.7.2 gives "impossible constraint in 'asm'" in some assembly.
Here is something that seems relevant, but I can't understand: http://stackoverflow.com/questions/1478 ... int-in-asm
I tried copying all MASM asm and then using the prescribed way to make gcc accept it. Then it complains about redefined symbols in the assembly (which apparently is clumped together in one big intermediary before compilation), and it complains that some labels(?) aren't instructions. I assume you have already seen those problems and were writing around it. Without knowledge of assembly there is little I can do, or is there?
BTW is your IRC name SonarPulse? Mine is CajunSyle [sic].
Pruning unused variables is one of the things I know how to do ^_^;
Sonarpulse
Coder
Coder
Posts: 443
Joined: Thu Dec 13, 2012 7:18 pm


Well actually I meant just forget about "unreachable" altogether, you can see I have two definitions of it in porthacks.h. I will look into gcc_unreachable though. No reason to lock older versions out of as good performance if we can avoid that.

The "impossible constraint" is probably due to movps and it's "friends" if you are trying to compile master. gcc doesn't really like the SIMD x86 there.

The StackOverflow post is about gcc extended inline assembly syntax. basically instead of hard coding register names, you can use alias which are resolved compile time. The top row is outputs, the second row is inputs, and the bottom row is register names you hard-code in, so the compiler knows that it can't keep values in them needed for other stuff.

on #aos.development I go by Ericson2314 like my github. In general I use both.
Sonarpulse
Coder
Coder
Posts: 443
Joined: Thu Dec 13, 2012 7:18 pm


Guys, it's working.

The last couple days I have really tried hard to clean up the history, stick some of the most common inlined inline asm functions in a header, and it now renders. Mouse is a bit weird, and it crashes like crazy, but things are fundamentally working. The crashes are probably because I don't have my C quite right, so it should be easy to fix. Also now that I know which function was the "last straw" I can probably just fix it's gcc inline assembly. I'm on windows right now, so it should be easy to compare and contrast and fix things that way too.

Edit: This is the header with the inline asm snippits: https://github.com/Ericson2314/Voxlap/b ... snippits.h I'm pretty sure almost all remaining bugs are caused by stuff in here

Edit2: OK fixed one thing. Mouse movements + GCC still cause crash but at least you can move with the arrow keys. And this doesn't mean much but unoptimized GCC is MUCH faster than unoptimized MSVC, basically as smooth as with assembly on my old computer.
Cajun Style
Deuced Up
Posts: 145
Joined: Fri Dec 07, 2012 11:04 am


That's great news! Good job!
As soon as I (>_>; figure out how to) rebase my own code, I'll check it out.
Sonarpulse
Coder
Coder
Posts: 443
Joined: Thu Dec 13, 2012 7:18 pm


if you made any changes, you best just let me rebase them as I've ruthlessly changin' history in my repository.
Cajun Style
Deuced Up
Posts: 145
Joined: Fri Dec 07, 2012 11:04 am


The only things I had done was getting rid of all the missing integer suffixes, make sure all the C-style formatted string functions received the right types, and tried to make the asm work. You apparently already did that. Blue_BigSmile
On MinGW 4.7 I still get:
Code: Select all
source/voxlap5.cpp:10773:3: warning: asm operand 0 probably doesn't match constraints [enabled by default]
source/voxlap5.cpp:10773:3: error: impossible constraint in 'asm'
I'm not sure whether compilation halts after this, or that you've fixed all other errors.Yep. Commenting it out just postpones it to the next asm block. :-/
Sonarpulse
Coder
Coder
Posts: 443
Joined: Thu Dec 13, 2012 7:18 pm


You are still on the master branch: On no_asm that line doesn't even exist. Once I get no_asm working I can work backwards to make master work too, but for now no_asm is still the only good branch.
Cajun Style
Deuced Up
Posts: 145
Joined: Fri Dec 07, 2012 11:04 am


If you've really ported all assembly to C, and it works faster than it did on MSVC, I couldn't be happier Blue_Happy3 I know C. I can even debug that shizzle.
Sonarpulse
Coder
Coder
Posts: 443
Joined: Thu Dec 13, 2012 7:18 pm


Not all of it, but a lot of it. I'm going on ##asm at freenode now so they can probably help me do the rest.
Cajun Style
Deuced Up
Posts: 145
Joined: Fri Dec 07, 2012 11:04 am


I've fixed some critical warnings from the compiler. I.e. ambiguous else-clauses and types that were too small. This improved the game to crashing a few seconds later for me (instead of at start-up). Can compile under Linux. If I don't load the voxdata, game actually allows me to move back and forward somewhat.
RedBull
Deuce
Posts: 3
Joined: Tue Jan 01, 2013 3:05 pm


What are the differences between your port and Project Iceball? As far as I know Iceball is an entire rewrite while you are using the available voxlap source code to port the game or am I wrong? And is your port gonna be compatible with 0.75 servers? Some pictures or video would be great.

Thanks for your efforts. Blue_Happy1
Articsledder
Deuced Up
Posts: 209
Joined: Mon Nov 12, 2012 5:13 pm


RedBull wrote:
What are the differences between your port and Project Iceball? As far as I know Iceball is an entire rewrite while you are using the available voxlap source code to port the game or am I wrong? And is your port gonna be compatible with 0.75 servers? Some pictures or video would be great.

Thanks for your efforts. Blue_Happy1
Iceball is being written on it's own engine
222 posts Page 3 of 15 First unread post
Return to “Noteworthy Picks”

Who is online

Users browsing this forum: No registered users and 20 guests