General Notice When using this document, keep the following in mind: ntial 1. This document is confidential. By accepting this document you acknowledge that you are bound by the terms set forth in the non-disclosure and confidentiality agreement signed separately and /in the possession of SEGA. If you have not signed such a non-disclosure agreement, please contact SEGA immediately and return this document to SEGA. 2. This document may include technical inaccuracies or typographical errors. Changes are periodi- cally made to the information herein; these changes will be incorporated in new versions of the program(s) described in this document at any time. de document. SEGA may make improvements and/or changes in the product(s) and/or the 3. No one is permitted to reproduce or duplicate, in any form, the whole or part of this document without SEGA’S written permission. Request for copies of this document and for technical information about SEGA products must be made to your authorized SEGA Technical Services representative. nfi 4. No license is granted by implication or otherwise under any patents, copyrights, trademarks, or other intellectual property rights of SEGA Enterprises, Ltd., SEGA of America, Inc., or any third party. describe herein. Co 5. Software, circuitry, and other examples described herein are meant merely to indicate the character- istics and performance of SEGA’s products. SEGA assumes no responsibility for any intellectual property claims or other problems that may result from applications based on the examples 6. It is possible that this document may contain reference to, or information about, SEGA products (development hardware/software) or services that are not provided in countries other than Japan. Such references/information must not be construed to mean that SEGA intends to provide such SEGA products or services in countries other than Japan. Any reference of a SEGA licensed prod- GA uct/program in this document is not intended to state or simply that you can use only SEGA’s licensed products/programs. Any functionally equivalent hardware/software can be used instead. 7. SEGA will not be held responsible for any damage to the user that may result from accidents or any other reasons during operation of the user’s equipment, or programs according to this document. NOTE: A reader's comment/correction form is provided with this document. Please address comments to : SE SEGA of America, Inc., Developer Technical Support (att. Evelyn Merritt) 150 Shoreline Drive, Redwood City, CA 94065 SEGA may use or distribute whatever information you supply in any way it believes appropriate without incurring any obligation to you. (6/27/95- 002) TM ntial de nfi Co System Library GA User's Guide Doc. # ST-162-062094 SE CONTENTS System Program User’s Manual .......................... 1 SMPC I/F User’s Manual ..................................... 7 CD Communication Interface User’s Manual ..... 21 © 1994 SEGA. All Rights Reserved. READER CORRECTION/COMMENT SHEET Keep us updated! nti If you should come across any incorrect or outdated information while reading through the attached document, or come up with any questions or comments, please let us know so that we can make the al required changes in subsequent revisions. Simply fill out all information below and return this form to the Developer Technical Support Manager at the address below. Please make more copies of this form if more space is needed. Thank you. General Information: Your Name Phone Document number Document name Corrections: Chpt. pg. # ST-162-062094 System Library User's Guide Correction de Date nfi Co GA Questions/comments: SE Fax: Where to send your corrections: (415) 802-3963 Attn: Manager, Developer Technical Support Mail: SEGA OF AMERICA Attn: Manager, Developer Technical Support 275 Shoreline Dr. Ste 500 Redwood City, CA 94065 REFERENCES with the assistance of the technical literature listed below. nti In translating/creating this document, certain technical words and/or phrases were interpreted al 1. KenKyusha New Japanese-English Dictionary 1974 Edition 2. Nelson’s Japanese-English Character Dictionary 3. 4. 2nd revised version Microsoft Computer Dictionary Japanese-English Computer Terms Dictionary Nichigai Associates de 4th version nfi Co GA SE (This page is blank in the original Japanese document.) ntial de nfi Co GA SE ii Table of Contents SYSTEM PROGRAM USER’S MANUAL ............................................. 1 1.0 2.0 nti GUIDE .............................................................................................. 1 al 1.1 Explanation ............................................................................ 1 REFERENCE .................................................................................... 3 2.1 List of Functions .................................................................... 3 2.2 Function Specifications ......................................................... 3 SMPC I/F USER’S MANUAL ................................................................. 7 1.0 2.0 de GUIDE .............................................................................................. 7 1.1 Objective ................................................................................. 7 1.2 Overview ................................................................................ 7 1.3 System Management System ............................................... 7 1.4 Peripheral Control System ................................................... 8 REFERENCE .................................................................................. 11 CD COMMUNICATION INTERFACE USER’S MANUAL ............. 21 nfi 2.1 Data Specification List ........................................................ 11 2.2 Data Specifications .............................................................. 11 2.3 List of Function Specifications .......................................... 15 2.4 Function Specifications ....................................................... 16 1.0 2.0 Co OVERVIEW .................................................................................... 21 1.1 Library Configuration ........................................................ 21 1.2 System Configuration ......................................................... 22 1.3 Functions and Characteristics ........................................... 23 BASIC FACTS ................................................................................ 24 2.1 Terminology and Symbols ................................................. 24 2.2 Disk Layout .......................................................................... 26 GA 3.0 COMMUNICATION WITH THE CD BLOCK ......................... 27 3.1 Communication Register ................................................... 27 3.2 Communication Method .................................................... 29 3.3 Response ............................................................................... 31 3.4 Data Transfer ........................................................................ 32 SE iii 4.0 CD DRIVE ......................................................................... 33 4.1 CD Drive Status Change ....................................... 33 4.2 CD Drive Operation ............................................... 37 5.0 nti 4.3 Subcodes .................................................................. 39 CD BLOCK CONFIGURATION .................................... 41 5.1 Data Flow ................................................................ 41 5.2 Stream Process Mechanism................................... 42 5.3 Selector Configuration........................................... 43 5.4 Sector Data Format................................................. 48 al 5.5 CD Block Initialization .......................................... 49 6.0 CD BLOCK FILE SYSTEM .............................................. 50 6.1 File Management in CD-ROM (ISO9660) ........... 50 7.0 de 6.2 CD Block File System Functions .......................... 51 DATA SPECIFICATIONS................................................ 55 7.1 Data List................................................................... 55 7.2 Data Detailed .......................................................... 56 8.0 nfi FUNCTION SPECIFICATIONS ..................................... 73 8.1 List of Functions ..................................................... 74 8.2 Function Details...................................................... 76 Index .......................................................................................... 104 Co GA SE iv ntial Pages 1-20 of this document have been archived. The revised pages of the de “System Program User’s Manual” and the “SMPC I/F User’s Manual” can be nfi found in ST-162-R1-092994 entitled Co “SATURN System Library User’s Guide ver.1.0”. GA SE CD Communication Interface User’s Manual 1.0 OVERVIEW ntial This document is a collection of CD block functions and CD communication inter- face external specifications. Functions of CD blocks are classified in Table 1.1 below. Table 1.1 Classification of CD Block Functions Classification Description CD Part Communication format, CD drive related, CD buffer related MPEG Part de CD block file system related MPEG Related CD block functions can be used by a common software interface through the CD communication interface. 1.1 Library Configuration nfi The library configuration of CD relationships is shown in Figure 1.1. Application Co Branch Animation Play Library MPEG Library (MPG) Stream System Library (STM) File System Library (GFS) CD Communication Interface (CDC) Software GA ................................................................................ Hardware CD Block Figure 1.1 Library Structure of CD Relationships SIMM, SCSI SE System Library User's Guide 21 1.2 System Configuration The system configuration of CD relationships is shown in Figure 1.2. Host Program (File system, Application, etc.) ntial H OST Function Call Return CD Communication Interface (DMA, etc., Data Transfer Module) Communication with CD Block Command Response deFetch data Write data [Command Input/Output Register] nfi [Data Transfer Register] Hardware Interface CD Block Program (Host Communication Interface, BIOS, etc.) C D B L O CK CD Drive Co Communication with CD Drive In interfacing with the CD block, the main system is called the host. Moreover, The CD block is one subsystem. GA Figure 1.2 System Structure of CD Relationships 1) Communication with the CD Block The host and CD block communicate (command/response, data transfer) using registers on the hardware interface. A command issued from the host to the CD block is called a CD block command; however, this is normally shortened to command. 2) CD Drive SEThe CD block periodically communicates with the CD drive controlling the CD drive with respect to commands from the host. The CD drive accommodates the CD-ROM XA standard and multi-session. It is able to switch between the stan- dard speed as well as double the standard speed. (Standard speed is automati- cally set when playing CD-DA.) 22 1.3 Functions and Characteristics Numbers “1” to “3” below are functions of the CD communication interface, and “4” to “7” are CD block functions. 1. CD Block Communication Functions ntial (a) Communicates between the host and CD block and is the C Language interface function set. (b) Issues commands to the CD block and receives the response. (c) Corresponds one to one with the CD block command. 2. Data Transfer Auxiliary Functions Supports auxiliary functions concerning data transfer such as data transfer de setup and termination as well as data transfer register address acquisition. Data that is fetched and written in the CD block is sent through the CD block data transfer register. The transfer itself is not through the CD communication interface but is through the DMA data transfer module. (Software transfer, SH-2 DMA, and SCU DMA can be done through the CPU.) 3. Register Access Function nfi Supports functions that access the CD block register. 4. CD Drive Function Playing music (CD-DA) and sector read (CD-ROM) are handled by a common Co command such as CD play. Stop and pause CD play are seek commands. Resume CD play (cancel pause) is executed by the CD play command. 5. Subcode R ~ W Decode Function Subcode R ~ W is decoded when playing CD-DA. There is a pack buffer of 23 pack segments for storing decoded pack data. 6. Stream Select Function GA CD-ROM XA standard sectors and the stream of every type of device (host, MPEG, etc.) are processed uniformly. (a) There are 200 sectors (about 460 Kbytes) of CD buffer for storing streams. (b) There are 24 independent selectors for selecting (separating, storing, fetching) streams. 7. CD Block File System Function (ISO9660) SE Directory information is held in the CD block so that files that conform to the ISO9660 standard can be easily accessed. System Library User's Guide 23 2.0 BASIC FACTS 2.1 Terminology and Symbols Definition of Terms Terms used are defined in Table 2.1 below. Table 2.1 Definition of T Term erms Meaning ntial Sector Basic units of data handled by a CD block (2352 bytes fixed). The sector size and configuration follows the CD-ROM format. Stream Distinguished by sector headers and subheaders. Flow of logically continuous data. CD Buffer CD Buffer Size Buffer Partition Buffer Partition Size de Buffer within the CD block that stores sector data. Size of CD buffer sector units. Segments CD buffer into multiple logical partitions. (Can be considered logical elements getting and storing streams.) Size of buffer partition sector units. Sector Location Filter Selector nfi Sector locations within buffer partition (location of sector units). Takes the value of 0 to (buffer partition size -1). Sectors of the buffer partition key-in the sector location and accesses. Logical element that separates streams by set conditions. Composed from the filter and buffer partition, logical element that selects streams. The selector enables the construction of a stream Device Connector Frame Address (FAD) Co select circuit. Logical apparatus that causes and absorbs streams such as a CD- ROM and MPEG. The stream select process is enabled by connecting a device to the circuit mentioned above. Terminal for connecting a filter, buffer partition, or device. Continually adds numbers in frame units with the absolute time 00:00:00 on the CD as 0. Corresponds 1 to 1 with absolute time. The CD block accesses the frame address as a key and not absolute time. (both CD-ROM, CD-DA) File Information GA Logic Sector No. (LSN) File Identifier Continually adds numbers in sector (frame) units with the absolute time 00:02:00 on the CD as 0. Logic sector number = frame address - 150 (2 seconds). Used for information within the directory code (ISO9660). Directory record information maintained for accessing files. There are the file lead FAD, file size, unit size, gap size, file number, and attributes. Directly sequence number for identifying files. Takes a value of 0 to (directory record number -1). SE 0: Own directory, 1: Parent directory. 24 List of Symbols and Codes Symbols and codes used are defined in Table 2.1 below. Table 2.2 List of Symbols and Codes Symbol or Code Adr BCD bn.bufno bufnum CI CN address Meaning binary coded decimal buffer no. buffer numbers coding information channel no. address nti Description al binary decimal number buffer partition number total number of buffer partitions coding information channel number Ctrl control control dst destination copy and move destination fad frame address frame address fasnum fad sector numbers frame address sector numbers fid fln, filtno FN LSB MSB ply pos SM file identifier filter no. file no. least significant bit most significant bit play parameter position parameter submode de file identifier filter number file number least significant bit most significant bit play parameters position parameters submode sct ses sesno snum sp. spos src stat subh sector session information session no. sector numbersnfi sector position source CD status information subheader condition sector session information session number (when specifying sector range of partition) (when specifying sector range of partition) copy / move source CD status information subheader condition for filter TNO toc txwnum X, idx word Numeric Notation Co track no. TOC information transfer word numbers index word track number (music number) TOC information (data transfer size in word units) index number units 2 bytes (16 bits) in length B is added to the end of a binary number. (Ex: 5 is 101B.) H is added to the end of a hexadecimal number. (Ex: 255 is FFH.) A hexadecimal number in a C language program is noted by C language specifica- GA tion (0x). Handling BCD BCD should not be used in parameters. Numbers recorded as BCD on a CD track number, for instance, are all converted to binary values. C Language Identifier Use identifiers that begin with CD or Cd in the CD communication interface. SE System Library User's Guide 25 2.2 Disk Layout Track Layout Figure 2.1 shows the relationship of the track configuration with the access key that indicates the position on the disk. Q Code Lead in Area Information Area Program Area ntialLead Out Area Data Data Audio Audio Control Data 03 AA TON 00 01 02 Index 00 01 01 00 01~ 01 2 sec. ≥ 2 sec. Time Absolute Time ATime Header (minute, second, frame) Logic Sector (LSN) de Frame Address (FAD) TOC Information Figure 2.1 Relationship of T FAD=0 Track start FAD rack Configuration and nfi Access Key Track start FAD Multi Session Layout TNO Absolute Time ATime 00 ←→ 01 2 sec. Co Session 1 02 03 AA 00 04 Session 2 2 sec. ←→ 05 06 AA 00 07 2 sec. ←→ Session 3 08 09 AA Header (minute, second, frame GA Logic Sector Number (LSN) Frame Address (FAD) TOC Information Track start FAD Session Information Session start FAD Track start FAD Session start FAD Track start FAD Session start FAD . . ..Index is 00 SE Figure 2.2 Multi Session Layout 26 3.0 COMMUNICATION WITH THE CD BLOCK 3.1 Communication Register access functions. nti Table 3.1 shows the CD block and communication registers and corresponding Table 3.1 Communication Registers Register Name DATATRNS R/W R/W Description Data Transfer Register al Access Function CDC_GetDataPtr HIRQREQ R/W Interrupt Factor Register CDC_GetHirqReq, CDC_ClrHirqReq HIRQMSK R/W Interrupt Mask Register CDC_GetHirqMsk, MPEGRGB R de MPEG Register (RGB data) * All access widths are 16 bits (1 word) See below for more information about the communication register. CDC_SetHirqMsk CDC_GetMpegPtr cant bit. nfi In the figure, a reserve bit is shown by “ - “ The reserve bit must be specified with a 0. The bit configuration is 15 for the most significant bit and 0 for the least signifi- Data Transfer Register (DATATRNS) Register Name Co When transferring data, this register inputs and outputs data between the host and CD block. The inner part of the register is FIFO. DATATRNS R/W R/W 15 14 13 12 11 10 9 8 GA 7 6 5 4 3 2 1 0 SE System Library User's Guide 27 Interrupt Factor Register (HIRQREQ) This is the interrupt factor register from the CD block to the host. nti Register Name R/W 15 14 13 12 11 10 9 8 HIRQREQ R/W — — SCDQ EFLS ECPY EHST CMOK (bit 0) : Issueable command DRDY (bit 1) : Data transfer ready CSCT (bit 2) : 1 sector stored 7 6 ESEL 5 DCHG 4 PEND 3 BFUL 2 CSCT al1 DRDY 1 = command can be issued (response set complete) 1 = data transfer setup is complete. 0 CMOK 1 = 1 CD-ROM sector is stored or discarded in partition BFUL (bit 3) : CD buffer full PEND (bit 4) : CD play end DCHG (bit 5) : Disk exchange ESEL (bit 6) : Selector set end EHST (bit 7) : Host I/O end ECPY (bit 8) : Copy end partition 1 = CD buffer is full de 1 = CD play has ended (current FAD is outside play range) 1 = Disk has been exchanged (tray has been opened) 1 = soft reset, stop execution of selector set 1 = stop execution of host input/output 1 = stop execution of copy and move between buffer EFLS (bit 9) : File system end SCDQ (bit10) : Subcode Q bit 11 ~ bit 13 : nfi 1 = stop execution of CD block file system 1 = subcode Q renewal complete (CD drive communication timing) MPEG related interrupt factor (see MPEG part for the meaning of each bit) Interrupt Mask Register (HIRQMSK) Co (a) Bit write can only be done at 0 (clear), not at 1. (b) The IRQ output to the host is OR output of all factors. Clears corresponding factor bits during interrupt process. (c) Names the command end flag of each bit ESEL, EHST, ECPY, EFLS. Reports the end of execution of commands belonging to each flag. This register is for masking interrupt from the CD block to the host. GA Register Name HIRQMSK R/W R/W 15 — EHST 7 14 — ESEL 6 13 DCHG 5 12 PEND 4 11 BFUL 3 10 SCDQ CSCT 2 EFLS DRDY 9 1 ECPY CMOK 8 0 SE (a) Bit content is the same as the HIRQREQ register. (1 = interrupt enable, 0 = same mask) (b) This occurs if interrupt is masked (corresponding bit = 0) when interrupt occurs. • not reflected in IRQ output. • reflected in the HIRQREQ register. (Polling process possible) 28 MPEG Register (MPEGRGB) This register is for transferring in the RGB format MPEG frame buffer image data that is in the RGB format to the host. Register Name MPEGRGB R/W R 15 7 14 6 13 5 12 4 nti 11 3 al 10 2 9 1 8 0 bit 0 ~ bit 15 : RGB data (See MPEG part for the meaning of each bit.) 3.2 Communication Method Communication Time de All interrupts are prohibited during the response time of command/response. Re- sponse time may be delayed when commands are continuously issued. Communication Error nfi A communication time out error occurs when the CD block does not respond (com- mand is not returned) within the prescribed time after a command is issued. Command Issue Provisions Co Command issue must obey the following provisions. (a) A maximum of 30 commands can be issued within 6.7 ms. (b) A maximum of 60 commands can be issued within 16.7 ms. (c) When acquiring a subcode, a maximum of 34 commands can be issued within 13.3 ms. (subcode R~W is 16 commands + subcode Q is 1 command) (d) Commands belonging to the same command end flag wait for execution to end and are issued. GA The polling process by continuously issuing commands is prohibited. Regular response and the interrupt factor register are used in the polling of condi- tion changes. Use of timing through the CSCT and SCDQ flags, and VSYNC issues commands. SE System Library User's Guide 29 Command End Flag The end of execution of each command listed below is posted. Table 3.2 Commands belonging to the Command End Flag ESEL Flag Command • Set CD device connection source • Set filter subheader conditions • Set filter connection destination • Calculate actual data size nti • Set filter frame address range • Set filter mode • Reset selector • Execute frame address find al • Set sector length EHST • Fetch sector data • Cancel sector data ECPY EFLS (a) • Cancel sector data fetch • Copy sector data • Move directory • Read file de • Write sector data • Move sector data • Save file information The ESEL flag also posts the end of soft reset execution. (b) nfi The EFLS flag is 1 when opening the tray and when stopping file access. Command End Flag Process in CD Communication Interface When commands belonging to the command end flag are issued, the CD communi- cation interface function does the following. • Soft reset Co (a) Checks the command end flag, and if 0, does not issue a command. (b) If 1, the command end flag is cleared to 0 and a command is issued. The command end flag is processed when the following commands are issued. • Gets actual data size • Gets frame address find results Clears ESEL flag to 0 (no check) Checks ESEL flag (not cleared to 0) Checks ESEL flag (not cleared to 0) • Stop file access Clears EFLS flag to 0 (no check) GA SE 30 3.3 Response Response Contents Response is composed of a 1 byte status and 7 byte report. The status are common Status nti but the report depends on the command. This most basic of reports is the CD report. The following information returns to status. • REJECT (improper command) : al Command itself is invalid due to mistake in command format. • WAIT (hold execute) : Cannot be executed under current conditions, therefore command can not be received. • Data transfer request • Periodic response • CD drive condition de : : : Shows that data transfer is necessary. Shows whether a periodic response or response to a command. Shows the logical condition of the CD drive seen from the host. Periodic Response nfi (a) Response during REJECT is invalid. (b) Status during WAIT and CD report are effective but other reports are ineffective. Periodic response is a response that returns with the communication timing of the Co CD block with the CD drive. The host can obtain information (status and CD report) without issuing a command. It is periodically updated by the communication cycle with the CD drive. (Same as the SCDQ flag update timing.) Periodic response update cycle At standard playing speed : 13.3 ms At double playing speed : 6.7 ms When not playing : 16.7 ms GA Update is not done during command/response. After response is read by com- mand, it is updated according to the next CD drive communication timing. SE System Library User's Guide 31 3.4 Data Transfer Data Transfer Procedure after the command/response. This procedure is listed below. nti When using commands to transfer data, the host must do the data transfer process (a) The command needed for transferring data is executed (data fetch/write). (b) Data transfer setup wait is executed. (Wait until the DRDY flag is 1). al (c) Data is input and output through the data transfer register (DATATRNS). Get Data transfer register pointer is executed when getting the address. (d) Data transfer end is executed when the necessary data is transferred. Data Transfer End setup wait function. de When there is a data transfer request by status, end data transfer must be executed even when no data is actually transferred. This is not necessary for REJECT and WAIT. When an error occurs with the data transfer setup wait, the application does not need to execute data transfer end. Execution is automatically done within the Data Transfer Errors nfi Table 3.3 shows errors that occur while waiting for the setup of data transfer. Table 3.3 Data Transfer Errors Data Transfer Error Data transfer time out Description CD block does not complete data transfer Co Write sectors cannot be secured setup within the prescribed time. (DRDY flag remains at 0 and does not change to 1) Empty sectors could not be reserved by writing sector data. (With the DRDY flag at 0 the EHST flag is 1.) GA SE 32 4.0 CD DRIVE 4.1 CD Drive Status Change CD Drive Status Table 4.1 CD Drive Status Status ntial Explanation Status change in progress Temporarily stopped Drive stop status CD play in progress Seeking de Scanning Tray is open There is no disc Read retry in progress Read data error occurred Fatal error occurred (hard reset required) Types of Drive Commands nfi Table 4.2 shows the types of commands (drive commands) that change the CD drive status. CoTable 4.2 Types of Drive Commands Drive Commands Initialize CD block Open tray Play Seek Corresponding Functions CDC_CdInit CDC_CdOpen CDC_CdPlay CDC_CdSeek Pause CDC_CdSeekd Stop CDC_CdSeek Scan CDC_CdScan GA (a) When doing a soft reset, CD block initialization does not operate as a drive command. (b) Drive commands other than tray open can be done concurrently with the tray close command. Issuing Drive Commands SE (a) Drive command response must return the status as long as there is no REJECT. (b) As a rule, command issued afterwards are issued by priority. System Library User's Guide 33 4.1.1 Illustrations of CD Drive Status Change 1) Status Change Illustration of a Normal System. Figure 4.1 illustrates the status change of a CD drive in a normal system. Tray Open Command Manual Open Tray Close Command Manual Close START ntial Hard Reset Opened OPEN Tray is closed All Drive Command No NODISC Stop Command STANDBY de CD Block Initialize Command Pause Command Standby Time Elapsed PAUSE Yes Disc TOC Read PLAY nfi Play Command Automatic Co SCAN SEEK Scan command Seek Command Figure 4.1 Illustration of CD Drive Status Change (Normal System) GA (a) occurs two seconds after TOC read at frame 0 (FAD=150=96H). (b) The status indicates that a status change is in progress (on arrow line). (c) The tray close command specifies drive commands other than tray open. The status corresponding to every command changes after the tray is closed. Example: Play command in the status changes to the status after the tray is closed. SE 34 2) Status Change Illustration of an Error System. Figure 4.2 illustrates the status change of a CD drive in an error system. Statuses are explained in Table 4.3. Tray Open Command Manual Open Tray Close Command Manual Close Opened nti START al Hard Reset OPEN Tray is closed All Drive Command No NODISC Disc Stop Command STANDBY de CD Block Initialize Command Pause Command Standby Time Elapsed PAUSE Yes TOC Read Each Command PLAY nfiAutomatic Retry Retry Succeeded Read Data Error RETRY Retry Failed ERROR Co SCAN SEEK Each Command FATAL Figure 4.2 Illustration of CD Drive Status Change (Error System) Fatal Error Table 4.3 Error Relationship Status GA Status Explanation if retry succeeds and if retry fails. Status does not change until the next drive command is issued. Stops the disc motor rotation. Hard reset is required. Internal conditions indicate equal conditions as CD block internal operations. Internal Status SE System Library User's Guide 35 4.1.2 Table of CD Drive Status Changes Table 4.4 lists status changes of the CD drive. For example, if the pause command is issued during , will be displayed. Table 4.4 Table of CD Drive Status Changes Operation & Status Automatic changes — Initialize Tray Open Play Commands Seek nti Pause al Stop Scan — — changes — — “–” indicates no change. undefined undefined undefined de undefined undefined undefined undefine 1) Commands issued in the status. nfi Commands issued in the status can be received but there is noguarantee of immediate execution. For example, While the tray is being opened or closed, a command is not executed until that operation is over. (However, the tray open command is executed immediately.) 2) Tray Open/Close. Co (a) As a rule, the tray open command is executed immediately in any mode. (b) The tray open/close command when not using the automatic open/close format is until executed manually. (c) Commands in the status (except for tray open) change to each status after the tray close process. (d) When the tray is closed, occurs if TOC read cannot be done. GA (Even if there is a disc). 3) Status Routings. (a) Everything goes though the status when done by command. (b) In some cases the routing is by way of when changing to the and statuses. 4) In the case of Multi Sessions. SE(a) Reads the final session of TOC. (b) After TOC is read, the status is at the 0 frame, 2 seconds from the start position of the final session. 36 4.2 CD Drive Operation Status Frame Address the case of a CD-ROM). nti The frame address (currently FAD) posted while a CD is playing indicates the sector during the read process. The current FAD sector is not stored in the CD buffer and cannot be retrieved. The host can access up to one sector before the current FAD. (In FAD-1 ↓ Current FAD ↓ al (retrievable) de Store in CD buffer During Read process (not retrievable) Figure 4.3 Sectors that the current FAD indicates When play has ended, FAD = play end position + 1. (The read out area is indicated Change from Status and Sector Storage When changing from to a different status, whether the sector during the read process can be store is undefined. If changing to any status other than Co the sector that should be stored is defined. When the pause command is issued in the status and the status changes from to , the storage sector + 1 FAD is posted the same as with 1). Play Range and FrameAddress By changing play end, seek, and the play range, occurs when FAD is outside the play range and the PEND flag of the interrupt factor register becomes 1. When FAD is outside the play range, the status cannot be canceled (restart play). Canceling when FAD is within the play range changes the status to GA . CD Play Repeat Process Both the repeat post frequency (0H~EH) and maximum indication frequency (0H~FH) are shown by 4 bits. After the frame of the play end position is played (FAD = play end position + 1), the following process is performed. (a) If the repeat frequency is less than maximum repeat frequency, CD play will be SE (b) repeated (return to the start position and continue playing). If the repeat frequency is at that time, the repeat frequency is increased by 1. If the repeat frequency is greater than or equal to the maximum repeat frequency, CD play will not repeat (play end position + 1 and pause). System Library User's Guide 37 If the play range or maximum repeat frequency changes, the repeat frequency clears to 0. Neither the repeat frequency nor play range rely on the tray open/close or the seek operation while play is in progress. Seek the Home Position (Stop) nti The following operations are done by seeking the home position. al (a) The disc motor rotation stops and pickup is moved to the standby position inside the circumference. (b) The CD drive status changes to and report is an invalid value (FFH line). (c) When the status changes from in the home position to , seek moves to the start of the disc. which have been saved cannot be changed. de (d) The play range, maximum repeat frequency, and repeat notification frequency Pickup Position in the status • Moving from the status: Current position (report also remains unchanged). • When seeking the home position: CD Read in a Full CD Buffer nfi Standby position inside the circumference (report is an invalid value). If the CD buffer becomes full, a will occur and the BFUL flag of the inter- rupt factor register becomes 1. When there is space in the CD buffer, play automati- cally starts where it left off. Co GA SE 38 4.3 Subcodes Subcode Update and SCDQ Flag nti The subcode Q is updated for each frame (one sector). The SCDQ flag becomes one every time subcode Q is updated (same as update timing of periodic response). Subcode R~W can update four packs (one packet) with one frame and be stored in al the pack buffer. There is a 23 pack (short of six packets) segment in the CD block. 13.3 ms Subcode Q Update SCDQ Flag Pack Data Aquisition (Subcode R ~W) ↓ 01 23 de ↓ 45 67 ↓ 89 A B ↓ C DE F Pack Data Update nfi (Subcode R ~W Decode Completion) 0 1 2 3 4 5 6 7 8 The SCDQ flag clears the host to 0. The CD block is only 1. Subcode R~W begins the decode process when data fetch starts and if 8 packs have been collected. Subcode Get Timing Co Figure 4.4 Subcode Update and SCDQ Flag T iming The host issues the Get command by a timing with the SCDQ flag at 1 and gets subcode Q and R~W data. (Polling is prevented by continuously issuing commands.) GA Getting Subcode Q The Get command can be executed any time regardless of the CD drive status. But when in the status, ineffective values may return depending on the CD drive status. Getting Subcode R~W Pack data reissues the Get command and gets data until the pack buffer is empty. However, exceeding 16 packs within the time of one frame (13.3 ms) is not allowed. SE WAIT is returned if the pack buffer is empty and pack data disappears. System Library User's Guide 39 Subcode R~W Decode (a) Decode start and end Decode On/Off are set by the initialize command of the CD block. (b) (c) nti To start decoding, set decode to ON then execute CD-DA play. Decode Start Timing Start decode during . al Data actually begins to be retrieved two frames before . Pack Buffer Clear Timing Clear is done when decode begins. The pack buffer content is saved even when doing seek and pause. (d) Decode Conditions Decode is done only when playing CD-DA. de Decode is not done in other cases (while scanning or playing the CD- ROM area) Subcode R~W Error (a) Over Run Error nfi If a pack is not fetched in time, the pack buffer is overwritten and an over run error occurs. After data transfer has ended, the get pointer advances to the extent that the pack is without an overrun error. The host must finish transfer- ring data within the decode time of 1 pack (3.2 ms). (b) Pack Data Error Co Pack data checks CRC and corrects the data if an error is detected. A pack data error occurs if the data cannot be corrected. GA SE 40 5.0 CD BLOCK CONFIGURATION shown below. nti The characteristics and logical configuration of the CD block as seen from the host is Data Format al The basic unit of the stream handled by the CD buffer is a fixed size (2352 bytes) sector no matter what the device is. Stream Select Circuit The functions that separate and store streams are attained by a filter and buffer partition design. These functions are considered to be logical elements (selector). Device de The circuit that selects the necessary streams is constructed by combining selectors. The CD and MPEG are considered to be logical devices that produce and absorb streams. The flow of a stream is controlled by connecting a device to the stream select circuit. 5.1 Data Flow nfi Figure 5.1 shows the entire data flow for a CD block. Co CD-ROM [CD Play] CD Read MPEG Buffer Read CD Buffer Write Write MPEG Decoder Decode Display VDP2 Read RGB888 Copy, Move (Buffer MPEG Frame Partition) Buffer GA CD Block Host Data Transfer Get Register Put Write Get MPEG Register (RGB) RGB555 Host SE Figure 5.1 CD Block Entire Data Flow System Library User's Guide 41 5.2 Stream Process Mechanism Figure 5.2 shows the overall configuration of the CD block from the viewpoint of stream flow. . There are 24 selectors numbered 0 to 23. Stream outflow device Selector Filter Buffer partition ntial Stream inflow device CD-ROM Host MPEG frame buffer MPEG decoder (A) MPEG buffer Host de Copy / Move MPEG decoder (V) MPEG frame buffer Device output connector nfi MPEG buffer Device input connector Filter input connector Co Partition output connector False output connector Figure 5.2 CD Block Overall Configuration [What each part does] (a) Device: Produces and absorbs streams (stream inflow and outflow device.) GA (b) Selector: Composed of a filter and buffer partition, used for selecting streams. (c) Filter: Separates streams by set conditions (conforms to Yes/No conditions.) (d) Buffer Partition: Stores streams, releases or cancels data through outside requests. There are connectors for connecting every device to a selector. The device and selector input/output connectors are 1 to 1. Connections can be made between selectors as well. Connections flow regularly in streams by connecting connectors that don’t pass SE through partitions and stop when entering a partition. Sectors that are output from an output connector that is not connected will be canceled. Devices must be connected through a selector. A device output connector can only connect to a filter input connector, and a device input connector can only connect to a partition output connector. 42 5.3 Selector Configuration The selector process function does not rely on the parts connection destination or 5.3 shows the selector configuration. nti device. It separates and stores the input stream and only outputs by request. Figure Filter al Buffer partition Filter input connector True output Partition input Partition output connector connector connector False output connector Other connectors are not connected. de Figure 5.3 Selector Configuration (Initial condition) In the initial condition of the selector, the filter and partition with the same number are connected through the true output connector and partition input connector. 5.3.1 Filter nfi Conditions (FAD range, subheader) of the sector that should pass are set in the filter. Sectors that match with the conditions are output to the true output connector and stored in buffer partition of the connection destination. All other sectors are output to false output connectors. Co False output connectors can be connected to other filter input connectors and achieve in secession similar selection processes. Sectors output from unconnected output connectors will be deleted. Decide conditions Yes Store Stream No GA Yes No Yes No SE Clear Figure 5.4 Type of Stream Select Process System Library User's Guide 43 5.3.2 Buffer Partition 1) Buffer Partition Configuration The CD buffer is divided into several buffer partitions. Figure 5.5 shows the configuration of a buffer partition. → → No -1 N1 -1 2 2 1 1 0 0 → → ntial Buffer partition number 1 0 Last partition Sector postion First partition Np -1 2 1 0 → → Buffer partition size (sector units) Np N23 -1 2 1 0 → de → 23 P 23 ∑ Np ≤ CD buffer size whole CD buffer. nfi Np: buffer partition size, P: buffer partition number, p=20 Contents of each partition are not fixed; data can be stored as long as there is space in the 2) 3) Co Figure 5.5 Buffer Partition Configuration Storing Sectors to the Buffer Partition Sectors entered in partitions are stored in the last partition. The last sector position of the partition is equal to the buffer partition size minus 1. Discharging and Canceling Sectors from the Buffer Partition Two ways to discharge sectors from partitions are to keep the sectors at the partition discharge source or clear the sectors (clear only can also be selected.) 4) GA For example, get to the host corresponds to “Get” and “Get and Clear.” Flowing in and out between selectors corresponds to “Copy” and “Move.” CD 1 Sector Interrupt and Store Destination One sector interrupt in CD read occurs in each sector at the time the sector is stored in the partition. The CD block stores the partition number of the store destination. The store destination partition number of the sector read last can SE be retrieved from the host. 44 5.3.3 Connectors 1) Connection from Buffer Partition to Filter (Sector Data Copy/Move) The partition output connector is connected to the filter input connector and the nti flow of sector data allows sector data to be copied and moved. The connection and flow I/O process are executed by executing one command. al Because only the selected number of sectors flow, loop does no continue indefinitely. de (a) Copy/Move for different selector (b) Copy/Move for self Figure 5.6 Copy/Move Sector Data 2) nfi Selector Connections by OR Condition (multi to one connection) True output connectors of several filters can be connected to the same partition input connector. This enables a sector to be stored in whichever of several conditions it coincides with. (OR condition: logical add). Co A B A or B GA Figure 5.7 Selector Connection by OR Conditions SE System Library User's Guide 45 3) Types of Connectors and Connection Destination Table 5.1 Types of Connectors and Connection Destination Output/Input Device Output True Output False Output Partition Output Filter Input O X O O Partition Input X ∆ X X nti Device Input al X X X O O: connectable (1 to 1), only 1 output connector can connect to 1 input connector. ∆: X: connectable (multi to 1), not connectable de several output connectors can connect to the same input connector. (OR condition) Whether to do a simple process of connecting (disconnecting) by one command nfi or a complex process collecting connections and flow in/out processes depends on each device. The CD-ROM and MPEG decoder are single processes. Others (host, copy/move, etc.) are complex processes. Co GA SE 46 5.3.4 Selector Precautions 1) Error in the Stream Process 2) cases. nti Except with the CD device, error in the stream process occurs in the following • Connection separates during operation. al • CD buffer becomes full while reading or writing to the buffer partition. Selector Set Effective Timing FAD with selector settings made effective while a CD is playing is within one FAD from response of the selector set command. The host considers the margin and issues the set command before 10 or more sectors of the target FAD. When the selector setting has ended, the ESEL flag of theinterrupt factor register 3) becomes 1. Sector Data when Changing Connectionsde When the CD is being read, data is not omitted even if the connection changes during the sector data sequence. In short, the flow of data is guaranteed when temporarily interrupted while switching connections. 4) nfi General Access to the Buffer Partition (general command specifying sector position and sector range) Returns to WAIT when the specified sector range doesn’t exist like the data number within the partition is exceeded. Always returns to WAIT when the 5) Co data number within the partition is 0. Clear Discharge from Buffer Partition When a sector is cleared and discharged from a partition, all data of the selected sector range is cleared (get and clear or move sector data) even if the process stops because of an error etc. GA SE System Library User's Guide 47 5.4 Sector Data Format 1) Basic Format Sector data format basically conforms to the CD-ROM XA sector format. CD-ROM 12 Sector 4 2048 2352 bytes 2340 bytes 2336 bytes ntial 288 bytes Mode 1 Header User Data EDC/ECC, etc. synch CD-ROM XA Mode 2 Form 1 12 Sector synch 4 Header 8 Sub header 2048 User Data de 280 bytes EDC/ECC CD-ROM XA Mode 2 Form 2 12 Sector synch 4 Header 8 Sub header nfi 2324 User Data 4 bytes EDC, etc. MIN SEC FRAME MODE Co FN CN FN: File Number SM CI 4 bytes repeat FN CN SM: Sub Mode SM CI CN: Channel Number CI: Coding Information 1 byte as 0. GA Figure 5.8 CD-ROM XA Sector Format 2) Handling Sub header and User Data (2048 bytes) (a) Sub header except for Mode 2 (mode part within header is 02H) is handled (b) There is user data immediately after the header only for Mode 1 (mode part SE within header is 01H). Otherwise, user data is considered to exist in the same position as mode 2 form 1. (c) Storing user data within a buffer partition, except data from a CD device, is the same as mode 2 form 1. The first 24 bytes is 0, and data after the user data is undefined. 48 5.5 CD Block Initialization TOC/Session Information File Information nti Initialized when the tray is opened, and information is in a non-input condition. Reads TOC when tray is closed (unrelated to the reset of software.) al Initialized if tray is opened or software is reset, and information is in a non-input condition. The host explicitly commands the reading of file information. Host Information Initialized if software is reset (unrelated to opening the tray.) notification number) de [Host Information] . . . . . . mostly host set information and buffer data • Initialization information (CD block initialization parameters) • Play information (play range, maximum number of repeats, current repeat • Selector information (filter, buffer partition, etc., host setting for selector) • Data within buffer, buffer partition size, space size • MPEG related information nfi • Actual data size retained, setting of sector length • Data transfer control register (initializing ends transfer of data) If the CD block is initialized without resetting the software, information in the TOC/ Session and Host is not initialized. Co GA SE System Library User's Guide 49 6.0 CD BLOCK FILE SYSTEM 6.1 File Management in CD-ROM (ISO9660) The CD block file system supports a logic format that conforms to ISO9660. Volume Identifier 1 Pass table Root directory Directory block (Directory file) Root directory Self ntial File f1 2 Sub directory Parent=Self Pass table size Pass table address Root directory code of Root directory 3 f1 Pass table code ~ n ~ ~ f2 Sub directory Parent ~ de f2 Directory number Directory block address Parent directory number Directory name nfi f3 Sub directory Sub directory f3 • Volume identifier : Co Directory code Parent Arranged from CD 00:02:16 (FAD = 166 = A6H) File lead sector address File size File name System information for mode 2 (file number, form information) • Pass table : A collection of pass table records. Pass table size and address are recorded in the volume identifier. GA • Pass table record : • Directory block : • Directory record : Corresponds to one directory (root, sub) Record position is the directory number (1 ~ n) Directory information is listed in the directory book. A collection of directory records. A directory block is considered to be one file. (directory file) Corresponds to one file (includes directory). Figure 6.1 File Management Data Configuration in CD-ROM (ISO9660) SE 50 6.2 CD Block File System Functions The CD block file system (referred to “file system” hereafter) has the following functions. 1) 2) Moves directories and holds file information Moves to the specified directory and holds in the CD block file information within that directory. Gets file information ntial Transfers held file information in response to a request from the host. 3) Reads files Reads file sector data originating from held file information to the CD buffer. 4) The host is able to extract read sector data by data transfer. Stop Accessing Files de CD play stops by moving a directory, holding file information, and reading a file. If file access is stopped, the CD block pauses the CD drive. 0 nfi Directory block (for directory record) 1 Root directory Parent=Self File 1 Co 2 ~ ~ Move directory (Hold file information in directory move destination) 0 Self 1 File Information Table Parent 2 0 Self .... File information of the current directory self 1 Parent ~ ~ i File i Holds file information 2 File i ← Held identifier of first file (i) GA 1+i File i+1 3 File i+1 Held file information number (n) ... ... ~ File j ~ ~ File j ~ ← fid = j ... ... ~ i+n -1 File i+n-1 ~ 255 ~ File i+n-1 ~ ~ ~ File identifier (fid) Directory record sequence number SE File j Reading file Figure 6.2 CD Block File System Configuration Buffer partition System Library User's Guide 51 6.2.1 File Information Holder Method The CD block provides 256 file information tables that hold file information for accessing. The first two parts in this table always holds current directory (self) and held. (The number cannot be designated.) nti parent directory information. Up to 254 parts of ordinary file information can be 1) Directory Move al If a directory is moved, the directory record is read, and file information is extracted and held in a table. The range that is held is from the start of the directory block. 2) Holding File Information (specifying the hold range) Specifies a file identifier and can hold file information from any position 6.2.2 1) held in the first two parts of the table. de within the current directory. In this case also, self and parent information is File Access Procedure Moving to the Root Directory In using the file system, first move to the root directory and create a file informa- 2) information range.) nfi tion table. This is the same when file information is cleared when starting up or changing disks. Neither a table can be created nor the file system used if the disk is not in the ISO9660 format. (REJECT occurs if getting the holding file Holding File Information 3) Co The file system can access only files inside the file information table. When accessing a file, the file information must be held beforehand. When moving directories, the target directory must be held. Reading Files File identifier and offset (sector units) are selected and the file read. The read destination selector is selected by the filter number. 4) Getting Sector Data 5) GA Files read to the buffer partition transfer and fetch data by fetching sector data. Data can be fetched while reading ,and there is no waiting for read to end. Pause occurs if the CD buffer becomes full while reading files. If a space can be created, pause is canceled and the remaining files read. Ending File Read When file read has ended, the EFLS flag of the interrupt factor register becomes “1”. Executing the file access stop command stops file read. (Accessing a file is SE done in the same by moving a directory and holding file information.) 52 6.2.3 File System Precautions 1) Work Selector Designation 2) used is canceled after the process ends. nti When reading file information from the CD-ROM, the CD block requires a work selector. One selector can be designated to move a directory and hold file information. At least one empty sector is required at this time. The selector Selector Settings al When accessing to a file, the file system does the following settings for the selector. (a) Connection conditions of indicated filter • filter input connector de : connects with a CD device. • true output connector : connects with buffer partition with the same number. • false output connector : cuts off other selectors. (b) Filter conditions Table 6.1 Set Filter Condition Action Move Directory Hold File Information nfi Filter Condition • Sets filter frame address range (FAD range) • Makes effective the frame address range of the filter mode Read Files Co • Sets filter frame address range. • Sets the file number of the filter subheader conditions • Makes effective the filter mode FAD range and file number selection (c) Filter and connected buffer partition The buffer partition sectors are cleared before files are accessed. 3) CD Play Range and Drive Command GA When accessing a file, the play range becomes the default value (disk first to last). The drive command (CD play, pause, etc.) is executed unchanged even with the file system in operation. Be aware that operation of the file system can be obstructed. Auto pause/cancel-pause operate normally when the buffer is full. 4) File Access End and Stop When file access ends or is stopped, the EFLS flag becomes 1. File access also SE stops if the tray is open. (But before the status, EFLS = 1.) While directory move and file information hold are being executed, the file information table is destroyed if file access stops. System Library User's Guide 53 5) Multi Session In multi session cases, the file system refers to the volume descriptor of the last session. ntial de nfi Co GA SE 54 7.0 DATA SPECIFICATIONS munication interface. nti This chapter lists the constants, data types, access macros, etc. used by the CD com- • Format al In the figures, the reserved regions are shown by the “–” mark. A 0 must be specified in the reserve regions. 7.1 Data List Table 7.1 is the CD communication interface data list. Table 7.1 Basic data Data List Data de Data Name Number 1.0 Constants nfi TOC information & Session information Status and Report Subcode information Data Types 2.0 3.0 4.0 5.0 6.0 Co CD communication function return code CD status information Hardware information CD position parameters CD play parameters CdcRet CdcStat CdcHw CdcPos CdcPly 6.1 6.2 6.3 6.4 6.5 Sub header conditions CdcSubh 6.6 Sector information CdcSct 6.7 GA File information CdcFile 6.8 SE System Library User's Guide 55 7.2 Data Detailed 7.2.1 Basic Data Title Data Specification 1) Data Basic Data Basic Data Types Type Name Data Name Description ntial No 1.0 Uint 8 1 byte integer without code Sint 8 1 byte integer with code Uint 16 2 byte integer without code Sint 16 Uint 32 Sint 32 Boo 1 de 2 byte integer with code 4 byte integer without code 4 byte integer with code logical type 4 byte integer (assumes logic constant as value) 2) Logic Constants Used as Used as aa logic logic (Boo (Bool) 1) value. value. Constant Name FALSE Value 0 nfi Description Indicates that logic value is false 3) Additional TRUE OFF ON Co Constant Name 1 0 1 Value Indicates that logic value is true Indicates switch is off (false) Indicates switch is on (true) Description NULL ((void *)0) NULL pointer GA SE 56 7.2.2 Constants Title Data Data Name No Data Specification Constants 2.0 1) Bit Names of interrupt factor register relationship (HIRQREQ, HIRQMSK). Constant Name CDC_HIRQ_CMOK CDC_HIRQ_DRDY Description Enable commands to be issued Prepare data transfer ntial CDC_HIRQ_CSCT Store 1 sector CDC_HIRQ_BFUL CD buffer is full CDC_HIRQ_PEND CD play end CDC_HIRQ_DCHG CDC_HIRQ_ESEL CDC_HIRQ_EHST CDC_HIRQ_ECPY CDC_HIRQ_EFLS CDC_HIRQ_SCDQ Disk change End Selector set End host input/output End copy End file system Subcode Q de 2) nfi Special designation of buffer partition sector range (sector location and sector number). Constant Name CDC_SPOS_END Description Indicates sector location of last partition Co Same as (sector no. in partition - 1) designated CDC_SNUM_END Sector number from designated sector location SP to last partition. Same as designated (sector no. in partition - SP) Effective with functions that correspond to the buffer partitions below. CDC_CalActSiz, CDC_ExeFadSearch, CDC_GetSctInfo, CDC_GetSctData, CDC_DelSctData, CDC_GetdelSctData, CDC_CopySctData, CDC_MoveSctData CDC_SNUM_END Filter Buffer Partitions 3) GA Other Stream N-1 SP CDC_SPOS_END 2 1 0 Designated Sector Location SP Constant Name Description SE CDC_NUL_SEL CDC_NUL_FID Special value of selector no. (filter number, buffer partition number) Special value of file identifier System Library User's Guide 57 7.2.3 TOC and Session Information Title Data Data Name No 1) Data Specification TOC Information TOC and Session Information 4 Bytes nti al 3.0 0 Track 1 Information byte 0 1 2 3 Location 1 Track 2 Information Ctrl Adr Track start frame address information 2 Track 3 Information of every track ~ ~ Tracks not existing on TOC is FFFFFFFFH (99 tracks) n 98 99 100 101 ~ Track n + 1 Information Track 99 Information First Track Information (A0) Last Track Information (A1) Read Out Information (A2) ~ de byte 0 1 Ctrl Adr First track Ctrl Adr Last 2 3 POINT=A0 number PSEC PFRAME Value track POINT=A1 Value number PSEC PFRAME 4 byte unit offsets nfiFirst/Last track numbers are PMIN binary values 0 1 2 3 Ctrl Adr Read out start frame address Indicates final session value for multi sessions 2) Session Information Co Session Number 4 Bytes GA byte 0 1 2 3 0 Total Session Information Session External read out start frame Session 1 Information Total No. address 1 2 Session 2 Information Equal to TOC read out start FAD in single sessions ~ ~ n Session n Information 0 1 2 3 ~ ~ Start TNO within Session start frame address 98 Session 98 Information session 99 Session 99 Information TNO (track no.) is a binary value SE Non-existing sessions are FFFFFFFFH (when session number exceeds session total) 58 7.2.4 Status and Report Title Data Data Name No nti Data Specification Status and Report (1/2) 4.0 1) Response Format Command response is in the format below. Whether CD report returns as a report depends on the command. Periodic response absolutely returns CD report. byte 0 Status 1 2 3 4 Report 5 al 6 7 CD Report Flg Rep Cnt Ctrl Adr TNO de X FAD 2) nfi Combined status and CD reports are called CD status information. Status A status of FFH indicates REJECT (abnormal command) bit 7 Co The status code is valid when WAIT (bit 7 = 1). Other bits (bit 4 to bit 6) are 0. 6 5 4 3 2 1 0 Status code (CD drive status) Value Status Explanation 00H Status currently changing 01H Currently paused GA 02H Standby (drive in suspended status) 03H Playing CD 04H Seeking 05H Scanning 06H Tray is opened 07H No disc 08H Currently retrying read 09H Read data error occurred SE 0AH 1: Periodic Response 0: Command Responce 1: Data Transfer Request 0: Not the same Fatal error occurred 1: WAIT (execute reserve) 0: ACK (command normal recieve) System Library User's Guide 59 Title Data Data Name No Data Specification Status and Report (2/2) 4.0 3) CD Report CD Report byte 1 Flg Rep Cnt 2 Ctrl Adr 3 TNO 4 X 5 6 FAD 7 ntial FLG : 4 bit flag bit 7 6 5 4 Rep Cnt 1 : CD-ROM de 0 : CD-DA (or when seeking or scanning) : 4 bit repeat frequency. Notification range 0H ~ EH (0 ~ 14 times) Ctrl Adr TNO X FAD : CONTROL/ADR byte of subcode Q nfi : Track number of subcode Q (binary value, not BCD) : Index number of subcode Q (binary value, not BCD) : Frame address (in header information when CD-ROM, otherwise, based on subcode Q) 4) Status CD Report content in every status CD Report is invalid for REJECT and valid for WAIT. CD drive status and CD report contents are shown below. The FFH rows mean invalid values. CD flag/repeat Control/ADR O / FFH Co O / FFH Track No. O / FFH Index No. O / FFH Frame address O / FFFFFFH O O O O O value at pause value at pause value at pause value at pause value at pause (when seek home) GA FFH O O O FFH FFH O FFH O target position O FFH FFH O FFH O target position O FFH FFH O FFH O target position O FFH FFH O FFFFFFH O target position O FFFFFFH FFFFFFH O FFH FFH FFH FFH FFFFFFH SE undefined O: Current value. undefined undefined Seek Home: seek (stop) against home position. When the standby time expires and the status changes from to , the value when paused is saved. undefined undefined 60 5) When CD report content is an ineffective value Home to . nti (a) The value immediately before the repeat frequency is saved. If changing to a different status, returns to the retaind value. (b) Moves to the start (FAD = 150) of the disk if the status changes from Seek al (c) The value immediately before is retained. If changing to the status, returns to the retained value. (d) Midway during the status, the ineffective value returns in some cases when changing to a different status. de nfi Co GA SE System Library User's Guide 61 7.2.5 Subcode Information Title Data Data Name No nti Data Specification Subcode Information 5.0 1) Subcode Q Information (a) When Adr = 1 byte 1 TNO Ctrl Adr Ctrl Adr 2 TNO 3 X : CONTROL/ADR byte 4 5 P_FAD 6 : Track No. (binary value not BCD) 7 00 8 9 Q_FAD al 10 CRC X P_FAD Q_FAD : Index No. (binary value not BCD) de : Time within track (frame address format with track lead at 0) : Absolute time (frame address format with 00:00:00 at 0) The content in each status is the same as for the CD report. Values in read in and read out are shown in the table below. (Can be acquired by multi-session) TNO 01H ~ 63H (1 ~ 99) AAH (Read Out) 00H (Read In) 01H ~ 63H 01H ~ 63H X nfi 01H ~ 63H, A0H, A1H, A2H P_FAD Elapsed FAD within track Elapsed FAD within track 000000H 2) (Normally cannot be acquired). Co Read in of the first session is Q_FAD = 000000H. (b) In other cases: the subcode Q value unchanged (10 bytes except CRC) Subcode R~W Information R S T U V W GA bit 7 6 5 4 3 2 1 0 Pack 24↑bytes ↓ 24↑bytes Packet (corresponds Pack ↓ to1 frame = 1 sector) 24↑bytes 96 bytes Pack ↓ Pack 24↑bytes ↓ SE unused (padded by 0) Subcode R~W is decoded in 1 pack units (24 bytes = 12 words). The CD block has an internal pack buffer of 23 packs (short of 6 packets). 62 7.2.6 Data Type Title Data Data Name No nti Data Specification CD Communication Function Return CdcRet 6.1 Code 1) Return Code CdcRet ret . . . . . . Be sure ret is not the pointer. Access Macro CDC_RET_ERR (ret) CDC_RET_STATUS (ret) Type Sint 16 Uint 8 al Explanation Error Code Status 2) Error Code Constant Name CDC_ERR_OK CDC_ERR_CMDBUSY CDC_ERR_CMDNG de Explanation Normal (process continuation) Command end flag is not 1 CMOK flag is not 1 when command is issued CDC_ERR_PUT nfi CDC_ERR_TMOUT CDC_ERR_REJECT Time out (wait for response, wait for data transfer ready) Data transfer read wait by sector data write. Could not reserve empty sectors. REJECT for command response 3) Status Co CDC_ERR_WAIT CDC_ERR_TRNS CDC_ERR_PERI CDC_ERR_PTYPE WAIT for command response Abnormal data transfer size Not a periodic response Abnormal play, seek position type The retaining status of the CD communication interface is substituted in the return code status together with all functions. Response status returnswhen response is acquired by acquiring periodic response or issuing commands. GA The holding status returns unchanged when a response cannot be acquired by not issuing a command or error. SE System Library User's Guide 63 Title Data Data Name No Data Specification CD Status Information CdcStat 6.2 Combine the CD block status and CD report to create CD status information. 1) CD Status Information CdcStat *stat Access Macro Type nti Explanation al CDC_STAT_STATUS (stat) Uint 8 Status CDC_STAT_FLGREP (stat) Uint 8 CD report CD flag and repeat no. CDC_STAT_CTLADR (stat) Uint 8 CD report CONTROL/ADR byte 2) CDC_STAT_TNO (stat) CDC_STAT_IDX (stat) CDC_STAT_FAD (stat) CD Report CD flag and Repeat Count Uint 8 Uint 8 Sint 32 de CD report track no. (binary value) CD report index no. (binary value) CD report frame address bit 7 6 5 4 1: CD-ROM nfi 3 2 1 0 Repeat number (0H ~ EH: repeat 14 times) 0: CD-DA (or when seeking or scanning 1) Title Data Specification Hardware Information Data Co Hardware Information Data Name CdcHw No 6.3 CdcHw *hw Access Macro Type Explanation GA CDC_HW_HFLAG (hw) Uint 8 Hardware flag CDC_HW_VER (hw) Uint 8 CD block version information CDC_HW_MPVER (hw) Uint 8 MPEG version information CDC_HW_DRV (hw) Uint 8 CD drive information CDC_HW_REV (hw) Uint 8 CD block revision information 2) Hardware Flag SE bit 7 6 5 4 3 2 1 0 1 : MPEG exists 0: not the same 1 : Hardware error occurs 0: Normal 64 Title Data Data Name No Data Specification CD Position Parameters (1/2) CdcPos 6.4 the seek position. nti Designates the CD range of play (start and end positions) and is used in designating 1) Position Type al Default value, frame address, track/index, and no change can be designated at position parameters. The constants (position type) below are used to select the parameter. Constant Name Explanation CDC_PTYPE_DFL Designates default values CDC_PTYPE_FAD CDC_PTYPE_TNO CDC_PTYPE_NOCHG de For CD play : indicates disk start and end. For seek: indicates home position. Designates frame address Designates track/index Designates no change (no change in set values) Beginning of disc: FAD = 150(96H) position (2 seconds, 0 frame with absolute time) 2) End of disc: Position Paramters CdcPos *pos Access Macro nfi FAD = readout start frame address (TOC information) - 1 position. Type Explanation 3) CDC_POS_FAD (pos) Co CDC_POS_PTYPE (pos) CDC_POS_TNO (pos) CDC_POS_IDX (pos) Setting Method Sint 32 Sint 32 Uint 8 Uint 8 Position type Frame address, FAD sector no. Track number Index number (a) Designating the default value CdcPos pos; GA CDC_POS_PTYPE (&pos) = CDC_PTYPE_DFL; (b) Designating the frame address CDC_POS_PTYPE (&pos) = CDC_PTYPE_FAD; CDC_POS_FAD (&pos) = fad; /* frame address */ The end position is designated by sector number (FAD sector number) from the starting FAD (c) Designating the Track/Index SE CDC_POS_PTYPE (&pos) = CDC_PTYPE_TNO; CDC_POS_TNO (&pos) = tno; /* track number */ CDC_POS_IDX (&pos) = x; /* index number */ (d) Designating No Change CDC_POS_PTYPE (&pos) = CDC_PTYPE_NOCHG; System Library User's Guide 65 Title Data Data Name No Data Specification CD Position Parameters (2/2) CdcPos 6.4 4) Execptions to Frame Address The frame address is explained by the conditions below. Condition FAD < disc start Start and Seek Positions FAD = disc start (150) nti End Position al FAD = 150+FAD sector no. - 1 (when starting FAD <150) FAD > disc end FAD = disc end + 1 FAD = disc end (equal to read out) Relationship of start and end positions: 5) End FAD = Start FAD + FAD sector number - 1 de (The held contents of the play range are the Start FAD and End FAD.) Execptions to Track/Index The track/index is explained by the conditions below. value) Condition TNO = 0 (track default X = 0 (index default value) TNO < disc start track Start and Seek Positions TNO = disc start track X =1 TNO = disc start track nfi End Position TNO = disc last track X = 99(63H) TNO = disc start track TNO > disc end track X does not exist Co X = 1 (same as X = 0) TNO = disc end track X = 1 (same as X = 0) (from the next track) TNO: track number, X: index number X = 99 (same as X = 0 ) TNO = disc end track X = 99 (same as X = 0 ) (until track ends) X = 0 means designation of the track only. (track start/last index) TNO = X = 0 is the default value of the position parameter. 6) postion) GA (Start position: start of disc, End position: end of disc, Seek postion: home Exceptions to the Play Range The play range is retained if the end postion is smaller than the start position, but the CD will not play. (For designating both frame address and track/index) 7) Meanings of Special Designations SE • Specifies seek position default value: • Specifies seek position no change: • Specifies play range no change: used as a stop command. (seeks home position) used as a pause command. used with pause cancel (retry CD play). 66 Title Data Data Name No Data Specification CD Play Parameters CdcPly 6.5 Used to designate the play range and play mode when playing a CD. 1) Play Mode ntial When playing a CD, the maximum repeat count of the play segment and the existence of pickup movement (play position) to the start position are designated. The designation range of the maximum repeat count is 4 bits. The default value is 0. bit 7 6 5 4 3 2 1 0 Value de Maximum Repeat Count 00H Explanation No repeat (plays only one time) 01H ~ 0EH Repeat designation count (repeat 1 ~ 14 nfi 0FH 7FH times) Infinite repetitions Does not change maximum repeat count 1: Does not move pickup to start position 0: Same movement CDC_PM_DFL Co Constant Name CDC_PM_REP_NOCHG CDC_PM_PIC_NOMOV CDC_PM_NOCHG Explanation Play mode default value (no repeat, moves pickup) No change in maximum repeat count Does not move pickup to start position ( status when current position is outside play range) Play mode does not change (can change play range only) Equal to (CDC_PM_REP_NOCHG : CDC_PM_PIC_NOMOV) GA SE System Library User's Guide 67 2) Play Parameters CdcPly *ply Access Macro CDC_PLY_START (ply) CDC_PLY_STYPE (ply) CDC_PLY_SFAD (ply) CDC_PLY_STNO (ply) Type CdcPos Sint 32 Sint 32 Uint 8 Explanation nti Play start position parameters Start position type Start position frame address Start position track number al CDC_PLY_SIDX (ply) Uint 8 Start position index number CDC_PLY_END (ply) CdcPos Play end position parameters CDC_PLY_ETYPE (ply) Sint 32 End position type CDC_PLY_EFAS (ply) CDC_PLY_ETNO (ply) CDC_PLY_EIDX (ply) CDC_PLY_PMODE(ply) Sint 32 Uint 8 Uint 8 Uint 8 de End position frame address sector number End position track number End position index number Play mode (repeat designation, pickup movement) nfi Co GA SE 68 3) Method for setting play parameters Play parameters designate the play range and play mode. Play range is designated by a combination of the position parameters of the start and end positions. nti (a) Track designation and frame address designation cannot be combined in the al play range. In such cases, REJECT is returned. All other play range combi- nations are possible. (b) All play range and play mode combinations are possible. (c) The play range and maximum repeat count is held within the CD block and are effective until reset. (d) Default value: start of disc to end of disc, no repeat, moves pickup. Examples of settings are shown below. N o . Play Method 1 2 Track designation Frame address designation Start Position tno 1, x1 fad de End Position tno 2, x2 fasnum Comments note: 1 3 4 5 Play from first of disc Play until end of disc End position does not nfi CDC_PTYPE_DFL tno 1, x1 fad tno 1, x1 tno 2, x2 fasnum CDC_PTYPE_DFL CDC_PTYPE_NOCHG note: 2 6 7 position changes) Co change. (only the start Start position does not change. (only the end position changes) Play is retried from the current position without changing the play range fad CDC_PTYPE_NOCHG CDC_PTYPE_NOCHG tno 2, x2 fasnum CDC_PTYPE_NOCHG note: 2 CDC_PM_NOC HG is designated in and play mode. the Play mode. GA Note 1: Note 2: fad: frame address tno 1: start track number x1: start index number fasnum: frame address sector number tno 2: end track number x2: end index number fad + fasnum -1 is retained as the end postion. Track and frame address designation cannot be combined even if there is no change on the one hand. SE 4) Execptions to the Play Range No play if the end postion is less than the start position. Becomes status same as play range exterior. The play range is held and the play mode is also effective. (Pickup moves to the start position.) System Library User's Guide 69 Title Data Data Name No Data Specification Sub header Conditions CdcSubh 6.6 Used when setting/getting sub header conditions for a filter. 1) Sub header Conditions dcSubh *subh ntial Access Macro Type Explanation CDC_SUBH_FN (subh) Uint 8 File Number CDC_SUBH_CN (subh) Uint 8 Channel Number CDC_SUBH_SMMSK (subh) CDC_SUBH_SMVAL (subh) CDC_SUBH_CIMSK (subh) CDC_SUBH_CIVAL (subh) Uint 8 Uint 8 Uint 8 Uint 8 de Sub mode mask pattern Sub mode comparison value Coding information mask pattern Coding information comparison value • Mask pattern • Comparision Value : : nfi Comparison object bit pattern. Comparison value of the bit designated by the mask pattern. Whether the submode and coding information is equal to the comparison value is decided after the logical product of their repective mask patterns are taken. Condition equation Co (sm & SMMSK) == SMVAL (ci & CIMSK) == CIVAL GA SE 70 2) Sub Mode bit 7 6 5 4 3 2 1 0 EOR V A nti (Same as CD-ROM XA sub mode byte) al (End OF Record) (Video) (Audio) 1: 1: 1: Record end sector Video sector Audio sector D (Data) 1: Data sector T (Trigger) 1: Trigger ON F (Form) 1: Form 2, 0: Form 1 Constant Name CDC_SM_EOR Type 01H RT EOF de(Real Time Sector) (End Of File) Explanation Record end sector 1: 1: Real time sector File end sector CDC_SM_VIDEO CDC_SM_AUDIO CDC_SM_DATA CDC_SM_TRIG CDC_SM_FORM nfi 02H 04H 08H 10H 20H Video sector Audio sector Data sector Trigger bit Form bit (0: Form 1, 1: Form 2) CDC_SM_RT CDC_SM_EOF Co 40H 80H Real time sector File end sector GA SE System Library User's Guide 71 Title Data Data Name No Data Specification Sector Information CdcSct 6.7 1) Sector Information CdcSct *sct Access Macro CDC_SCT_FAD (sct) CDC_SCT_FN (sct) Type Sint 32 Uint 8 ntial Explanation Frame address File Number CDC_SCT_CN (sct) Uint 8 Channel Number CDC_SCT_SM (sct) Uint 8 Sub mode CDC_SCT_CI (sct) Uint 8 Coding information Title Data Specification Data File Information de Data Name CdcFile No 6.8 1) File Information CdcFile *file Access Macro CDC_FILE_FAD (file) CDC_FILE_SIZE (file) nfi Type Sint 32 Sint 32 Explanation File start frame address File size (byte number) * CDC_FILE_UNIT (file) CDC_FILE_GAP (file) CDC_FILE_FN (file) CDC_FILE_ATR (file) Co Uint 8 Uint 8 Uint 8 Uint 8 File unit size Gapsize File number * File attributes When there is no directory record system information, the file number becomes 0. bit 7 2) 6 File Attributes 5 GA 4 3 2 1 0 1 : Yes directory 1 : Form 1 sector included 1 : Form 2 sector included 0 : no directory (note 1) 0 : not included 0 : not included 1 : Interleave sector included 0 : non-interleave Valid at CD-ROM XA standard 1 : CD-DA file 0 : CD-ROM file Note 2 SE Note 1: Note 2: 1 : Yes d irectory file 0 : no directory file bit 1 is a directory bit of the file flag within the directory record and valid when there is no system information (discriminant gives bit 7 priority) bits 3 to 7 is attribute information conforming to CD-ROM XA standards, and bits 3 to 7 are 0 when there is no system information. 72 8.0 Function Specifications 1) nti Function specifications of the CD Communication Interface are described. Format al Reserved areas with the figure are indicated by a “–” mark. Reserved areas must be designated with a 0. 2) Initial Values of Parameters Initial values of parameters held in the CD block are equal to the default values designated by the host as long as they are not specially specified. 3) de CD Status Information (Status and CD Report) Hold The CD communication interface holds status and CD reports when a CD block command is issued. Information is not held by a periodic response. The intial value of all holding contents is 0. The functions that change the holding status/CD report are listed below by symbol. [SR] [S-] [--] : : : nfi changes status and CD report changes status only no changes (no command issued) Title Co Data Function Specification CD Play Function Name CDC_CdPlay [SR] No 2.1 Nothing changes when there is an error (When the error code is not CDC_ERR_OK). 4) Data Transfer Inside Functions Among the information get functions, data transfered by the function interior GA enters the function name as Tget. The method of data transfer is software transfer by the CPU. Example: Get TOC information (CDC_TgetToc) These functions call the following functions internally. • Data transfer waiting for start (CDC_DataReady) • Data transfer end (CDC_DataEnd) SE System Library User's Guide 73 8.1 List of Functions Table 8.1 is a list of functions of the CD communication interface. Table 8.1 List of CD Communication Interface Functions (1) CD Block Common Function Get current CD status information Get previous CD status information Get periodic CD status information Name CDC_GetCurStat CDC_GetLastStat CDC_GetPeriStat nti Number al 1.0 1.1 1.2 1.3 Get hardware information CDC_GetHwInfo 1.4 Get TOC information CDC_TgetToc 1.5 Get session information Initialize CD block Open tray Data transfer ready Data transfer end CD Drive de CDC_GetSes CDC_CdInit CDC_CdOpen CDC_DataReady CDC_DataEnd 1.6 1.7 1.8 1.9 1.10 2.0 CD play Seek play position Scan Subcode Get subcode Q nfi CDC_CdPlay CDC_CdSeek CDC_CdScan CDC_TgetScdQch 2.1 2.2 2.3 3.0 3.1 Get Subcode R ~ W CD-ROM Device Co Set connection point of CD device Get connection point of CD device Get buffer partition of last read sector Selector CDC_TgetScdRwch CDC_CdSetCon CDC_CdGetCon CDC_CdGetLastBuf 3.2 4.0 4.1 4.2 4.3 5.0 Set filter frame address range CDC_SetFiltRange 5.1 Get filter frame address range CDC_GetFiltRange 5.2 GA Set filter subheader conditions Get filter subheader conditions Set filter mode Get filter mode Set filter connection point Get filter connection point CDC_SetFiltSubh CDC_GetFiltSubh CDC_SetFiltMode CDC_GetFiltMode CDC_SetFiltCon CDC_GetFiltCon 5.3 5.4 5.5 5.6 5.7 5.8 Reset selector (filter, partition) CDC_ResetSelector 5.9 SE 74 Table 8.1 List of CD Communication Interface Functions (2) Function Name Number Buffer Information 6.0 Get CD buffer size Get buffer partition sector number Calculate actual data size Get actual data size Get sector information Execute frame address search nti CDC_GetBufSiz CDC_GetSctNum al CDC_CalActSiz CDC_GetActSiz CDC_GetSctInfo CDC_ExeFadSearch 6.1 6.2 6.3 6.4 6.5 6.6 Get frame address search results CDC_GetFadSearch 6.7 Buffer Input/Output 7.0 Set sector length CDC_SetSctLen 7.1 Get sector data Delete sector data Get and delete sector data Write sector data Copy sector data de CDC_GetSctData CDC_DelSctData CDC_GetdelSctData CDC_PutSctData CDC_CopySctData 7.2 7.3 7.4 7.5 7.6 Move sector data nfi Get sector data copy/move error CD Block File System Change directory Hold file information CDC_MoveSctData CDC_GetCopyErr CDC_ChgDir CDC_ReadDir 7.7 7.8 8.0 8.1 8.2 Co Get holding file information range Get holding file information Read file Stop file access Register Access Get data transfer register pointer CDC_GetFileScope CDC_TgetFileInfo CDC_ReadFile CDC_AbortFile CDC_GetDataPtr 8.3 8.4 8.5 8.6 9.0 9.1 Get interrupt factor register value CDC_GetHirqReq 9.2 Clear interrupt factor register CDC_ClrHirqReq 9.3 GA Get interrupt mask register value CDC_GetHirqMsk 9.4 Set interrupt mask register CDC_SetHirqMsk 9.5 Get MPEG register pointer CDC_GetMpegPtr 9.6 SE System Library User's Guide 75 8.2 Function Details 8.2.1 CD Block Common Format: Input: Output: Title Function Specifications Function value: Function Get current CD status information CDC_GetCurStat CdcRet CDC_GetCurStat (CdcStat *stat) None stat : CD status information Returns the return code nti Function Name al [SR] No. 1.1 Function: Issues the get command of CD status information for the CD block and gets current CD status information (status and CD report). Format: Input: Title Function Specifications Function Get previous CD status information de Function Name CDC_GetLastStat CdcRet CDC_GetLastStat (CdcStat *stat) None [ -- ] No. 1.2 Output: Function value: Function: Remarks: stat nfi : CD status information Returns the return code. Gets CD status information for the previous CD block command. If the CD communication interface issues a CD block command, the status and CD report of that response is held. This function returns the value being held. Function Specifications Format: Input: Title Output: Function Get periodic CD status information Function Name CDC_GetPeriStat CdcRet CDC_GetPeriStat (CdcStat *stat) None stat Co : CD status information [ -- ] No. 1.3 Function value: Returns the return code. Function: Gets CD status information through periodic response. Remarks: GA Since the command for CD block is not issued, the load is small and the polling process is possible. SE 76 Title Function Function Name [S- ] No. Function Get hardware information CDC_GetHwInfo 1.4 Specifications Format: Input: Output: Function value: Function: CdcRet CDC_GetHwInfo (CdcHw *hw) None hw : hardware information Returns the return code. nti Gets CD block hardware information. al Title Function Function Name [S- ] No. Function Get TOC information CDC_TgetToc 1.5 Specifications Format: Input: Output: Function value: Function: Example: de CdcRet CDC_TgetToc (Uint32 *toc) None toc : TOC information (204 words) Returns the return code. Gets all TOC information (102 peices, 408 bytes) Waits in the status and status Uint 32 toc [102]; /* reserves TOC information store region */ Title Function Specifications nfi ret = CDC_TgetToc(toc); /* get TOC information Function Get session information Function Name CDC_GetSes [S- ] No. 1.6 */ Format: Input: Output: Function value: Function: Co CdcRet CDC_GetSes (Sint32 sesno, Uint32 *ses) sesno : session number (0 ~ 99) ses : session information (2 words) Returns the return code. Gets session information (4 bytes) of the designed session. Waits in the status and status. GA SE System Library User's Guide 77 Title Function Function Name [SR] No. Function Initialize CDblock (1/2) CDC_CdInit 1.7 Specifications Format: Input: CdcRet CDC_CdInit iflag : initializing flag stnby : standby time ecc : ECC frequency retry : retry frequency nti (Sint32 iflag, Sint32 stnby, Sint32 ecc, Sint32 retry) (insignificant 8 bits are effective) al (insignificant 8 bits are effective) (insignificant 8 bits are effective) (insignificant 8 bits are effective) Output: none Function value: Returns the return code. Function: Initial setting of CD block. 1) Initializing flag Designates each type of setting flag (8 bits) to the CD block. de When software is reset, all other initialized parameters are ignored and this becomes the initial value. bit 7 6 5 4 3 2 1 0 nfi Initial value : 00H 1 : Reset CD block software 1 : Decode of RW subcode 0 : not the same 0 : not the same 1 : Doesn't confirm Mode 2 subheader 0 : the same 1 : Retry Form 2 read 0 : not the same 1 : CD-ROM data read standard speed 0 : 2X standard speed (a) (b) Co 1 : No change 0 : Change Interrupt factor register ESEL flag becomes 1 when reset of software ends. Recognition of the Mode 2 subheader is used only in the correcting process during CD-ROM decode. The selector always recognizes the subheader. (decides conditions of the filter, selector length, etc.) (c) Data is output even if there is an error when Form 2 read is not retried. (d) CD-ROM data read speed switches when changing to the status. When the CD-DA area is played, it automatically plays at standard speed. 2) GA The prior speed returns if the CD-ROM area is entered. Standby Time Designates the transition time from to . Changes to when the standby time of expires. Set Value Description SE 0000H 0001H ~ FFFEH FFFFH 180 seconds ......initial value Transition time (in seconds) No change in settings 78 Title Function Function Name [SR] No. Function Initialize CD block (2/2) CDC_CdInit 1.7 Specifications 3) ECC Frequency nti Designates the number of repetitions of the ECC process (PQ once each) during CD-ROM decode. 00H Set Value al Description ECC is processed a maximum of only 1 time in real time ..... initial value. 01H ~ 05H When an error exists after the ECC process, maximum number of repetitions (total of 2 to 6 times). 4) 80H FFH Retry Frequency No ECC process No change in settings de Designates the number of retries of the same sector if an error occurs during CD-ROM decode. Set Value 00H 01H ~ 0FH ( ) nfi Description Without retrying, stops data output (becomes ) ..... initial value. Retries designated number of times, data output stops if there is an error (becomes ). 40H 41H ~ 4FH ( 80H FFH Co ) Data is output without retrying Retries designated number of times, data is output even if there is an error. Infinite number of retries No change in settings bit 7 6 5 4 3 2 1 0 Frequency indicated by insignificant 4 bits. 5) GA Tray Open/Close Frequency (0 ~ 15 times) Closes the Tray when in the status. 1 : Data output even if error occurs 1 : Infinite number of retrys 0 : Stops output 0 : Definte number • When automatic format (front loading) : CD block automatically closes tray. SE • When manual format (top loading) : status until closed by manual. Tray open when in the status. (See Tray Open) Tray open and close operates the same for CD play, seek play position, and scan. Remarks: All command issues are prohibited while the software is being reset. System Library User's Guide 79 Title Function Function Name [SR] No. Function Open tray CDC_CdOpen 1.8 Specifications Format: Input: Output: Function value: Function: CdcRet CDC_CdOpen (void) none none Returns the return code. Stops the CD drive and opens the tray ntial • When automatic format (front loading) : CD block automatically opens tray. • When manual format (top loading) : status until opened by manual. Remarks: When the tray is opened, DCHG of the interrupt factor register Title Function Specifications (Same for when opening manually.) de and EFLS flag become 1. The timing is before the status. Function Data transfer ready Function Name CDC_DataReady [S-] No. 1.9 Format: Input: Output: Function value: Function: nfi CdcRet CDC_DataReady (Sint32 dtype) dtype none : transfer ready type Returns the return code. Waits until data transfer ready is enabled. Data can be transfered after ready is finished. If data is transfered, data transfer end must be 1) Transfer Ready Type Value CDC_DRDY_GET CDC_DRDY_PUT executed. Co Description Designated when getting data. (CD block → host) Designated when writing data. (host → CD block) GA 2) Transfer Ready Process Waits until DRDY of the interrupt factor register becomes 1, and clears 0 if it becomes 1. If empty sectors can not be reserved when writing, the EHST flag of the interrupt factor register becomes 1. In this case, CDC_ERR_PUT error is returned. Remarks: When an error is caused by ready, there is no need to execute data transfer end. It will be automatically executed inside the ready function. SE 80 Title Function Function Name [S-] No. Function Data transfer end CDC_DataEnd 1.10 Specifications Format: Input: Output: Function value: Function: CdcRet CDC_DataEnd (Sint32 *cdwnum) none cdwnum nti : CD block transfer word number Returns the return code. al Instructs the end of data transfer for the CD block. Data transfer can be stopped while in process. 1) CD Block Transfer Word Number Returns the word number of effective data transfered by the CD block.The be transfered). de normal word number can not be exceeded (entire number of words that should Constant Name CDC_DEND_ERR Description Error occurred by data transfer Data transfer end is executed even though it isn't time for transfer. 2) Relationship of Transfer Word Numbernfi Data transfer conditions can be checked by comparing the host transfer word number (word number transfered by the host until data transfer end is executed) and the CD block transfer word number. Transfer Conditions Transfer interrupt Transfer all Excess transfer Co Host Transfer Word Number (Host Word Number) host word no. < normal word no. host word no. = normal word no. host word no. > normal word no. CD Block Transfer Word Number (cdwnum) When gettng (CD → host) cdwnum > host word number When writing (host → CD) cdwnum = host word number cdwnum = normal word number = host word number cdwnum = normal word number < host word number • Transfer interrupt : Stops data transfer while in progress. GA • Transfer all • Excess transfer : All data is transfered. : Normal word number is exceeded and transfered (Excess part is transfered as dummy data). SE System Library User's Guide 81 8.2.2 CD Drive For tray open/close in the and statuses see Initialize CD block. Function Specifications Format: Input: Title Output: Function CD play CdcRet CDC_CdPlay (CdcPly *ply) ply none : play parameters Function Name CDC_CdPlay ntial [SR] No. 2.1 Function value: Returns the return code. Function: Plays CDs according to the designated play parameters. Plays music in the CD-DA area. Reads sector data in the Remarks: Example: CD-ROM area. de In playing CD-DA, mute is canceled 4 frames prior to the start position to prevent the start of a song from being cut off. (1) Frame Address Designation CdcPly ply; CDC_PLY_STYPE (&ply) = CDC_PLY_SFAD (&ply) CDC_PLY_ETYPE (&ply) = CDC_PLY_EFAS (&ply) = = nfi CDC_PTYPE_FAD; fad; CDC_PTYPE_FAD; fasnum; /* definition of play parameter variable */ /* start frame address /* frame address sector number */ */ Co CDC_PLY_PMODE (&ply) = ret = CDC_CdPlay (&ply); (2) Track/Index Designation CDC_PLY_STYPE (&ply) = CDC_PLY_STNO (&ply) CDC_PLY_SIDX (&ply) = = pmode; CDC_PTYPE_TNO; tno1; x1; /* play mode /* play start /* start track number /* start index number */ */ */ */ CDC_PLY_ETYPE (&ply) = CDC_PTYPE TNO; CDC_PLY_ETNO (&ply) = tno2; /* end track number */ GA CDC _PLY_EIDX (&ply) = x2; /* end index number */ CDC _PLY_PMODE (&ply) = pmode; /* play mode */ (3) Default Value Designation CDC_PLY_STYPE (&ply) = CDC_PTYPE_DFL; /* start position is first of disc */ CDC_PLY_ETYPE (&ply) = CDC_PTYPE_DFL; /* end position is end of disc */ CDC_PLY_PMODE (&ply) = CDC_PM_DFL; /* no repeat, move pickup */ SE (4) CD Play Restart (unchanged selection: play from current position) .... cancel pause CDC_PLY_STYPE (&ply) = CDC_PTYPE_NOCHG; CDC_PLY_ETYPE (&ply) = CDC_PTYPE_NOCHG; CDC_PLY_PMODE (&ply) = CDC_PM_NOCHG; 82 Title Function Function Name [SR] No. Function Seek play position CDC_CdSeek 2.2 Specifications Format: Input: Output: Function value: Function: Example: CdcRet CDC_CdSeek (CdcPos *pos) pos none nti : position parameters Returns the return code. al Moves (seeks) the play position (pickup) according to the designated position parameters. 1. Frame Address Designation CdcPos pos; /* definition of position parameter variable */ 2. CDC_POS_FAD (&pos )= fad; de CDC_POS_PTYPE (&pos) =CDC_PTYPE_FAD; ret = CDC_CdSeek (&pos); Track/Index Designation CDC_POS_PTYPE (&pos) /* frame address /* seek start = CDC_PTYPE_TNO; */ */ 3. 4. CDC_POS_TNO (&pos) CDC_POS_IDX (&pos); nfi = = tno; x; /* track number /* index number CD Play Stop (Default vlaue designation: Seek home position)...... Stop CDC_POS_PTYPE (&pos) = CDC_PTYPE_DFL; Pause CD Play (No changed selection: seek current position) ......Pause */ */ Co CDC_POS_PTYPE (&pos) = CDC_PTYPE_NOCHG; GA SE System Library User's Guide 83 Title Function Function Name [SR] No. Function Scan CDC_CdScan 2.3 Specifications Format: Input: Output: Function value: Function: CdcRet CDC_CdScan (Sint32 scandir) scandir none : Scan direction Returns the return code. Scans the CD. ntial Scanning continues until a CD drive command (CD play, seek, etc.) is issued. Scan is canceled and a pause occurs if the play range is exceeded. The pause position at that time is undefined. 1) Scan Direction Constant Name CDC_SCAN_FWD CDC_SCAN_RVS de Description Fast forward scan (forward direction) Fast reverse scan (reverse direction) 2) Sound Output nfi If scanning from the status, -12 dB sounds are output in the CD- DA region. Sound is muted if scanning in the CD-ROM area or in the status. If the scan direction in near the play range boundary is reversed, the sound may not be output. Remarks: Co When the CD-ROM area is scanned, sector data will not be read. GA SE 84 8.2.3 Subcode Title Function Function Name [S-] No. Function Specifications Format: Input: Output: Function value: Get subcode Q nti CdcRet CDC_TgetScdQch (Uint16 *qcode) none qcode CDC_TgetScdQch al : Subcode Q information (5 words) Returns the return code. 3.1 Function: Gets subcode Q channel information (10 bytes other than CRC) Title Function Specifications Format: Input: Output: Function Get subcode R ~ W Function Name CDC_TgetScdRwch [S-] CdcRet CDC_TgetScdRwch (Uint16 *rwcode, Sint32 *scdflag) none rwcode de : Subcode R ~ W information (12 words) No. 3.2 Function value: Function: (1) Subcode Flag scdflag nfi : Subcode flag (effective bits are insignificant) Returns the return code. Gets subcode R~W channel information (1 pack of 24 bytes). data). Co Shows error conditions of retrieved subcode R ~ W information (pack bit 7 6 5 4 3 2 1 0 1 : Pack data error 0 : Normal 1 : Overrun error 0 : Normal GA Remarks: Pack data can not exceed retrieval of 16 packs in one time frame (13.3 ms). Returns to WAIT if the pack buffer is empty and there is no pack data. SE System Library User's Guide 85 8.2.4 CD-ROM Device Title Function Function Name [SR] No. Format: Input: Output: Function Specifications Function value: Set connection destination of CD device CdcRet CDC_CdSetCon (Sint32 filtno) filtno CDC_CdSetCon : Connection destination filter number (CDC_NUL_SEL : display non-connection) none Returns the return code. ntial 4.1 Function: Sets the connection destination (filter) of the CD device. Connection is separated if CDC_NUL_SEL is selected. Format: Input: Output: Title Function Specifications Function Get connection destination of CD device CdcRet CDC_CdGetCon (Sint32 *filtno) none filtno de Function Name CDC_CdGetCon : Connection destination filter number [S-] No. 4.2 Function value: Function: Title Returns the return code. nfi (CDC_NUL_SEL : displays non-connection) Gets the connection destination (filter) of the CD device. Returns CDC_NUL_SEL if there is no connection. Function Function Name [S-] No. Format: Input: Output: Function Specifications Function value: Co Get buffer partition of last read sector CdcRet CDC_CdGetLastBuf (Sint32 *bufno) none CDC_CdGetLastBuf bufno : Storage destination buffer partition number (CDC_NUL_SEL : displays non-storage) Returns the return code. 4.3 Function: Gets the buffer partition number of the storage destination of the sector last read from the CD. GA SE 86 8.2.5 Selector See selector reset for the initial value of the selector set parameters. Format: Input: Title Function Function Specs Set filter frame address range nti Function Name CDC_SetFiltRange CdcRet CDC_SetFiltRange (Sint32 filtno, Sint32 fad, Sint32 fasnum) filtno fad : filter number : starting frame address fasnum : frame address sector number al [SR] No. 5.1 (0: effective FAD range does not exist) Output: none Function value: Returns the return code. Function: Title de Sets the frame address range for the filter. When fasnum = 0, all sectors are output to false output connectors if the FAD range of the filter mode is effective. Function Function Specs Get filter frame address range Function Name CDC_GetFiltRange [S-] No. 5.2 Format: Input: Output: Function value: nfi CdcRet CDC_GetFiltRange (Sint32 filtno, Sint32 *fad, Sint32 *fasnum) filtno fad : filter number : starting frame address fasnum : frame address sector number Returns the return code. Function: Format: Input: Title Co Gets the frame address range for the filter. Function Function Specs Set filter subheader conditions Function Name CDC_SetFiltSubh CdcRet CDC_SetFiltSubh (Sint32 filtno, CdcSubh *subh) filtno : filter number [SR] No. 5.3 subh : subheader conditions Output: none GA Function value: Function: Format: Input: Title Returns the return code. Sets subheader conditions for the filter. Function Function Specs Get filter subheader conditions Function Name CDC_GetFiltSubh CdcRet CDC_GetFiltSubh (Sint32 filtno, CdcSubh *subh) filtno : filter number [S-] No. 5.4 Output: subh : subheader conditions SE Function value: Function: Returns the return code. Gets subheader conditions for the filter. System Library User's Guide 87 Title Function Function Name [SR] No. Function Specs Set filter mode CDC_SetFiltMode 5.5 Format: Input: Output: Function value: Function: nti CdcRet CDC_SetFiltMode (Sint32 filtno, Sint32 fmode) filtno fmode none : filter number : filter mode (insignificant 8 bits are effective) Returns the return code. Sets the filter mode for the filter. al 1) Filter mode bit 7 6 5 4 3 2 1 0 de 1 : Select file number (FN) 0 : not the same 1 : Select channel number (CN) 0 : not the same 1 : Select submode (SM) 0 : not the same nfi 1 : Select coding information (CI) 0 : not the same 1 : Reverse subheader conditions 0 : not the same reversal 1 : Select frame address range 0 : not the same 1 : Initialize filter conditions (return to intial values) 2) Co 0 : not the same initialization Reverse Subheader Conditions If subheader conditions are reversed, the output destination will be the opposite of what is normal for subheader conditions. In short, sectors that correspond to subheader conditions are output to false output connectors, and sectors that do not correspond to subheader conditions are output to true output connectors GA (conditions below.) • Output to true output connector: filter FAD range coincides and subheader conditions do not coincide. • Output to false output connector: filter FAD range does not coincide or subheader conditions coincide. 3) Initialing Filter Conditions When filter conditions are initialized, other bit selections are ignored and the SE initial values below are set. • Frame address range : Starting FAD = 0, FAD sector number = 0 • Subheader conditions : FN, CN, SMMSK, SMVAL, CIMSK, CIVAL are all 0 • Filter mode : All bits = 0 88 Title Function Function Name [S-] No. Function Get filter mode CDC_GetFiltMode 5.6 Specifications Format: Input: Output: Function value: Function: nti CdcRet CDC_GetFiltMode (Sint32 filtno, Sint32 *fmode) filtno : filter number fmode : filter mode (insignificant 8 bits are effective) Returns the return code. Gets the filter mode for the filter. al Filter mode bit 7 6 5 4 3 2 1 0 de 1 : Select file number (FN) 0 : not the same 1 : Select channel number (CN) 0 : not the same 1 : Select submode (SM) nfi 0 : not the same 1 : Select coding information (CI) 0 : not the same 1 : Reverse subheader conditions 0 : not the same reversal 1 : Select frame address range 0 : not the same Co GA SE System Library User's Guide 89 Title Function Function Name [SR] No. Function Specs Set filter connection destination CDC_SetFiltCon 5.7 Format: Input: nti CdcRet CDC_SetFiltCon (Sint32 filtno, Sint32 cflag, Sint32 bufno, Sint32 flnout) filtno cflag bufno flnout : filter number : filter connection flag (insignificant 8 bits are effective) : buffer partition no.of true output connector connection destination (CDC_NUL_SEL : disconnected) al : filter number of false output connector connection destination (CDC_NUL_SEL : disconnected) Output: none Function value: Returns the return code. Function: Sets the connection destination below for the filter. Connections are disconnected if CDC_NUL_SEL is specified. Filter Connection Flag bit 7 6 5 de • true output connector and buffer partition input connector • false output connector and other filter input connectors 4 3 2 1 0 filter fin true output connector → bn nfi True output connector set flag 0 : No change in connection conditions 1 : Change the same (connect/disconnect to buffer partition) Title ↓ flnout Co false output connector Function False output connector set flag 0 : No change in connection conditions 1 : Change the same (connect/disconnect to filter) Function Name [S-] No. Function Specs Get filter connection destination CDC_GetFiltCon 5.8 Format: CdcRet CDC_GetFiltCon (Sint32 filtno, Sint32 *bufno, Sint32 flnout) Input: Output: Function value: Function: GA filtno bufno flnout : filter number : buffer partition no. of true output connector connection destination (CDC_NUL_SEL : not connected) : filter number of false output connector connection destination (CDC_NUL_SEL : not connected) Returns the return code. Gets the filter connection destination. When not connected returns CDC_NUL_SEL. SE 90 Title Function Function Name [SR] No. Function Specs Resert selector (filter, partition) CDC_ResetSelector 5.9 Format: Input: Output: Function value: Function: CdcRet CDC_ResetSelector (Sint32 rflag, Sint32 bufno) rflag bufno none : buffer partition number Returns the return code. nti : reset flag (insignificant 8 bits are effective) al Initializes selector set conditions according to the reset flag value. •When reset flag = 0 : All specified buffer partition data is cleared •When reset flag ≠ 0 : Buffer partition number is ignored 1) Reset Flag bit 7 6 5 4 3 2 1 de 0 1 : Initializes data of all buffer partitions 0 : not the same initialization nfi 1 : Initializes all partition output connectors 0 : not the same initialization 1 : Initializes all filter conditions 0 : not the same initialization 1 : Initializes all filter input connectors Co 0 : not the same initialization 1 : Initializes true output connector of all filters 0 : not the same initialization 1 : Initializes false output connector of all filters 0 : not the same initialization 2) Initial Values The following initial values are set for all selectors by initialization. GA • Buffer partition data • Partition output connector • Filter conditions • Filter input connector • True output connector : All cleared (all data within the CD buffer is cleared) : Status: All unconnected : Similar to initialization by “set filter mode” : Status: All unconnected : buffer partition and same number companion filters are connected SE • False output connector : Status: All unconnected System Library User's Guide 91 8.2.6 Buffer Information Title Function Function Name [S-] No. Format: Input: Output: Function Specifications Get CD buffer size freesiz CDC_GetBufSiz CdcRet CDC_GetBufSiz (Sint32 *totalsiz, Sint32 *bufnum, Sint32 *freesiz) none totalsiz : total buffer size (sector units, 200 sectors = C8H) bufnum : total buffer partition number (24 partitions = 18H) : empty buffer size (sector units) ntial 6.1 Function value: Returns the return code. Function: Gets the Cd buffer total size and buffer partition number (both are fixed values), also the current space size. The selector number (or Remarks: Title Function de filter number) is equal to the total buffer partiton number. Even if the space size is 0, the buffer does not need to be full since there are sectors being used by the system. Function Get buffer partiton sector number Function Name CDC_GetSctNum [S-] No. 6.2 Format: Input: Output: Specifications Function value: nfi CdcRet CDC_GetSctNum (Sint32 bufno, Sint32 *snum) bufno snum : buffer partition number : sector number within buffer partition (buffer partition size) Returns the return code. Function: Co Gets current sector number (buffer partition size) of buffer partition. GA SE 92 Title Function Function Name [SR] No. Function Calculation of actual data size CDC_CalActSiz 6.3 Specifications Format: Input: nti CdcRet CDC_CalActSiz (Sint32 bufno, Sint32 spos, Sint32 snum) bufno spos snum : buffer partition number : sector postion (CDC_SPOS_END : shows the al partition’s last sector) : sector number (CDC_SNUM_END : shows the sector number from spos to the last partition) Output: none Function value: Returns the return code. Function: Calculates the actual data size (word number when fetched to host) of the buffer partition designated sector range, and holds that result. Remarks: Title de Executes the setting of the sector length to set the length of 1 sector. Connectors already connected to the partition output are disconnected. Executes “get actual data size” to get the calculation result of the actual data size. Function Function Name [S-] No. Function Specifications Format: Input: Output: Function value: nfi Get actual data size CDC_GetActSiz CdcRet CDC_GetActSiz (Sint32 *actwsiz) none actwsiz : actual data size (word units) Returns the return code. 6.4 Function: Title Function Specifications Format: Co Gets the actual data size (initial value of 0) held by the CD block. Function Get sector information Function Name CDC_GetSctInfo [S-] CdcRet CDC_GetSctInfo (Sint32 bufno, Sint32 spos, CdcSct *sct) No. 6.5 Input: bufno : buffer partition number spos : sector position (CDC_SPOS_END : shows the GA partition’s last sector) Output: sct : sector information Function value: Returns the return code. Function: Gets header information (FAD) and subheader information of buffer partition designated sectors. SE System Library User's Guide 93 Title Function Function Name [SR] No. Function Specs Execute frame address search CDC_ExeFadSearch 6.6 Format: Input: Output: Function value: nti CdcRet CDC_ExeFadSearch (Sint32 bufno, Sint32 spos, Sint32 fad) bufno spos fad none : : : buffer partition number sector position (CDC_SPOS_END : shows the partition’s last sector) frame address Returns the return code. al Function: Starting at the designated sector position in the buffer partition, with the frame address as the key, the sector is retrieved and the result retained. 1) Direction of retrieval de Retrieves in the direction of the buffer partition (from the smaller to larger sector position.) 2) Retrieval result Contents to be held as retrieval results include the buffer partition number, retrieved sector position, and the frame 3) Retrieval conditions nfi address of that sector. When a FAD that coincides does not exist, the nearest sector not exceeding the designated FAD is used. Therefore, retrieval resultant FAD is the greatest FAD that satisfies FAD≤ designated FAD. When there is no sector that satisfies this condi- tion or when retrieval can not be done because of an error, the Remarks: Co sector position of the retrieval results is CDC_SOPS_END. Connector that is already connected to the partition output is disconnected. The retrieval result executes to get the frame address retrieval result. Title Function Function Name [S-] No. Function Specs Get frame address search results CDC_GetFadSearch 6.7 GA Format: CdcRet CDC_GetFadSearch (Sint32 *bufno, Sint32 *spos, Sint32 *fad) Input: none Output: bufno : buffer partition number spos : sector position (CDC_SPOS_END : no applicable sector shown) fad : frame address Function value: Returns the return code. Function: Gets frame address search results (initial values all 0) held by the CD SE block. 94 8.2.7 Buffer Input/Output Each buffer input/output function (get sector data, delete, write, copy, move) in- cludes the connector connection process. In other words, by issuing 1 command, the Format: Title nti device and selector connections and flow in and out complex processes are done. Connectors connected to the partition output connector are disconnected. Function Specifications Function Set sector length al Function Name CDC_SetSctLen CdcRet CDC_SetSctLen (Sint32 getslen, Sint32 putslen) [SR] No. 7.1 Input: getslen : sector length when fetching putslen : sector length when writing Output: none Function value: Function: de Returns the return code. Sets the length of one sector in the next cases. • Gets sector data (CD buffer to host) • Writes sector data (host to CD buffer) Sector Length Constant Name CDC_SLEN_2048 CDC_SLEN_2336 CDC_SLEN_2340 CDC_SLEN_2352 nfi Description 2048 bytes (user data) ....... initial value when fetched, 2324 bytes if mode 2 form 2 2336 bytes (up to subheader) 2340 bytes (up to header) Co 2352 bytes (entire sector) CDC_SLEN_NOCHG No change Remarks: The set “sector length when fetching” is also reflected in “Calculation of actual data size.” GA SE System Library User's Guide 95 Title Function Function Name [SR] No. Function Specs Get sector data CDC_GetSctData 7.2 Format: Input: Output: nti CdcRet CDC_GetSctData (Sint32 bufno, Sint32 spos, Sint 32 snum) bufno : spos : snum : none buffer partition number sector position (CDC_SPOS_END : shows the partition’s last sector) al sector number (CDC_SNUM_END : shows the sector number from spos to the last partition) Function value: Returns the return code. Function: Gets sector data from the designated sector range of the buffer partition. Remarks: After executing the function, data must be transferred and fetched. Input: Title Function Function Specs Delete sector data Format: spos : deFunction Name CDC_DelSctData CdcRet CDC_DelSctData (Sint32 bufno, Sint32 spos, Sint 32 snum) bufno : buffer partition number sector position (CDC_SPOS_END : shows the partition’s last sector) [SR] No. 7.3 Output: Function value: Function: Remarks: snum : none nfi sector number (CDC_SNUM_END : shows the sector number from spos to the last partition) Returns the return code. Deletes sector data of the designated sector range of the buffer partition. Sector positions after data is deleted advance in order. Input: Title Function Specs Get and delete sector data Format: Function Co Function Name CDC_GetdelSctData [SR] No. 7.4 CdcRet CDC_GetdelSctData (Sint32 bufno, Sint32 spos, Sint 32 snum) bufno spos : : buffer partition number sector position (CDC_SPOS_END : shows the partition’s last sector) snum : sector number (CDC_SNUM_END : shows the GA sector number from spos to the last partition) Output: none Function value: Returns the return code. Function: Gets data from the designaed sector range of the buffer partition. Sector data of the designated sector range is deleted from the buffer partition. Remarks: After the function is executed, data must be transferred and fetched. Even if all data is transferred without being fetched, all data of the SE designated sector range is deleted. 96 Title Function Function Name [S- ] No. Function Specs Write sector data CDC_PutSctData 7.5 Format: Input: Output: Function value: Function: Remarks: nti CdcRet CDC_PutSctData (Sint32 filtno, Sint32 snum) filtno : snum : none filter number sector number Returns the return code. al Writes sector data to the designated filter. Data must be transferred and written after the function is executed. Data of the designated sector number is written even if data transfer is interrupted. Values except for transferred data are not fixed. Title Function Specs Copy sector data Format: Input: Function de Function Name CDC_CopySctData [SR] No. 7.6 CdcRet CDC_CopySctData (Sint32 srcbn, Sint32 spos, Sint32 snum, Sint32 dstfln) srcbn spos : : copy source buffer partition number sector postion (CDC_SPOS_END : shows the partition’s last sector) Output: Function value: Function: snum dstfln : none : nfi sector number (CDC_SNUM_END : shows the sector number from spos to the last partition) copy destination filter number Returns the return code. Copies sector data from designated sector range of the buffer Title Copartition. (Copies in between selectors.) Function Function Specs Move sector data Format: Input: spos : Function Name CDC_MoveSctData CdcRet CDC_MoveSctData (Sint32 srcbn, Sint32 spos, Sint32 snum, Sint32 dstfln) srcbn : move source buffer partition number sector postion (CDC_SPOS_END : shows the [SR] No. 7.7 partition’s last sector) snum : sector number (CDC_SNUM_END : shows the GA Output: Function value: Function: dstfln : none sector number from spos to the last partition) copy destination filter number Returns the return code. Moves sector data from designated sector range of the buffer partition. (Moves in between selectors.) SE System Library User's Guide 97 Title Function Function Name [SR] No. Function Get sector data copy/move error CDC_GetCopyErr 7.8 Specifications Format: Input: Output: Function value: Function: CdcRet CDC_GetCopyErr (Sint32 *cpyerr) none cpyerr : copy/move error information Returns the return code. Gets sector data copy/move error information. ntial Copy/Move Error Information Constant Name Description CDC_COPY_OK Normal end ...... initial value CDC_COPY_NG CDC_COPY_BUSY de Error is caused • Selector is disconnected during copy/move • No more space in buffer Copy/Move process is in progress nfi Co GA SE 98 8.2.8 CD Block File System Title Function Function Name [SR] No. nti Function Change directory CDC_ChgDir 8.1 Specifications Format: CdcRet CDC_ChgDir (Sint32 filtno, Sint32 fid) Input: Output: Function value: Function: filtno fid none : : filter number al file identifier of the directory file (CDC_NUL_FID : root directory) Returns the return code. Moves the current directory to the directory shown by the designated file identifier. Moves to the root directory if CDC_NUL_FID is specified in the file identifier. Remarks: the file identifier. de When moved, it reads directory record, and retains a maximum of 254 files worth of data from the start (256 files if including parent and own). Returns REJECT when directory is not designated by The CD block file system uses the selector in the operation. The operation selector designates through the filter number. Title Function Specifications Format: Function nfi Hold file information Function Name CDC_ReadDir CdcRet CDC_ReadDir (Sint32 filtno, Sint32 fid) [SR] No. 8.2 Input: Output: Function value: Function: Cofiltno : filter number fid none : file identifier Returns the return code. Reads the directory record of the current directory and holds up to 254 pieces of file information after the designated file identifier (own and parent are always retained). Remarks: The CD block file system uses the selector in the operation. The operation selector designates through the filter number. GA SE Title Function Function Name [S-] No. Function Get holding file information range CDC_GetFileScope 8.3 nti Specifications Format: CdcRet CDC_GetFileScope (Sint32 *fid, Sint32 *infnum) Input: none Output: Function value: Function: Remarks: fid : first file identifier being held infnum : number of file information being held Returns the return code. al Returns the file information range held by the current CD block. Since the self and parent directories are always held, they are not included in the file information number. Title Function Function Name [S-] No. Function Specifications Format: Input: Get holding file information CdcRet CDC_TgetFileInfo fid deCDC_TgetFileInfo (Sint32 fid, CdcFile *file) : file identifier (CDC_NUL_FID : shows entire file information) 8.4 Output: Function value: Function: Example: file : file information Returns the return code. nfi Obtains file information (12 bytes) of the indicated file identifier. Obtains all file information (up to 254 pieces) held in the CD block if CDC_NUL_FID is designated in the file identifier. CdcFile file; /* Reserves information storage area of 1 file*/ Title Function Co ret = CDC_TgetFileInfo (fid, &file) ; CdcFile file[256]; /* Reserves information storage area of all files */ ret = CDC_TgetFileInfo (CDC_NUL_FID, file) ; Function Read file Function Name CDC_ReadFile [SR] No. 8.5 Specifications GA Format: CdcRet CDC_ReadFile (Sint32 filtno, Sint32 fid, Sint32 offset) Input: filtno : filter number fid : file identifier offset : logical offset from first of file (sector units) Output: none Function value: Returns the return code. Function: Reads the designated file. The read destination selector is designated by the filter number. SE Title Function Function Name [SR] No. Function Stop file access CDC_AbortFile 8.6 Specifications Format: Input: Output: Function value: Function: CdcRet CDC_AbortFile none none Returns the return code. (void) ntial Stops file access by each function (directory move, file information hold, and file read) of the CD block file system. Pauses the CD drive, and the EFLS flag of the interrupt factor register becomes 1. Remarks: Even if file access is stopped, the buffer partition is not cleared and the selector is not initialized. File information being held is de destroyed if directory-move and file-information-hold are stopped. File access is also stopped when the tray is opened. nfi Co GA SE 8.2.9 Register Access Title Function Function Name [ -- ] No. nti Function Specs Get data transfer register pointer CDC_GetDataPtr 9.1 Format: Uint16 *CDC_GetDataPtr (void) Input: none Output: Function value: Function: Title Function none Register pointer al Gets the data transfer register (DATATRNS) pointer. Function Specs Get interrupt factor register value Function Name CDC_GetHirqReq [ -- ] No. 9.2 Format: Input: Output: Function value: Function: Title Function Uint16 CDC_GetHirqReq (void) none none Register value de Gets the interrupt factor register (HIRQREQ) value. Function Name [ -- ] No. Function Specs Clear interrupt factor register Format: Input: Output: Function value: nfi void CDC_ClrHirqReq (Uint16 bitpat) CDC_ClrHirqReq 9.3 bitpat : cleared bit pattern (bit to clear is 0, other bits are 1) none none Function: Remarks: Title Function Co Clears the interrupt factor by the designated bit pattern. (Only 0 is written.) Since the CD communication interface uses the interrupt factor register CMOK flag, clearing by the application program is prohibited. Function Name [ -- ] No. Function Specs Get interrupt mask register value CDC_GetHirqMsk 9.4 GA Format: Uint 16 CDC_GetHirqMsk (void) Input: none Output: none Function value: register value Function: Gets the interrupt mask register (HIRQMSK) value. SE Title Function Function Name [ -- ] No. Function Set interrupt mask register CDC_SetHirqMsk 9.5 Specifications Format: Input: Output: Function value: Function: nti void CDC_SetHirqMsk (Uint 16 bitpat) bitpat : mask bit pattern (bit to mask is 0, other bits are 1) none none al Masks interrupt factor by designated bit pattern. Title Function Function Name [ -- ] No. Function Specifications Format: Input: Output: Function value: Get MPEG register pointer de Uint 16 *CDC_GetMpegPtr (void) none none register pointer CDC_GetMpegPtr 9.6 Function: nfi Gets MPEG register (MPEGRGB) pointer. Co GA SE