Jump to content
Jagware

SebRmv

Level1
  • Content count

    1,553
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by SebRmv


  1. Hi,

     

    I quickly tested on my windows this evening.

    Unfortunately aln cannot be run on Windows 64 bits.

    I then tried with sln 0.1.4 (not the latest version, because I didn't managed to get it from Subqmod website).

    Unfortunately, this version of sln is not able to understand the archive files (*.a).

     

    I'll try with dosbox and cross the fingers.

     


  2. Ok, I stop here for today. Please keep me informed if this works on your setup.

     

    The difficult part will be to invoke aln ;)

     

    Note: the gcc -c command in the previous message is not exactly what should be typed (some compiler flags should be put) but this permits to test if this works.

     

    The good command is:

     

    gcc -mc68000 -Wall -fomit-frame-pointer -O2 -msoft-float -funroll-loops -c -I f:\gcc-68k\jlibc\include  -I f:\gcc-68k\rmvlib\include -I f:\gcc-68k\cygwin\usr\local\m68k-aout\lib\gcc-lib\m68k-aout\3.3.6\include example4.c

     

    Don't be afraid if you get some warnings...


  3. Part 3

     

    Test compilation with GCC
    =========================
    
    1-Get an example from the Removers website
    
    In the following, I assume that you have chosen example4.tar.gz
    
    2-Uncompress the archive.
    
    I assume you uncompressed the archive in f:\gcc-68k\example4
    
    (shame on me, the archive does not create a directory example4)
    
    3-Set your environment PATH variable so that gcc find its binaries.
    
    set PATH=%PATH%;F:\gcc-68k\cygwin\usr\local\m68k-aout\m68k-aout\bin
    set PATH=%PATH%;F:\gcc-68k\cygwin\usr\local\m68k-aout\lib\gcc-lib\m68k-aout\3.3.6
    
    4-Compile example4.c
    
    F:\gcc-68k\example4>gcc -c -I f:\gcc-68k\jlibc\include  -I f:\gcc-68k\rmvlib\include -I f:\gcc-68k\cygwin\usr\local\m68k-aout\lib\gcc-lib\m68k-aout\3.3.6\include example4.c
    
    This should produce example4.o!


  4. Ok, here is the first step of the recipe (tried on Windows 7 - 64 bits: note that cygwin is not installed on my windows)

     

    This one deals with Cross GCC installation.

     

    Install Cross GCC compiler
    ==========================
    
    1-Get xgcc-3.3.6-m68k.tar.bz2 from The Removers web site.
    
    2-Decompress the archive to the wanted directory.
    
    3-Open a command console
    [Windows]+[R] cmd
    
    4-Go to the directory where you uncompressed the archive.
    
    cd path\to\uncompressed\archive
    
    In the following, I assume that gcc has been uncompressed in F:\gcc-68k
    
    So, I did 
    
    f:
    cd f:\gcc-68k
    
    5-Go into cygwin subdirectory (windows binary is in it)
    
    cd cygwin
    
    6-Copy Cygwin DLLs to C:\Windows (you may need administrator rights)
    
    cp dll\cygiconv-2.dll C:\Windows
    cp dll\cygintl-3.dll C:\Windows
    cp dll\cygwin1.dll C:\Windows
    
    7-Try gcc
    
    usr\local\m68k-aout\m68k-aout\bin\gcc.exe -v
    
    Expected output is:
    
    Using built-in specs.
    Configured with: ../gcc-3.3.6/configure --prefix=/usr/local/m68k-aout --enable-languages=c --target=m68k-aout
    Thread model: single
    gcc version 3.3.6


  5. Hi,

     

    sorry, I did not get time to answer before.

     

    The best advice I could give is

     

    if you are running on windows, please take the binary distribution of jlibc and rmvlib !

     

    (I think rebuilding them on windows is a nightmare in the current state)

     

    Second, take the cross gcc on my website.

    It should run on a standalone Windows (ie without cygwin) as long as you copy the included DLL files (that comes from cygwin) in the right directory (probably something resembling to C:\System)

    Try to run gcc -v in a command shell for instance.

     

    You also have to copy the header files of my lib (ie the *.h) at a place where the cross gcc will find them.

     

    The difficult part is to get madmac and aln running on Windows.

    If you plan to develop only in C, then you just need aln.

    Otherwise madmac is also needed (obviously).

     

    The idea is to use the cross gcc to produce object files.

    Then, thanks to aln, you link them against my libs and it produces magically a Jaguar executable :)

     

    Maybe you can use sln and smac, but I never tested this setting myself.

    Otherwise, I believe that madmac and aln work under dosbox.

     

    So if you open a dosbox console, and assuming you have the right path

     

    gcc -v foo.c -> produces foo.o (for the options passed to gcc, you may have a look at the Makefile I give with the examples)

    ...

     

    and then

    aln rmvlib.a foo.o ... (once again, have a look at one of the Makefile furnished with the examples to get the right command line)

     

    You may also have a look at this webpage (sadly in french)

    http://removers.free.fr/spip/?92-je-veux-d...opper-sur-atari

    It contains probably some useful hints.

     

    Hope this helps.

     

    --

     

    One thing that is missing on windows is the GNU Make tool and the bash shell.

    (that's why it is probably a nightmare to rebuild my libs from the sources on Windows)

     

    Regarding make, I will try to investigate a bit in the direction of CMake, which seems

    to be a good candidate to replace make (and which is portable).


  6. Hi,

     

    I have released these libraries under the LGPL license.

    I hope this license will not bother you. Otherwise tell me and we'll find a deal.

     

    Regarding the interaction between C & ASM, I think Zerosquare has basically said everything.

    To see on a real example, you may wish to inspect the example4 available on my website.

    I have added a small example in assembly that call the sound driver to replay a sample.

     

    For the installation issues, what is your setting? Windows? Linux?

    In any case, do not hesitate to ask precise questions, I will be pleased to help you.

     

    Best,

     

    Seb


  7. A guide how to install the library would have been great!

     

    :whistling:

     

    Anyway, first of all I'd like to post a public thank you to Seb because he is very helpful.

     

    Unfortunately Seb, my pc died shortly after our communication and anything I had done with it as well.

     

    So now I am on my CT63.. Is it possible to use your library with it (gcc 4.4.2) or even better would it be possible to use it with another compiler (pure_c, ahcc)? If so how to setup a dev environment?

     

    Also, how about c++? Will it work with that as well (this I guess is a more general question about C and C++).

     

    Thanks

     

    Thanks for your kind support.

     

    Just recall that my library is just a piece of code, so it can be interfaced with other piece of code, thanks to ALN.

    The header files (.h files) just describes the interface of all the functions provided by my library in a C style.

    Up to you programmers to understand them to use them through your favorite language (eg assembly, C, ot whatever).

    (all that you need to know is the argument passing convention:

    - everything is passed on stack

    -integers are assumed to be 32 bits long

    -and result is given back in d0

    -d2-d7/a2-a7 are preserved but nothing is guaranteed for d0-d1/a0-a1 )

     

    The keypoint is to use ALN to glue everything together in order to produce a Jaguar executable.

    As long as you produce object files that can be understood by ALN, then "this is a bingo" ;)

     

    So to answer your question, yes, I think it must be possible to use an Atari computer to program the Jaguar with my library.

    (even if I don't know the exact setup :P)

     

    About C++, I should investigate this one day. This could be convenient to have support also for this language (even if it might be too heavy for the poor 68k)

    In particular, for C++, some runtime support (memory management and classes) has to be added. For sake of simplicity, I disabled C++ support in the cross gcc I distribute.

     

     


  8. If I would like to run some C code from the cartridge memory, what sort of things should I pay attention ?

     

    I would say nothing really special.

     

    Of course, do not make write access to the DATA section (nor the TEXT section).

     

    Regarding your previous question, actually this is not completely clear where global variables are allocated.

    For sure, if they are not initialized in the C code, then they will go in BSS section (but remember that crt0 will erase the BSS section at the very beginning of the program)

    Otherwise, I guess it's rather in the DATA section, so be careful with these!


  9. Question about linking of C files :

     

    global variable declaration in a C file are they added in the DATA section or in the BSS section ?

    is malloc and memalign allocate memory into the BSS section ?

     

    global variables are allocated in BSS

     

    the heap (for malloc) is beginning at the end of the bss section

     

     


  10. ok :)

     

     

    Another question :

    if we use the scale of sprite, can the sprite manager compute the new position in X and Y of the sprite to be always centered on a point ?

    or do we have to compute manually the position ? :)

     

    Yes, you can, if you use the "hotspot" mechanism.

    Simply set the coordinates you want to consider as being the "centre" of the sprite with hotspot_x and hotspot_y (or is it hx, hy)

    and enable the hotspot by setting the corresponding bit.

     

    Otherwise, you'll have to compute that manually.


  11. another question about the sprite manager :

    is it double buffered ?

    or :

    at wich time the OP list is updated ?

     

    for example :

    if we attach a new object, then wait vsync, is it present on the screen or is it at the next vsync that it will be display ?

     

    the OP list is double buffered

     

    this means that it is at the second vsync that you can be sure this will be displayed

     

    sometimes, I regret this choice of having double buffered the OP list

    this is clearly not well suited for framebuffered games (eg Another World does not use this display manager)

    but I fear this is the price to pay to draw lots of sprites

×