the possession of SEGA. If you have not signed such a non-disclosure agreement, please contact SEGA immediately and return this document to SEGA. document. SEGA may make improvements and/or changes in the product(s) and/or the program(s) described in this document at any time. information about SEGA products must be made to your authorized SEGA Technical Services representative. party. property claims or other problems that may result from applications based on the examples describe herein. Such references/information must not be construed to mean that SEGA intends to provide such SEGA products or services in countries other than Japan. Any reference of a SEGA licensed prod- uct/program in this document is not intended to state or simply that you can use only SEGA's licensed products/programs. Any functionally equivalent hardware/software can be used instead. document. Please address comments to : 150 Shoreline Drive, Redwood City, CA 94065 SEGA may use or distribute whatever information you supply in any way it believes appropriate without incurring any obligation to you. |
Game Development |
For more information................................................................................................................ iii Conventions................................................................................................................................ iii System Manager and Peripheral Control (SMPC)................................................................ 3 SH-2 CPUs .................................................................................................................................. 4 Cart port...................................................................................................................................... 4 CD-ROM subsystem.................................................................................................................. 4 MPEG decompression chip........................................................................................ 5 Dual frame buffer........................................................................................................ 6 VDP 2 ............................................................................................................................ 6 68EC000 ........................................................................................................................ 7 The display list ........................................................................................................................... 12 Specifying colors........................................................................................................................ 15 Color calculations ...................................................................................................................... 16 Changing and erasing the frame buffer ................................................................................. 16 Rotating the entire frame buffer.............................................................................................. 17 VRAM and the display interval .............................................................................................. 20 Character patterns and scroll planes ...................................................................................... 22 Scroll plane display ................................................................................................................... 23 Priority functions ........................................................................................................ 24 Color processing.......................................................................................................... 24 BRIP............................................................................................................................... 26 SaturnSp_C PhotoShop/Debabelizer module........................................................ 26 SaturnBRIP PhotoShop/Debabelizer module (under development).................. 26 3DS2SAT (under development)................................................................................ 26 The Hitachi E7000 ICEs .............................................................................................. 29 Sherry SH-2 simulator ................................................................................................ 30 |
Hitachi documentation ............................................................................................... 31 SCU documentation ....................................................................................................31 CD-ROM subsystem documentation........................................................................31 Video subsystem documentation ..............................................................................31 Sound subsystem documentation ............................................................................. 32 |
subsystem, and summarizes some of the resources available to Saturn game developers. You should read this document before reading any other Saturn documentation and before attending your first Saturn training session. and some of its most important capabilities. interval, and some of the calculations it can perform as it displays each pixel. developers. Documentation" in Chapter 4. not kilobits (Kbits) and megabits (Mbits). 1 Mbit = 1024 Kbits = 128 KB. |
|
including the following: calculations such as matrix transformations. Both SH-2s have access to 1.5 MB of synchronous DRAM (labeled Work RAM in Figure 1-1). into appropriate control signals for the other buses. video and sound subsystems. supports 15-bit or 24-bit color. VDP 1 uses a dual frame buffer that allows it to plot a new frame while the previously plotted frame is being displayed, permitting display at 60 frames per second or at slower rates that divide evenly into 60 frames per second. and can be programmed for 3-D sound and other effects. achieve simultaneous processing of different kinds of data. For example, Saturn can play up to 32 sounds while calculating transformations of 3-D models and displaying the resulting 2-D sprites in real time. |
RAM |
controller, and a direct memory access (DMA) chip. The bus controller translates addresses specified by the SH-2 CPU on the system bus into appropriate control signals for the other buses. This allows the SCU to integrate the A bus and B bus memory and processors into one large SH-2 memory map. These can be useful for tasks such as 3-D transformations. For example, you can load a program into the DSP that performs a coordinate transformation for rotating an object. When you need to rotate that object, you send the matrix of vertices you want to multiply through the DMA with a command that runs the program in the DSP for each vertex. The resulting transformed matrix of vertices ends up wherever the DMA is sending it, in this case VDP 1's VRAM. hard-wired programs. Sega provides libraries of programs that perform matrix calculations and other common tasks. DMA between any parts of memory without involving the SH-2 CPU. For example, you can DMA from work RAM to VDP 1's VRAM or from the cartridge port ROM to VDP 2's RAM. For an overview of the system memory map, see "Memory Configuration" later in this chapter. real-time clock and can reset either the entire system or individual microprocessors (SH-2, SH-1, 68EC000, and SCSP). The SMPC also controls nonmaskable interrupts sent to the SH-2 and via the SCU to the 68EC000, SCSP, VDP 1, and VDP 2. This capability permits the SH-2, for example, to interrupt the 68EC000's processing to request that it play a particular sound. The SMPC runs continuously and is powered by a battery when the system is off. SH-2 CPU can access the peripheral directly. In indirect mode, the SMPC regularly polls for and buffers the latest information from a variety of peripheral devices, including the eight-button Saturn controller and other devices that use a 4-bit parallel protocol, three-line handshake devices, serial devices, and Genesis controllers like the six-button controller, the mouse, and the Genesis team player. |
routines or poll the peripherals directly. Instead, your program can check SMPC registers whenever it needs peripheral data, and you can be sure that they contain the latest data. The SMPC continually polls for data and buffers whatever it finds in registers. and poll the devices as necessary. SH-2. Both chips run at 28 MHz. Because they are on a single system bus, one has to wait for the other if they both need to access the work RAM or anything else on the bus at the same time. However, each SH-2 includes cache RAM that you can configure either as a 4-KB 4-way write-through unified cache or as a 2-KB 2-way write-through unified cache plus 2 KB of RAM for use as private work RAM. cache and the slave SH-2's cache RAM configured as a 2-KB two-way cache with 2 KB of additional RAM. CartDev system module directly into the cartridge port and perform debugging and other tasks via a SCSI connection with a personal computer. For more information about the CartDev system, see "Programming Tools" in Chapter 4. "2x" CD drive that reads data at 300 KB/sec, and a 512-KB data cache. It reads CD+G, CD Red book (audio CD), CD Yellow book (CD-ROM), and CDX-A formats. ROM subsystem. For example, if you are writing a fast-paced game and you want the title screen to appear as soon as a player's character gets killed, you can send |
that it will be ready for immediate display when you need it. This capability avoids the wait times that occur with most CD drives. SH-1 directly; you can only request, via the driver, that the SH-1 read or write to the data cache. for both sound and audio. If this chip is available, it pipes decompressed video directly to VDP 2 and decompressed audio directly to the SCSP without having to use the buses. backgrounds that it plots and displays the resulting image via the RGB encoder. example, the SH-2 can perform matrix transformations or other processing at the same time that VDP 1 is plotting the display list to the inactive frame buffer and VDP 2 is displaying the contents of the active frame buffer and several backgrounds. information, see Chapters 2 and 3. backgrounds displayed by VDP 2. VDP 1 plots parts in the frame buffer one pixel at a time according to a list of commands, texture bitmaps, and other information in its VRAM. polygon with four vertices that's filled with a bitmapped texture. You can specify the colors for a textured part's pixels as 15-bit RGB codes (from a total of 32,768 possible colors), palette offsets (from up to 256 entries) from a base address in VDP 2's color RAM, or entries in a 16-color color lookup table (CLUT). A nontextured part is a polygon (interior filled), a polyline (outline colored, interior empty), or a line. VDP 1 can apply a single RGB or paletted color to a nontextured part. |
for any part. If you specify the color for a part using RGB values, VDP 1 can also perform color calculations on the part's pixels when it plots them to the frame buffer, including Gouraud shading, shadowing, half luminance, and half transparency. being displayed by VDP 2. VDP 2 integrates each frame with the current backgrounds, taking account of priority settings to determine how to display overlapping pixels. the way individual frames are erased and switched, which in turn determines how many frames are displayed per second. Display at 60 frames per second makes for smoother animation and a clearer image, but slower rates allow you to display more parts in a single frame. pattern tables, and other information in its VRAM. It can access four 128-KB banks of VRAM simultaneously during the four- or eight-cycle display interval after it displays one pixel and before it displays the next. You have complete control, via registers, of the way VDP 2 uses the cycles available in the display interval to access each bank of VRAM. VDP 1 and VDP 2. You can use either 15-bit or 24-bit color for palette entries. a scroll plane is larger than the TV display area and consists of tiled character patterns or a single bitmap image with an RGB color assigned to each pixel. Pixels specified with RGB colors may be 15-bit or 24-bit. planes. A normal scroll plane supports vertical and horizontal scrolling and can rotate around the z axis only. A rotation scroll plane supports two-axis rotation and scaling as well as vertical and horizontal scrolling. VDP 2 can display four normal scroll planes, or two normal scroll planes and one rotation scroll plane, or two rotation scroll planes. |
other backgrounds are transparent. The back plane can display a single RGB color or a different RGB color for each line, but can't display paletted colors. source for either frequency modulation (FM) sounds or pulse-code modulation (PCM) sounds. Musicians can compose music or generate sound effects using standard MIDI programs on a personal computer. To play those sounds in a game, you load tone bank data, AIFF files, MIDI sequence data, DSP programs, and commands into the appropriate parts of the sound memory map and trigger the commands when necessary. The system can handle 8- or 16-bit samples. a sound wave editor, and a sound compiler that creates sound banks and patch banks. These tools are described in the sound documentation listed under "Documentation" in Chapter 4. Sega also provides a library of general MIDI sounds. (PCM/FM) slots, a sound-exclusive 128-step DSP, and a digital mixer. The SCSP also acts as a DRAM controller for the 68EC000. frequency of each sample to the DSP sampling frequency of 44.1 KHz. You can use the 128-step program area in the DSP to apply various effects to all 32 channels, including reverberation, early reflection, echo, pitch shifting, surround sound, voice canceling, distortion, filters, panning, and parametric EQ. Sega provides tools that allow you to construct programs for the DSP on a Macintosh and to generate code you can download to the DSP from your program. of the mixer's slots can accept more than one channel's output. on a time-sharing basis with the SCSP, the 68EC000 runs at half this speed when the SCSP is running at full specification. |
commands and, like any MIDI sequencer, takes care of playing the sounds with the specified instrument, controller information, and so on. In most cases you don't need to provide your own sound driver, although you can if you want to. memory map. The SH-2 doesn't need to process additional instructions to access the multiplexed B bus. Instead, the SCU translates signals as necessary to provide transparent access to the entire system. You can access all memory and devices via the SH-2 memory map. four 32-MB areas shown in Figure 1-2. These four areas represent the entire SH-2 memory map. The IPL ROM occupies a small portion of CS0, the SCU uses CS1 and CS2, and CS3 is SDRAM. addresses as cache addresses. If you use these addresses, SH-2 looks first in its RAM cache for the specified address and uses it via the cache. Alternatively, if you use a cache through address to refer to the same location in the memory map, SH-2 looks directly in external memory without checking the cache first, even if the cache controller is turned on. |
memory maps, see the documentation for each component. 0x05900000 0x06000000 0x5900000 or from the SH-2 at 0x06000000. If you use the SCU address, you can perform a DMA, for example, from work RAM directly through to VDP 1. In this case the SCU generates an address for the work RAM, gets the data, puts it in the work RAM at that address, generates an address for VDP 1, and passes the data directly to VDP 1. This is faster than having the SH-2 perform the same task. |
|
and other information in its VRAM. While VDP 1 is plotting parts to the inactive buffer, VDP 2 integrates the active frame buffer with the backgrounds defined by its VRAM and displays the result. The frame buffers then switch roles and the process is repeated. Figure 2-1 shows the relationship between VDP 1, the frame buffers, and VDP 2. VRAM when it plots parts to the frame buffer, and some of its most important capabilities. For detailed information about VDP 1, see the VDP 1 Manual. polygon with four vertices that's filled with a texture bitmap. VDP 1 can plot three kinds of textured parts: |
for displaying 2-D transformations of 3-D objects. or offsets within palettes in VDP 2's color RAM. If you specify RGB colors for a sprite, you can also apply Gouraud shading and other color calculations to it. single palette color. VDP 1 can plot three kinds of nontextured parts: for each of its vertices. VDP 1 can then interpolate intervening color offsets across all the part's pixels. For example, if you specify color offsets for the vertices of a polygon that's part of a three-dimensional object, VDP 1 can interpolate the intervening color offsets across the polygon's pixels and shade the color smoothly as if the polygon were reflecting light from a nearby source. commands that tell VDP 1 what to plot for a single frame. Each command in the display list is specified by a command table, a 32-byte block that also indicates which command to execute next and other information VDP requires to execute the command successfully. For sprites, this information includes coordinates within which to plot and the address of a sprite bitmap elsewhere in VRAM. Depending on the command, a command table may also specify the address of a color lookup table or a Gouraud shading table. Figure 2-2 shows a simplified example. |
information in the SH-2's work RAM and replace the relevant parts of VRAM with a copy of the shadow during the VBL interrupt. VDP 1 then plots the sprites defined by the revised display list to the inactive frame buffer while VDP 2 is displaying the contents of the active frame buffer. Both byte access and word access are possible from the SH-2 or by DMA. All access to VRAM and the frame buffers occurs using burst transfer. commands: whether or not to clip and if so whether to clip inside or outside the currently defined boundaries. |
list by specifying a jump mode for each command. Jump modes instruct VDP to jump (after processing the current table) or skip (without processing the current table) to the next command table or to another command table elsewhere in the list. You can also use jump modes to specify another command as a subroutine of the current one, so that VDP 1 returns, after processing the subroutine, to the original command table or the one that follows it. Thus, if you want to keep a group of related commands that plot a particular object in one place in VRAM, you can move them in and out of the display list by manipulating jump modes. command should be performed inside or outside of the area defined by the clipping coordinates. If clipping is disabled, VDP 1 ignores any previously processed Set User Clipping Coordinates command when it processes the part. between the end codes. End codes make it possible to display sprites with nonrectangular shapes much faster than would otherwise be possible. plotted underneath those pixels (that is, with a lower priority) will be visible. If see-through pixels are disabled, see-through color codes in the sprite bitmap are plotted like other color codes and make those pixels opaque. described in the next sections. |
a single palette or CLUT while it plots the part. Any RGB color may be altered by the color calculations described in the next section while VDP 1 is plotting individual pixels to the frame buffer. frame buffer. Depending on a color mode set in the command table, VDP 1 interprets the sprite bitmap data as 4-bit offsets into a CLUT, 4- to 8-bit offsets into a color palette, or 16-bit RGB values. pixels. For RGB data, this involves simply copying the pixel data from VRAM. In this case, the high bit of each pixel descriptor is set to 1, and the remaining 15 bits specify an RGB value. For CLUT or palette data, VDP combines bits set in the color control word of the command table with the 4- to 8-bit offsets specified in the bitmap to obtain the values for all 16 bits. In this case, the high bit of the color control word (and thus of the pixel descriptors that VDP I plots to the frame buffer) should be set to 0. Figure 2-3 shows these two basic formats for pixel descriptors. descriptor's format and, depending on the format, the pixel's priority and information related to color calculation. The bits in a CLUT descriptor specify the CLUT's base address, which VDP 1 adds to the 4-bit offset in the sprite bitmap to locate an entry in that CLUT. The entry in the CLUT can be either a 16-bit RGB descriptor or a complete palette descriptor. If it is a palette descriptor in a format that permits priority settings, a CLUT entry may be used to specify the priority of an individual pixel as well as its color. paletted colors. All sprites whose pixels are defined with RGB values have the same priority, which is determined by a register set in VDP 2. A sprite whose bitmap is defined using paletted colors can have its own priority as determined by the color control word in its command table. If you want to set the priorities for a single |
backgrounds, use paletted colors. Priority has no effect between parts; to place parts in front of other parts, you must draw them in sequence, backmost part first. specified with RGB color: as bright. data by two, adds the results, and plots the sum, producing a semitransparent effect. VRAM. VDP 1 interpolates the intervening color offsets across the part to produce a smooth gradation. mode, plot trigger mode, fill data for erasing, and the frame buffer change mode. The frame buffer change mode determines the way VDP 1 changes and erases the frame buffers, which in turn determines how many frames are displayed per second. |
pixel in the active frame buffer after it is displayed and switches the frame buffers every 1/60 of a second for a display rate of 60 frames per second. Because the number of parts that VDP 1 can plot to a single frame is limited by the size and scaling of each part, the way colors are specified, the color calculations applied, and other factors, it may sometimes be necessary to plot more than once to the same frame buffer to display a large number of parts. You can do this by setting the frame buffer change mode register during the VBL interrupt to one of three manual modes (valid only for the next frame): buffers. buffers. frame buffers. frame (for display at 30 frames per second), you can set the frame buffer change mode as follows: during next VBL automatic 1-cycle mode, which only needs to be set once, or the Erase & Change manual mode, which needs to be reset for each cycle. diagonally, in effect rotating the entire frame buffer. Pixels that lie beyond the frame buffer coordinates are treated as transparent. Clipping areas remain fixed with respect to the frame buffer, so they are also rotated. |
mode is set to high resolution or HDTV. |
patterns, and other information in its VRAM. VDP 2 also includes 4 KB of color RAM that defines color data for use by both VDP 1 and VDP 2. Figure 3-1 shows the configuration of VDP 2. provides for accessing VRAM during the display interval, and some of the calculations it can perform as it displays each pixel. For detailed information about VDP 2, see the VDP 2 User's Manual. planes. The picture in a scroll plane is larger than the TV display area and consists either of tiled cells or a single bitmap image with an RGB color assigned to each pixel. A cell for a scroll plane consists of the color data for an 8-by-8-pixel area, defined either as palette offsets or as RGB colors. |
horizontal flipping of cells. You can also display the contents of two pattern name tables in different windows within a single rotation scroll plane. scrolled. It is visible only when all other backgrounds are transparent. The back plane can display a single RGB color or a different RGB color for each line, but can't display paletted colors. buffer, scroll plane data it reads from VRAM, priority settings for backgrounds and sprites, any color calculations to be performed, and various settings in its registers. When the TV screen is in normal mode, VDP 2 has an eight-cycle display interval: that is, it has eight clock cycles after the display of each pixel to get the scroll plane data it needs from VRAM to display the next pixel. When the TV screen is in high- resolution mode, VDP 2 has a four-cycle display interval. interval. VDP 2's VRAM consists of two 256-KB banks labeled VRAM-A and VRAM-B. You can optionally divide each of these into two 128-KB banks, for a total of four banks, each of which has a corresponding cycle pattern register as shown in Figure 3-2. |
VRAM-A1 VRAM-B0 VRAM-B1 by one square) determines access to the corresponding bank of VRAM during a single clock cycle. interval. Four eight-slot cycle pattern registers determine how VDP 2 uses the cycles it has available. You can set each slot in each register to specify that VDP 2 read a specific table in the corresponding bank of VRAM, provide read and write access to that bank from the SH-2 CPU, or not allow access the bank at all during that cycle. This means, for example, that you can calculate line scrolling for a single scroll plane without having to calculate it for all scroll planes. User's Manual. For example, certain kinds of accesses must be performed at or before specific cycles in the display interval. If you are trying to do something complex, you may find that you need to use two VRAM banks and split up the accesses across two different cycle pattern registers. Similarly, because of the additional data and accesses required for a rotation scroll plane, you need to use two 128-KB banks and two cycle pattern registers to plot each pixel in the plane. VRAM bank consists, at a minimum, of a pattern name table, a character pattern table, and character patterns. If you define a scroll plane using RGB colors, the data in VRAM consists, at a minimum, of the bitmap data. In addition, a bank of VRAM may also include the following tables, depending on the kind of scroll plane and what you want to do with it: edge of the rotation plane, matrix parameters that specify the degree of |
rotation is observed, and center coordinates that determine the point around which the plane rotates. example, if the horizontal coefficient is 0.1, VDP II stretches out each pixel horizontally to occupy ten times it's normal width. You can use coefficient tables to stretch or squeeze the plotting of one or more pixels vertically or horizontally to produce scaling, bowing, and other effects. 2048 palette entries or from 32,768 or 16,777,216 RGB colors. The amount of RAM required to specify each of a cell's pixels varies from 4 bits to 32 bits, depending on the number of colors. Cells are referenced through several levels of indirection from tables in VRAM that identify character patterns and collections of character patterns to be displayed as a scroll plane. table, for a square made of either one or four cells. Each character pattern is referenced from a pattern name table, which references all the characters for a 32- by-32- or 64-by-64-character page. References to pages can be grouped in planes, and references to planes can be grouped in a map that defines a single scroll plane. You can combine these references in various ways to build up a scroll plane as large as 8192 by 8192 pixels from just a few character patterns occupying a small portion of VRAM. character pattern table. Depending on the way the character pattern's colors are specified, the pattern name table may also identify the address of a palette in color RAM and additional information about horizontal or vertical flipping and priority and color calculations. values. If you use 15-bit color, each palette entry occupies 16 bits and you can specify a total of 2048 entries. If you use 24-bit color, each palette entry occupies a |
using 24-bit color wastes 1 byte of RAM per palette entry and restricts the total number of entries to 1024. registers, and set the cycle pattern registers as necessary during each display interval. Initialization includes setting the scroll rotation matrix parameters, the color mode register (for either 15-bit or 24-bit color), and the priority registers and clearing the color calculation and color offset registers. the starting point within the pattern name table for display of the upper-left corner of the plane on screen. For continuous scrolling, you should reset these values during each VBL interrupt. the portion that fits and then replace it with another portion that is shifted in the appropriate direction through the original table. to a pattern name table and a character pattern table. The coefficient table determines the rate at which VDP II steps through the original pattern name table as it plots each pixel, thus allowing for vertical or horizontal scaling and special effects. Each coefficient is a 4-byte representation of a decimal value and applies to a line, groups of pixels, or (potentially) a single pixel. displays one frame. Because VDP 2 needs continuous access to the k coefficients to display a rotation scroll plane accurately, you should normally load new k coefficients during the VBL interrupt, either just before or just after you swap frame buffers. It's also possible to load new coefficients during the HBL interrupt. parameters set in VDP 2's registers. These include the following: |
axis, or on the y and z axis, but not on the x axis and y axis simultaneously. priority settings for each part that uses paletted colors, a single priority setting for all parts that use RGB colors, and a single priority setting associated with each background. For example, if you are displaying a sprite and two backgrounds, one showing trees in front of a main background showing a landscape, you can set priority bits for the sprite's pixels so that Saturn displays the trees in front of the main background and the sprite between the backgrounds. You can then bring the sprite to the foreground by changing the priority settings for all its pixels. underneath it by specifying 0 as the color for those pixels. draw them in sequence, backmost part first. ratios and make use of the priority settings for the sprite or background pixels involved. VDP 2 color calculations are useful for making sprites and backgrounds appear or disappear gradually. and dividing the RGB values of the sprite or background below it in half. |
development that are currently available or will soon be available. Other tools, not discussed here, will also be available later in 1994. your program. Three tools are currently available: specify a sprite. specify a background. SAT3 file for your program. a PICT or PCX file and converts it to an array of 15-bit RGB values in the form of a C header file you can compile directly into your program. The header file defines an array of 16-bit pixels. When necessary at run time, your program copies the array to an address in VDP 1's VRAM so that you can specify it as a sprite bitmap. |
PCX file and converts it to a C header file you can compile directly into your program. In the process, BRIP eliminates duplicate character patterns, including vertical or horizontal mirror images. The PCX file can specify either paletted colors or up to 256 RGB values. Unlike SCONVERT, BRIP outputs three arrays: an array of 8-bit character patterns (a character pattern table), an array of references to those character patterns (a pattern name table), and an array that defines a single palette used by the character patterns. (BRIP doesn't yet support back screens or enforce the nested references to cells, pages, and planes described in Chapter 3.) PhotoShop or Debabelizer file to a C header file that you can compile directly into your program as a sprite bitmap. The file to be converted can specify either RGB color or paletted color. If the file specifies RGB color, SaturnSP_C outputs an array of 16-bit RGB color values. If the file specifies paletted color, SaturnSP_C outputs two arrays: an array of 8-bit indices into the palette and an array that defines a 256- entry palette. or Debabelizer file to a C header file you can compile directly into your program. The file to be converted must specify paletted color. SaturnBRIP outputs three arrays: an array of character patterns (a character pattern table), an array that defines an array of references to those character patterns (a pattern name table), and an array that defines the palette used by the character patterns. 3-D software tools such as 3D Studio and use that model to export a series of bitmapped images. You then display the bitmapped images in a series of frames to create the illusion of movement in three dimensions. Each bitmapped image takes up a lot of memory and you must be able to predict all potential movements of an object in order to provide the appropriate bitmaps. model to the SAT3 format, the standard Saturn file format for 3-D information. For example, suppose you want to display a rotating cube. The 3-D model consists of six four-sided polygons, each of which is filled with a bitmapped image. When you |
transformations for the vertices of the six polygons in 2-D space, distort the bitmaps for each polygon accordingly, and display the resulting image on the screen--all at run time at 30 or 60 frames per second. Thus, instead of limiting potential motion to preselected views of a 3-D model, you can orient it any way you want and update each frame at run time. object, an array that defines the object's faces by specifying their vertices, and a variety of other information such as vertex normals used in Gouraud shading. This arrangement allows you to perform a matrix transformation on the vertex coordinates before associating those vertexes with specific faces, thus avoiding repeated calculations for shared points. the information provided by the SAT3 file format. For example, if you don't intend to apply Gouraud shading to an object, you don't need to include that information in your program. In most cases you should create a third file from the SAT3 file that includes only the information you need for your program. SH-2 CPU. GNU supports registerized parameters--that is, it allows you to refer to up to four registers directly; other parameters are on the stack. can use to compile and link assembly and C files. You can also use other third-party assemblers to compile and link assembly files. Typically, these assemblers provide a debugger, a linker, and a command-line DOS interface that requires a DOS extender. and other parts in assembly language using a third-party assembler, then link both the GNU C modules and the assembly files and output C files in the COFF file format. debuggers with the CartDev to debug your program, as shown in Figure 4-1. |
(ICE) as a debugging system. Unlike software debuggers used with the CartDev, ICEs provide a history display and can deal with more esoteric problems such as interrupts or anything that requires strict tracing of code. In some cases it may be desirable to use both the CartDev and an ICE at the same time for different purposes. architecture, you can load files into the Sherry simulator, an SH-2 simulation program that runs on a PC. Sherry simulator in more detail. port. It has its own controller that handles all communication. A SCSI (SCSI 2) interface permits communication with the CartDev from an IBM PC, a Macintosh, or other hosts, such as SGI workstations. The CartDev communicates with Saturn through dual port RAM. It also includes dual-access emulation RAM (RAM that can be read or written to from either the CartDev or from Saturn) that includes 64 KB of static RAM, with room for up to 8 MB of optional DRAM. |
one in-and-out high-speed parallel port for an auxiliary interface. Currently, the auxiliary interface consists of a sound adapter with a digital audio interface and two sets of in, out, and through MIDI ports that can handle up to 32 voices. Other auxiliary interfaces may be developed in the future. and, when used with appropriate debugging software, allows you to set software breakpoints, single step through code, and read and write to memory. to download or upload art or sound files. In general, downloads with the CartDev are ten or twenty times faster than downloads with the E7000 ICEs. The CartDev has an open interface that allows third parties to use its communication capabilities for additional game development tools. similar hardware debugging capabilities and can emulate the SH-2 processor. Each version of the E7000 ICE knows about all internal workings of the processor on a cycle-per-cycle basis (including pipelining), and maintains a history of previous instructions. from a host with telnet capabilities. interface card. proprietary parallel interface card used with the E7000PC. same time as the CartDev. The E7000 ICEs can be helpful with low-level problems such as interrupts or crashes that corrupt the system, or with any problem that you can't isolate using a software debugger. |
program you can run on a PC without any connection to Saturn or any other hardware. If you load an S record into the Sherry program, it allows you to set breakpoints and single step through code using a memory map that emulates the SH-2 memory map. This is especially valuable for observing clock cycle counts for pipelined RISC instructions and for learning how new instructions and the ordering of instructions affect the pipeline. only uses as much of the PC's memory as your program requires, even if you are addressing a larger memory space. It doesn't simulate the cache. programs. Because the SH-2 chips are RISC, assembly-language programming for Saturn can be more complex than for other game machines. For example, you must deal with pipelining if you write in assembly language. This means development in assembly language may take longer than development in a high-level language. some circumstances than an assembler, it takes care of many of the complexities of RISC programming, such as pipelining, automatically. Hand-crafted assembly code can be useful in situations where slight performance improvements are significant, but compiled C code works just as well for many tasks. programs for Saturn. |
Saturn Stream System, ST-098 |
|
transparent. values. patterns for a scroll plane. plotted is "clipped." for a part or information that VDP 1 combines with the offsets specified in a sprite bitmap to obtain a pixel descriptor. jump mode, and other information VDP 1 requires to execute the command. cycles in the display interval to access its VRAM. and before it displays the next. You have complete control, via the cycle pattern registers, of the way VDP 2 uses the cycles available in the display interval to access its VRAM. frame. rotated and distorted by specifying the coordinates of four corner points. color. |
that simulates transparency. vertical scrolling of cells, vertical and horizontal flipping of cells, and line zooming from 256x to 0.25x of normal size. the high bit is set to 1, the remaining 15 bits specify an RGB value. If the high bit is set to 0, the pixel descriptor consists of information from the color control word combined with an offset in the sprite bitmap, and it specifies either an entry in a color lookup table or a palette entry in VDP 2's color RAM. single color. it encloses) can be drawn with a single color. well as horizontal line scrolling, vertical scrolling of cells, and horizontal and vertical flipping of cells. magnified or reduced horizontally, vertically, or both horizontally and vertically. with a bitmapped image; also called a sprite. |