[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Re: MiNTOS Versions

> >> The really nice thing about it is that nearly everything that runs on MiNT
> >AES (Application Environment Services) is that part that manages windows
> >needs a running VDI.
> And VDI, from what I see in vdibind.h, provides functions to do simple
> drawing, access mouse and other stuff... right?

Yes. All normal (non-games) programs are supposed to use the VDI for all
their screen output.

> Is there a free version (with source) of it that I could look at?

Yes. As I mentioned in an earlier message in this very thread (Re: [MiNT] Re:
MiNTOS versions (macmint)), fVDI is available and will do what you want, if
you write a new device driver for it.
The sources are still not stable enough that I have put them up for download
anywhere (except for the example device driver in the v0.85 archive), but
send me an email and I'll let you have what you need.

> BTW: does anyone know if it is possible to declare an inline function in gcc?

Inline functions are easy:

#include <stdlib.h>

inline int test(int a)
   return rnd() < a;

int main(void)
   int i;

   i = test(2) + test(20);
   return i;

GCC would even inline test() without the 'inline' if you gave it the
right compile options.

> e.g. some compilers allow this:
> 	void dummyfunc(void) = 0xA913;

It seems you really want inline assembly (or machine code in the case of
compilers that don't include an assembler).

GCC has very advanced support for that, which means that it's not exactly
very simple to use.

> which makes a function that calls an a-trap, but my gcc (2.5.8) whines at this,
> saying something like "function initialized like a variable."

Well, standard C doesn't allow anything like that.
Naturally, it would have been simple to allow it in GCC (and it even might
be possible using some other syntax), but with nothing more than that you
can't leave the optimizer on (GCC would have no idea about what registers
might get modified) which is a very _bad_ thing.

> It would be nice if someone knows how to do this, because this is what I need
> to be able to call Mac functions from inside MacMiNT, which is necessary for
> a few things...

Aren't there some simple examples of this kind of thing in the standard
GCC MiNT library headers? I would have thought that they called TOS via
inline assembly.

If you don't find anything useful in there (and noone else can help), I'll
look around at home and see what I can find. I have used GCC inline assembly
once or twice before.

Do you really have to have these things inlined, by the way?
It's much easier to do it from an assembly function in a separate file.

  Chalmers University   | Why are these |  e-mail:   rand@cd.chalmers.se
     of Technology      |  .signatures  |            johan@rand.thn.htu.se
                        | so hard to do |  WWW/ftp:  rand.thn.htu.se
   Gothenburg, Sweden   |     well?     |            (MGIFv5, QLem, BAD MOOD)