Mail Archives: djgpp/2000/04/17/08:58:21
Alexei A. Frounze wrote:
[Alexei has sent me an (almost) compilable set of sources. Looks
quite nice - the graphics;)]
>Not really. The inner loop in my tmapper can not be written in pure C.
>Belive me.
This is not true.
>No one compiler figure out such a trick as used in my ASM module.
Alexei, then you will surely accept the following bet.
Level I:
I will replace about half of your inline assembly in T_Map() by
C code, that does exactly the same thing. No change of algorithm.
Most of the replacement will be your comments. To make the competition
fair, I will put in your shift code in inline assembly (with correct
constrains), because this was in the original source you posted here,
and because the C replacement was my sugestion. But this is really
a minor point. I will compile my C version with gcc (2.95.2) -O. It is
your choice, whether you want your version compiled with -O or -O2.
To compare the performance, I start your program (plain DOS, AMD K6-2),
wait a little bit, write down the FPS display, and stop it again
with ESC. I bet my version will be faster! If I win, you send me
100 g of the best Russian caviar (you will have to pay the toll, if any,
as well). When I loose, I will send you the nicely printed sections about
inline assembly and constraints of the gcc manual by snail mail to Russia;)
Game over, when I loose, otherwise ...
Level II:
I get rid of all your inline assembly in T_Map. I will be allowed
to add one single line (say less than 50 characters from __asm__
upto the closing ')' ) of inline assembly to your source. I bet,
the plain C code will perform about the same, as your inline
code. I win, when my code is no more than 2 FPS slower, or faster, than
your code (The executable you sent reports 70 FPS here).
When I win, you will add to your package a bottle of the best champagne
from Crimea. When I loose, I will add Brennan Underwood's tutorial.
Especially for you, I will add some hand written notes, where the
tutorial doesn't conform with current gcc anymore.
In either case, as a bonus, you will receive some code fixes
by email.
--
SCNR, Dieter
- Raw text -