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. 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. 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. 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
0x8ceeb9d8: UpdateIdleTimeoutFromRegistry: no screen idle timeout in registry. 0x8ceeb9d8: UpdateIdleTimeoutFromRegistry: using screen idle timeout of 0 sec 0x8ceeb9d8: NOTIFY_INIT: Notification APIs NOT present 0x8ceea06c: PASS 1 0x8ceea06c: PASS 4 0x8ceea06c: PASS 6 Serials 00x8ceea06c: WDM initialized! 0x8cee5d9c: SYSSTART: Signaling PSLs that system is started. 0x8cee5d9c: LoadNetworkInfo: invalid network info 0x8cee5d9c: Boot time assuming start at 0 is 5017 ms 6. To upload a new OS image or to try this image again, close Windbg and Dctool. Then type dctool again. Troubleshooting The following problems may occur in running or building applications Console If the power button on the front panel has no effect, check that the console is plugged in and that the power switch on the rear of the unit is in the ON position. Windbg If output stops at Entering KdInit, this usually means that Dctool is hung up and needs to be restarted. Also try restarting Windbg. Dctool If a message box pops up stating that there is a missing DLL, follow the instructions for retrieving the Windows NT ASPI services from Adaptec. If it prints “Finding debug adapter: SALSA error…..” in the Boot Image Download Output/Console Output box and exits, Dctool cannot find your Dreamcast debug adapter because the console is turned off or misconfigured. If the Dctool Boot Image Download Output/Console Output displays something like the following and then stops, either the console had not been turned off and turned back on before running Dctool, or the console required more time to initialize. Try again, but wait longer before starting Dctool. Successfully initialized salsa library Found SEGA KATANA_DA Device on SCSI Host <0> : SCSI Device <4>. Firmware Version 1.60A. Built at Apr 17 1998 13:19:09. console is currently running, stopping. >> The console status is 'stopped' within debug stub (SUSPENDED) >> The user code PC is at <0xa000021c> writing memory: SALSA error <ASPI: Command completion error (SS_ERR)> Building a Custom OS Image This section describes how to build your own OS image with whatever modifications you have chosen to make. The OS image is generated by the Makeimg tool, which uses binary image builder (.bib) files and registry (.reg) files found in the %_FLATRELEASEDIR%. Binary Image Builder Files A binary image builder (.bib) file is used by the Makeimg tool to determine which modules and files to combine to form the OS image and where to place the modules in memory. Binary image builder files can contain any of the following sections, in the order listed: MEMORY Defines the physical memory available, including the starting address, size, and type of memory. CONFIG Defines options for Makeimg to customize its output. MODULES Specifies which object modules Makeimg includes in the image. FILES Reserves a section of memory for static data files. The .bib file is built out of four .bib files found in the %_FLATRELEASEDIR% Config.bib This file is used to configure the OS for the RAM available, where it will be loaded, and so on. Do not change the contents of this file; it has already been configured for Dreamcast. Common.bib This file contains FILES and MODULES sections for the operating system. Project.bib This file contains FILES and MODULES sections for the DirectX components. Platform.bib This file contains FILES and MODULES sections for Dreamcast. You are most concerned with the FILES and MODULES sections in either Project.bib or Platform.bib. Add any modules or files you want to include in your image to one of those files. The following files are required in your release directory in order to build an image. However, some of them, .txt files for example, do not become part of the image. Nk.exe Coredll.dll Filesys.exe Gwes.exe Sysstart.exe Platutil.dll Microstk.exe Mppp.dll Mwinsock.dll Schannel.dll Shell.exe Toolhelp.dll Ddi.dll Sh4ser.dll Seg_rock.dll Wdmlib.dll Wdmoem.dll Wdevice.exe Wsegacd.dll Maple.dll Default.fdf Arial.ttf Armcom.drv 1250.txt 1251.txt 1252.txt 1253.txt 1254.txt 1255.txt 1256.txt 1257.txt 1258.txt 20127.txt 20261.txt 20269.txt 20866.txt 21027.txt 21866.txt 28591.txt 28592.txt 28593.txt 28594.txt 28595.txt 28596.txt 28597.txt 28598.txt 28599.txt 29001.txt 437.txt 708.txt 720.txt 737.txt 775.txt 850.txt 852.txt 855.txt 857.txt 860.txt 861.txt 862.txt 863.txt 864.txt 865.txt 866.txt 869.txt 874.txt 932.txt 936.txt 949.txt 950.txt Nlssrc.txt Prevctry.txt Xjis.txt Common.bib Config.bib Dshowdgn.bib Gemini.bib Platform.bib Common.reg Dshowdgn.reg Dshowmpg.reg Gemini.reg Platform.reg Intltrns\Jpn\Common.str Jpn\CalibrUi.res Jpn\Cegsm.res Jpn\Cmd.res Jpn\Comm.res Jpn\Commctrl.res Jpn\Commdlg.res Jpn\Commg.res Jpn\Console.res Jpn\Control.res Jpn\Coreres.res Jpn\Ctlpnl.res Jpn\Cursor2.res Jpn\Cursor8.res Jpn\Fatfs.res Jpn\Fileopen.res Jpn\Filesys.res Jpn\Fmtres.res Jpn\Generic.res Jpn\Gweshare.res Jpn\Intl.res Jpn\Intlg.res Jpn\Main.res Jpn\Mcursor1.res Jpn\Menu.res Jpn\Msfilter.res Jpn\Msgbox2.res Jpn\Msgbox28.res Jpn\Msgbox8.res Jpn\Msim.res Jpn\Netui.res Jpn\Network.res Jpn\Networkg.res Jpn\Notify.res Jpn\Oleaut32.res Jpn\Oomui.res Jpn\Passwrd.res Jpn\Passwrdg.res Jpn\Pcmcia.res Jpn\Pegterm.res Jpn\Power.res Jpn\Powerg.res Jpn\Remnet.res Jpn\Rmaapp.res Jpn\Schannel.res Jpn\Screen.res Jpn\Screeng.res Jpn\Shcore.res Jpn\Shexec.res Jpn\Shmisc.res Jpn\Shortcut.res Jpn\Sipcpl.res Jpn\Sounds.res Jpn\Soundsg.res Jpn\Spincube.res Jpn\Spintest.res Jpn\Startui.res Jpn\System.res Jpn\Systemg.res Jpn\Tapi.res Jpn\Taskman.res Jpn\Termctrl.res Jpn\Testime.res Jpn\UniModem.res MODULES Section Each MODULES section entry has the following format: Name Path Memory Block Type Name The name of the MODULES section entry as it appears in the memory table. Normally, the Name entry is the same as the name of the file referenced by Path. Path The full path to the MODULES file that Makeimg.exe incorporates into the image. Normally, the Path name is the same as the Name memory table entry. Memory Block The MEMORY region into which Makeimg.exe loads the object module. Makeimg.exe places the object modules in the specified memory area in the order in which they appear in the MEMORY section. Type The file type. This can be s for a system file or h for a hidden file. In the following code example, Makeimg.exe loads the object module Init.exe into the NK memory block. Makeimg.exe creates Init.exe from %_FLATRELEASEDIR%\Init.exe. The object module is both a system file (s) and a hidden file (h). MODULES INIT.EXE %_FLATRELEASEDIR%\INIT.EXE NK SH [FONT="][/FONT] FILES Section Each FILES section entry has the following format: Name Path Memory Block Type Name The name of the FILES section entry as it appears in the memory table. Normally, the Name entry is the same as the name of the file referenced by Path. Path The full path to the FILES file that Makeimg.exe incorporates into the image. Normally, the Path name is the same as the Name memory table entry. Memory Block The MEMORY region into which Makeimg.exe loads the FILES entry. Makeimg.exe places the files in the specified memory area in the order in which they appear in the MEMORY section. Type The file type: either a system file s, hidden file h, or an uncompressed file u. By default, all files listed in the FILES section are compressed. In the following example, Makeimg.exe loads the file Initobj.dat into the NK memory block. Makeimg.exe creates Initobj.dat from %_FLATRELEASEDIR%\INITOBJ.DAT. The object module is both a system file s and a hidden file h. FILES INITOBJ.DAT %_FLATRELEASEDIR%\INITOBJ.DAT NK SH [FONT="][/FONT] The .bib files use an #ifdef directive based on environment variables. Registry Files The .reg files contain registry entries that are loaded into the OS registry when it boots. Like the .bib files, there are multiple .reg files, one for the core OS, one for the project, and one for the platform. Edit only the latter two. Registry keys are very application-specific; therefore, only the format of the file is discussed here. The following is an excerpt from one of the .reg files: [FONT="][/FONT] [HKEY_LOCAL_MACHINE\Modem\NullModem] "Port"="\\Device\\COM1" "Settings"=hex: 1c,00,00,00, 00,4b,00,00, dd,20,00,00, cc,cc, 00,02, 80,00, 08, 00, 00, 11, 13, 0d, 0d, 0d, cc,cc "Flags"=dword:00000001 "Locs"=multi_sz:"loc1",”loc2”,”loc3” The following table shows the HKEY_LOCAL_MACHINE\Modem\NullModem registry key created. Value name Type Contents Port REG_SZ \Device\COM1 Settings REG_BINARY Sequential bytes Flags REG_DWORD 1 Locs REG_MULTI_SZ Loc1\0Loc2\0Loc3\0\0 To load the new raw OS image onto the Dreamcast system 1. Change the current directory to %_FLATRELEASEDIR% by typing cd %_FLATRELEASEDIR%. 2. Edit the .bib and .reg files to suit your needs. 3. Terminate Dctool; it can interfere with the OS image creation process. 4. At the command prompt, in the %_FLATRELEASEDIR% directory, type makeimg. Makeimg generates a few screens of information indicating what files have been put in the image, and so on, and then generates a Nk.bin file. If Makeimg fails, it is usually because Makeimg could not find a file or the format of the .bib or because the .reg files have been corrupted. Creating a New Application This section explains how to use the Windows CE for Dreamcast SDK to create your own applications and games for Dreamcast. Creating a New Visual Studio Project To develop an application or game within Visual Studio integrated development environment (IDE), first create a project and a workspace. A project is a collection of source code files, a record of dependencies between files, and the options to be used when building the project into an application (.exe), dynamic-link library (.dll), or statically linked library (.lib). A workspace groups together related projects and keeps track of settings related to the appearance of the Visual Studio environment, such as the position and size of your windows. Visual Studio automatically creates a new workspace when a new project is created. This section describes how to use the IDE to create a new project. Using the IDE allows you to develop and debug your application or game within a single environment. This section assumes that you have installed Visual Studio, the Windows CE Toolkit for Visual C++ 5.0, the SH4 IDE enhancement pack, and the Windows CE for Dreamcast SDK. 1. Start Visual Studio. This should be located in your Microsoft Visual C++ 5.0 program folder. 2. Choose New on the File menu. Choose Win32 Application on the Projects tab if you are creating an executable application (.exe). – Or – Choose Win32 Dynamic-Link Library for creating .dlls or Win32 Static Library for creating .libs. Be sure that the checkbox next to Win32 (WCE SH4) in the section labeled Platforms is checked. This allows you to build and debug Dreamcast application. If your application is intended to run on the Windows 95 desktop as well, make sure the Win32 checkbox is also checked. Choose a name and location for your project, and then choose the OK button. 3. Always have the WCE Configuration toolbar visible. You can show or hide toolbars by right-clicking the mouse on any visible toolbar or an unused area of the menu bar. 4. To add source code files to your project, choose Project from the menu bar, then Add To Project, and Files. It is not necessary to add a Make file to the project; Visual Studio creates and maintains the project’s Make file automatically. 5. To save your project, choose File, then Save Workspace from the menu bar. Header Files All of the header files necessary to develop an application for Dreamcast are located in the <WCEDreamcast>\Inc directory. Therefore, this directory should be the first one listed in the include path when building your application. To check your include path 1. Choose Tools from the menu bar, then Options, and then the Directories tab. 2. Choose the Win32 (WCE SH4) Platform and the Dreamcast Configuration. 3. In the Show directories for box, choose Include Files. Make sure that <WCEDreamcast>\Inc is the first directory listed; if it does not exist, add it. These header files contain function prototypes for only those APIs which are supported by the Windows CE for Dreamcast SDK. If you are developing an application that can be ported to Windows 95 or Dreamcast, you can also use these header files to build for the desktop. This forces your application to use only the functions and APIs supported in the Windows CE for Dreamcast SDK. However, if the desktop version of your application uses additional APIs not supported on Dreamcast, use the standard Windows CE and DirectX header files, which are not included with this SDK, when building your application for the desktop platform. Do not mix header files from the Dreamcast SDK with header files from the Win32 or DirectX SDKs. For any platform and configuration, use headers files exclusively from one place. Modify the include path for the desktop platform by choosing Tools from the menu bar, then Options, then Directories, and then choosing the Win32 Platform. By putting #include <Windows.h> at the top of your source code file, you can get prototypes for all Windows CE functions supported by the SDK. This includes GDI, User, and kernel functionality. To get DirectX functionality in your application, include the corresponding DirectX header file. For example, if your application uses DirectInput, put #include <Dinput.h> in your source code file. Other Dreamcast-specific APIs such as the Virtual Memory LCD API and the DMA API have their own header files as well, which must also be included individually. Libraries Libraries (.lib files) for all Windows CE functionality are provided in the <WCEDreamcast>\Lib\Wince\(Debug, Retail) directory. This includes Windows CE, C run-time, DirectX, and additional Dreamcast-specific APIs. Your application must link with the appropriate libraries to make use of these APIs. The directory for these libraries should be listed at the top of your library path. To modify the library path 1. Choose Tools from the menu bar, then Options, and then the Directories tab. 2. Choose the Win32 (WCE SH4) Platform and the Dreamcast Configuration. 3. Choose Library Files in the Show directories for box. Be sure that either <WCEDreamcast>\Lib\Wince\Debug or <WCEDreamcast>\Lib\Wince\Retail is the first directory listed, depending on whether you would like to use debug or retail versions of the library. To link your project with all the appropriate libraries so that it builds properly 1. Choose Settings in Project. 2. Choose Win32 (WCE SH4) Debug/Release in the Settings For: box. 3. Choose the General category on the Link tab. Add Corelibc.lib where it says Object/library modules. This library provides core C run-time support and is required if your application is a C++ application with global initialized classes or variables. See Setting the Application Entry Point. Also add any additional libraries that are required for the Windows CE components that your application uses. For example, if your application uses DirectDraw, add Ddraw.lib. A few of the libraries provided are statically linked libraries that contain the actual implementations of the functions. When you link with these, the functions become part of your executable (.exe) file. For example, Fulllibc.lib is a statically linked library that contains all of the C run-time functions supported by Windows CE. All the rest of the libraries are import libraries, whose functionality is actually implemented by a DLL of the same name. For example, if your application links with Coredll.lib to use Windows CE functions, Coredll.dll is automatically loaded at the same time as your application. In addition to the Windows CE for Dreamcast libraries, the DirectX 5.0 SDK for Windows 95 libraries are found in the <WCEDreamcast>\Lib\Win95\(Debug, Retail) directory. These are provided so that a DirectX application being built for the desktop platform can link with the DirectX import libraries, even if you do not have the DirectX SDK installed on your development computer. This directory should be at the top of list in the library path for the Win32 platform. Modify the library path for the desktop platform by choosing Tools from the menu bar, then Options, then Directories, and then choosing the Win32 platform. Setting the Application Entry Point The entry point of an application is the function that is called by the operating system when the application is launched. For normal applications the entry point is WinMain, and for normal DLLs the entry point is DllMain. However, in Windows CE for Dreamcast, the entry points can be slightly different. By default, applications have an entry point of WinMainCRTStartup, and DLLs have an entry point of _DllMainCRTStartup. But these functions are not implemented in the application source code; instead, they are implemented in a library called Corelibc.lib. These functions initialize global C++ classes and variables. For an executable application (.exe), if the WinMainCRTStartup function is not called, the global variables may not be initialized properly. The WinMainCRTStartup function then calls the standard WinMain function that should be implemented by your application source code. To change the entry point for your application or DLL 1. Choose Project from the menu bar, then Settings. 2. Choose the appropriate Platform in the Settings For: box, such as Win32 (WCE SH4) Debug or Release. Choose the Output category on the Link tab. 3. Edit the Entry-point symbol box, as appropriate. In summary, if your application or DLL uses global C++ variables or classes, be sure your entry point is either WinMainCRTStartup or _DllMainCRTStartup. If it is, link your project with Corelibc.lib to get the implementations of these functions. Building Your Application From within Visual Studio, you can build your application for any platform. Choose the active Platform and Configuration from the WCE Configuration toolbar if it is visible, or choose Build from the menu bar, and then Set Active Configuration. To build for Dreamcast, the Platform should be Win32 (WCE SH4) Debug or Release, and the Configuration should be Dreamcast. To build for the Windows 95 desktop or Windows NT platform, the Platform should be Win32 Debug or Release. To build your application, press F7, or choose Build from the menu bar, and then Build. To build for multiple platforms and configurations at the same time, choose Build from the menu bar, and then Batch Build. When building your project for Dreamcast, the final executable is automatically copied to the release directory. The release directory is specified by the _FLATRELEASEDIR environment variable. Modify this variable by choosing Control Panel, then System, then Environment. Set this variable to either <WCEDreamcast>\Release\Wince\Debug or <WCEDreamcast\Release\Wince\Retail. Documentation Nearly all the APIs and interfaces supported in this SDK are subsets of Windows CE version 2.1 and DirectX version 5.0. All APIs supported by Windows CE for Dreamcast are documented in this SDK. If you have other document sets loaded in your Visual Studio integrated development environment (IDE), an API name search may find APIs from other document sets that are not supported by Dreamcast. In this case, you can check the search results for the location of each instance found. If a location description begins with “Windows CE for Dreamcast…,” the API it refers to is supported by Dreamcast. You can access the documentation from within Visual Studio by using the InfoViewer. To view the documentation 1. Press Alt-0 to go to the Workspace window, and choose the Infoview tab. 2. Open the Windows CE for Dreamcast SDK Documentation book, and browse through the contents. – Or – Choose Help from the menu bar, and then Search to search for a particular topic. Building the SDK Sample Applications The Windows CE for Dreamcast SDK comes with many sample applications. Included are samples for all DirectX components, as well as the additional Dreamcast-specific components such as the Virtual Memory LCD and DMA APIs. All samples are already built, and the binary executables (.exe files) are in the <WCEDreamcast>\Release\… directory. You can run them directly on Dreamcast or Windows 95, without having to build them first. However, in case you want to modify the sample code, this section describes two different ways to build the sample applications: from the command line, and from the Visual Studio. Building Samples from the Command Line You can build the sample applications from the command line by using the Nmake utility. Some samples are dependent on libraries that are also provided as sample code. Each sample has a Readme.txt file that lists its dependent libraries. To build a sample application or library 1. Choose the WinCE Command Line shortcut in the Windows CE for Dreamcast SDK program folder if you want to build the samples for the Dreamcast platform. – Or – Choose the Win95 Emulation shortcut if you want to build the samples for the Windows 95 desktop. You may get a message requesting that you run the Vcvars32.bat script before continuing. This happens if you are building on a Windows 95 computer or if you are using a Windows NT computer and you unchecked the Register Environment Variables checkbox when installing Visual Studio. If you get this message, go to your VC5 directory and then into the Vc\Bin subdirectory, and run the Vcvars32.bat script. This sets up some environment variables and configures the path so that the VC5 executables, such as Nmake, can be run from any directory. 2. Go to the directory for the sample application or sample library that you want to build. Type nmake to build that sample for both debug and retail versions. Type nmake debug to build only for debug, or type nmake retail to build only for retail. These commands rebuild only those files whose source code has changed since the last build. The nmake clean command deletes all object files (.obj). The next time you build the sample, all files are recompiled. 3. When building a sample library, the final .lib file is placed in the <WCEDreamcast>\Samples\Lib\Wince\(Debug, Retail) or the <WCEDreamcast>\Samples\Lib\Wince\(Debug, Retail) directory. When building a sample application, the final .exe file is placed in the <WCEDreamcast>\Release\Wince\(Debug, Retail) or the <WCEDreamcast>\Release\Win95\(Debug, Retail) directory. The executable is not copied to the directory specified by the _FLATRELEASEDIR environment variable automatically. 4. You can perform an nmake command on several or all samples by typing the command in the higher level directories. For example, typing nmake from the <WCEDreamcast>\Samples directory causes all the SDK samples to be built automatically. This also builds the appropriate sample libraries before the sample applications that use them. Building Samples from Visual Studio You can build any of the sample applications or libraries from within Visual Studio as follows: 1. Start Visual Studio by either choosing the Visual Studio shortcut in your Microsoft Visual C++ 5.0 program folder – Or – by typing msdev at a command prompt. 2. Choose File from the menu bar, then Open. Navigate to the directory for the sample that you want to load. For example, the Dsbench sample is located in the <WCEDreamcast>\Samples\Dsound\Dsbench directory. Open the .dsw workspace file for that sample, for example, Dsbench.dsw. A Visual Studio workspace (.dsw) can contain multiple Visual Studio projects (.dsp). Many of the SDK sample applications make use of functions that are implemented in other sample libraries. In these cases, the workspace for the sample application contains the sample application project, as well as the projects for all the dependent sample libraries. The leftmost list box on the WCE Configuration toolbar has a list of projects contained in the workspace. For example, in the workspace Dsbench.dsw, there are three projects: Dsbench, Dslib, and Sampdpf. 3. Choose the project that corresponds to the sample application itself. In this case, choose Dsbench. The other two projects are supporting libraries that are required for this sample application. 4. Choose the platform and configuration that you want to build. This can be done from the drop-down list boxes on the WCE Configuration toolbar. To build for Dreamcast, choose the Win32 (WCE SH4) Debug or Release platform along with the Dreamcast configuration, and to build for the desktop (Windows 95 or Windows NT), choose the Win32 Debug or Release platform. If your WCE Configuration toolbar is not visible, select your platform and configuration by choosing Build from the menu bar, and then Set Active Configuration.
5. Choose F7 – Or – choose Build from the Build menu to begin compiling and linking the sample application. All the necessary supporting sample libraries are built first if they have not yet been built or they are out of date. Then the sample application itself is built. The final executable is placed in the release directory specified by the _FLATRELEASEDIR environment variable in Control Panel under Settings, then Environment. 6. If you get compiler errors when building, be sure that <WCEDreamcast>\Inc is the first directory listed in your include path. You can check this by choosing Tools from the menu bar, then Options, then Directories, and selecting Include Files from the list box. 7. If you get linker errors when building, be sure that <WCEDreamcast>\Lib\Wince\(Debug, Retail) is the first directory listed in the library path for the Win32 (WCE SH4) Dreamcast configuration. The library path for the Win32 configuration must list the appropriate directories, which contain the DirectX import libraries (<WCEDreamcast>\Lib\Win95\Retail) and the Win32 SDK libraries (<DevStudio>\Vc\Lib). Check your library path by choosing Tools from the menu bar, then Options, then Directories, and choosing Library Files from the list box. GD-ROM Drive and Emulator This section provides instructions on the use of the GD-ROM drive and emulator on the SET5 development platform. Some content, where noted, also applies to the use of the GD-ROM drive on production hardware. This section covers the following topics: A description of the GD-ROM format, GD-ROM drive, GD-ROM emulator, and GD-ROM burner. A functional description of the GD-ROM drive and emulator. Instructions for the setup and use of the GD-ROM drive and emulator. Setup of GD Workshop, the desktop-based GD-ROM-drive and emulator-control software. GD-ROM emulator Creating a GD-ROM Emulating a GD-ROM GD-ROM drive Burning a GD-ROM Controlling the GD-ROM drive. Windows CE specifics How the GD-ROM appears to Windows CE-based software. How to create a bootable GD-ROM. Format, Drives, and Emulation The following illustration shows the physical layout of a GD-ROM. Format The GD-ROM is a CD format containing a single-density area and a high-density area. These are referred to as Session 1 and Session 2, although they are not strictly sessions according to the Orange Book specification but more like two volumes on a CD. Single-Density Area This has the same layout as a conventional CD, except that it has approximately a 35-MB capacity. User data and audio is written in the program area, which contains one data and one audio track. This area can be read by a normal CD-ROM drive, such as that found on the desktop. Although you can put whatever you want in this area, the following are recommended: An audio track saying that the GD-ROM can only be played on a Dreamcast system. Three data files with the following names: Abstract.txt, Copyrigh.txt, Bibliogr.txt. You can put appropriate information in these files or leave them empty, but if these files are not present, the GD Workshop software gives you a warning that it cannot find them. The warning does not cause any problems, but follows the ISO96601 standard. High-Density Area This is located after the lead-out of the single-density area and starts with a second volume descriptor 10:16:00 into the disc. The high-density area is where the game is written and can contain up to 99 Mode 1 (data) and CD-DA tracks. It is possible to have a Mode1 track following a CD-DA track in this format. A GD-ROM is played in a constant angular velocity (CAV) drive, which means that the speed at the inside edge of the disc is slower than at the outside edge. Therefore, the disc speed and data retrieval rate of the high-density area is 6x at the beginning, increasing to 12x at the edge. GD-ROM Drive A GD-ROM drive is built into both the SET5 and the Dreamcast production hardware. On the SET5 development platform, the drive is about midway down the front of the case. If the drive door is pressed in gently, and then released, the drive mechanism slides out, allowing for insertion or removal of the GD-ROM. On the production hardware, a button causes the door to open. GD-ROM Emulator The GD emulator is a device that appears as a GD-ROM to the SET5, 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-ROM and test it on the SET5 without actually burning GD-ROM media. The emulator includes a timing model, which replicates the performance of the real GD-ROM drive. From the SET5, the GD-ROM drive and emulator should be almost indistinguishable. GD-ROM Burner Assuming you have a GD-ROM burner, you can burn GD-ROMs based on your emulated GDWorkshopprojects by attaching the burner to the SET5 and following the instructions later in this section. There is also alternative software available from CRI through Sega. It is not integrated with the GD-ROM emulator but communicates directly with the burner hardware. Setup and Use of the GD-ROM Drive and Emulator This section covers setup and use of the GD-ROM drive and emulator. Setting Up GD Workshop The version of the GD-ROM firmware and software used is extremely important at this time. Use the GD Workshop and firmware provided in the Tools\Cross Products\GD Workshop directory Note On Windows NT, you must be running as a user with administrative privileges to successfully complete this procedure. Upgrading the GD-ROM Emulator Firmware Type dacheck at the command prompt to launch the Cross Products diagnostics tool. Your SET5 must be turned on. The following illustration shows the window that come up. Choose OK. If the GD-M portion is blank, says Not found, or something similar, the software was unable to find the GD-ROM emulator on your SET5. This is usually a transient condition. Exit Dacheck, and try again. If the problem persists, try confirming in Control Panel under the SCSI Adapters outlet that the GD-ROM emulator is visible; then try Dacheckagain. The following illustration shows the window that comes up. This document is only concerned with the right side of this window, which reflects the state of the GD-ROM emulator. Note the firmware revision in the Firmware Ver field. After initialization is complete, click the Reflash GD-M. button at the bottom of the window. When asked to Flash from a File or Flash from the GD-M’s disk, choose the Flash from a File option, and select the file Gm2_5_0e.fsh, or later if present, which should be located in your Tools\Cross products\GD Workshop directory After the firmware has been upgraded, it is notnecessary to restart Windows NT. Choose the Manually Shut Down button, if you are asked. You need to turn your SET5 off and turn it on again, however, in order for the change to take effect. Wait 10 seconds after turning your SET5 on before trying anything else. If you want to test the GD-M, start Dacheck again, and choose the TEST GD-M. button. Configuring GD Workshop GD Workshop starts up and, on most systems, automatically detects the SET5 GD-ROM emulator and assigns a drive letter. A dialog box may come up telling you that multiple removable drives and/or emulators have been found. Choose OK. To assign a drive letter to an emulator: 1. Choose an emulator in the tree. 2. Choose an available drive letter in the drop-down box, and choose Add. The emulator is assigned to the drive letter and added to the list of current drive selections. The emulators added to this list appear in a drop-down list in the emulator control bar of GD Workshop so that you can choose the one you want to use at the time of emulation. Emulating a GD-ROM To use GD Workshop, you must create a project. A project contains CDs or GD-ROMs that have been created for emulation. The quickest and easiest method to add content to your project is to drag and drop the files in from another application, such as Windows Explorer. To add content to your project 1. Set up your source files on the host computer. 2. Set up a new project. 3. Drag and drop the source files into GD Workshop. Arrange your source files on the host computer in the way you want them to appear on the CD. If you want to group a set of files in a directory on the CD, place them in the same directory on the host computer. Give your files and directories meaningful names to avoid having to edit them later. The permitted characters are uppercase A to Z, 0 to 9, and the underscore symbol. ISO9660 Level 1 allows only 8.3 format. ISO9660 Level 2 allows up to 30 characters for file names and up to 31 characters for directory names. When a file name has no extension, the file name must end with a period. The following rules apply: The maximum number of files that the GD emulator can emulate is 20,000. Drag-and-drop can only handle 4,000 files in a single directory. If you need to create a directory on the CD that contains more than 4,000 files, you must drag in separate directories of 4,000 files each. Then, by renaming the directories in GD Workshop, you can move all the files into the same directory on the CD. If you create empty directories on the development computer, they are not copied when you drag them into GD Workshop. Always make sure that there is at least one file in a directory. To create an empty directory on the CD, use the Add Directory button in the Project toolbar. To set up a new project 1. Start GD Workshop, and choose New. 2. Name the project, and choose OK. An empty project window is created. 3. Choose Workshop on the Configuration menu. 4. Under Initial Track Type, select the type of track that you want to create first on the CD. For example, if your source files are CD-ROM data, select Mode 1 as your initial track type. 5. If you are creating a GD-ROM: If you want to add the files to the second session (the data session), check GD-ROM auto-build, add files to 2nd session on the Workshop Configuration dialog box. If you want to add the files to the first session (the message session), uncheck GD-ROM auto-build, add files to 2nd session. 6. Choose OK. To drag and drop source files 1. Browse the host computer for the files you want to put on the CD. 2. Select all the files and drag them into the empty project window. If your source files are grouped together in directories, select the directories that you want to copy, and drag them into the project window. This should result in a prompt asking for the type of CD that you want to create. Choose GD-ROM. 3. At the prompt, choose whether you want to copy relative paths. For example, if all your files are in a directory in root called Project_X, if you choose Yes, all the files are copied into root on the CD. If you choose No, the full path to each file is copied, and all the files are copied into a directory called Project_X on the CD. 4. At the prompt, confirm or change the file-naming system to use on the CD. When you have confirmed the file-naming system, the following happens: A File Copier progress window appears, and the source files are copied to the emulation drive where they will be accessed later during emulation. A tree is drawn in the project window to represent the content of the CD. Adding Audio Tracks The GD Workshop Help contains instructions for adding audio tracks to CD-ROMs and GD-ROMs. IMPORTANT NOTES Note In order to emulate a GD-ROM successfully, you must do the following: Pad out the two tracks on the single-density area to at least 700 KB of data each. It is best to copy a large file each to the MODE1 and CDDA tracks in the initial session to meet this requirement. Pad out the high-density data area to at least 303 MB of data, and also fill in both of the System File Area sections of the Disc tab on the right hand side of the project window with the Tools\Gdworkshop\Ip_drago.binfile. Then choose Apply at the bottom of the window. To emulate a GD-ROM 1. Switch the Emulator/GD-Drive switch on the control toolbar to Emulator, the up position. 2. If you have more than one emulator connected to the development computer, select the emulator you want to use in the drop-down list on the control toolbar. 3. If your project consists of several CDs, select which CD you want to emulate in the drop-down list on the control toolbar. You can only emulate one CD at a time. 4. Click Close Door on the control toolbar. Note These controls are also available from the task bar, using the right-click mouse button when GD Workshop is minimized. The GD emulator now appears to the SET5 development hardware as a GD-ROM drive that is playing your virtual GD-ROM. To halt the emulation at any time Choose Open Door on the control toolbar. You can make changes to your project and re-emulate as many times as you like until you are completely satisfied that your CD has no running problems before you write a gold master. Troubleshooting You may receive this dialog box when you try to emulate a GD-ROM. This dialog box indicates that the specified tracks do not contain enough data to meet the GD-ROM format specification. This is usually an issue with the first and second GD-ROM tracks since only the third is used. This dialog box can be eliminated by putting about 2.5 MB of data into each track mentioned in the dialog box. There are two ways to use the emulator: Start GD Workshop every time you boot the SET5. You can set GD Workshop to load the last project you worked on each time, but you still have to close the door every time. Configure the GD-ROM to auto-emulate by using the Configure dialog under Hardware, which means that when the SET5 comes up, it automatically loads the chosen GD-ROM and closes the door. Documentation for this function can be found in the GD Workshop Help under How to emulate a CD. Using the GD-ROM Drive In order to use the GD-ROM Drive, you must switch the Emulator/GD-Drive switchon the control toolbar in GD Workshop to Drive (down position). Open and close the GD-ROM drive by pushing on the cover until it is released or until a click is heard, and then releasing it. As long as GD Workshop is set to the GD-Drive position, CDs and GD-ROMs are detected automatically. Burning a New GD-ROM In order to burn a GD-ROM or ISO9660 CD, first attach the GD Writer with a SCSI cable to the Dreamcast console at the connector labeled For GD Writer on the rear of the unit. The GD Writer must be turned on and the Dreamcast console rebooted to recognize the GD Writer. Start up GD Workshop. Go to Open on the File menu to open the specific GD Workshop project that you want to burn to the GD-ROM. If you need to create a new project, see the Creating a GD-ROM for Emulation section of this document. To verify that the project must be emulated at least once 1. Switch the Emulator/GD-Drive switch on the control toolbar to the Emulator (up) position. 2. Choose Close Door on the control toolbar. If the second and third toolbar buttons are still grayed out, go to the Configuration/SCSI Bus menu of GD Workshop. You should see an entry like ID # 3: Sega GD-R 1997. Choose this in the tree view, and then choose the button labeled Select As CD-R. 3. Choose OK. At this point, the second and third toolbar entries should be valid. The second toolbar button does a test write on the GD-ROM. The third button actually does a write. When selecting either of these, a dialog appears, giving you an option of writing speed and OK or Cancel buttons. Choose OK. The progress bar in the dialog box indicates how far along the writing is. When the writing is complete, the GD-ROM is automatically ejected from the GD Writer, and the dialog box disappears. Test your newly burned GD-ROM by inserting it into the GD-Drive. Windows CE–specific Issues Note this important change: By default, the CD/GD-ROM is in the execution path. The default path is set as follows: HKEY_LOCAL_MACHINE\Loader "SystemPath"=multi_sz: "\\CD-ROM\WinCE", "\\CD-ROM" In this case, \\CD-ROM\WinCE and \\CD-ROM are searched. The path is searched only if the path to the file being looked for is not explicitly given; for example, LoadLibrary(L“\Mydirectory\Myfile.dll”) does not cause a path search. The total length of the SystemPath cannot exceed 260 characters, or the path is ignored. You may want to modify or override this registry key to search directories of your own. Add only path entries at the end of the path, and preserve the existing contents. Autoplay To start your game automatically when the OS boots, add the following to one of the .reg files in your %_FLATRELEASEDIR%, changing Donuts.exe to be your game’s .exe: [HKEY_LOCAL_MACHINE\init] "Launch70"="donuts.exe" "Depend70"=hex:3C,00 It is not possible to pass arguments to programs launched by this mechanism. Creating a Bootable GD-ROM This section describes how to construct a bootable GD-ROM. The resulting emulated GD-ROM can be burned by following the instructions in the previous sections. A Windows CE bootable GD-ROM must have the following format and contents: A specially converted version of the OS image with a specific name put in the root directory of the second GD-ROM session A populated \WinCE directory containing the rest of the Windows CE components. To put together a CD with that format and contents 1. In a build window, type: MAKECD. This generates a directory tree in %_FLATRELEASEDIR%\cd that contains the Windows CE components that go on the CD, except for the OS image. 2. Start an Explorer window in this directory by typing explorer %_FLATRELEASEDIR%\cd. 3. Using GD Workshop, create a new project. 4. Drag and drop the contents of the explorer window, which should be just the \WinCEdirectory, into GD Workshop. 5. Choose GD-ROM as your CD type. The contents of the explorer window are added to the newly created project. You should now have a project with three tracks, where the last track contains the Windows CE directory. 6. In GD Workshop, choose the Disk tab. There are two edit controls on this property sheet. One is labeled System Area File (single), and the other System Area File (double). Next to each edit control is a Browse button. 7. Choose <WCEDreamcast>\Tools\GDWorkshop\Ip_drago.bin in both controls, and then choose Apply. 8. Create an OS image, using Makeimgas described earlier in this document. 9. To create a bootable image called 0winceos.bin, type the following: GORE 10. Insert the 0WinCE.binin the root directory of the second session on the GD-ROM drive either by right-clicking on the session in GD Workshop or choosing Insert File on the Edit menu. The GD-ROM should now be bootable. 11. Try closing the emulator door using Close Door on the control toolbar. If you have any problems doing this, check the troubleshooting section earlier in this document. 12. Start Dctool, and change the Load From setting from Image File to GD ROM. Choose the Boot button. This causes the Dreamcast console to boot from the GD-ROM. Depending on how you have configured your image, either Windbg should pop up, or you should see console messages in Dctool. 13. You can now add additional game-specific content to the GD-ROM. You may want to follow these instructions to add additional paths to the execution path and automatically start the game when the OS boots. Performance Anything placed in Nk.binand the resulting 0WinCEOS.bin consumes RAM for the duration of the game. However, taking too many things out of the image results in slower performance, as each file is loaded individually when needed. The GD-ROM performance is faster out at the rim of the CD. To pad your data out to the rim 1. Choose the MODE 1 track in the second GD-ROM session. 2. Go to the Track property page. 3. Choose Pad Track, and then choose Apply. 4. Open and reclose the door for the new parameters to take effect. For more information, see the GD Workshop software Help.