pouët.net

Go to bottom

two little win32 sizecoding tricks

category: code [glöplog]
I was able to get 4 bytes off of a test 1k intro (Peach GLSL Shader of Japan) by replacing the "edit" string with 0xC018, making it 1006 bytes instead of 1010. Nice.

...and then I got it down to 1004 bytes, because now "test eax, eax" compressed better than "test ax, ax", which used to compress better sometime before this newest change. ;) This 1k intro business is crazy, you'd really need some kind of brute-force code masher that tries all possible combinations of code that perform the same thing.
added on the 2014-05-01 19:21:11 by yzi yzi
Code: CreateWindowEx(WS_EX_TOPMOST, "STATIC", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

That´s mine since 2009 using DirectX9...someone told me using "static" instead of "edit" would be better back then in some other thread...was iq if i remember correctly.
The ATOM for "static" is 0xC019 btw, but be warned: it added 7 bytes here in my first test, opposed to chopping off 4 bytes in case of "edit".
Oh, shit...i did the test the wrong way around...meaning the ATOM actually chopped off 7 bytes in case of "static" vs. "0xC019" :/ :D
Yay, thanks for the nice trick, man! :)
I never tried to write 1K. why is nessesary to create window?
added on the 2014-05-02 08:39:51 by g0blinish g0blinish
Good question!
I only did one 1k so far, but used hitchhikrs framework (1kpack 0.9) to do so, so i am no expert!
But to answer your question: To get access to the GPU (hardware) via directx or opengl (dll-hook) ;)
Ofcourse you can go with your typical 256b-approach (int32hsthblah), but you limit yourself to software and 320*200 this way! :p
I have no experience in size coding, so maybe a little dumb question, but how can you create a 0;0 sized window? I mean the directx init to this window wont fail?
added on the 2014-05-02 11:11:20 by kt kt
it takes the resolution of the before created Windows-Window. ;) Hard to explain, but it´s a simple fallback! ;)
Quote:
why is nessesary to create window?

Where would you want to paint if there was no window?
Quote:

I mean the directx init to this window wont fail?

The swapchain descriptor contains the backbuffer size, the DX init knows the hWnd (also from the swapchain desc) and then does the appropriate things to your window.
added on the 2014-05-02 16:21:08 by las las
Quote:
Where would you want to paint if there was no window?

maybe it is stupid, but to HWND GetDesktopWindow
added on the 2014-05-02 18:59:33 by g0blinish g0blinish
Then you're fighting with, among others, the operating itself for drawing on that surface, meaning that you get nice blinking icons and other things whenever the desktop decides to update itself.
in other words: that aint no hardcodeable raw pointer into ram at all! :p
Why size code now, you just expanded from 4K+30MB libs to 8K+30MB libs! Yay! Right? :)
added on the 2014-05-03 01:36:28 by Photon Photon
Photon:
I love what you do on Amiga, but please dont compare this to PC if you have no Idea of what you are talking at all! :p
We have to call some shit, so we get some window at all, eating up like 1-1.5kb off our 4ks only to get access...this is the only thing we need those "30MB" for :P
We´d be better off with no libs, but tell me how to access GPUs without :P
Got it, thanks the answers!
added on the 2014-05-03 12:29:12 by kt kt
Photon: Amiga Troll.
There has always been some kind of given logic set which has been used as sizecoding platform. This might be hardware, software or a combination of both (even true for Amiga).
In case you didn't notice these platforms change over time.

Starting to allow some certain libs (especially DX SDK Stuff in 2005) might have been a bad idea, leading to the situation we have now. Most of these libs are kind of deprecated by now and will most hopefully be disallowed in future competitions.

Just so you know: Some people are currently trying to get the "4k (and other size coded intros) will have to run on vanilla installations with appropriate hardware"-thing back - which is not too hard (+Some people will be really (un)happy about this. Hi hardy! :D).

Back to topic: Hardy, 1-1.5kb for basic setup? Really? :D
added on the 2014-05-03 15:42:41 by las las

login

Go to top