Copy Link
Add to Bookmark
Report

Xbox GPU Basics

xbox's profile picture
Published in 
xbox
 · 9 months ago

written by Michael Steil, 1 July 2002

The Xbox graphics hardware manufactured by nVidia is nothing more or less than a PCI (or AGP) VGA card.

Being VGA compatible means that it has all MDA/CGA/EGA/VGA text modes and all CGA/EGA/VGA graphics modes, including Mode X, and that it can be programmed just like IBM's Video Graphics Array from 1988. PCI VGA cards differ from the legacy VGA architecture in concerns of I/O and video RAM access.

VGA Access Methods

The Xbox kernel bootloader configures the VGA hardware so that the legacy I/O ports from 0x3B0 to 0x3DF as well as the legacy memory region from 0xA0000 to 0xBFFFF are disabled, just like on a secondary PCI VGA card in a PC. All VGA accesses are done through the two memory regions introduced with PCI VGA cards. It might be possible to re-enable the legacy resources, but this has not been tested yet.

Like all nVidia graphics controllers, the Xbox GPU has two memory regions in the i386's 4 GB address space: one for Memory Mapped I/O (MMIO) at 0xFD000000 and one for the video RAM at 0xF0000000. Note that these locations are assigned by the Xbox kernel bootloader and can of course be changed using PCI configuration statements.

Memory Mapped I/O

All nVidia VGA hardware has a similar MMIO layout. The most important thing about it is how to access the standard VGA registers, for example to set up a text mode. The standard VGA registers can be found at the following locations in the MMIO space (add 0xFD000000 to get a valid address within the Xbox kernel):

Register NameVGA I/O portnVidia MMIO address
ATTR_REG_INDEX0x3c00x006013c0
ATTR_REG_DATA0x3c10x006013c1
CRTC_REG_INDEX0x3d40x006013d4
CRTC_REG_DATA0x3d50x006013d5
GRA_REG_INDEX0x3ce0x000c03ce
GRA_REG_DATA0x3cf0x000c03cf
SEQ_REG_INDEX0x3c40x000c03c4
SEQ_REG_DATA0x3c50x000c03c5
MISC_REG0x3c20x000c03c2

A simple way to switch into 80x25 text mode would look like this:

void crtcout(unsigned char reg, unsigned char data) { 
/* a single 16 bit access might also work */
_asm {
mov al, reg
mov ebx, 0xFD6013d4
mov [ebx], al
mov al, data
mov 1[ebx], al
}
}

void settextmode() {
crtcout(0x00, 0x5F);
crtcout(0x01, 0x4F);
crtcout(0x04, 0x54);
crtcout(0x05, 0x80);
crtcout(0x07, 0x1F);
crtcout(0x10, 0x9C);
crtcout(0x17, 0xA3);
}

Of course, we would have to set up a font first, because the Xbox GPU includes no font in ROM. This information will be important for many different efforts, because it will allow us to output debug information to the screen quite easily, once everything works.

Video RAM

Nothing is known yet on how the video RAM addresses at 0xF0000000 are related to the legacy addresses at 0xA0000.

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT