Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
66 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

Contents
 Dreamcast Hardware
 Drawing Pixels
 on the Screen


 Printable version
 Discuss this article
 in the forums



The Series
 Part I
 Part II

Disclaimer: Please be aware that all information is provided as-is, and may be used at your own risk. "Sega" and "Dreamcast" are trademarks of Sega Enterprises. All information here has derived from my own experience. Nothing in this document is under any type of NDA nor does it include any information from the official dreamcast development kit.

Introduction

In Part I we talked about what you need in order to start developing Dreamcast programs. Assuming now that you have your Dreamcast development system up and running, it’s time to get started doing some really cool stuff, like drawing graphics on the screen. So without further ado let's get started.

What you need to do before we start

You are going to need to download and install libdream 0.71 or KOS 0.6. Please READ the libdream.txt before you get started!!!

This is a simple guide to get you started in DC programming it is by no means complete.

The goal of this series is to get experienced game programmers into Dreamcast coding thus it is missing all those nice hand-holding beginner’s steps.

Dreamcast Hardware

Here’s a quick overview of the dreamcast hardware.

Note: You will need either libdream 0.71 or KallistiOS 0.6 installed first. Instructions are found in the archive.

The Dreamcast is a nice, cleanly designed beast that has a total of 8 megs of video memory. Now that may not seem like that much but it’s more then enough to create great looking programs. The Dreamcast comes with a TA or a Tile Accelerator provided by NEC's PowerVR chip. The TA gives the Dreamcast all that 3D power that we’re used to. For now, we're not going to use the TA, we're just going to use the video memory as a large frame buffer.

Since we're using libdream we don’t really need know every thing about the Dreamcast in order to get things done. However, I believe that you’ll learn more about the Dreamcast as time goes on and you continue to program for this amazing system. So here’s a basic rundown of what we have to work with hardware-wise.

Color Modes

RGB555 2 Bytes (16-bit Color Depth)
RGB565 2 Bytes (16-bit Color Depth)
ARGB4444    2 Bytes (16-bit Color Depth)
RGB888 4 Bytes (32-bit Color Depth)
ARGB888 4 Bytes (32-bit Color Depth)

Resolutions List

Note: This list is not complete because these are the only ones supported right now.

320x240x16
640x480x16
640x480x32

Base Address of the frame buffer is 0xA5000000

Base Address of the PowerVR chips is 0xA05F8000

What the Heck is RGBXXX?

Well, the 565 in RGB565 represents the number of bits used to store each color component. The red and blue components are stored with 5 bits and the green component is stored with 6 bits.

How Do I Convert RGB5XX into a 16-bit number?

#define RGB565(r, g, b) ((r >> 3) << 11)| ((g >> 2) << 5)| ((b >> 3) << 0)
#define RGB555(r, g, b) ((r >> 3) << 10)| ((g >> 3) << 5)| ((b >> 3) << 0)




Next : Drawing Pixels on the Screen