RB library

Commonly used code of my projects.

about

These simple development libraries are not low level Saturn asm libs. Instead they are more high level and partially enable platform independency. (SEGA Saturn, Windows, MacOS X)

The purpose is to aid the Saturn game development, especially the early phases by enabling the quick setup of options menus, CD access and other stuff. Some more advanced support for 3D data exists with the MAP and POL stuff, too.

content/component description

PCM

platform independent

Functions to convert between Windows .wav files and Saturn raw .pcm files. Enables wav playback on Saturn. Conversion between samplerate and SGL pitch value provided. Used in Sound Player and RB_SaturnPCM.

TXT_SCROLL

SEGA Saturn, SDL platforms, (Windows, MacOS X) shell platforms

Wraps graphical text output. A Text scroll got size and position on screen. Printing to a scroll is formated like printf and furthermore placed at a certain position. The scroll got a small local character screen buffer and for performance reasons you can select if printing updates the real screen immediately or later in a batch. Drawing the text is performed with SGL on Saturn, with SFont or KBF font libraries for SDL platforms and with usual text console output.

TXT_MENU

platform independent

Quickly build up (nested) options menus with callbacks and widgets like button, listbox, checkbox, int and float spinner. Even little applications can be done with it in a very modular way. The menu is drawn onto a TXT_SCROLL.

The Sound Player utilizes this with a PCM player and a CDDA player. The Voxel demo got a DSP debugger implemented with TXT_MENU and TXT_SCROLL.

TXT_MESSAGES

platform independent

To log messages that an application might give to the user. You define the maximum number of messages to keep in a ring buffer. Works like a replacement for printf. Can output messages to a TXT_SCROLL. This enables some sort of standard output on systems without a shell like classic consoles.

TXT_STRING

platform independent (unfinished yet)

Let's the user input and edit strings in two different ways. Select each character from a big character matrix or from one of six little 3x3 matrices. The 2nd implementation lets you input a character with only up to 2 button presses.

Useful for highscore or savegame names.

DUAL

unfinished, very very early stage

This was supposed to allow to setup a distributed application (for SEGA Saturn and possibly 32X dual SH2 CPUs) which cares about dual CPU usage totally on it's own. The idea is to build a graph of application pieces, connect them and apply constraints which determine the load balancing and stuff. Ever heard of Petri-nets?

Sadly though only the graph setup is partially implemented. Most of the idea behind this is in my head only ;-).

MinCD

SEGA Saturn only (uses SGL and GFS)

Minimalistic CD file browser which support subdirectories and CD swapping. You can define your own file types with filename wildcarts, add a file load action and collect multiple such directives which determines priority.

File load actions to choose from are load to a supplied buffer untill completed with GFS, return file ID, return GFS handle only or return SGL file handle. So you can treat different files in a different way. The size of the supplied buffer is recognized, a file type description is shown to the user if a match exists.

The CD can be rescanned by a push of a button. A CD Change is tried to be recognized automatically, but still buggy.

Used in Emulators, Rockin'-VR and Sound Player for memory playback and file playback as well.

CartRAM

SEGA Saturn only

Initializes those external RAM carts for Saturn for use in your program. 1MB and 4MB carts are supported.

Used by most Emulators and the Save Game Manager.

EmuStats

SEGA Saturn only because of text display not using TXT_SCROLL (can be fixed easily)

Determine execution statistics and execution times as well. Two functions:

Record the number of times a certain part of an application is executed. This is very useful to record opcode usage statistics in emulators.

The other function is to determine the time needed to execute a certain part of the application. For human readability names can be supplied. Key feature is the ability to nest these benchmarks.

Benchmark results and a sorted list of most used application parts(opcodes) can be printed to the screen.

All EmuStats code can be completely disabled and removed from compilation by a single #define!

Can be used by all Emulators, Texture Coordinates and Terrain Renderer.

INPUT

SEGA Saturn, SDL platforms, shell platforms

Just some wrapper macros which hide system dependencies.

Used in TXT_MENU and others.

Very limited yet. A much better implementation is needed which wraps different peripherials like mouse, pad, gun, keayboard and which enables run-length encoded recording and playing of peripherial input. Such a method has been used in my MineSweeper game and is very usefull to enable demo play, ghost drivers and replay functionalities. A button mapping functionality should be included, too.

werehere

SEGA Saturn

To mark a breakpoint to stop at runtime and display some information like variable values using sprintf.

Leaving the breakpoint is done by pressing A and B sequentially to avoid skipping the next breakpoint. Holding down START skips the breakpoints.

Would be cool to disable this code with a #define and make it platform independent using TXT_SCROLL.

Used in almost all of my projects during development.

RETVAL

platform independent

Just a small collection of return value definitions. I know there might be better aproaches. But I don't want to use errno.h.

POL and MAP

platform independent, expect: runtime is SEGA Saturn only

This deals with SEGA Saturn SBL 3D polygon data.

The use of Saturn 3D data as .MDL C source code and binary file(!!) is possible on SEGA Saturn and any PC system as well. Main purpose is to convert a 3D (outdoor) scene to a 2D polygon map which is a space partitioned representation. Several methods of splitting and joining objects at tile borders are implemented. By using multiple input files it exceeds the size limit set by 3DEditor.

Furthermore a Saturn optimized ground following and border collision detection method is applied. It can generate the needed collision data at conversion time. Runtime rendering and ground following functions are supplied.

Used for track creation in 3d Racing Game Project and POL is used in Texture Coordinates for selecting certain polygons.

Examples of use

DSP_DEBUG

application for SEGA Saturn only (no other system got this SCU DSP)

Offers DSP debuging stuff for running on real Saturn like stepwise execution, execute untill, pause, stop, run. The big advantage is that it allows browsing the RAM content of the DSP with human readable format. For this you supply RAM allocation information by giving it a name and a type(integer, fixed number). You can also reset RAM0-RAM3 seperately to default values. For this functions have to be supplied.

Furthermore you can supply a list of function locations which let's you easily run the DSP a certain function only. There are several ways possible to exchange data between main CPU and DSP, which are also supported.

Using this isn't easy plug and play. You need a DSP program to test, of course and supply functions to set values for all 4 RAM areas as well as RAM layout definitions and function addresses (human readability).

Used in the Saturn Voxel demo.

PCM_Player, CDDA_Player

application for SEGA Saturn only

Part of the Sound Player.

3Dmenu

application for SEGA Saturn only

To manipulate 3D transformations of objects and lights, used in Sound Player and 3d Racing Game Project.

Contained in
Compiled with
Contains