• Rise from your gwave!

A step foward -->

Discussion in 'Saturn Dev' started by Rolzup, Nov 3, 2001.

  1. Rolzup

    Rolzup New Member

    Ok, I need some support here, when I write a saturn program is it like a new lanuage or do I just do it in regular C code then use the saturn compiler to change it? And what dose the SGL Library do and What ever happened to these projects to make new games?
     
  2. ExCyber

    ExCyber Staff Member

    It depends on what you mean by "regular C code".

    You can only code Saturn programs directly in C if you know how to program the hardware. C itself is a very minimal language; often someone learning C will learn a "Hello, World" program that looks like this (this will almost certainly be wrong; blame IkonBoard):

    #include <stdio.h>

    int main(int argc; char** argv;)

    {

    printf("Hello, World!

    ");

    return 0;

    }

    The bulk of the work in this program is done by the printf function, which is part of the standard C library, not part of C. If you've done any substantial amount of C programming on PC, a lot of your knowledge is probably in regards to what library calls you should use to perform certain functions such as reading a file, printing to the screen, copying data to video memory, etc.

    Saturn does not use the standard C library, because the vast majority of the functions in the standard C library are designed to be used to code general-purpose applications with a complex underlying operating system. Saturn does not have a complex operating system and is not intended to run general-purpose applications. Thus most of the functionality provided by the standard C library is not very useful.

    Instead, Sega created a library called SGL that provides functions specific to Saturn's hardware, including setting up graphics modes, controlling the sound subsystem, reading data from CD, reading the controllers, etc. SGL is copyrighted Sega code, but they don't appear to care about unauthorized use now that Saturn is dead.

    So to summarize:

    You can use C to code a Saturn program by directly talking to the hardware (requires the manuals for the different Saturn components and a C compiler that can produce SuperH code).

    You can use C with the SGL library to code a Saturn program, but you'll need to learn how to use the SGL library.

    You can't use C to code a complex program for PC, compile it with the Saturn compiler, and expect it to work on Saturn.

    Hope this helps.
     
  3. MasterAkumaMatata

    MasterAkumaMatata Staff Member

    #include <stdio.h>

    int main(int argc; char** argv;)

    {

    printf("Hello, World!

    ");

    return 0;

    }


    Hmm, looks fine to me. ;)
     

Share This Page