The Interactive Engineer Volume 4, Number 2, 1995
In this Issue:Debugging Services
Optimage BBS

Table of Contents
Sticky Modules1
Can I make my own Media Mogul Plugins?2
Promote your own tools3
Support contractors section3
Making a CD-i Ready using MediaMogul3
Compatibility between Hard Disk and Syquest4
CD-i Training courses5
NIRD Services6
Optimage BBS6

Sticky Modules

Increasing the speed of your application

Tom Tabruyn Philips Interactive Media Centre ¥ What is a sticky module ? All modules you or a process needs, must be loaded into memory before you are able to use them. But what if you donÕt need a module any more? Instead of letting the memory flood with obsolete garbage, CD-RTOS acts as a very tidy operating system by removing the old modules (the ones no longer in use) for you. CD-RTOS determines this by the link count (you can view this in the link field when you use mdir -e). Every time a process needs a module, it will increase the link count by one. When the process no longer needs it, it will in turn decrease the link count. This way a module will only be loaded once, afterwards just linked to (besides being tidy, CD-RTOS also is very lazy). And when the link count finally reaches 0, the module will be unloaded from the memory. Except for sticky modules: these will stay in memory wether or not their link counts are 0. ¥ Why does anyone want a module to be sticky ? If you know you will need to use a module very soon after unlinking it for the last time, it would save you a disk access (and some valuable time) if CD-RTOS didn't remove it from memory. ¥ Can I make all my modules sticky ? Yes, you can. In doing so, however, you will both fragment your memory and leave so little space that any more modules might be too big to be loaded. Therefore, be careful and only make a module sticky when you are really going to need it a lot. ¥ I'm using MediaMogul, I don't need this technical module discussion. You're right, you don't. But remember you can improve the speed of your application with it (and which MeMo user wouldn't like that?) One thing though : only use sticky modules when you have some spare memory left, see previous paragraph. ¥ How to do it? To make a module sticky, it's enough to set just one bit in the attribute/revision field. You can see this by typing ident (look at the Ty/La At/Rev line). Bit 6 of the most significant byte is the sticky bit XX: e.g. :
Ty/La At/Rev     $101        $C001    --> 1100 0000 0000 0001
			                                 |
			                                 |--> sticky bit
You can change this field using fixmod -ua=XXXX . Replace the XXXX by the hexadecimal value you want. Just make sure the sticky bit is set or reset. e.g. : a module with this field set to 8003 can be made sticky by typing fixmod -ua=c003 modname. This will only change the sticky bit. Now check if your module really became sticky by ident . It should say "Sticky Module" on the last line.

Can I make my own MediaMogul Plugins?

Is it possible to make your own Media Mogul plugins? The number of MediaMogul users is increasing steadily. Beginning studioÕs tend to use this tool for their first steps into the world of CD-i. MediaMogul is also used for the majority of professional applications. Like any other high-level scripting language, MediaMogul has its limitations. Many developers are pushing this tool to its limits, and when these limits are reached, the question often arises as to whether it is possible to write MediaMogul Plugins. Interactive resources in Iowa has developed many plugins. You can purchase these plugins through Philips or OptImage (U.S.). They allow you to extend MediaMogul's capability. Plugins are CDRTOS/OS9 executable modules that are "called" from MediaMogul. They are developed as any OS9 program module would be (Compiled "C" code). They can be very simple like reading a MediaMogul variable or they can be more sophisticated like adding a special video effect. The architecture of MediaMogul is such that these plugins can retreive information from data modules that the MediaMogul "engines" maintain to provide current environment (state) information. There is example code in the appendices of the MediaMogul documentation that illustrates how to access the MediaMogul data modules. Also included with the MediaMogul Package are the necessary include files to compile plugin code. Writing plugins obviously requires programming skills and knowledge of CDRTOS/CD‑i along with an understanding of the MediaMogul architecture. Courses are planned to help potential plugin developers to come up to speed quicker.

Promote your own tools!

Many CD-i studioÕs have made their own tools for developing CD-i applications. Some studioÕs are even thinking about making these tools more user-friendly and selling them to other StudioÕs. This magazine is an ideal means of presenting your tool to the CD-i comunity. If you are a developer and you would like to describe your authoring tool to your collegues all over the world, please do not hesitate to contact / to send texts to: Hein Zegers at PIMC, tel. +32 11 242546, fax +32 11 242, Email hein@pimc.be.

Support Contractors section

People entitled to have support from Philips Interactive Media Centre will find the following items together with this Interactive Engineer:

New Technical Notes

¥ TN #109: Developing for the CDi 450 Technical Note #109 describes points that need special attention for the CDI450 generation of CD-i consumer players. ¥ TN#110: Making Media Mogul titles conform to the FPD This document discusses the actions that should be undertaken to create a CD-i with MediaMogul that conforms to the Final Production Delivery specifications. At present, one cannot simply run Script2Disc to create an FPD-conform disc image.

