HomeForumsWhat's newResources 
 
 
using SGL/SBL with SNASMSH2
AntiPasta - May 27, 2003
 AntiPasta May 27, 2003
Like the topic said, can I use SGL/SBL functions using only SNASMSH2? If so, how?

thanks in advance.

 antime May 27, 2003
IIRC SNASMSH2 can output COFF objects so it should be possible. You have to learn whatever syntax SNASM uses to specify external symbols and of course adhere to the SuperH ABI.

 mrkotfw May 27, 2003
wow, SBL functions? are they for C too? and what are they? are they extra SGL functions? info please!

 vreuzon May 28, 2003
From SBL6/SBL601.TXT :

[Overview]

The Sega Basic Library (SBL) is a low-level library which can be applied to many uses. This library enabled developers the flexibility they needed to create their own customized applications. However, past versions of SBL were not helpful for the development of 3D graphics-based software.

The Sega Game Library (SGL) is a high-level library which can be used mainly for 3D graphics applications. However, depending on the application, the developers are forced to deal with many of its restrictions.

The objective of SBL6.0 is to integrate the positive aspects of both libraries. SBL6.0 provides developers the flexibility of customizing their applications as with the old SBL, along with taking advantage of the benefits provided by the expanded features ported from SGL.

It is possible to combine the features from SBL and SGL.* By skillfully utilizing SBL and SGL according to the needs of the application, the developer can develop software quickly and efficiently. For example, although basic hardware-level control functions were provided by previous versions of SBL, the user had to bear the overhead of coming up with a efficient polygon rendering engine. In contrast, while SGL has a powerful polygon 3D engine, there are weaknesses in its support for the Saturn's scroll functions due to the its original design implementation.

SBL6.0 provides a development environment with high efficiency and flexibility in order to compensate for the deficiencies found in both SBL and SGL.

* Keep in mind that limitations will inevitably appear when SBL and SGL are combined.

 AntiPasta May 28, 2003
well, I was only interested in loading files actually so that's not a problem

 mrkotfw May 28, 2003
hey can you guys send me SBL? and it's docs please? i never heard of SBL! thanks!!!

 vbt May 30, 2003
do you think SBL functions would be faster than SGL function to display a background picture ? Even if I win only 5% of speed it would be interesting .

Previously I used slBMPut, is there something equivalent on SBL ?

 vbt May 30, 2003
Ok there is no bitmap functions in the SBL just scroll functions for VDPs.

 AntiPasta May 31, 2003
right, so IF I could make a COFF file out of my asm code, with the correct declarations, how would I link it to the SGL? What tools would I need for that?

 antime May 31, 2003
The same tool you use to link everything else: ln.

 AntiPasta Jun 1, 2003
sure you don't mean LD?

 antime Jun 2, 2003
Yes, you're right.

 AntiPasta Jun 2, 2003
aight, thanks for your assistance but as I really don't know jack about C, libraries, linking and whatever I still have some questions: where do I get LD? Do I need a specific SH2 one or can I just look for a win32 console port of GCC and find it in there? Moreover, how do I pass arguments to the SGL functions?

Thanks in advance!

 antime Jun 3, 2003
ld is part of the GNU binutils, and if you have the Sega toolchain it's included. Otherwise, you can get it from the KPIT toolchain (which is useful to have anyway). As for passing arguments, that's where the ABI comes into play. It's described in one of the Hitachi tool manuals on my site, but IIRC the first four arguments are passed in r4-r7 and the return value is passed in r0. The called function can overwrite r0-r3, the other registers (r8-r15, mach, macl) should be preserved. There's some more rules (regarding structs and some other details), but they should be described in the manual in question.