Saturn compiler/assembly

I'm interested in learning to program a Sega Saturn, and I was wondering what I would need in order to do that. I think it might be good learning to program it

in assembly ,but what would I need to do that? I already know how to set up a Dev environment on Saturn using a compiler. But im not sure if this is a proper assembly environment? http://www.phantasy-star-universe.com/DEVELOPER/ I might just program it that way, but I was wondering what would be needed for assembly programming for SS. Would that dev environment be usable? or no? Can I use the SGL? I happen to be a tad confused on what direction to go in, what I need, and how to do it. :blink:
 
The most readily available assemblers are GAS and SNASMSH2. The former is part of the GNU binutils package and if you use Windows or Linux a precompiled version is available in KPIT's GNUSH distribution. SNASMSH2 is a DOS program but unfortunately I can't remember where the latest version (that works under Windows XP) can be found. IMO, SNASMSH2 is better suited for hand assembly but comes without documentation. (There are of course other assemblers, eg. Renesas' own, but they are commercial and tend to cost serious money.)

You can use the SGL libraries (and any other libraries written in any other language) from assembly, you just have to make sure your function calls adhere to the SH calling convention which is described in one of Renesas cross-tool manuals which can be downloaded from their website.
 
Cool, so you could just, er, call the functions from the SGL?

Im not sure how that would work, what exactly is the SGL? Im not sure if Im too clear on what it is anymore <_<

Also, are there any documents on how to do 2d/3d graphics with SGL and hand assembly, along with documents on getting parallel processing working? How

would you do that, anyhow, is there some way to say what processor you're doing something on?
 
SGL is a set of high-level libraries that provide functions for graphics, sound etc. Using the libraries from assembly is just like using any C-written library from assembly, you could try compiling some SGL sample programs using GCC, telling the compiler to produce only the assembly listings and using them as reference. For info on how to use the SGL libraries, try the SGL documentation.

When using SGL the libraries do much of the processing on the second CPU, so it's not free for your use. You can register a function that can run in the remaining time per frame, but the heavier your scene the less time there is.

If you set your master and slave CPUs to run the same code, there is a bit in the processor's internal registers you can check to see what mode it is in. See the 7604 manual for info.
 
Back
Top