View Single Post
Old 18 May 2021, 17:01   #32
pink^abyss
Registered User
 
Join Date: Aug 2018
Location: Untergrund/Germany
Posts: 408
Quote:
Originally Posted by Daytona675x View Post
New wip video #15
https://www.youtube.com/playlist?lis...yr1OhOssiA0axW

That video is somewhat different as it shows how I just made optimizing the game much more comfortable.

GCC's inline assembly is quite some pita.
Every line has to be enclosed into "", every line has to be terminated with \n, register names like d1 become %/d1, parameters coming from C have to be listed in a fixed order and cannot be referenced by name but only by their position in that list.

Also, you have to track all your scratch registers by yourself and add those to the so called clobber list at the very end.
When using branches you have to add a b or a f to the target label to tell gcc that it has to branch Back or Forward

As you may imagine this quickly becomes a mess, especially if your parameter list changes because you add or remove something.
Because of that I spent the weekend to get into VSCode extensions because for this game project I'm using VSCode and the great
Amiga C/C++ plugin by Bartman^Abyss.

For stuff like the menus, most precalculations etc. you can easily get away with C++ most of the time.
But sometimes the not-so-brilliant GCC 68k code generator produces such sub-optimal code that asm is your only option if your targets are unaccelerated Amigas.

To work around the gcc inline asm hell I wrote a little extension which can convert GCC-style asm into something more readable, allows me to edit that and then converts it all back, while also adjusting all branches, parameter-references and the clobber list accordingly.
It integrates nicely into VSCode. I simply have to mark the asm code, hit ctrl+F1 to un-gcc it, do my changes, mark everything again and hit shift+ctrl+F1.

Cheers!

Yeah, GCC asm doesn't seem to be made for humans . Good solution from your side!
Just in case, here are the essential GCC compiler options for fast code:
-Ofast -fwhole-program -flto -fno-tree-loop-distribution

Your latest build looks really smooth! I feel like the grass could look better with less noise. I would mipmap away even all noise on the far distance. Of course, thats just a matter of taste
pink^abyss is offline  
 
Page generated in 0.07548 seconds with 11 queries