News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

"trunk/text_pixel.c" touble with the asm volatile syntax

Started by eldorico, November 08, 2012, 12:13:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

eldorico

Hello!


I'm triyng compiling simutrans on code:blocks, and have some trouble with the asm volatile synthax.


// 17% faster pixel setting for text ...
// helper for display_text_len_clip
asm volatile (
"jmp *JumpDC(,%2,4)\n\t"
"ud2\n\t"
".p2align 4\n"
"JumpDC:\n\t"
".long .DCende\n\t"
".long L9901\n\t"
".long L9902\n\t"
".long L9903\n\t"




...


"stosl\n\t"
"stosl\n\t"
"stosl\n\t"
".DCende:\n\t"
: "+D" (dst)
: "a" (color2), "r" (dat)
: "cc", "memory"
);


It reports me that a "(" was expetced before ":" token. I dont know what to do.

here is some documentation, but it is to complicateted for my level.

Does anyone could help?

Thanks


Ters

Are you trying to compile it as an independent file? Don't do that. simgraph16.c will include it and feed it what it needs.

eldorico

Oh thanks..


Yes, I realised that I was compiling file per file.  :-X


Do you know how I ask to code:blocks to compile from simmain.cc? Or should I creat a new main, and fetch it with simmain?








Ters

There is no "compile from simmain.cc". You add all the files that need to be compiled to the project, and then compile. The tricky part is figuring which files those are. You can figure out which those are by looking through the Makefile. It contains one big list of files that should always be compiled, but scattered about are references to some files that shall only be compiled when targetting certain platforms. Personally, I just added everything (except the makeobj directory), and then removed files I could tell I shouldn't have, before I tried compiling and removed file by file that didn't fit. That requires some experience, though, and it is possible that I still have too many files in the project, but the rest are harmless.

prissi

besch/writer director is not needed too. From the music/sound files use only one. same for the simsys_?.cc, only use one, and do not use simgraph0.cc. If you are on a non-intel/x64 machine you HAVE to define USE_C. You better also define DEBUG.

But why go through the hassle with that and not use make. It is so much easier to use.

Ters

Quote from: prissi on November 09, 2012, 08:44:47 AM
But why go through the hassle with that and not use make. It is so much easier to use.

Make is just for compiling, not editing.

kierongreen

You can use your choice of text editor to edit code though (I use Leafpad at the moment for example). No IDE required!

Ters

I've used Notepad for programming in the past, but intergrated debugging, context sensitive searching and a simple build-and-run button is nice. (Though Code:blocks is so crappy on some of this that it's worth is almost negative.)