This document contains sections on setting up your Dreamcast system, using the Dreamcast SDK, and using the GD-ROM.
Hardware and Software Setup of Windows CE for Dreamcast
Hardware Requirements
Setting Up Your Dreamcast Development System
Installing the Windows CE for Dreamcast SDK
This section explains how to set up a Dreamcast system and how to install the Windows CE for Dreamcast SDK on your Windows® NT 4.0 development computer. If possible, print out this document for easy reference and convenience.
Even if you have already set up and configured Dreamcast, unplug everything, and start from the beginning. This version of the SDK uses some ports differently than previous versions of the SDK.
After having successfully completed all the instructions in this document, you can do the following:
Run the Windows CE for Dreamcast OS on your Dreamcast console.
Run the SDK samples on your Dreamcast system.
Write and build your own applications and games that take advantage of the Windows CE for Dreamcast OS and DirectX components.
Remotely debug the samples or your own applications and games on your Windows NT development computer.
Hardware Requirements
Read this section carefully to be sure that you meet all the hardware requirements before proceeding with the setup instructions. You need the following:
A desktop computer running Windows NT 4.0, either a server or a workstation, with Service Pack 3 (SP3) installed. Windows 95, Windows 98, and Windows NT 5.0 are not supported in this release. This is your development and debugging computer, also called the host, and is connected directly to the Dreamcast console. Here are the requirements for your host computer:
Not an NEC 98 series. This platform is not supported by Windows CE for Dreamcast.
A Pentium® 133MHz, or faster, processor.
32 MB of RAM.
213 MB of free disk space for installation only, or 382 MB for installation and compiling all samples.
At least one serial port (COM port) free and available for use if you want to use the communications functions.
An Adaptec SCSI controller (1542, 1742, 2940, 2940U, 2940UW, or 3940) installed, with an external SCSI connector. SCSI controllers from other manufacturers may not work with the Dreamcast console. While it is possible to connect Dreamcast to the existing SCSI chain on your host computer, it is highly recommended that you install a separate SCSI card that services only Dreamcast. This eliminates the risk of corrupting your hard drives or crashing the development computer.
Dreamcast SET5.2. This is your target platform. Earlier versions are not supported in this version of the Windows CE for Dreamcast SDK. Your Dreamcast development system should have the following:
A power cable.
A null-modem serial cable.
A Cross Products CD-ROM emulator or debug adapter. The emulator comes with a parallel port dongle. This dongle is currently not needed, but should be saved for future versions.
An SCSI cable that fits the external connector on the Windows NT computer SCSI controller and has a SCSI2 male connector on the other end
An SCSI terminator. This small device may already be attached to one of the two SCSI ports on the rear panel of the Dreamcast console.
Dreamcast gamepads with four buttons. These plug directly into the front of the Set5.2 console.
(Not included) A VGA monitor with cable or an NTSC television with appropriate RCA cables to connect to the Dreamcast console.
(Optional) A desktop computer running Windows 95. This Windows 95 computer can be used as an emulation target platform. This computer should have at least the following:
A Pentium 133MH, or faster, processor.
16 MB of RAM.
DirectX 5.0 run-time installed, which can be obtained from the Web site http://www.microsoft.com/directx
A 3-D accelerated graphics card.
A sound card.
Setting Up Your Dreamcast Development System
SCSI Connection
Monitor or Television
Power
Optional
Dongle
This section outlines the steps necessary to set up the Set5 Dreamcast development hardware and connect it to your Windows NT development computer. The following illustration shows some of the cables that come with your Set5 hardware.
![[IMG]](https://web.archive.org/web/2im_/http://file:///C:/Users/0OOO0O%7E1/AppData/Local/Temp/msohtmlclip1/01/clip_image002.gif)
Cables
SCSI Connection
On the back panel of the Dreamcast console, there are two rotary switches that represent SCSI IDs. Set these switches to use IDs that are not currently being used by any other existing SCSI devices on your development computer. To find out which SCSI IDs are already being used, boot your Windows NT computer, and watch as your SCSI adapter enumerates the existing SCSI devices on your chain. You may be able to accept the default settings of these switches, which are 3 and 4.
Note
Do not connect the Dreamcast development system to a SCSI controller serving other SCSI devices, such as a Windows NT system disk or other hard drives. If you do, the debug adapter may lock up or crash during the development process, resulting in possible data loss.
The following illustration shows the back panel of the Dreamcast console.
![[IMG]](https://web.archive.org/web/2im_/http://file:///C:/Users/0OOO0O%7E1/AppData/Local/Temp/msohtmlclip1/01/clip_image004.gif)
The back panel of the Dreamcast console
1. Insert the SCSI terminator in one of the two SCSI ports on the back of the Dreamcast console.
2. Be sure that your Windows NT development computer is turned off. Insert one end of the SCSI cable in the other SCSI port on the back panel of the Dreamcast console. The other end of the SCSI cable needs to be connected to an SCSI card in your Windows NT development computer. Install a separate SCSI card that services only the Dreamcast console. This eliminates the risk of corrupting your hard drives or crashing the development computer.
Monitor or Television
If you are using a VGA monitor, connect the VGA cable to the port on the back panel of the Dreamcast console labeled Analog RGB (VGA). If you are using an NTSC television, connect the RCA cable from the television to the port on the Dreamcast console labeled Video.
Plugging in the Gamepads
The following illustration shows the front panel of the Dreamcast console.
![[IMG]](https://web.archive.org/web/2im_/http://file:///C:/Users/0OOO0O%7E1/AppData/Local/Temp/msohtmlclip1/01/clip_image006.gif)
The front panel of the Dreamcast console.
Connect the Dreamcast gamepad(s) to the plugs on the front of the Dreamcast console.
Power
Connect the power cable to the back of the Dreamcast console and plug it into a suitable power outlet. Do not turn it on yet.
Optional Setup
If you require serial communications, connect one end of the null-modem serial cable to the Dreamcast console serial port labeled SERIAL. Connect the other end of the serial cable to the COM1 or COM2 port of the Windows NT development computer.
If you require sound output, connect suitable speakers or the audio inputs of your television to the two ports on the back panel of the Dreamcast console labeled L-Audio-R.
When you need to create a Sega GD-ROM image of the application, a GD-ROM writer cable must be installed in the port labeled For GD-Writer on the back panel.
Dongle
Your hardware setup is now complete. The dongle supplied with the Dreamcast system is not used in this version.
Installing the Windows CE for Dreamcast SDK
Verification of SCSI Devices
Configuring the SDK For Debug or Retail
Selecting NTSC vs. VGA Mode
Setting Up the GD-ROM Emulator (Optional)
Verification of Complete Setup
This section outlines the steps necessary to install the Windows CE for Dreamcast SDK on your Windows NT development computer and configure your system to work with the Dreamcast system.
1. Before beginning the installation:
Be sure that you have installed Microsoft Visual C++ with at least the typical setting if you want to be able to run all the samples in the Dreamcast SDK.
Be sure Visual Studio is not running.
If you have not already installed the current version of the Microsoft Windows CE Embedded Toolkit for Visual C++ 5.0, you must uninstall any previous versions of the toolkit before you can install the current toolkit.
2. Install the Advanced SCSI Programming Interface (ASPI), if it is not already installed. This is an Adaptec-developed interface specification for sending commands to SCSI host adapters. To check for ASPI installation, type the following at a command prompt:
dir %SYSTEMROOT%\system32\drivers\aspi32.sys
If this file is not found, install the Windows NT ASPI services from the following location:
ftp://ftp.adaptec.com/pub/BBS/winnt/aspi32.exe
3. Run the Setup.exe program from <WCEDreamcast>\Eng or from <WCEDreamcast>\Jpn. This will install the Windows CE Embedded Toolkit for Visual C++, the SH4 Enhancement Pack, and the Windows CE for Dreamcast SDK. It will also upgrade the debug adapter firmware and the Dreamcast Boot ROM firmware.
Verification of SCSI Devices
1. Turn on the Dreamcast console by pressing the large button on the front of the unit.
This causes various light-emitting diodes (LEDs) to blink and the disk to spin.
2. Reboot the Windows NT computer.
As the Windows NT computer is booting, you should see some basic I/O system (BIOS) messages from the Adaptec SCSI controller, including a list of SCSI hardware found. You should see GD-M and Katana DA, in addition to whatever hardware you normally see listed.
The GD-M emulator appears as a removable SCSI disk to Windows NT.
3. Note the drive letter that has been assigned.
Configuring the SDK For Debug or Retail
The Windows CE for Dreamcast SDK creates an environment variable, _FLATRELEASEDIR, when it is installed. This variable contains the default directory and is initially set to <WCEDreamcast>\Release\Wince\Debug. When you require the retail version of an application without any debug information embedded into the code, this variable should be edited to <WCEDreamcast>\Release\Wince\Retail.
To edit this environment variable
1. Open Control Panel on your Windows NT computer.
2. Choose the System icon, and go to the Environment tab.
3. Choose _FLATRELEASEDIR in the User Variables box.
4. Type the new entry in the Value box.
5. Choose Set, and then choose OK.
If you change the value of this variable in the future, you must close all command windows and re-open them in order for the change to take effect.
Selecting Television vs. VGA Mode
This release supports selection of television or VGA mode, using the DIP switches on the SET5 front panel after you have successfully upgraded the Dreamcast Boot ROM.
If DIP switches 1 and 2 on the left are down, television is selected. If DIP switches 1 and 2 are up, VGA is selected. DIP switches 3 and 4 should always be down.
If television is selected, the broadcast format should be set on the rotary switch on the front of the Set5. The available settings are:
0 NTSC
1 PAL
2 PAL-M
3 PAL-N
Setting Up the GD-ROM Emulator (Optional)
The GD-ROM emulator is a device that appears as a GD-ROM to the Dreamcast system, while appearing as a removable SCSI disk to the host computer. Using the supplied Cross Products software called GD Workshop, you can construct a virtual GD and test it on the Dreamcast console without actually burning a GD-ROM.
Verification of Complete Setup
Your Dreamcast console and Windows CE for Dreamcast SDK should now be set up properly. To verify they are set up properly, follow these steps.
1. Turn on the Dreamcast console, if it is not already on.
2. Open dctool by double-clicking on the “Dreamcast Tool†icon in your Windows CE for Dreamcast SDK program folder.
3. When the window pops up, choose Boot. You should see something similar to this:
Connecting to Dreamcast...
Connected
Found SEGA KATANA_DA Device on SCSI Host <1> : SCSI Device <3>.
resetting target...
>> The console status is 'executing' user code outside debug stub (RUNNING)Image physical size : 0050756c
Physical start address : 8c010000
Section: address=8c011000, size=0003f1ec
Section: address=8c051000, size=000011f0
Section: address=8c053000, size=000385d0
. . .
4. After dctool has downloaded the image, you should see output in the command window which indicates that the Windows CE for Dreamcast OS is booting.
5. You should also see a “Windows CE>†prompt in the dctool window. Type s chessbrd at this prompt.
6. You should see the D3DIM/DDraw/DInput chessbrd sample running on your monitor/TV. Press X to exit the sample.
You are now ready to start developing your own games, using the Windows CE for Dreamcast SDK.
Contents of the Dreamcast SDK
This section describes the contents of each of the Windows CE for Dreamcast SDK. <WCEDreamcast> refers to the top-level directory where you have chosen to install the SDK.
When you install the Windows CE for Dreamcast SDK on your computer, you choose the drive letter and top-level directory where the SDK files are copied. The setup program creates several subdirectories under this location and copies the appropriate files to them. The following are the directories in the tree:
<WCEDreamcast>
This is the root directory of the installation. The WCEDREAMCASTROOT environment variable contains the full path of this directory. The setup program does this for you. This directory contains two batch files, W95emul.bat and Wce.bat. Depending on whether you are developing for Windows CE for Dreamcast or Windows 95, you need to run one of these two batch files. The SDK installation process creates two shortcuts that open command windows and automatically run these batch files. These shortcuts are in the Windows CE for Dreamcast SDK program folder.
<WCEDreamcast>\Docs
This directory contains documentation on how to set up your Dreamcast system and the Windows CE for Dreamcast SDK, how to use the SDK, how to use the tools provided, and so on. It also contains several IVI and IVT files that can be viewed from the InfoViewer window within the Visual Studio IDE. These online Help files contain information about the SH4 processor, a DirectX programming guide, and reference manuals for the DirectX and Windows CE APIs supported for Dreamcast.
<WCEDreamcast>\Inc
This directory contains header files for all supported APIs on Dreamcast, including those for DirectX and Windows CE. Include these header files when building an application, whether you are building it for Windows 95 or Windows CE to ensure that your application runs on both platforms.
<WCEDreamcast>\Lib
This directory contains the import libraries that your application must link with, depending on which components you use. The directory <WCEDreamcast>\Lib\Wince\(Debug, Retail) contains libraries for building your application for Windows CE on the SH4. This includes the core Windows CE libraries (Coredll.lib, Corelibc.lib), the C run-time library (Fulllibc.lib), and the DirectX libraries (Ddraw.lib, D3dim.lib, Dsound.lib, Dinput.lib, and Dplayx.lib). The <WCEDreamcast>\Lib\Win95\(Debug, Retail) directory contains DirectX 5.0 libraries for Windows 95. These are the same libraries that ship with the desktop version of the DirectX 5.0 SDK.
<WCEDreamcast>\Tools
This directory contains tools for use with Dreamcast, such as Dctool. These tools are described in detail in the <WCEDreamcast>\Docs\Tools.doc. The Cross Products tools are also found in the <WCEDreamcast>\Tools directory. These include utilities to upgrade the Flash ROMs on Dreamcast, as well as administer the GD-ROM emulator. The <WCEDreamcast>\Tools directory contains an image of the latest firmware for the Dreamcast Boot ROM.
<WCEDreamcast>\Release
The <WCEDreamcast>\Release\Wince\(Debug, Retail) directory contains the released Windows CE and DirectX binaries (DLLs and EXEs) for the SH4. In this directory are the binary image (Nk.bin) for the OS, which needs to be downloaded to Dreamcast before you can run your application. Even if a certain .dll or .exe file is not included in the binary image, it can still be accessed by Dreamcast, using the Dctool shell program, as long as the file is located in this release directory. The release directory also contains the built executables for all the SDK samples, so you can run them immediately without having to build them yourself. The <WCEDreamcast>\Release\Win95\(Debug, Retail) directory contains Windows 95 versions of pre-built executables for all the SDK samples.
<WCEDreamcast>\Samples
This directory contains source code and make files for all the samples. These samples can be built for either Windows 95 or Windows CE. Study these samples to get a better understanding of how to write applications and games for Dreamcast. A complete list of samples is provided in the Samples appendix in the IVT documentation.
Booting the OS Image
This section assumes that you have set up your Dreamcast system and that you have an OS image file called Nk.bin. The release directories already contain sample images, or you can generate your own, following the instructions in the next section.
To boot the OS image
1. Turn on the Dreamcast console, using the large button on the front panel. Wait 5 seconds to make sure that the hardware is completely up.
2. From your Windows CE for Dreamcast SDK program folder, start the Dreamcast Tool (dctool.exe). This tool allows you to download a binary image to your Katana and also provides the command line shell interface to the Windows CE kernel. Dctool always loads files from the directory specified by _FLATRELEASEDIR.
3. In the Dctool window, choose the Boot button. Before doing this, make sure your Dreamcast console has been on for at least 5 seconds. In the lowest pane of the Dctool window, you should see something similar to this:
Connecting to Dreamcast...
Connected
Found SEGA KATANA_DA Device on SCSI Host <1> : SCSI Device <3>.
resetting target...
>> The console status is 'executing' user code outside debug stub (RUNNING)Image physical size : 0050756c
Physical start address : 8c010000
Section: address=8c011000, size=0003f1ec
Section: address=8c051000, size=000011f0
. . .
4. After Dctool has downloaded the image, you should see output in the pane called Remote File System, which indicates that the Microsoft Windows CE is booting. You should also see a “Windows CE>†prompt in the Command Shell pane.
5. The OS image has now been loaded into Dreamcast and run. You should see activity from the Dctool command shell as described in the following:
On a successful boot, the command shell within Dctool produces the following prompt:
Welcome to the Windows CE Shell. Type ? for help.
Windows CE>
See later sections on what you can do at this prompt.
On a successful boot in a debug build, Dctool outputs something like the following code example. Retail builds have fewer lines of output.
Windows CE Kernel for Hitachi SH Built on Aug 13 1998 at 17:24:06
SH-4 Kernel
0x0: CCR=0105
0x0: Set 5 is detected
0x0:
Old or invalid version stamp in kernel structures - starting clean!
0x0:
Booting kernel with clean memory configuration:
0x0: FS0: 8c523000 00000000 00000000 00000000
0x0: FS1: 00000000 00000000 00000000 00000000
0x0: K0 : 8c523000 009cd000 00000000 00000000
0x0: K1 : 00000000 00000000 00000000 00000000
SH3Init done.
Windows CE KernelInit
0x0: 0: paStart=0c523000 paEnd=0cef0000 paLimit=0c523000 pUseBase=8ceef000 pUseMap=8ceef634
Scheduling the first thread.
0x8ceeee9c: KernelInit2: pCurThread=8ceeee9c hCurThread=0ceeee7e hCurProc=0ceeefe2
0x8ceed8d0: FileSystem Starting - starting with clean file system
0x8ceed074: CreateNewProc failure on \Windows\SystemPatchModule.exe!
0x8ceed8d0: Filesystem initialized!
0x8ceeb9d8: Bits-per-pixel: 16
0x8ceeb9d8: Adding font resource '\Windows\arial.ttf'...
0x8ceeb9d8: **** Signature of FONT File is: '0100'...
0x8ceeb9d8: Adding font resource '\Windows\msgot.ttf'...
0x8ceeb9d8: **** Signature of FONT File is: '0100'...
0x8ceeb9d8: LoadOneLibrary failure on kbdmouse.dll!
0x8ceeb9d8: LoadOneLibrary failure on keybddr.dll!
0x8ceeb9d8: Could not load keyboard driver dll keybddr.dll
0x8ceeb9d8: InitStaticControl returned FALSE.
0x8ceeb9d8: InitButtonControl returned FALSE.
0x8ceeb9d8: InitListboxControl returned FALSE.
0x8ceeb9d8: InitComboxControl returned FALSE.
0x8ceeb9d8: InitEditControl returned FALSE.
0x8ceeb9d8: InitSBCtl returned FALSE.
0x8ceeb9d8: InitImageLists returned FALSE.
0x8ceeb9d8: UpdateIdleTimeoutFromRegistry
0x8ceeb9d8: UpdateIdleTimeoutFromRegistry: using battery idle timeout of 0 sec
0x8ceeb9d8: UpdateIdleTimeoutFromRegistry: using external idle timeout of 0 sec
0x8ceeb9d8: UpdateIdleTimeoutFromRegistry: no wakeup idle timeout in registry.
0x8ceeb9d8: UpdateIdleTimeoutFromRegistry: using wakeup idle timeout of 60 sec
Hardware and Software Setup of Windows CE for Dreamcast
Hardware Requirements
Setting Up Your Dreamcast Development System
Installing the Windows CE for Dreamcast SDK
This section explains how to set up a Dreamcast system and how to install the Windows CE for Dreamcast SDK on your Windows® NT 4.0 development computer. If possible, print out this document for easy reference and convenience.
Even if you have already set up and configured Dreamcast, unplug everything, and start from the beginning. This version of the SDK uses some ports differently than previous versions of the SDK.
After having successfully completed all the instructions in this document, you can do the following:
Run the Windows CE for Dreamcast OS on your Dreamcast console.
Run the SDK samples on your Dreamcast system.
Write and build your own applications and games that take advantage of the Windows CE for Dreamcast OS and DirectX components.
Remotely debug the samples or your own applications and games on your Windows NT development computer.
Hardware Requirements
Read this section carefully to be sure that you meet all the hardware requirements before proceeding with the setup instructions. You need the following:
A desktop computer running Windows NT 4.0, either a server or a workstation, with Service Pack 3 (SP3) installed. Windows 95, Windows 98, and Windows NT 5.0 are not supported in this release. This is your development and debugging computer, also called the host, and is connected directly to the Dreamcast console. Here are the requirements for your host computer:
Not an NEC 98 series. This platform is not supported by Windows CE for Dreamcast.
A Pentium® 133MHz, or faster, processor.
32 MB of RAM.
213 MB of free disk space for installation only, or 382 MB for installation and compiling all samples.
At least one serial port (COM port) free and available for use if you want to use the communications functions.
An Adaptec SCSI controller (1542, 1742, 2940, 2940U, 2940UW, or 3940) installed, with an external SCSI connector. SCSI controllers from other manufacturers may not work with the Dreamcast console. While it is possible to connect Dreamcast to the existing SCSI chain on your host computer, it is highly recommended that you install a separate SCSI card that services only Dreamcast. This eliminates the risk of corrupting your hard drives or crashing the development computer.
Dreamcast SET5.2. This is your target platform. Earlier versions are not supported in this version of the Windows CE for Dreamcast SDK. Your Dreamcast development system should have the following:
A power cable.
A null-modem serial cable.
A Cross Products CD-ROM emulator or debug adapter. The emulator comes with a parallel port dongle. This dongle is currently not needed, but should be saved for future versions.
An SCSI cable that fits the external connector on the Windows NT computer SCSI controller and has a SCSI2 male connector on the other end
An SCSI terminator. This small device may already be attached to one of the two SCSI ports on the rear panel of the Dreamcast console.
Dreamcast gamepads with four buttons. These plug directly into the front of the Set5.2 console.
(Not included) A VGA monitor with cable or an NTSC television with appropriate RCA cables to connect to the Dreamcast console.
(Optional) A desktop computer running Windows 95. This Windows 95 computer can be used as an emulation target platform. This computer should have at least the following:
A Pentium 133MH, or faster, processor.
16 MB of RAM.
DirectX 5.0 run-time installed, which can be obtained from the Web site http://www.microsoft.com/directx
A 3-D accelerated graphics card.
A sound card.
Setting Up Your Dreamcast Development System
SCSI Connection
Monitor or Television
Power
Optional
Dongle
This section outlines the steps necessary to set up the Set5 Dreamcast development hardware and connect it to your Windows NT development computer. The following illustration shows some of the cables that come with your Set5 hardware.
![[IMG]](https://web.archive.org/web/2im_/http://file:///C:/Users/0OOO0O%7E1/AppData/Local/Temp/msohtmlclip1/01/clip_image002.gif)
Cables
SCSI Connection
On the back panel of the Dreamcast console, there are two rotary switches that represent SCSI IDs. Set these switches to use IDs that are not currently being used by any other existing SCSI devices on your development computer. To find out which SCSI IDs are already being used, boot your Windows NT computer, and watch as your SCSI adapter enumerates the existing SCSI devices on your chain. You may be able to accept the default settings of these switches, which are 3 and 4.
Note
Do not connect the Dreamcast development system to a SCSI controller serving other SCSI devices, such as a Windows NT system disk or other hard drives. If you do, the debug adapter may lock up or crash during the development process, resulting in possible data loss.
The following illustration shows the back panel of the Dreamcast console.
![[IMG]](https://web.archive.org/web/2im_/http://file:///C:/Users/0OOO0O%7E1/AppData/Local/Temp/msohtmlclip1/01/clip_image004.gif)
The back panel of the Dreamcast console
1. Insert the SCSI terminator in one of the two SCSI ports on the back of the Dreamcast console.
2. Be sure that your Windows NT development computer is turned off. Insert one end of the SCSI cable in the other SCSI port on the back panel of the Dreamcast console. The other end of the SCSI cable needs to be connected to an SCSI card in your Windows NT development computer. Install a separate SCSI card that services only the Dreamcast console. This eliminates the risk of corrupting your hard drives or crashing the development computer.
Monitor or Television
If you are using a VGA monitor, connect the VGA cable to the port on the back panel of the Dreamcast console labeled Analog RGB (VGA). If you are using an NTSC television, connect the RCA cable from the television to the port on the Dreamcast console labeled Video.
Plugging in the Gamepads
The following illustration shows the front panel of the Dreamcast console.
![[IMG]](https://web.archive.org/web/2im_/http://file:///C:/Users/0OOO0O%7E1/AppData/Local/Temp/msohtmlclip1/01/clip_image006.gif)
The front panel of the Dreamcast console.
Connect the Dreamcast gamepad(s) to the plugs on the front of the Dreamcast console.
Power
Connect the power cable to the back of the Dreamcast console and plug it into a suitable power outlet. Do not turn it on yet.
Optional Setup
If you require serial communications, connect one end of the null-modem serial cable to the Dreamcast console serial port labeled SERIAL. Connect the other end of the serial cable to the COM1 or COM2 port of the Windows NT development computer.
If you require sound output, connect suitable speakers or the audio inputs of your television to the two ports on the back panel of the Dreamcast console labeled L-Audio-R.
When you need to create a Sega GD-ROM image of the application, a GD-ROM writer cable must be installed in the port labeled For GD-Writer on the back panel.
Dongle
Your hardware setup is now complete. The dongle supplied with the Dreamcast system is not used in this version.
Installing the Windows CE for Dreamcast SDK
Verification of SCSI Devices
Configuring the SDK For Debug or Retail
Selecting NTSC vs. VGA Mode
Setting Up the GD-ROM Emulator (Optional)
Verification of Complete Setup
This section outlines the steps necessary to install the Windows CE for Dreamcast SDK on your Windows NT development computer and configure your system to work with the Dreamcast system.
1. Before beginning the installation:
Be sure that you have installed Microsoft Visual C++ with at least the typical setting if you want to be able to run all the samples in the Dreamcast SDK.
Be sure Visual Studio is not running.
If you have not already installed the current version of the Microsoft Windows CE Embedded Toolkit for Visual C++ 5.0, you must uninstall any previous versions of the toolkit before you can install the current toolkit.
2. Install the Advanced SCSI Programming Interface (ASPI), if it is not already installed. This is an Adaptec-developed interface specification for sending commands to SCSI host adapters. To check for ASPI installation, type the following at a command prompt:
dir %SYSTEMROOT%\system32\drivers\aspi32.sys
If this file is not found, install the Windows NT ASPI services from the following location:
ftp://ftp.adaptec.com/pub/BBS/winnt/aspi32.exe
3. Run the Setup.exe program from <WCEDreamcast>\Eng or from <WCEDreamcast>\Jpn. This will install the Windows CE Embedded Toolkit for Visual C++, the SH4 Enhancement Pack, and the Windows CE for Dreamcast SDK. It will also upgrade the debug adapter firmware and the Dreamcast Boot ROM firmware.
Verification of SCSI Devices
1. Turn on the Dreamcast console by pressing the large button on the front of the unit.
This causes various light-emitting diodes (LEDs) to blink and the disk to spin.
2. Reboot the Windows NT computer.
As the Windows NT computer is booting, you should see some basic I/O system (BIOS) messages from the Adaptec SCSI controller, including a list of SCSI hardware found. You should see GD-M and Katana DA, in addition to whatever hardware you normally see listed.
The GD-M emulator appears as a removable SCSI disk to Windows NT.
3. Note the drive letter that has been assigned.
Configuring the SDK For Debug or Retail
The Windows CE for Dreamcast SDK creates an environment variable, _FLATRELEASEDIR, when it is installed. This variable contains the default directory and is initially set to <WCEDreamcast>\Release\Wince\Debug. When you require the retail version of an application without any debug information embedded into the code, this variable should be edited to <WCEDreamcast>\Release\Wince\Retail.
To edit this environment variable
1. Open Control Panel on your Windows NT computer.
2. Choose the System icon, and go to the Environment tab.
3. Choose _FLATRELEASEDIR in the User Variables box.
4. Type the new entry in the Value box.
5. Choose Set, and then choose OK.
If you change the value of this variable in the future, you must close all command windows and re-open them in order for the change to take effect.
Selecting Television vs. VGA Mode
This release supports selection of television or VGA mode, using the DIP switches on the SET5 front panel after you have successfully upgraded the Dreamcast Boot ROM.
If DIP switches 1 and 2 on the left are down, television is selected. If DIP switches 1 and 2 are up, VGA is selected. DIP switches 3 and 4 should always be down.
If television is selected, the broadcast format should be set on the rotary switch on the front of the Set5. The available settings are:
0 NTSC
1 PAL
2 PAL-M
3 PAL-N
Setting Up the GD-ROM Emulator (Optional)
The GD-ROM emulator is a device that appears as a GD-ROM to the Dreamcast system, while appearing as a removable SCSI disk to the host computer. Using the supplied Cross Products software called GD Workshop, you can construct a virtual GD and test it on the Dreamcast console without actually burning a GD-ROM.
Verification of Complete Setup
Your Dreamcast console and Windows CE for Dreamcast SDK should now be set up properly. To verify they are set up properly, follow these steps.
1. Turn on the Dreamcast console, if it is not already on.
2. Open dctool by double-clicking on the “Dreamcast Tool†icon in your Windows CE for Dreamcast SDK program folder.
3. When the window pops up, choose Boot. You should see something similar to this:
Connecting to Dreamcast...
Connected
Found SEGA KATANA_DA Device on SCSI Host <1> : SCSI Device <3>.
resetting target...
>> The console status is 'executing' user code outside debug stub (RUNNING)Image physical size : 0050756c
Physical start address : 8c010000
Section: address=8c011000, size=0003f1ec
Section: address=8c051000, size=000011f0
Section: address=8c053000, size=000385d0
. . .
4. After dctool has downloaded the image, you should see output in the command window which indicates that the Windows CE for Dreamcast OS is booting.
5. You should also see a “Windows CE>†prompt in the dctool window. Type s chessbrd at this prompt.
6. You should see the D3DIM/DDraw/DInput chessbrd sample running on your monitor/TV. Press X to exit the sample.
You are now ready to start developing your own games, using the Windows CE for Dreamcast SDK.
Contents of the Dreamcast SDK
This section describes the contents of each of the Windows CE for Dreamcast SDK. <WCEDreamcast> refers to the top-level directory where you have chosen to install the SDK.
When you install the Windows CE for Dreamcast SDK on your computer, you choose the drive letter and top-level directory where the SDK files are copied. The setup program creates several subdirectories under this location and copies the appropriate files to them. The following are the directories in the tree:
<WCEDreamcast>
This is the root directory of the installation. The WCEDREAMCASTROOT environment variable contains the full path of this directory. The setup program does this for you. This directory contains two batch files, W95emul.bat and Wce.bat. Depending on whether you are developing for Windows CE for Dreamcast or Windows 95, you need to run one of these two batch files. The SDK installation process creates two shortcuts that open command windows and automatically run these batch files. These shortcuts are in the Windows CE for Dreamcast SDK program folder.
<WCEDreamcast>\Docs
This directory contains documentation on how to set up your Dreamcast system and the Windows CE for Dreamcast SDK, how to use the SDK, how to use the tools provided, and so on. It also contains several IVI and IVT files that can be viewed from the InfoViewer window within the Visual Studio IDE. These online Help files contain information about the SH4 processor, a DirectX programming guide, and reference manuals for the DirectX and Windows CE APIs supported for Dreamcast.
<WCEDreamcast>\Inc
This directory contains header files for all supported APIs on Dreamcast, including those for DirectX and Windows CE. Include these header files when building an application, whether you are building it for Windows 95 or Windows CE to ensure that your application runs on both platforms.
<WCEDreamcast>\Lib
This directory contains the import libraries that your application must link with, depending on which components you use. The directory <WCEDreamcast>\Lib\Wince\(Debug, Retail) contains libraries for building your application for Windows CE on the SH4. This includes the core Windows CE libraries (Coredll.lib, Corelibc.lib), the C run-time library (Fulllibc.lib), and the DirectX libraries (Ddraw.lib, D3dim.lib, Dsound.lib, Dinput.lib, and Dplayx.lib). The <WCEDreamcast>\Lib\Win95\(Debug, Retail) directory contains DirectX 5.0 libraries for Windows 95. These are the same libraries that ship with the desktop version of the DirectX 5.0 SDK.
<WCEDreamcast>\Tools
This directory contains tools for use with Dreamcast, such as Dctool. These tools are described in detail in the <WCEDreamcast>\Docs\Tools.doc. The Cross Products tools are also found in the <WCEDreamcast>\Tools directory. These include utilities to upgrade the Flash ROMs on Dreamcast, as well as administer the GD-ROM emulator. The <WCEDreamcast>\Tools directory contains an image of the latest firmware for the Dreamcast Boot ROM.
<WCEDreamcast>\Release
The <WCEDreamcast>\Release\Wince\(Debug, Retail) directory contains the released Windows CE and DirectX binaries (DLLs and EXEs) for the SH4. In this directory are the binary image (Nk.bin) for the OS, which needs to be downloaded to Dreamcast before you can run your application. Even if a certain .dll or .exe file is not included in the binary image, it can still be accessed by Dreamcast, using the Dctool shell program, as long as the file is located in this release directory. The release directory also contains the built executables for all the SDK samples, so you can run them immediately without having to build them yourself. The <WCEDreamcast>\Release\Win95\(Debug, Retail) directory contains Windows 95 versions of pre-built executables for all the SDK samples.
<WCEDreamcast>\Samples
This directory contains source code and make files for all the samples. These samples can be built for either Windows 95 or Windows CE. Study these samples to get a better understanding of how to write applications and games for Dreamcast. A complete list of samples is provided in the Samples appendix in the IVT documentation.
Booting the OS Image
This section assumes that you have set up your Dreamcast system and that you have an OS image file called Nk.bin. The release directories already contain sample images, or you can generate your own, following the instructions in the next section.
To boot the OS image
1. Turn on the Dreamcast console, using the large button on the front panel. Wait 5 seconds to make sure that the hardware is completely up.
2. From your Windows CE for Dreamcast SDK program folder, start the Dreamcast Tool (dctool.exe). This tool allows you to download a binary image to your Katana and also provides the command line shell interface to the Windows CE kernel. Dctool always loads files from the directory specified by _FLATRELEASEDIR.
3. In the Dctool window, choose the Boot button. Before doing this, make sure your Dreamcast console has been on for at least 5 seconds. In the lowest pane of the Dctool window, you should see something similar to this:
Connecting to Dreamcast...
Connected
Found SEGA KATANA_DA Device on SCSI Host <1> : SCSI Device <3>.
resetting target...
>> The console status is 'executing' user code outside debug stub (RUNNING)Image physical size : 0050756c
Physical start address : 8c010000
Section: address=8c011000, size=0003f1ec
Section: address=8c051000, size=000011f0
. . .
4. After Dctool has downloaded the image, you should see output in the pane called Remote File System, which indicates that the Microsoft Windows CE is booting. You should also see a “Windows CE>†prompt in the Command Shell pane.
5. The OS image has now been loaded into Dreamcast and run. You should see activity from the Dctool command shell as described in the following:
On a successful boot, the command shell within Dctool produces the following prompt:
Welcome to the Windows CE Shell. Type ? for help.
Windows CE>
See later sections on what you can do at this prompt.
On a successful boot in a debug build, Dctool outputs something like the following code example. Retail builds have fewer lines of output.
Windows CE Kernel for Hitachi SH Built on Aug 13 1998 at 17:24:06
SH-4 Kernel
0x0: CCR=0105
0x0: Set 5 is detected
0x0:
Old or invalid version stamp in kernel structures - starting clean!
0x0:
Booting kernel with clean memory configuration:
0x0: FS0: 8c523000 00000000 00000000 00000000
0x0: FS1: 00000000 00000000 00000000 00000000
0x0: K0 : 8c523000 009cd000 00000000 00000000
0x0: K1 : 00000000 00000000 00000000 00000000
SH3Init done.
Windows CE KernelInit
0x0: 0: paStart=0c523000 paEnd=0cef0000 paLimit=0c523000 pUseBase=8ceef000 pUseMap=8ceef634
Scheduling the first thread.
0x8ceeee9c: KernelInit2: pCurThread=8ceeee9c hCurThread=0ceeee7e hCurProc=0ceeefe2
0x8ceed8d0: FileSystem Starting - starting with clean file system
0x8ceed074: CreateNewProc failure on \Windows\SystemPatchModule.exe!
0x8ceed8d0: Filesystem initialized!
0x8ceeb9d8: Bits-per-pixel: 16
0x8ceeb9d8: Adding font resource '\Windows\arial.ttf'...
0x8ceeb9d8: **** Signature of FONT File is: '0100'...
0x8ceeb9d8: Adding font resource '\Windows\msgot.ttf'...
0x8ceeb9d8: **** Signature of FONT File is: '0100'...
0x8ceeb9d8: LoadOneLibrary failure on kbdmouse.dll!
0x8ceeb9d8: LoadOneLibrary failure on keybddr.dll!
0x8ceeb9d8: Could not load keyboard driver dll keybddr.dll
0x8ceeb9d8: InitStaticControl returned FALSE.
0x8ceeb9d8: InitButtonControl returned FALSE.
0x8ceeb9d8: InitListboxControl returned FALSE.
0x8ceeb9d8: InitComboxControl returned FALSE.
0x8ceeb9d8: InitEditControl returned FALSE.
0x8ceeb9d8: InitSBCtl returned FALSE.
0x8ceeb9d8: InitImageLists returned FALSE.
0x8ceeb9d8: UpdateIdleTimeoutFromRegistry
0x8ceeb9d8: UpdateIdleTimeoutFromRegistry: using battery idle timeout of 0 sec
0x8ceeb9d8: UpdateIdleTimeoutFromRegistry: using external idle timeout of 0 sec
0x8ceeb9d8: UpdateIdleTimeoutFromRegistry: no wakeup idle timeout in registry.
0x8ceeb9d8: UpdateIdleTimeoutFromRegistry: using wakeup idle timeout of 60 sec
s 00x8ceea06c: WDM initialized!
on the control toolbar to Emulator, the up position.
on the control toolbar.![[IMG]](https://web.archive.org/web/2im_/http://file:///C:/Users/0OOO0O%7E1/AppData/Local/Temp/msohtmlclip1/01/clip_image012.gif)
![[IMG]](https://web.archive.org/web/2im_/http://file:///C:/Users/0OOO0O%7E1/AppData/Local/Temp/msohtmlclip1/01/clip_image014.gif)
does a test write on the GD-ROM.
actually does a write.