Final Production Delivery (FPD)

¥ FPD Document Philips developers will receive a copy of the document ÒFinal Production Delivery.Ó This document of about hundred pages explains how titles should be submitted to Philips for replication and archiving. StudioÕs having a support contract at present will also receive this document, since it is an interesting document for non-Philips Developers as well. ¥ FPD Disc One of the appendices of the FPD document is in fact a compact disc. On this disc, you will find: The official Philips Media Bumper, which must be included in every Philips Media production The green test utilities, which help you to determine if your title is compliant to the green book. You can find instructions in the README file on the disc and in the appendixes M (Philips Media Bumper) and N (Green test utilities) of the FPD document.

Making a CDi ready using MeMo

Tom Tabruyn Philips Interactive Media Centre A CD-i ready disc is a disc that can also be played by a normal CD-audio player. It is a disc that contains CD-i tracks as well as red tracks (CD-audio tracks). Many developers ask if it is possible to make such a CD-i ready with MediaMogul. This is possible. But there is a problem: as for now, it is impossible to burn a WORM from a CDi ready image that will work correctly on all players. The Philips CDD522 is capable of writing these CDi Ready images, but there's currently no software available to do this... (The mastered CDi ready image is correct though - you can emulate it quite fine. And actually pressing it at a disc factory will normally cause no problems...). How can you make such an image? 1. Insert the red tracks as assets into your script. You can do this by providing them as parameters to a dummy subroutine (a subroutine that actually exists, but is never used in your scripts) which is at a point in your flow which is never reached. Your intro script may look like this :
00:00Br_always_nr/h0/SCRIPTS/main.scr
02:00dummy_pluginredtrack1
03:00dummy_pluginredtrack2
04:00dummy_pluginredtrack3
05:00dummy_pluginredtrack4
This way cdbuild will add them as assets to your image. 2. Call cdbuild When you are working on an emulator or on a Sun, use CTRL-C to stop cdbuild before actually calling master, i.e. after the creation of the Real Time Files. When you are working on Macintosh, select "make realtime files only". After that has finished, examine the master-include files. To finish the build, select "combine real time files only" and select "Process". Wait for the message "FULL CD IMAGE" to appear, then stop it as explained above. (Don't use the -m option : this does not create a new master_script). You must also use the -kr=dummy_plugin option to tell cdbuild NOT to convert the red tracks into yellow files. The -kr means all parameters passed to dummy_plugin are red tracks. Therefore be sure you do not use this dummy_plugin in any other part of your application. 3. Call master On emulator/Sun: Cdbuild now has built a master_script which you can master (actually it only builds the _master_include_x files, the master_script is always the same). You can list these _master_include_x files to check the red tracks being mastered as red tracks. Use the master -u master_script command to build a real CDi ready disc image. On Macintosh, you can simply select "Combine realtime files only" How can you overcome the disc burning problem? First emulate the CDi-Ready image : this allows to test the CDi part of the disc. Then burn a WORM using a CDD522 : this will allow testing the CDDA : a CDi player will only recognize the red part of a burnt CDi-Ready WORM. But again, itÕs not a 100% guarantee...

Compatibility between Hard Disk and Syquest

Eddy Paulissen and Jaap van Zoest Philips Interactive Media Centre In the world of CD-i authoring, Syquest is sometimes used as a medium for backupping a hard disk and transporting large amounts of data. In this article, we will take a look at the data transfer from a PC or MAC harddisk, via a 605 player to a Syquest tape driver. Therefore, we will first decribe the compatibilities between a Harddisk and a 605 player, and then we will describe the compatibilities between a 605 player and a Syquest. From HD to 605 For transferring data from PC or MAC harddisk to CDI605 player, the following compatibilities are valid: ¥ It is suspected that a single PC partition cannot be over 2 Gigabyte. ¥ Adaptecs AFDISK has never been used successfully in creating a PC drive readable by the 605. ¥ Fixed disk - single partition: On PC: Format on PC using FDISK and FORMAT for a single partition. Once formatted, move to the 605 and access using /pch1_ or /pch1, or /pch2. On MAC: Format on Macintosh using Formatter Five for a single partition. Once formatted, move to the 605 and access using /pch1_ or /pch1 or /pch2. ¥ Fixed disk - multiple partitions: On PC: Format on PC using FDISK and FORMAT for a multiple partitions or on the Once formatted, move to the 605 and run the shell script start_pch1. This will execute partdgen which will create device descriptors for each of the partitions, load them into memory, and initialize them. The shell script will print a list of the created descriptors on the screen, you may access them using /pch1a, /pch1b, etc. Alternately, run partdgen on the 605 manually, then load the derived descriptors /pch1a, /pch1b... chd /h0/cmds/bootobjs partgen -g /pch1 load -d pch1a load -d pch1b iniz pch1a iniz pch1b chd /pch1a chd /pch1b On MAC: Macintosh using Formatter Five. Once formatted, move to the 605 and run the shell script start_pch1. This will execute partdgen which will create device descriptors for each of the partitions, load them into memory, and initialize them. The shell script will print a list of the created descriptors on the screen, you may access them using /pch1a, /pch1b, etc. Alternately, run partdgen on the 605 manually, then load the derived descriptors /pch1a, /pch1b... Syquest disc to CDI605 player On PC: Syquest disc - MUST single partition only: Format on PC using SQPREP version 2.4 or later with DOS 5.0 or later for a single partition only. Multiple partitions on Syquest cartridges (disc) are not supported on the 605. Access as /pch1_ or Format on a PC using DOS (5.0 or later) FDISK and FORMAT commands - single partition only! Access as /pch1_ On MAC: Format on the Macintosh using FormatterFive for a single partition only. Once formatted, move to the 605 and access using /pch1_.. ¥ Removable hard drives (Syquests) have never been read successfully on the 605 using /pch1 or /pch2. /pch1_ is the only descriptor that appears to work. ¥ Most Macintoshs can read/write to Removable type PC hard drives through the use of DOSMounter or other commercial DOS enablers. ¥ Fixed PC hard drives may also be readable on the Macintosh using the most current DOSMounter or similar software - untested.

CD-i Training Courses

PIMC is organizing several CD-i and DV courses. All courses will be held in Hasselt, Belgium. Training courses can be cancelled when there are less than 4 participants. PIMC reserves the right to reschedule courses. For prices in your country please contact your local Philips representative. For registration and more information please contact : Ann Holsteyns PIMC Training Maastrichterstraat 63 3500 Hasselt - Belgium tel.: +32 11 242546 fax: +32 11 242273 Please note that OptImage giving similar courses in the U.S. Please contact OptImage for more information about these courses. A schedule of the courses in Europe is printed below: Design Principles: 10/5-12/5 2/8-4/8 8/11-10/11 Media Mogul: 25/4-28/4 30/5-2/6 27/7-30/7 25/7-28/7 22/8-25/8 26/9-29/9 24/10-27/10 28/11-01/12 Balboa: 10/3-13/3 2/5-5/5 13/6-16/6 11/7-14/7 8/8-11/8 12/9-15/9 10/10-13/10 14/11-17/11 12/12-15/12 DV Principles 20/4 23/5 20/6 18/7 17/8 19/9 17/10 21/11 19/12 DV Hands-On Delta Vx 21/4 24/5 21/6 19/7 18/8 20/9 18/10 22/11 20/12

NIRD Services

The Non-Intrusive Real-Time Debugger (NIRD) is a very useful tool for advanced CD-i developers. It allows you to look at the disassembled bus stream of the CD-i player, and thus offers the best way of finding bugs. It is especially valuable for C- and Assembler programmers. The debugger links disassembled bus cycles using .DBG files to the C-source code of the program. The NIRD was developed at Philips Research Labs in Redhill, by Paul Clarke. Philips is in the process of commercializing this product. Meanwhile, the Support group at PIMC is already using several NIRDS for debugging titles (for Philips productions and for developers with a support contract.) PIMC is also planning to give courses about debugging with the NIRD.

OptImage BBS

Optimage offers an interesting BBS with lots of information about CD-i development. You just need a computer with a modem to log in. OPTIMAGE BBS: (++1) 5152251933 Any communication software will do the job. The best way to get an idea of the possibilities of this BBS, is by looking at the short session log printed below.
              ****************************************************
              ******************  Main Menu  *********************
              ****************************************************
              **********     Press any key inside ( )    *********
              **********                                 *********
              ****  (A)  ALTER preferences (screen params...  ****
              ****  (D)  DISPLAY preferences                  ****
              ****  (P)  PASSWORD change                      ****
              *********                                  *********
              ****  (F)  FILES & DOCUMENTS                    ****
              ****  (M)  MESSAGES                             ****
              ****  (B)  BULLETINS (releases & news)          ****
              ****  (U)  Maintenance UPDATES (limited access) ****
              ****************************************************

    ========================== Control Selections ===========================
    (0) Main Menu   (<) Previous Menu   (T) Time Used           (G) GOODBYE!

Menu Selection: f

               ***********************************************
               **              File Sections                **
               ***********************************************
               **     (1) PC, Mac, Sun, OS-9 machines        **
               **     (2) "C" Related Files for CD-i        **
               **     (3) Articles                          **
               **     (4) Tech Tips                         **
               **                                           **
               **     (P) PUBLIC Uploads/Downloads          **
               ***********************************************