• Welcome to Dark Bit Factory & Gravity.
 

Visual C++ 4k settings?

Started by taj, November 13, 2006

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

taj

Does anyone (Rbraz?) have a set of instriuctions/settings/steps/tutorial/link on how to reduce code size to the minimum using Visual C++. I prefer to put as little into the C code as possible. I usually use GCC but I'm having a lot of issues combining that with DX and these days DX offers a lot more than Opengl for size coders.

Challenge Trophies Won:

benny!

Sorry ... I am in a hurry ... but maybe this link is of some help for you :

http://keyj.s2000.ws/?p=29

cu l8er.
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Rbz

I'm installing Visual C++ 2005 Express right now, when I got something I'll post here...
Challenge Trophies Won:

taj

Quote from: benny! on November 13, 2006
Sorry ... I am in a hurry ... but maybe this link is of some help for you :

http://keyj.s2000.ws/?p=29

cu l8er.

That link has one or two gems including the /QIfist hint! Thanks Benny
Challenge Trophies Won:

Rbz

With VC2005 Express, the best what I can get is 563 bytes packed...
Challenge Trophies Won:

Rbz

#5
Ok, now it's 427 bytes only  :o , damn it's too close to my ASM version (421 bytes packed)   :||


:cheers:



[Edited - file updated again...]
Challenge Trophies Won:

taj

Now thats worth Karma :-) thanks rbraz!
Challenge Trophies Won:

benny!

Indeed .. very cool Rbraz. Thx for sharing !
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Rbz

No problems dudes :)

I have updated the attached file, just removed unused #pragma commands, removed msvcrt.lib and added msvcrtd.lib instead.
Challenge Trophies Won:

benny!

@rbraz:

cool ...


@taj:

uhh ... the new banner looks scary cool  ;)
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

taj

Quote from: Rbraz on November 14, 2006
Ok, now it's 427 bytes only  :o , damn it's too close to my ASM version (421 bytes packed)   :||
:cheers:

[Edited - file updated...]

Rbraz,

I did some texting with this with some results for you.
Aulds 1k framework under GCC, your exact version of code: 494 bytes
Aulds 1k framework under GCC, his code: 474 bytes

Neither is close to your result but 50 bytes is damn suspicious. Thats something not working (as if aulds framework pulls in another library under GCC), not simple optimisation. Nontheless it seems VC++ plus your tuned version of aulds framework is 50 bytes smaller!! Damn, guess I'll be working in VC++ from now on.

One thing how do you compress? Is it convert to com and then use apack?
Are you using the same settings as in aulds framework or something else?
Challenge Trophies Won:

Rbz

Cool, I hope that Auld can find this and post it at In4k  ;)

To compress it, I just used the same settings as Auld have used for his framework, tried others settings but without any better results...

Cheers,
Challenge Trophies Won:

taj

In4k is a wiki Rbraz, you can always add this information yourself...
Challenge Trophies Won:

Rbz

I've already registered at In4k (sometime ago), I'll check how to add that info there... thx
Challenge Trophies Won:

Rbz

Quote from: taj on November 15, 2006
In4k is a wiki Rbraz, you can always add this information yourself...

Done  ;)
Challenge Trophies Won:

taj

Quote from: Rbraz on November 15, 2006
Quote from: taj on November 15, 2006
In4k is a wiki Rbraz, you can always add this information yourself...

Done  ;)

Yeah checked it out, mega cool!
Challenge Trophies Won:

taj

#16
Im really struggling to get this working Rbraz.

Installed VC++ 2005 Express
Installed platform SDK

trying to manually find all the paths for stuff that it needs..getting this error
Project : error PRJ0002 : Error result -1073741515 returned from 'C:\Program Files\Microsoft Visual Studio 8\VC\bin\link.exe'.

Any ideas?


...

Ok found the answer. Despite the install instructions I found I had to add:
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
under Tools->Options->Projects and Solutions->VC++ Files on the tab executable Files

As you can imagine, it took a while to find so if anyone else tries this and has issues, I wanted to write it down to save you hassle.
Challenge Trophies Won:

taj

Rbraz,

why have you added exitprocess and return 0 to the code? It seems to compile and run fine without them and the result is only 414 bytes.
Challenge Trophies Won:

benny!

Quote from: taj on November 18, 2006
...
Ok found the answer. Despite the install instructions I found I had to add:
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
under Tools->Options->Projects and Solutions->VC++ Files on the tab executable Files

As you can imagine, it took a while to find so if anyone else tries this and has issues, I wanted to write it down to save you hassle.

Always nice to see when people add the solution to their own question when no one else
answerrs ! I like this attitude - keep it up. (Karma up!)
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Rbz

Quote from: taj on November 18, 2006
Im really struggling to get this working Rbraz.

Installed VC++ 2005 Express
Installed platform SDK

trying to manually find all the paths for stuff that it needs..getting this error
Project : error PRJ0002 : Error result -1073741515 returned from 'C:\Program Files\Microsoft Visual Studio 8\VC\bin\link.exe'.

Any ideas?


...

Ok found the answer. Despite the install instructions I found I had to add:
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
under Tools->Options->Projects and Solutions->VC++ Files on the tab executable Files

As you can imagine, it took a while to find so if anyone else tries this and has issues, I wanted to write it down to save you hassle.

I really recommend for people who want install VC++2005 to follow this link, step by step, to avoid such problems:
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/


Quote from: taj on November 18, 2006
Rbraz,

why have you added exitprocess and return 0 to the code? It seems to compile and run fine without them and the result is only 414 bytes.

Because I like to waste bytes  ::)
No, just kidding, because I'm not able to make WinMain return void, and since that function return int,  return 0 doesn't make your file bigger.

About Exitprocess(0), you know better than me that is more safe to exit all process created by our prog, if removed from my ASM version, the final file is 399 bytes, but it crash when exit was pressed...



Well, I found one issue about VC++2005 framework, msvcrt.lib and msvcrtd.lib they call respectively those dlls - msvcrt80.dll and msvcrt80d.dll
to get rid about that I've included an old msvcrt.lib (from VC++6.0) and renamed it to msvcrts.lib ( s=standard), this library call the standard msvcrt.dll present in all windows platform (I guess), anyway I've tested it with Windows98 and WinXP and it works fine.

Download the updated framework here --> http://www.rbraz.com/source/1K_FrameWork_VC2005.zip
There's a little readme.txt file included to help you install the file msvcrts.lib

Have fun!

Challenge Trophies Won: