home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / CD32 / CD32_Support / notes / CATS_CD32_Notes < prev    next >
Encoding:
Text File  |  1999-10-27  |  38.9 KB  |  994 lines

  1.  
  2. Additional CD32 information and tips from CATS
  3. ==============================================
  4.  
  5. $VER: CATS_CD32_Notes 40.1 (15.10.93)
  6.  
  7.    ************************************************************************
  8.    *                                      *
  9.    *                COPYRIGHTS                  *
  10.    *                                      *
  11.    *       Copyright (c) 1993-1999 Amiga, Inc.  All Rights Reserved       *
  12.    *                                      *
  13.    ************************************************************************
  14.  
  15.  
  16.    ************************************************************************
  17.    *                                      *
  18.    *                CONFIDENTIAL DEVELOPER MATERIALS          *
  19.    *                                      *
  20.    ************************************************************************
  21.  
  22.    THIS SOFTWARE AND INFORMATION IS PRELIMINARY AND/OR CONFIDENTIAL, AND
  23.    IS PROVIDED ONLY FOR INHOUSE TESTING AND/OR USE BY REGISTERED DEVELOPERS.
  24.  
  25.    THIS SOFTWARE AND INFORMATION MAY NOT BE DISTRIBUTED, DISCLOSED,
  26.    OR DUPLICATED, IN WHOLE OR IN PART, IN ANY MANNER OTHER THAN AS
  27.    SPECIFIED IN A SIGNED NONDISCLOSURE AGREEMENT WITH COMMODORE.
  28.  
  29.    THIS SOFTWARE AND INFORMATION MAY NOT BE RETRANSMITTED ELECTRONICALLY,
  30.    AND MAY NOT BE STORED ON MULTI-USER SYSTEMS.
  31.  
  32.    
  33.    ************************************************************************
  34.    *                                      *
  35.    *                DISCLAIMER                  *
  36.    *                                      *
  37.    *   THIS SOFTWARE AND INFORMATION IS PROVIDED "AS IS".          *
  38.    *   NO REPRESENTATIONS OR WARRANTIES ARE MADE WITH RESPECT TO THE      *
  39.    *   ACCURACY, RELIABILITY, PERFORMANCE, CURRENTNESS, OR OPERATION      *
  40.    *   OF THIS SOFTWARE AND INFORMATION, AND ALL USE IS AT YOUR OWN RISK. *
  41.    *   NEITHER AMIGA NOR THE AUTHORS ASSUME ANY RESPONSIBILITY          *
  42.    *   OR LIABILITY WHATSOEVER WITH RESPECT TO YOUR USE OF THIS SOFTWARE  *
  43.    *   AND INFORMATION.                              *
  44.    *                                      *
  45.    ************************************************************************
  46.  
  47. FIRST - Read the Other Docs
  48. ===========================
  49. Read the AppDeveloper.spec and the Periph_Compat documents, and
  50. any other written or electronic docs we have provided.
  51.  
  52. These notes are intended to be an addendum to the other docs!
  53.  
  54.  
  55. SECOND - Regarding Sample Scripts
  56. =================================
  57. Some of the sample CD startup scripts provided here have not been
  58. tested as-is.  But they are similar to parts of scripts we have
  59. used on our demo, bundle, and test CDs.
  60.  
  61.  
  62. Notes on Debug (aka. Developer) Boards
  63. ======================================
  64. A limited number of CD32 "Debug" boards should be available for sale
  65. to registered developers.  This board, when attached to the back of a
  66. CD32, provides floppy, parallel, serial, and RGB ports.  There is also
  67. an IDE port which is functional if you have a special CD32 developer
  68. ROM containing the IDE driver.  These boards are VERY useful for
  69. debugging CD's and testing new executables with CD Data.
  70.  
  71. But - be sure to also test your product on a CD32 with no debug
  72. board attached!!!  We have seen cases where a title worked if there
  73. was a debug board attached but crashed somewhere on a standard
  74. CD32 with no debug board.  Some possible causes for crashing with
  75. no debug board would be  1. memory layout differences and  2. code
  76. dependence on the existance of a DF0: (there was always a DF0: in
  77. the doslist on a CDTV).
  78.  
  79.  
  80. Notes on CD-Audio and CDXL
  81. ==========================
  82.  
  83. 1. You can't do CD-Audio, CDXL, and other CD accesses at the same time
  84.  
  85. While playing CD audio or CDXL with CD32 cd.device you must not
  86. make any other filesystem or track-level accesses of the CD or it
  87. will hang at least until the CD audio or CDXL completes.  This
  88. could be a long time.  Note that the CDTV cdtv.device behaved
  89. differently and would automatically abort CD audio if a filesystem
  90. or track-level access occurred.
  91.  
  92. Keep this in mind while writing your code - for example, you can not
  93. start CD audio playing and THEN try to load an ILBM....
  94.  
  95.  
  96. 2. BUGS and Workarounds
  97.  
  98. a. Various cd.device and nonvolatile bugs
  99.  
  100.    You MUST USE the latest V40 SetPatch on your titles!  As of this
  101.    writing SetPatch 40.12 is the latest SetPatch.  It is part of
  102.    the Workbench 40.35 beta, and either this version or a newer SetPatch
  103.    should be available in closed CD32 listings areas.
  104.  
  105.    SetPatch 40.12+ fixes some CD32 device/library problems including:
  106.  
  107.    - crash if application accessed nonvolatile if the Amiga CD32
  108.      NonVolatile prefs screen was used before closing door on title.
  109.  
  110.    - a CD_SEEK problem
  111.  
  112.    - possible hang of cd.device on certain length commands when
  113.      sent to certain drive firmware revisions
  114.  
  115.    See the SetPatch notes below on the use of SetPatch.
  116.  
  117.  
  118. b. CD prefetch can cause CD_CONFIG speed setting to be ignored
  119.  
  120.    It is possible for a cd.device CD_CONFIG speed setting command
  121.    to be ignored if the data you try to read at the new speed
  122.    setting resides on the disc directly after the last data
  123.    data that was read.  This is because if the second read's
  124.    data is currently being prefetched when you tell cd.device
  125.    to read that data, the reinitialization of the cd.device to
  126.    the new speed settings will not occur until either an error
  127.    or a read from elsewhere on the disc occurs.
  128.  
  129.    A simple but not necessarily upward compatible workaround
  130.    is to Delay(14) or equivalent non-busy-wait for about 1/4
  131.    second before starting the read of the data which you wish
  132.    to read at the new speed.  But if a future cd.device has a
  133.    longer/bigger prefetch, this Delay may not be enough.
  134.    A better workaround is to READ (not SEEK) a few bytes at
  135.    a position 2 sectors before your data, before reading your
  136.    data.
  137.  
  138.    We ran into this problem in the CDGSXL player which can do a
  139.    filesystem load of an ILBM, then set double speed for CDXL, 
  140.    then start playing the double speed CDXL.  The ILBM resided
  141.    right before the CDXL stream on the disc, and the double-speed
  142.    setting was sometimes ignored.
  143.  
  144.  
  145. c. Taking over INT2 is BAD BAD BAD and can Hang System !!!!
  146.  
  147.    If your title takes over the INT2 interrupt, two very bad
  148.    problems can occur!!!!
  149.  
  150.    o Your title can hang on some drives or firmware if you happen to
  151.      take over INT2 while the cd.device is still prefetching data after
  152.      the last read which occured!  That last read might have been the
  153.      read that loaded the code of your game, or a read that you performed
  154.      to load your title screen or music.  This type of hang genrally
  155.      does not show up until you cut a disk because only then are all
  156.      files being loaded from the CD.  And since it is a race condition,
  157.      it may only occur sometimes or only on some systems.
  158.  
  159.    o If you have taken over INT2, and the user jostles the CD32 hard
  160.      enough to cause the drive to spin down, the drive tries to send
  161.      an error to cd.device, an interrupt occurs which cd.device must
  162.      handle, and cd.device cannot handle it because you knocked
  163.      cd.device out of the INT2 chain by taking over INT2.
  164.      Result - Your Game Will Hang.
  165.  
  166.      Proper Workaround: Do NOT TAKE OVER INT2.  On CDTV and CD32,
  167.      the cd driver is ON THE INT2 CHAIN and requires proper
  168.      servicing of its interrupts.  This is not an A1200.
  169.      Read the 2.0 RKM Devices Manual cia resource chapter.
  170.      Use the OS to properly allocate a timer for yourself if
  171.      you need your own timer.  Or, if you want INT2, see the
  172.      Libraries manual Exec Interrupts chapter, and add yourself to
  173.      server chain for INT2, and properly return with the processor
  174.      Z flag set so that the other INT2 servers will be called.
  175.  
  176.      Kludge workaround: If you are taking over INT2 be sure to Delay()
  177.      or WaitTOF() for at least 1/4 second after any CD reads have occured
  178.      and before taking over INT2.  That should take care of possible
  179.      hanging during game startup on current systems and firmware.
  180.      But tell your users that your game can totally hang if they
  181.      jostle the CD32 too hard.
  182.  
  183.  
  184. 3. CD_PAUSE and CD_SEARCH are global and sticky
  185.  
  186. If the CD_PAUSE command is used to pause CD audio, pause mode
  187. will remain in effect even if a CD_PLAYTRACK is aborted and/or the
  188. cd.device is closed.  If your title can exit, and has paused CD
  189. audio, please unpause it before you exit.
  190.  
  191. Similarly, CD_SEARCH settings are global and sticky.  If CD_SEARCH
  192. is used to change the CD audio PLAY mode settings, please set them back
  193. to a reasonable default.  If your title does not need to be booted from
  194.  
  195. If your title can be started in a peripheral or multitasking environment,
  196. or can be exited and reentered, you may wish to use the CD_INFO command
  197. to check if CD audio is paused or if CD audio Search mode has been set to
  198. anything other than normal forward speed.  Then, if necessary, use the
  199. CD_PAUSE and/or CD_SEARCH commands to reset to unpause and normal forward
  200. speed before attempting to start your own CD audio.  This way, if some
  201. previous code accidently left the drive in a paused or unusual state,
  202. you will still be able to play CD audio.
  203.  
  204.  
  205. 4. cd.device/CD_INFO
  206.  
  207. This command can tell you if CD audio is playing.  But DON'T use it
  208. to determine whether you have queued a request to play CD audio.
  209. CD_INFO will only report that CD audio is playing if the audio has
  210. actually been started.  If you want to check if you have an outstanding
  211. CD audio request, use CheckIO() instead.
  212.  
  213.  
  214. 5. Aborting CD audio or CDXL
  215.  
  216. The only way to do this with cd.device is AbortIO().  The CDTV
  217. cdtv.device had some additional commands for stopping things,
  218. but cd.device does not.  Normal procedure is:
  219.  
  220. WARNING - first edit the clib/exec_protos.h file to correct the CheckIO
  221. prototype to return struct IORequest *, not BOOL!  This is a bug in the
  222. prototype which is being fixed!!!!
  223.  
  224. if(!(CheckIO(iorequest)))    /* if not completed yet */
  225.    {
  226.    AbortIO(iorequest);
  227.    }
  228. WaitIO(iorequest);
  229.  
  230.  
  231.  
  232.  
  233. Notes on Lowlevel 
  234. =================
  235.  
  236. 1. First ReadJoyPort - not from an interrupt
  237.  
  238. The first call to ReadJoyPort() must be made from a task or process,
  239. not an interrupt (because of setups and allocations which are
  240. performed by the first call).  After the first call, you may call
  241. the function from an interrupt.
  242.  
  243.  
  244. 2. First ReadJoyPort - may miss special buttons
  245.  
  246. In our experience, the first calls to ReadJoyPort() after opening
  247. lowlevel.library may miss special game controller buttons.  If you
  248. are checking for special controller button presses right away, you may
  249. need to first call ReadJoyPort() a couple of times with a Delay(10)
  250. in between, then call it again to read the actual state initial state
  251. of the controller.  Once you are past this initial startup problem,
  252. ReadJoyPort() can be used normally with no Delay()'s needed.
  253.  
  254.  
  255. 3. What if you require mouse-like movement of the Intuition pointer ?
  256.  
  257. For most CD titles controlled by a game controller, this is a very
  258. bad user interface.  If possible, you should have highlighted
  259. boxes or pictures or text, and you should let the user move the
  260. highlight, and let the user select the highlighted item by pressing
  261. the select (red, A) button.
  262.  
  263. However, if your title absolutely requires smooth mouse-like travel
  264. of the Intuition pointer via game-controller (like a kid's paint
  265. package), then contact CATS US for a special "joymouse" startup-sequence
  266. program which uses lowlevel.library to generate mouse events and
  267. can also pass the special controller buttons as raw key codes.
  268. Do Not Use the old CDTV playerprefs.library function InstallJoyMouse
  269. when running on a CD32.  It makes the correct lowlevel.library
  270. controller-reading function unusable, and we don't intend to continue
  271. to provide playerprefs.library and other pre-CD32 CD modules.
  272.  
  273.  
  274. 4. SCON_TakeOverSys
  275.  
  276. If you use the lowlevel.library SystemControlA() function tag
  277. SCON_TakeOverSys to "take over" the system, you may not be able to
  278. then use system features which require their own multitasking.
  279. For example, if you wish to take over the system AND play CD audio,
  280. you will probably need to start the CD audio, delay until the
  281. CD audio has started playing, then take over the system.
  282.  
  283. Or, just don't use SCON_TakeOverSys.  Here is one CD32 developer's
  284. point of view:
  285.  
  286.    "Having problems getting CD-Audio to work? Does the CD seek to your
  287.    track, drive light go on, but no audio appears? If so then you're
  288.    probably using the SystemControl() tag SCON_TakeOverSys. This is
  289.    _bad_. If basically does a Forbid(), which knocks the cd.device stuff
  290.    on the head. The way I got round it was to remove the tag... I also
  291.    run my task at default task priority (0)... I don't want to hear this
  292.    rubbish like 'my program won't run fast enough if I don't do a
  293.    SetTaskPri() to 127 and use SCON_TakeOverSys (or Forbid()).. it's
  294.    complete bol*ocks. I have an input.device handler that swallows all
  295.    input, default task priority, no Forbid(), no SCON_TakeOverSys and my
  296.    code still runs at 50fps for 98% of the time.. It _sometimes_ misses
  297.    a frame when you put a Floppy disk in the drive, but mostly it's
  298.    transparent... you also get the added bonus of CD audio running quite
  299.    happily."
  300.  
  301.           Dean Ashton, Millennium Interactive, Ltd.
  302.         
  303.     
  304.  
  305. Notes on Nonvolatile
  306. ====================
  307.  
  308. 1. Only processes may call nonvolatile
  309.  
  310. Because nonvolatile.library accesses dos.library, only processes may
  311. use nonvolatile.library 
  312.  
  313. 2. BUGS and Workarounds
  314.  
  315. SetPatch v40.12 and higher contain at least one patch for a
  316. nonvolatile problem.  If the user accesses the Nonvolatile prefs
  317. screen (brought up by pressing Red button while CD32 has no
  318. disc to load and startup animation is up), and then, without
  319. rebooting, they put a disc in the drive and close the door,
  320. then later that title accesses nonvolatile.library, the system
  321. can hang.
  322.  
  323. You must use the SetPatch on your title to avoid this problem.
  324.  
  325.  
  326. 3. Try the disk stuff !
  327.  
  328. If a filesystem device (floppy, harddisk, etc) is present containing
  329. an environment variable Prefs/Env-Archive/sys/nv_location, and that
  330. environment variable contains the path to a directory which
  331. nonvolatile can lock (for example MyHighScores:nonvolatile), then
  332. nonvolatile.library may get and store nonvolatile information
  333. to and from that directory on the filesystem device.  If you use
  334. nonvolatile.library, PLEASE test your title with such a disk inserted
  335. and make sure your high score (or whatever) loading and saving works
  336. fine to a disk.  We have tested this from nice processes and it appears
  337. to work very well.  But if you have taken over or disabled the system
  338. in some way, it is possible that when you access nonvolatile.library
  339. on a system with a with a score-saving disk or harddisk directory,
  340. you will crash, hang, or trash a disk.  So please test this.
  341.  
  342. One caveat however: the current behavior of CD32 nonvolatile.library
  343. is that if a saved item with the same name exists already in
  344. the internal nonvolatile memory, nonvolatile will overwrite that
  345. memory entry rather than go to a disk set up for nonvolatile storage.
  346.  
  347. You can easily make a nonvolatile score-saving floppy:
  348.  
  349. Floppy Disk named ZZZ containing:
  350. ---------------------------------
  351.      Prefs (dir)
  352.           Env-Archive (dir)
  353.                sys (dir)
  354.                  nv_location <-this file contains the text: ZZZ:nonvolatile
  355.      nonvolatile (dir)       <-here's where nv_location says to store stuff
  356.  
  357.  
  358.  
  359.  
  360. Notes on Freeanim.library
  361. =========================
  362.  
  363. 1. CD32 titles must freeanim
  364.  
  365. CD32 trademark disks must OpenLibrary and CloseLibrary "freeanim.library"
  366. to take down the CD32 system startup animation.  You should do this
  367. in your code, right before you are ready to put up your own display
  368. (so the user doesn't have to stare at a black screen).  If you don't
  369. free the startup animation, it will remain and mess up your own display.
  370.  
  371. For CDTV-trademark titles, the old CDTV RMTM command will also
  372. bring down the CD32 startup animation.  Note that if you boot from
  373. a floppy or harddrive, the startup animation is removed for you,
  374. so you might not notice you are missing your Open/CloseLibrary
  375. of freeanim.library until you cut a disk!
  376.  
  377.  
  378. 2. Two startup animations, two startup environments
  379.  
  380. There are two CD32 different startup animations - the one with cycling
  381. color aurora and shimmering CD disk, and the second one that just has
  382. Amiga CD32 in the top part of the screen.  If the user turns on or
  383. reboots the CD32 with a CD in the drive and the door closed, the fancy
  384. aurora startup display will not be displayed, and the system will go
  385. directly to the simpler top of screen Amiga CD 32 display.  If the
  386. user turns on or reboots the CD32 with the door open or no disk in
  387. the drive, the fancier aurora startup will be displayed.
  388. Depending on whther or not the aurora display has appeared, there
  389. may be less memory immediately available to your title, and the
  390. positions and maximum sizes of available memory may be different.
  391. Test booting your title both ways.  And as always, don't count on
  392. allocating giant blocks of memory like 900K ! - use separate allocations
  393. if possible.
  394.  
  395.  
  396. 3. Keeping Workbench Closed
  397.  
  398. The Amiga OS will force the Workbench screen open if the last screen
  399. in the system is closed.  Shutting down of the startup animation will
  400. not cause this to happen.  You can shut down the startup animation, and
  401. then open your display.  BUT, if you ever close the only screen that's
  402. open, the Workbench screen will be forced open.  You don't want that to
  403. happen.  To make sure this does not happen, take note of the following tips.
  404. If you use the CDGSXL program to display a CDXL in your startup, either
  405. use its VIEW option so that it will use a view instead of a screen, or
  406. use its new PATCHOPENWB option which tells CDGSXL to temporarily patch
  407. OpenWorkbench() so Workbench screen won't open when CDGSXL closes its
  408. screen.  If you need to use some other program which will open and
  409. close a screen, one workaround is to first open a very short one-bitplane
  410. blank screen and leave it open while doing your other screen opening
  411. and closing stuff.
  412.  
  413. Note that one other thing that will cause Workbench to pop open is any
  414. stdio to the shell process you are started from or to any child shell
  415. processes (RUN's) which have inherited the file handle of the parent
  416. shell.  Therefore be sure to redirect everything to NIL: unless you are
  417. debugging.  Example:  RUN >NIL: whatever
  418.  
  419.  
  420. Notes on CDFileSystem
  421. =====================
  422.  
  423. 1. CD32 CDFileSystem capabilities
  424.  
  425. The version of CDFileSystem in the CD32 does not support new V37+
  426. packets.  This means that some V37+ dos.library functions such
  427. as ExamineFH() can not be used on CD0: because they rely on V37+
  428. filesystem packets.  The 3.1 Workbench l:CDFileSystem for mounting
  429. external CD-ROM drives does support V37+ packets.
  430.  
  431.  
  432. 2. Mounting an ISO image file with Commodore's CDFileSystem
  433.  
  434. Using our V40 CDFileSystem and Matt Dillon's fmsdisk.device from
  435. Fish Disk 294 it is possible to mount an ISO image file which is sitting
  436. on a harddisk and view it as a filesystem (i.e. you can access the ISO
  437. image as a volume with plain Amiga functions and C: commands, execute
  438. programs on it, etc.).  Should also work with ISO images on a network.
  439.  
  440. This can be very handy for checking ISO image files you have built
  441. using Commodore's ISO tools (provided to licensed CD Developers).
  442. You may even be able to test your title code on the ISO image if you
  443. only access CD0: as a filesystem (and do not access cd.device directly).
  444.  
  445. Setup for FMS:  (requires the V40 Mount command)
  446.  
  447. - Have an ISO image file such as created by ISOCD
  448.  
  449. - Put fmsdisk.device (from Fish Disk 294) in DEVS:
  450.  
  451. - Make a mountlist just like 3.1 storage/dosdrivers/CD0 but change
  452. scsi.device to fmsdisk.device.  If you plan use this mountlist via the
  453. icon, Workbench-rename the file&icon to the device name you desire for
  454. the ISO image (example: ISO2). If you plan to perform the mount from a
  455. shell or a script, then you must add the device name with a ":"
  456. (like ISO2:) to the beginning of the mountlist, and add a "#" as the
  457. last line of the mountlist. (icon-started mountlists don't need those)
  458.           
  459. - Rename your ISO image file to "Unitn" where n is the Unit number
  460. specified in the mountlist (for example: Unit2).  This is required
  461. by fmsdisk.device so it can find the file for that unit.
  462.  
  463. - Assign FMS: where the ISO image file "Unitn" resides.  This is also
  464. required by fmsdisk.device so it can find the file.
  465.             
  466. - Mount CD0:
  467.  
  468.  
  469.  
  470. Notes on Locale
  471. ===============
  472.  
  473. CD32 has a language selection screen which can be accessed by pressing
  474. the Blue button while the aurora CD32 attract screen is displayed.
  475. Lowlevel.library GetLanguageSelection() can return the user's
  476. selected language preference.
  477.  
  478. V40 locale.library can query lowlevel.library for a user's preferred
  479. language (in the absence of a locale.prefs file).  Therefore, you
  480. can localize your titles using locale.library.  Or, you could
  481. call lowlevel's GetLanguageSelection() yourself to decide which
  482. language to use.
  483.  
  484. But... If you support different languages, MAKE SURE you test
  485. your code with the CD32 set to different languages, including
  486. ones you do not support.  We have seen code crash because of
  487. an unexpected or untested language setting on a CD32.
  488.  
  489.  
  490.  
  491. Notes on Workbench files and command
  492. ====================================
  493.  
  494. 1. SetPatch
  495.  
  496. Under V40 (CD32) use the latest V40 SetPatch QUIET in the beginning of
  497. your startup-sequence.  Even if you are a CD32 trademark CD that doesn't
  498. need the turn-on-AA feature of V40 SetPatch (AA is already turned on for
  499. CD32 trademark disks), you will benefit from using it because it will
  500. turn on the CPU data cache if one is present, giving your title a
  501. performance boost.  In addition, v40.11 SetPatch and higher contain
  502. patches for some CD32-specific bugs.
  503.  
  504. The best SetPatch to use on CDTV trademark titles, when booted on
  505. on a 1.3 CDTV, is the one from Workbench 1.3.3.  If your title is
  506. compatible with V40 graphics.library and AA bandwidth on a CD32,
  507. use V40 SetPatch QUIET when booted under V40+.  Even if you don't
  508. take advantage of AA, the extra bandwidth of AA can give your title
  509. a performance boost.
  510.  
  511.  
  512. Use the VERSION command to check what version system you are running on.
  513. As long as you have the failat set to 21, you can use the V40 VERSION
  514. command even on a 1.3 system.  VERSION itself It will fail because it
  515. requires at least 2.04 Kickstart, so you'll still get warned.
  516. Alternately, you could use the 1.3 version command.  But don't
  517. try to check both version and revision with that one (that didn't
  518. work proeprly until V39).
  519.  
  520. failat 21
  521. version >NIL: graphics.library 40
  522. if not warn
  523.     ; V40 or higher system
  524. else
  525.     ; less than V40
  526. endif
  527.  
  528.  
  529. 2. devs/system-configuration
  530.  
  531. You really shouldn't have one on a CD32 title.  It can cause the
  532. CD32 startup animation to jump left and lose a sprite.  Similarly,
  533. your CD should contain no Prefs/Env-Archive/sys/#? files.
  534.  
  535.  
  536. Making a Title Boot Faster
  537. ==========================
  538.  
  539. 1. Use Full Paths
  540.  
  541. If you use full paths to all disk-loaded startup-sequence commands
  542. that are not in the current directory, they will load faster.  Without
  543. a full path, the system must first search the current directory, then
  544. any paths, then C:.
  545.  
  546. NOTE:  There are MANY "Internal" shell commands under V39/40.
  547. These should be referenced _without_ a path.  (C:command will work
  548. for these BUT the shell would have to check C: first before using the
  549. Internal command)
  550.  
  551. ALSO NOTE:  If you are trying to make a CD that will work on both
  552. CDTV and CD32 remember that many shell commands that are now internal
  553. are disk-loaded under 1.3 Kickstart (like C:CD, etc.)
  554.  
  555. ALSO: There may be some 1.3 commands that don't work if a full
  556. path is specified (C:ELSE ? others ?)
  557.  
  558.  
  559. Making a Title Bootable on both CDTV and CD32
  560. =============================================
  561.  
  562. First:
  563. We have not tested this, and we don't think it's a particularly good
  564. idea. We can not predict what future CD32 systems or emulations will
  565. do (or not do) for compatibility when booting a CDTV trademark
  566. disk.
  567.  
  568. Second:
  569. Be sure to read the AppDeveloper.spec!  It contains important
  570. information about the CDTV-compatibility modules including the
  571. fact that new titles should NOT USE the old CDTV modules.
  572. The CDTV-compatibility modules (for example debox, playerprefs,
  573. bookmark.device, cdtv.device) may have only partial functionality
  574. on CD32 (or no functionality in the case of bookmark.device),
  575. and we do not intend to carry these modules over to new systems
  576. or peripheral emulations of CD32.
  577.  
  578. If your title software is 1.3 and 3.0 compatible, or contains two
  579. different versions of your title (CDTV and CD32) you may wish to
  580. be bootable on either machine AND may wish to have full AA features
  581. available to you when booted on CD32.
  582.  
  583. If you use the CDTV.tm trademark, your CD will be bootable on either
  584. CDTV or CD32.  But on CD32 the system will boot into a ECS-compatible
  585. non-AA-capable mode.  If you wish to enable AA features after
  586. booting into a CDTV-trademarked CD on a CD32, you may do this
  587. by using V40 Setpatch >NIL: or calling the V39+ graphics.library
  588. SetChipRev() function, BUT you must do this before any display is
  589. opened (other than the built-in CD32 startup animation).
  590. Once a display has been opened, it is not possible to reinitialize
  591. graphics via SetPatch or SetChipRev().
  592.  
  593. Remember that most V40 Workbench commands will not work under earlier
  594. kickstarts, so you may need be careful in your startup-sequence,
  595. or may need to place either the V40 or the 1.3 sommands in separate 
  596. directories.  Also remember that many INTERNAL V40 shell commands
  597. require actual C: commands under V34 (for example c:IF and C:RUN).
  598. There are also differences in the way some 1.3 and 3.0 commands
  599. behave (i.e. additional options or capabilities under 3.0, etc.)
  600.  
  601. NOTE: Conceptually, we would prefer if your root directory
  602. contained pure CD32/V40 stuff, and your older 1.3 stuff was
  603. in a subdirectory.  But this would make your startup-sequence
  604. much more complicated because V40 commands don't work under 1.3.
  605.  
  606.  
  607. Simple game startup sequence for CDTV V34 and CD32 V40+AA
  608. ---------------------------------------------------------
  609. failat 21
  610. version >NIL: graphics.library 40
  611. if not warn
  612.   ; we are on a V40 machine - do V40 patches, turn on AA graphics
  613.   c:SetpatchV40  QUIET    ;(V40 SetPatch renamed to avoid any conflicts)
  614.   ; here place any assignments need only for your V40 CD32 program
  615.   MyProgram    ; or MyProgram.CD32 (which will freeanim)
  616. else
  617.   ; maybe put a 1.3.3 SetPatch >NIL: here
  618.   ; here place any assignments need only for your V34 CDTV program
  619.   ; here maybe CDTV bookit command for CDTV prefs
  620.   rmtm        ; take down CDTV trademark
  621.   MyProgram    ; or MyProgram.CDTV
  622. endif
  623. endcli >NIL:        ; if case you run or detach your program
  624.  
  625.  
  626. More complex startup sequence for CDTV/CD32 disk with V34 root level
  627. directories and V40 Workbench in a separate V40/ subdirectory
  628. --------------------------------------------------------------------
  629. failat 21
  630. c:version >NIL: graphics.library 40
  631. if not warn
  632.   ; we are on a V40 machine
  633.   V40/c/Setpatch >NIL:
  634.   resident c:assign pure    ; for speed
  635.   assign SYS:      V40
  636.   ; only assign the dirs below that you actually have in your V40/ dir
  637.   assign c:    SYS:c
  638.   assign libs:  SYS:libs
  639.   assign devs:  SYS:devs
  640.   assign s:    SYS:s
  641.   assign l:    SYS:l
  642.   assign fonts: SYS:fonts
  643.   cd SYS:
  644.   ; here place any other V40 startup-sequence stuff you need
  645.   ; here place any other assignments need only for your V40 CD32 program
  646.   MyDisk:MyProgram    ; or MyProgram.CD32 (which will freeanim)
  647. else
  648.   ; maybe put a 1.3.3 SetPatch >NIL: here
  649.   ; here place any other 1.3 startup-sequence stuff you need
  650.   ; here place any other assignments need only for your V34 CDTV program
  651.   ; here maybe CDTV bookit command for CDTV prefs
  652.   rmtm            ; take down CDTV trademark
  653.   MyDisk:MyProgram    ; or MyProgram.CDTV
  654. endif
  655. endcli >NIL:        ; if case you run or detach your program
  656.  
  657.  
  658. General Startup-Sequence Tips
  659. =============================
  660.  
  661. 1. Don't reference DF0: (etc.)
  662.  
  663. Standard Amiga startup-sequence includes an ADDBUFFERS DF0: command.
  664. This will cause a requester to insert DF0 on a base CD32 unit.
  665.  
  666. 2. Don't forget to freeanim (for CD32) or rmtm (for CDTV) !
  667.  
  668. Don't forget to Open/CloseLibrary("freeanim.library",0) inside your
  669. CD32 title code (or rmtm in your CDTV title startup-sequence).
  670. If you have been testing your title by booting off a floppy or harddisk,
  671. the system startup animation never comes up, so you wouldn't notice if
  672. you were neglecting to take it down! (until you cut your CD!)
  673.  
  674. 3. If you execute other scripts
  675.  
  676. Assign t: to ram: if not already assigned elsewhere.  If you don't,
  677. the execute command may try to make a tmp file in :T on the CD and
  678. will fail (CD is unwriteable)
  679.  
  680. For command line redirection (or 1.3 IconX) to work properly, you must
  681. start the script you plan to execute with the following lines:
  682. .key none ;(or whatever args you are passing)
  683. .bra {
  684. .ket }
  685.  
  686. 4. failat
  687.  
  688. During development, you should put a failat 21 command early in your
  689. CD startup-sequence so that if you make a small mistake (like referencing
  690. a noncritical file or command that you forgot to put on the CD), your
  691. CD will still continue its startup-sequence past the error.
  692.  
  693.  
  694.  
  695. For PAL and NTSC Compatibility
  696. ==============================
  697.  
  698. 1. Let system choose PAL or NTSC
  699.  
  700. If your graphics are suitable for PAL (256/512 lines) or NTSC (200/400
  701. lines) and you want your title to work on PAL or NTSC, make sure you
  702. don't explicitly open PAL or NTSC displays.  Be careful with ILBM's
  703. because many graphics packages will place an explicit monitor ID
  704. (PAL or NTSC) in the ILBM when you create or edit the ILBM.  This is
  705. generally good because it allows the ILBM to be redisplayed in the
  706. exact video mode it was designed for.  But it can be bad for you if
  707. this causes your title to force PAL or NTSC displays.  You can mask
  708. out the monitor ID of a ILBM CAMG or modeid before use by ANDing it
  709. with the XOR of MONITOR_ID_MASK (i.e. ~0xFFFF1000).  This way your
  710. display will be either PAL or NTSC, whichever is the default on that
  711. system.  WARNING: Don't use this technique to remove the monitor id's
  712. of more complex multiscan modes - the remaining modeid may not be the
  713. resolution you require.
  714.  
  715. 2. Or use different code and/or graphics for PAL and NTSC
  716.  
  717. A simple startup command like the "warnifnotpal" example can
  718. allow you to branch in your startup depending on whether you are
  719. booted under PAL or NTSC:
  720.  
  721.  
  722.     warnifnotpal
  723.     if warn ; not a PAL system
  724.       ; maybe start NTSC version or change some assignments
  725.     else    ; is a PAL system
  726.       ; maybe start PAL version or change some assignments
  727.     endif
  728.  
  729.  
  730.  
  731. Hardware Notes
  732. ==============
  733.  
  734. 1. The keyboard/auxiliary port
  735.  
  736. Early diagrams we recieved were backwards.  This should be the correct
  737. diagram for the CD32 keyboard/auxiliary port:
  738.  
  739.  
  740.                 Serial Read   6 || 5   KB Clock
  741.                    VCC +5v   4      3   Signal Ground 
  742.                 Serial Tran   2    1   KB Data
  743.  
  744. Warning - you can damage a CD32 by accidently shorting some of these
  745. pin sockets against each other.  I know.  I did it. :-(
  746.  
  747. Note that the Serial read and transmit lines are TTL signals (0-5v)
  748. and are connected pretty directly to a chip.  When/if a debug board or
  749. other "real" serial hardware is attached to the expansion bus, these
  750. Keyboard port serial signals become unusable.
  751.  
  752.  
  753. 2. The MPEG module
  754.  
  755. The Commodore CD32 MPEG module is autoconfig, but currently
  756. its ROM contains code which must reside at $200000.
  757.  
  758. This means that if you are designing expansion bus hardware
  759. which is intended to work with the CD32 MPEG module, you
  760. must insure that the MPEG module is autoconfigged before any other
  761. autoconfig devices. 
  762.  
  763. The MPEG module currently allocates one meg of address space.
  764.  
  765.  
  766.  
  767. Debugging Tips
  768. ==============
  769.  
  770. 1. Use assigns to replace startup, override files/programs, or debug
  771.  
  772. Once you cut a first disk, it is useful to be able to boot from
  773. the disk but replace executables or scripts with new ones for testing.
  774. This allows you to boot from the CD with normal startup animation, etc.
  775.  
  776. One way is to insert lines that will let you grab control of
  777. the CD startup-sequence midstream so that you can start debugging
  778. tools or replace the rest of the startup-sequence.
  779.  
  780. An additional technique is to reference your executables, scripts, or files
  781. relative to an assigned name which can be overridden.  This way you
  782. can even replace files referenced from within your CD executables.
  783. And you can make multiple assignments to the floppy if necessary.
  784.  
  785. This is very useful because it
  786.  
  787. - Allows you to recover much testing value in the event that you
  788.   botch the CD startup-sequence after the test-for-transfer to floppy
  789. - Allows you to boot the title normally by not inserting the floppy.
  790. - Allows correction/tuning of startup-sequence without cutting a new
  791.   disc.
  792. - Allows addition of debug commands (eg. SegTracker, DoSAD.nn,
  793.   set echo on) even once your CD startup-sequence is perfected.
  794. - Because floppy is non-bootable (thus you actually do boot off the CD),
  795.   the CD startup anim and other aspects are exactly like a normal boot
  796.   off CD.
  797.  
  798. Use distinctive assign and volume names that won't conflict with your
  799. CD volume name, nor with other common assignments or volume names.
  800.  
  801. Note - if your special startup does any output, it will cause a CON
  802. window and the Workbench screen to open.  This may be good for debugging
  803. but does change your title's startup environment and the amount of
  804. memory free.
  805.  
  806. ; Here's way to get into or override your CD startup-sequence
  807. ; If placed early in your CD startup-sequence (after SetPatch), this
  808. ; would allow you to start some debugging tools, set echo on, etc,
  809. ; or replace the whole startup-sequence
  810. c:assign >NIL: XYZBin: exists
  811. if not warn  ; XYZBin floppy IS mounted so XYZBin: is the floppy
  812.    c:assign t: ram:
  813.    c:execute XYZBin:startup ; replace the CD startup-sequence
  814. endif
  815.           
  816. ; Alternately - a scheme for just replacing your executables
  817. ; If you referenced all of your executables off XYZBin:, 
  818. ; this startup would allow you to insert a floppy named XYZBin so
  819. ; you could test different executables when booting your title
  820. c:assign >NIL: XYZBin: exists
  821. if not warn  ; XYZBin floppy IS mounted so XYZBin: is the floppy
  822.    c:assign t: ram:
  823.    c:execute XYZBin:setup    ; any special assignments, debug tools, etc.
  824.    XYZBin:MyProgram
  825. else  ; XYZBin override disk not mounted, use CD setup, executables
  826.    c:assign XYZBin: "" ; for current dir on CD
  827.    ; any normal setup or assignments here
  828.    XYZBin:MyProgram
  829. endif
  830.  
  831.  
  832.  
  833. 2. Booting from a floppy to the CD
  834.  
  835. Even without special assign tricks, you can boot from a floppy
  836. (to start debug tools etc.) then transfer control to the CD.  It
  837. will be similar to booting from the CD but you won't get the
  838. system startup animation.  If your CD startup sequence is failing,
  839. it can be helpful to use this procedure even to just SET ECHO ON
  840. so you can see every startup-sequence command being executed.
  841. If you'd like a remote (serial terminal) view of the progress of your
  842. startup-sequnce, try the TSTAT line show below which will watch
  843. CLI 1.
  844.  
  845. Note - if your special startup does any output, it will cause a CON
  846. window and the Workbench screen to open.  This may be good for debugging
  847. but does change your title's startup environment and the amount of
  848. memory free.
  849.  
  850. ---------------------- debug boot floppy startup ----8< cut here
  851. c:SetPatch QUIET   ; V40 SetPatch to turn on AA if testing CD32 title
  852. failat 21
  853.  
  854. ; NOTE - we do not RESIDENT any commands in this startup because
  855. ; we want to catch CD startup errors such as a CD referencing
  856. ; a Workbench command which is not available
  857.  
  858. ; SOME EXAMPLE DEBUGGING TOOLS HERE
  859. ; set echo on
  860. ; TNT serial
  861. ; c:SegTracker
  862. ; run >NIL: c:tstat 1 SHOWHUNK SHOWHUNKCODE REMOTE -10
  863.  
  864. c:assign >NIL: CD0: exists
  865. if not warn
  866.    ; since we will "execute" the CD's startup, we need to
  867.    ; join it to these lines so any redirection in it will work
  868.    echo  >ram:startup-prefix ".key dummy"
  869.    echo >>ram:startup-prefix ".bra {"
  870.    echo >>ram:startup-prefix ".ket }"
  871.    c:join ram:startup-prefix CD0:s/startup-sequence as ram:cd-startup-sequence
  872.  
  873.    c:assign t: ram:
  874.  
  875.    ; Some CDTV modules (like bookmark.device) are only available if you
  876.    ; boot directly from a CDTV trademark disk.  So if you plan to boot
  877.    ; from floppy to a CDTV disk which calls CDTVPrefs, you must nullify
  878.    ; the CDTVPrefs command and possibly the bookit command because they
  879.    ; may fail and break the CD startup-sequence.  Here we do this by writing
  880.    ; a small ASM command which just does MOVEQ #0,d0, RTS, putting it on our
  881.    ; floppy as c:nothing, and residenting it as "CDTVPrefs"
  882.    ; If you have a similar problem with any other CDTV-specific
  883.    ; commands in a CDTV title startup-sequence, nullify them too.
  884.    ;
  885.    ; (uncomment next line and supply a c:nothing command if you need it)
  886.    ; resident CDTVPrefs c:nothing pure
  887.  
  888.  
  889.    ; MOVE ALL SYSTEM ASSIGNMENTS TO ANY CD DIRECTORIES THAT EXIST
  890.    c:assign OLDSYS:  SYS:
  891.    c:assign SYS:    CD0:
  892.  
  893.    if exists CD0:LIBS
  894.       c:assign LIBS:    CD0:LIBS
  895.    endif
  896.    if exists CD0:DEVS
  897.       c:assign DEVS:    CD0:DEVS
  898.    endif
  899.    if exists CD0:fonts
  900.       c:assign FONTS:    CD0:fonts
  901.    endif
  902.    if exists CD0:L
  903.       c:assign L:    CD0:L
  904.    endif
  905.    if exists CD0:s
  906.       c:assign S:    CD0:S
  907.    endif
  908.    if exists CD0:C
  909.       c:assign C:    CD0:C
  910.    endif
  911.  
  912.    cd CD0:
  913.  
  914. ;   newshell
  915.  
  916.    ; Now call the CD's own startup sequence
  917.    OLDSYS:c/execute ram:cd-startup-sequence
  918. else
  919.    echo "CD0: not found"
  920. endif
  921.  
  922.  
  923. 3. Branching on a button press
  924.  
  925. The example "warnifpressed" can be used in a startup-sequence
  926. to allow branching based on whether certain game controller or
  927. mouse buttons are held down:
  928.  
  929.     Usage: warnifpressed button [button button...] [PORT0]
  930.  
  931.     Acceptable button names:
  932.     RED(LMB) BLUE(RMB) GREEN YELLOW FORWARD(R_EAR) REVERSE(L_EAR) PLAY
  933.  
  934.         Example:
  935.  
  936.     warnifpressed RED GREEN
  937.     if warn    ; user is holding both RED and GREEN gamecontroller buttons
  938.       ; do something here
  939.     else
  940.       ; do something else
  941.     endif
  942.  
  943.  
  944.  
  945. Licensing
  946. =========
  947.  
  948. To be bootable, CDTV and CD32 titles must have the CDTV.tm (bootable on
  949. CDTV or CD32) or CD32.tm (bootable on CD32) trademark file installed
  950. during the ISO build procedure.  These files may only be used on titles
  951. for which an AmigaCD license has been signed.
  952.  
  953. If you wish to place any files and programs from Amiga Workbench disks
  954. on your CD, you must execute the appropriate Workbench License.
  955. Workbench Licenses are currently available for 1.3, 2.0, 2.1, and 3.0.
  956.  
  957. Contact your developer support manager for copies of the any of these
  958. licenses.  Or contact CATS - Licenses, 1200 Wilson Drive, West Chester,
  959. PA, USA, 19380.
  960.  
  961. Please note that having a license does not make you a member of our
  962. registered developer support programs, nor are you required to be a
  963. registered developer to execute a license.  Anyone can execute a license.
  964.  
  965.  
  966.  
  967. Developer Support Program
  968. =========================
  969.  
  970. Members of Commodore's Certified or Commercial developer support
  971. programs are "registered" developers.  If you plan to develop for CD32,
  972. you should also become a registered developer if you are not already one.
  973.  
  974. The latest OS software, tools, and examples are often made available to
  975. our registered developers via the listings areas of our closed developer
  976. conferences on BIX (US), ADSP (Europe), and CIX (UK).  
  977.  
  978. Beta and pre-release OS or development file disk sets, when such exist,
  979. are also only made available to registered developers.
  980.  
  981. Phone support is available for developers registered in our upper
  982. level "Commercial" program.
  983.  
  984. Developing for CD32 requires not only CD32-specific includes and docs,
  985. but also the latest V40 system software for your development machine,
  986. and V40 development files.  These V40 files are available to our
  987. registered developers in our closed BIX/ADSP/CIX listings areas.
  988.  
  989. If you would like an application to join our developer support
  990. program, please request an application from your local Commodore
  991. developer support department.  In the US, this is CATS - Administration,
  992. 1200 Wilson Drive, West Chester, PA. 19380.
  993.  
  994.