June 7, 1995 Version 2.4 Confidential Information Property of Atari Corporation Jaguar Software Reference Manual - Version 2.4 Pagei INtrOGUctiOn ............ccccccsccccecceccccssccccceccoceccccecsusececcssecececcseecanserecececececeepenseescensestsesses 1 What is Jaguar? ....0..eccece cc ce cee cteeeseeeeeeeens caeecceveeeeeetacerseereseeees How is Jaguar used? oo... eee cece ee ceeeeeeeeesececsesssecseessesseenerenegisiboeeecenees Jaguar Video and Object Processor... ee cess eseeteceeseeesselibebesseeesreeeeeenes OVELVICW 20. eeccecccesccsceeceeceenceneecetececeensecatesuesicescenseassaseseesseaeensoraes HUicissesecceeeseee Object Processor Performance .........cccceseecscsseessesssreesesecereeneesaeenes Memory controller ....... cee cess csseeeeeseessessssesstessssasessseestenneenneenees i Microprocessor Interface .........::c:cccssessesseeseeseseereeneees Memory Map qu... ce eset cececeeseeeneeteseneenaseteeneeneeeeees Peripheral Memory Map...u.....c.ccecssseseecnneeeeseeteeneeaeees Object definitions ...... eee cece eeeeeeeeeeeeeeeneees Description of Object Processor/P:xel path Refresh Mechanism Colour Mapping..............c:ccceeseeceeeees Introduction... cece sete seeeceeteeeees The CRY Colour Scheme ............... Graphics Processor Subsystem........... Memory Map .......eccseesseseseseeseteeeseeeees Graphics Processor .........:.::000++ What is the Graphics Processor? eiiisi.e eee cece EEE eee eee EEEE ec teeeeeeeeees 33 Programming the Graphies:Processor 228i... UO eee 33 Design Philosophy .........425b.....e cc ceeeee TEE SSE ease cseeceeeeesseseceesteeneneeaeeneenseaeenens 34 Pipe-Lining 2. eee Eg eiglag eeeeee ee TUE esc cece scenceeeneneseensesanenseeees 34 Memory Interface .............. UEP. EE cs eeceee cece Bees ecececeeeeeeeeneeteneceseneeeenenes 36 Load and Store Operations eveeeaeeececeesneeesasesensceeeseesens ceescaseeetecsseseteeseerens OG Arithmetic FutiGtions 00.0... ccccccccccecccescesesceecsecesseeeeeeenisdhdbveceseccesceeseeceaeceeneneeeseeneeees 38 Interrupts...... secesenseeeeseeuee Ec easesessseaseaceaceassaceessessecseees OO Program ControE BiG Wiis... eee cece cence dU Ds sees cesseenceeeacseneeeetenenseneneeseees 40 Multiply and A mulat TOTS ooo. eeeeeeeecesessceeeceenecssseseessscnnseessrsassecssssssonaeaes 42 Systolic Matrix Triplies SEE Bsa oeccecescescecseceeceneecaesseseseneserensesseseenenteseseseseteetees 43 Divide Unit .......ccccccccccscecceeeeeeee OES en cesceccesseneeseeserseneesaeeceeseeeessessteeetneneaeseesenees 43 Blitter ...2283e. eee a oeeereeenececresenstnsssarecssersantnscsecassessegscssersrceresnrescneseneetes 49 esceseresceecseseeseseseacessesesesesseseeseceseseesesereeeseseseeseneees 49 seveeceseeceecsssssscsesecssesesecesseeeseaeseeseaeseenseenssseseeereeseets 49 Address Genéta peceeeesecaaeaessesceeeeeecsesecsesseeenseeesssaessssseaeaneneesessseeeeteses 50 Data Path............ esceeseceeraseaeelenecscseeacssacsescseeeseesesceaassaneesseasaesasenenesenseens 52 | ”) Bus Interface .......ceccscecseceesessesscsessesecseeesscsescersssseneeesucscesscsucaesssovsseneesenesseseeseeeeaeenaes 54 Register Description... eecceeeeee ccc ceeecceenseeesesesenenecsessiesesenseasseeeesesecsesesscsenenseeegsaee 55 Address Registers .........ccccccseesceceescesseessacescaseesnesessesnseneesessenstaseassesseseenensseresaseaered 55 Control Registers 00.0... .ceccecceseseeseeeeeceeseseeesscseeeesceneeseseeessesseseeeseaesresseeseeeeeeneeseeee 59 Data Registers .0........:cccceccsesccsssesececeeccecsesseseesenseeceesscessessaseeenececeseseeseeseeereesseseenenee 62 Modes of Operation .........c.csccscsessecessesseseeseteesenenteseseeseeesessssaneeeeeseessesseneceessrecseeeeer en 64 © 1992-95 Atari Corp. Confidential Information TR Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Appendices .........:eessceeeeeees cacceccccuccncccccenccccsscscssvsscsssccsenssassessssnsunsossessecacasarssrer sees serse ees sees eee Sees eee ee Ce eee ee Frequency dividers .......sssssssscecsssseecsssessnsecenenenesetsenn ett tt ee ese Programmable Timers ....-.sscossssssesssesssssssseeseecesnessecennannnsnasseensnenssessesegte eget e 8 [rte rrupts ..ecscsseecsssecssssesvescesssscecnncseneecssnecccanacenasenenssensnseensseeenssneeseseeeses ees ne ees e804 ee Synchronous Serial Interface.........-sssssssseessrescserecers terest sees Asynchronous Serial Interface (ComLynx and Midi) Joystick Interface .....-..-seccsessessescesessrecterteaeneceentesnnnnnen terete attsts General Purpose IO Decodes.........-sesssesserserssreesesstesestenenantertensnniss sececcccccdccacccscccsnecsccsccncsscscccssssassssssvessensascccsreseesssesese seen reel eee ee ee [ntroductiOn .........:csscsececescesseecececsesceseneteserssesenensarsseenesacsseneesseneneesegs Programming the DSP ..........--.:ssssscssesreessssssteesssensenneenneessetsnestsseses Design Philosophy ........----.:-::-ssssesseeeressresserteestentenensess Pipe-Lining .......-.eceeceecseseeceeceeecesereereeseeesessesenannenees ess Memory Map.......cs-cccesecscesececeeseesseeneeneencerencenenssasensenseses Load and Store Operations ........s:essescsecseseesssceseeenereesereen een EHTRA THEA Rtiggeceeereneceeseeees Arithmetic Functions ........-...eccsessesseeceeeesssssaeereerenensseetens BE eeeeesdiasaieligeeseeeeeners [Nterrupts .......-seececseceseceeceneseessneesesssssenennatenscacensensacennentnnsstsersstestes tees Program Control FIOW .......::-sescsescssseceeerserennanapminancenterenseeeesetesressennsetes Circular Buffer Managementl.............2.2+++.S RDS bhar sees ceeeeeeeeeetenececeetercees Extended Precision Multiply / Accumuldtes'...........--/S2is auditors seecrereerereseseeereeeerees Divide Unit ....0....cceccceceeeecceeeneeeesseeeereesdbbeditereererenseressens pgateeceecnececsessasenses Register File .......sscccccccscsstsesceeeessseseesseeeththitiigceeeessceeetaneansceeeceet BREE Rypeceeeeereeese External CPU ACCESS ....sccesesesseeeseseresees Internal Registers ..........-cssecsessecesnsgueseseseseeeeeeetebbnniinee eeeneesereecseceseerHEtigizerseeeeeaeees RISC Instruction Set........ ee HEHE accesses oR ee Writing Fast GPU and DS Programs secenesceseesees Data Organisation - Big and: Little Endia © 1992-95 Atari Corp. Confidential Information TR Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page I This document is the Jaguar Software Reference Manual - it is a definitive referer ce work for the programmer's view of the Jaguar ASICs. It is neither a hardware reference w ide to a particular implementation of the Jaguar design. Jaguar is a custom chip set primarily intended to be the heart of a very high-perf computer. It may also be used as a graphics accelerator in moré lex systems, arid'4 and business uses. As well as a general purpose CPU, Jaguar contains four processit — Object Processor The Object Processor is responsible for g of commands - the object list - and gene¢' Objects may be bit maps in a range of may be performed within the object lis — Graphics Processor The Graphics Processor is generation. It has its own | operations. — Blitter ipidly move and fill graphical objects in The Blitter is closely coupled ‘to the GPU, and is able’ shading at very high speed. memory. It includes hardware support for Z-buffering —_— Digital Sound Processor is similar to the ip ics Processor, but is intended primarily for ing back sampled sound. It may also be used for general processing th to external memory devices, and is capable of a very high © 1992-95 Atari Corp. Confidential Information FOR Property of Atari Corporation June 7, 1995 Page 2 Jaguar Software Reference Manual - Version 2.4 Jaguar contains two custom chips, code-named Tom and Jerry. For graphics, Tom contains the Object Processor, the Blitter and the Graphics Processor. For sound, Jerry holds the Digital Sound Processor. In addition to these, there is an external CPU currently é a 68000. When animating graphics there are therefore four processing elements, and they ha: The CPU is used as a manager. It deals with communications with the outs for the other processors. It is the highest level in the control flow of a Jagu control of the systems basis of the commands there assembles each display line of the yideo picture Obie pixels, and these may overlap and may be easily moved from fraie€:tt processed in the object list determines how they overlap. Object Aisplay | line being assembled, and can scale bit-maps. They may graphics tool in its own tight. The Graphics Processor and Blitter provide a ti range of animation effects. A design goal of thi displayed by the Object’ kilobytes of fastigteesal RAM, which is used for local program and internal timers, interrupts and audio output to allow fast, The Digital Signal Proce data space. It is tightly c: independent access. © 1992-95 Atari Corp. Confidential Information FR Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 3 The Jaguar video section has been designed to drive a PAL/NTSC TV. H approach to the design the chip can be used with a range of display standa This will allow the chip to become the backbone of many ( possibly unfore Two colour resolutions are supported, 24-bit and 16-bit. The 24-bit mode is useftii true colour. The 16-bit mode is designed for animation. It consiigites less memory, fits} memory, and in the case of CRY (Cyan, Red, Intensity), is simp from 24-bit mode. Jaguar decouples the pixel frequency from the system clock by‘4is clock does not have to be related to the colour carrier frequency and may be u are actually two line buffers one is displayed while. eideher.j buffer is a 360 x 32-bit RAM. The line buffer conta Ws ixels these may be either: pixels. The line buffers may be swapped over Sti iddte of display lines. sted by gen-locking. There ¥ocessor. Each line In CRY, pixels at the output of the line buffer af; ; 9 pixels using a combination of look-up tables and small multipliers. The video timing is completely prog sé:and sprite based architectures. sZaled bit-map objects, branch It can interrupt the graphics processor to perform ‘will support perspective, rotation, branches, Jaguar uses an Object Processor, Jaguar's Object Processor is simpl objects for controlling its control | more complex operations on its belt palette loads, etc. ixels per clock cycie. The source data can be rent colour resolutions can be mixed. The a 16-bit physical colour. The Object Processor east:write into the line buffer at up to tw 1,2,4,8,16 or 24 bits pe is that it can modity the existing contents of the line buffer with *e shadows, mist or smoke, coloured glass or say the effect of a A sophistication in the 4¥bject Proce another image. This could be used to room illumi flash lamp. o ignore data which'is stored alongside pixei data. If, for instance, a Z buffer is éd next to the pixels. This helps because DRAM RAS pre-charges are needed © 1992-95 Atari Corp. Confidential Information FER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual! - Version 2.4 Page 4 Each object is described by an object header which is two phrases for an unscaled object and three phrases for a scaled object. When an image has been processed the modified header is written back to memory. The Object Processor fetches one phrase (64 bits} of video data at a time. This phrase.is expanded into pixels (and written imo the line buffer) while the next phrase is fetched. tmage data consists of a whole number of phrases. The image data may need pixels (colour zero in 1.2,4,8 & 16-bit modes). The Object Processor writes into the line buffer at one write per system cloc and for scaled objects one pixel is written per cycle. For unscaled objects with pixels are written per cycle. Most objects will therefore be expat If the read-modify-write flag is set in the object header the object’ line buffer. In this case the data rate into the line buffer is halved. This peak rate may be reduced if the memory bandwidth is not higt is installed then these data rates will be sustained for all modes. re is an overhead of between three and vi#l_occur infrequently during object e object header (because the cles will also occur after is in an area of memory with irocessing has completed. seven clock cycles (depending on DRAM spee data fetches but will typically occur during the fir ta read after readif er in memory). Jaguar's memory controller is very fast‘and flexibie. It hides thé parts of the system. mory width, speed and type from the other Memory is grouped into have the same width and s; chip selects RAS & CAS all look 64 bits wide. :that may be of differe®t.width ‘Bach bank is enable ds and iypes (although both ROM banks 1ep sclect. In the case of DRAM there are two ‘There are eigh d[O-15},d{ i it is cheap and fast when used in fast page mode. In fast page mode ir, The row time access is programmable. The column access time is ticks). The memory controfle es ona cycle by cycle basis whether the next cycle can be a fast page mode cycle. Data and algorithms should be organised to minimise the number of page changes. The page size is 2 kbytes. There are four memory banks; two of ROM and two of DRAM. © 1992-95 Atari Corp. Confidential Information PR Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 JAGUAR has been designed to work with any 16 or 32-bit microprocessor with (up to) 24 address lines. The interface is based on the 68000 but most microprocessors can be attached by using a PAL to synthesize those control signals which differ. All peripherals are memory mapped; there is no sep 1/O space. The width of the microprocessor is determined during reset by a pull-up / pi address of the cold boot code/vector is accommodated by making the boo the memory configuration is set up by the microprocessor. The microprocessor interface is generally asynchronous so the clock speeds 2 microprocessor # processors may be independent. Jerry uses the same microprocessor interface. The CPU normally has the lowest bus priority but under interrupt ity is increased. The following list gives the priorities ot all bus masters. Highest priority Higher priority daisy-chained bus master Refresh DSP at DMA priority GPU at DMA priority Blitter at high priority Object Processor DSP at normal priority CPU under interrupt GPU at normal priority Blitter at normal priority . CPU Lowest priority Poh tO TN — © 1992-95 Atari Corp. Confidential Information “JER Property of Atari Corporation June 7, 1995 Page o Jaguar Software Reference Manual - Version 2.4 Jaguar's memory map depends on how it is being used. Following reset th 16 Mbyte address space until memory is configured by the microprocessor by writing t allows the system to boot whether the microprocessor is a 680X0, an 80X86 configuration, this map corresponds to the area defined as ROMO on the m TPPPEP LEPEEE Bootstrap ROM 120000 Jerry DSP 218006 Joysticks and GPIOO-5 114000 Pi0 Jerry 21090CC Internal istex r00c00 LRegtSte** Bootstrap ROM 0060000 When the memory configuration is s¢ memory configuration register. r FE FREFFFE ROMO Bootstrac ROM r ister zoo000 f_and registers ROM1 Cartridge 800000 DRAM?i Dynamic RAM 400000 000000: ROMO is the shown above. A 68000 system will nat document. If the system is ope rather than F. ROK € Mpytes 4 Mpytes c00C00 s:selected di ynamic RAM ROM? Cartridge RCM ROMO Bootstrap ROM and registers ROMHI=0 e following 2 Mbyte window, corresponding to the ROMO area, is repeated throughout the o MEMCON1. (This .) After nding on bit ROMHI of the 6 Moy tes 4 Mbytes Mbytes Mbytes mal (ASIC) memory and peripherals occupy 128 Kbytes of this space, as ROM. DRAMO and DRAMI are the two banks of DRAM. ie’ with RAM at 0, so the ROMHI = 1 map is assumed throughout this rated with ROMHI = 0 then the first digit of all internal addresses should be } © 1992-95 Atari Corp. Confidential Information TER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 7 Internal Memory is mostly 16 bits wide to allow operation with 16-bit microprocessors. 32-bit write cycles are allowed to some areas of internal memory notably the line buffer and the graphics processor memory. The line buffer support 32-bit writes primarily in order t e Blitter writes to the line buffer. The graphics processor supports 32-bit writes to accelerate pro Description When set the two Rt 16M window. When 8M. This document discussing register adresses 1-2 ROMWIDTH Specifies the width of ROM: 0 8S bits 3-4 ROMSPEED RAM Speed. The page mode cycle time is always ese bits determine RAS related timing as arge RAS to CAS Refresh dl YU xe times are clock cycles. 2 ROM cycle time to two clock cycles. This is for test purposes only. Set to zero. Zs q Specifies the speed of external peripherals. The number of cycles : here is the overall cycle time, the control strobes are active for two cycles less than this. 0 18 clock cycles 1 10 clock cycles 2 4clock cycles + 3 6 clock cycles rth} Go Ua] / W 13 unused Set to zero. 14 CPU32 Indicates that the microprocessor is 32 bits. _ q 15 unused Set to zero. © 1992-95 Atari Corp. Confidential Information TER Property of Atari Corporation June 7, 1995 Page 8 Jaguar Software Reference Manual - Version 2.4 All the ROMSPEED bits are set to zero on reset. ROMHI, ROMWIDTH and CPU32 are determined by external pull-up / pull-down resistors. All the other bits are undefined. ROMO repeats every 2 Mbytes until this register is written to. Description Specifies number of columns 0 256 1 $12 2 1024 3 2048 2-3 DWIDTHO Specifies the width of 1 0 8S bits 1 16 bits 2 32 bits | 3 4-5 COLS} S lumns in DRAM] 0 1 2 3 6-7 DWIDTH1 $ 64 ts 8-11 REFRATE Specifies the refresH frequency of CLK / require a refresh frequency of 64 KHz. Refresh cycles occur at the end of obj processing. If REFRATE is zero refresh is disabled. 12 Specifies that'big-éndian addressing should be used. This «| determines the address of a byte within a phrase and allows Jaguar -be used comfortably with Big-endian (Motorola) processors or ittle-endian (Intel) processors. Specifigs:that image data should be displayed from high order bits i to low order. All the above bits are undefine set except BIGEND which is determined by external pull-up / pull-down resistors. This register comprises of a ten bit counter which counts from zero up to the value in the horizontal period register twice per video line. An eleventh bit determines which half of the display is being generated. The counter is incremented by the pixel clock. The vertical counter is incremented every half line in order to support interlaced displays. This register is only for ASIC test purposes. © 1992-95 Atari Corp. Confidential Information 7@® Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 9 ero up to the value in the vertical period twelfth bit determines which field (odd/even) is being generated. The counter is do beam synchronous operations. It is only written to This register comprises of an eleven bit counter which counts from Z register once per field. A incremented every half line. This register can be read to for ASIC test purposes. This read only eleven bit register gives the horizontal position in pixels of the:3: The low eleven bits of this register gives the vertical position of the! These four registers allow the graphics process {ké graphics processor object to pass parameters to the GPU phrase boundary so the of this address are replaced by bottom three bits are always zero the LINK data in the object. The Processor could interrupt the 68000 used to change OLP. Use the GPUs ESS ‘ranch instruction. If set the branch is taken, if bject. This flag 1s intended as a mechanism for letting the graphics gram flow. A write (of anything) to this register restarts the Object ect. Bit zero of this register ¢ clear execution continués:¥ processor control the Object Proce Processor after a Graphics Processor inte Description When set enables time-base generator. T to zero in a Jaguar Console. Determines how the line buffer contents are translated into his should never be set physical pixels. © 1992-95 Atari Corp. Confidential Information PER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 16-bit CRY. Each 32-bit entry in the line buffer is treated as two 16-bit CRY pixels on successive clock cycles. Each is converted into eight bits of red, green, & blue using a combination of lookup tables and multipliers. CRY16 pixels are arranged as follows: CRY 16 (0) B15 Bit 0 : The least-signifigant bit is norm signifigant bit of intensity. If V cleared to indicate a CRY16 pixel RGB24 (1) of green and eight bits follows: DIRECT16 (2) 20 clock. This mode is for xcess of the video clock. It p.In this fiking and video active are least significant bits of blue. 16-bDiERGB. Each’ 32-bit entry in the line buffer is treated as two RGB16 (3) : Ed 16-bit RGB pixels. 16 pixels are arranged as follows: | Bats .:. LE FOO OHEE Eee e least-signifigant bit is normally interpreted as the least- Hifigant bit of green. If VARMOD is also set, this bit will be idicate a RGB16 pixel and only the top five bits will be used té:determine the level of green. When set this bit enables digital genlocking. This means that external syncs will reset the internal time-base generators. On its own this mechanism does not give satisfactory genlocking because there is jitter. However this mechanism is used to quickly lock onto a new video source. An external Phase Locked Loop 1S required for true genlocking. Not supported in Jaguar Console. Enables encrustation. When set, the least significant bit of thel6 ! bit data is used to switch between local and external video sources j using an external video multiplexer. This allows the video source | ( to be switcfied on a pixel by pixel basis. / Selects the local border colour if encrustation is enabled. H CSYNC Enables composite sync on the vertical sync output. 7 t © 1992-95 Atari Corp. Confidential Information ‘FER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 11 7 BGEN Clears the line buffer to the colour in the background register after displaying the contents. This only has effect in CRY and RGB16 | modes. | & ' VARMOD Enables variable colour resolution mode. When this bit is set the least significant bit of each word in the line buffer is used to determine the colour coding scheme.of-the. other 15 bits. If the bit is clear the bits the word is treat pixel. If the bit is set | | then bits [1-5] are green, bits ve Bits 111-15} are | red. This mechanism allows J B window | 9-11 PWIDTH1-8 | | video clock and not ‘ | The display width sh be an integer nutnber' of pixels, | rr i.e. an integer multip width programmed here. | j Unused ? Write zeroes. | primary colour. Red is the less s of the screen and blanking. It e-base registers. These registers determine the physical border co significant byte of BORD1. This colour is display: is not necessary to display a border. T T area 18% This ten bit register determines the period of half a display lin longer than the value written into this register. This eleven bit-register determines the sta tarts in the second half Gf theine. This eleven bit register determines the width of the horizontal sync and equalization pulses. The pulses start when the horizontal count equals the value in the register. The pulses end when the horizontal count equals © 1992-95 Atari Corp. Confidential Information FER Property of Atari Corporation June 7, 1995 Page 12 Jaguar Software Reference Manual - Version 2.4 the horizontal period. The most significant bit is usually set because horizontal sync happens at the end of the line. The most significant bit is ignored in the generation of equalization pulses which are the same width as horizontal sync but which appear twice per line (for 10 half lines during field blanking). This ten bit register determines the end position of the vertical sync pulses. : sync pulses for several half lines. These pulses are generated twice per line: time as the horizontal sync or equalization pulses but end when the least sign count match the HVS register. The Object Processor can run twice per line ino odes where the amount of data on a display line is greater than can be contained in o férs are each 360 words x 32 bits. If the display mode was 720 x 24 bits per pixel the i splayed at the start of the line while buffer B was being written. Then during the sé¢ buffer B would be displayed while line buffer A was prepared for the ina value corresponding to This eleven bit register displayed after the horizo The relative positions of following diagram. play line "TUT TTTTTTTTT * © 1992-95 Atari Corp. Confidential Information TER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 13 This eleven bit register determines the number of half lines per field. The number is one more than the value written into this register. If the number of half lines is odd then the display is interlaced. This eleven bit register specifies the half line on which vertical blanking begins This eleven bit register specifies the half line on which vertical 4 This eleven bit register specifies the half line o ,. Vertical sync pulses are generated from this line to the line specified by thé: This eleven bit register specifies t! every line until the half line specifies these active lines. This eleven bit register Bee i€S'4] Console, this register shéuld be sét: This eleve it register specifiés'thé.half line on which equalization pulses start. wv This eleven bit register specifies the half line on which equalization pulses end. © 1992-95 Atari Corp. Confidential Information FOR Property of Atari Corporation June 7, 1995 Page 14 ; Jaguar Software Reference Manual - Version 2.4 This eleven bit register specifies the half line on which the VI interrupt is generated. This must be odd if the display is non-interlaced. This interrupt will occur once per frame when interlaced, that is every other field. operate as a pair controlling the interrupts. The system clock is divided by (one plus the value in the first register). If the F timer is disabled. The resulting frequency is divided by (one plus the value int output of this divider generates the interrupt. This register enables, identifies and The interrupts sources are as follow by the video time-base, on the line C_VIDENA This interrupt is generated by the graphics processor writing to an | C_GPUENA | 1 | ternal register. | } ! 4 | interrupt is generated by stop objects. smterrupt is generated by the PIT. This interrupt is generated by an input to Tom and is intended for use by Jerry. This is an active high edge-triggered interrupt - the first interrupt will occur on the first rising edge after it has been enabled. When set, this bit clears pending video time-base interrupts. : When set, this bit clears pending GPU interrupts. C_OPENA C_GPUCLR C_OPCLR When set, this bit clears pending Object Processor stop object interrupts. C_PITCLR | 11 Timer When set, this bit clears pending PIT interrupts C_JERCLR | 12 Jerry When set, this bit clears pending Jerry interrupts. © 1992-95 Atari Corp. Confidential Information FER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 15 is set the graphics processor interrupt is enabled. Bits 0 to 4 enable the individual interrupt sources, i.e. if bit 1 i.e. if bit 3 is set there is an timer interrupt When read bits 0 to 4 indicate which interrupts are pending, pending. Bits 8 to 12 clear pending interrupts from the corresponding interrupt source. Note that INT2 must always be written to at the end of a CPU interrupt service routine. When an interrupt is applied to the CPU the bus priorities of the graphics that the CPU can service real time interrupts promptly. The bus priorities 43 this register. This should therefore always be done at the end of an interrup this port the Blitter or GPU may then restart, and no further instructions will then: next interrupt occurs, or the GPU or Blitter operation complete The colour look-up table translates an eight bit colour index into a 16-bit phys comes from the object data, which may be 1,2.4 or. &:its:Jn order to achieve a high tables allowing two pixels at a time to be written: : suffer. There are 256 1 EE table. Locations in the range F00400-SFE read: s in the range FQ0600-7FE read from table B. Writing to either range writes to both ti when an object with the ‘Release’ bit is part 6 ‘pit RAM. Each 32-bit long-word can be i a CRY pixel; the less significant byte 8 é left-most pixel. In 24-bit RGB mode each at the lower address is the red value. The ‘byte of the word at the high address is the There are two line buffers each of witch consisi read/written as two 16-bit words. In 16-bit CRY mode each the intensity. The wordyyith the lowest address corresponds t 32-bit long-word is a pixel: The less significant by. : more significant byte i -value and the les blue value. The fourth A. The second addresses line buffer B. The third addresses the st two address ranges are for test purposes the third is for the The first address range addresses line tly selected for writing. Jerry and external per ipy the 64k above the internal memory. All Peripheral Memory is 16 bits wide although it is likely that many devices will have eight bit buses. © 1992-95 Atari Corp. Confidential Information TER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 There are five basic object types This object displays an unscaled bit mapped object. The object must be on a First Phrase Field Description display is interlaced the numb: lines. If the display is non-intétlaced the nubs: opiec’ will be active while the vertical counter’ js always even. The OS and HEIGHT > 14-23 | HEIGHT 24-42 | LINK xt object: E FH 4875 an object to link to another bytes. 43-63 | DATA a ta can be found. Like LINK this is a phrase fine bits 3 to 23 of the data address. This d anywhere in memory. After a line is is written back to the object. addréss. These twenty- -one 5 allows object data to be posit displayed the new,data add é Second Phrase Bits Field iption es the X position of the first pixel to be plotted. This 12 bit field vasitions in the range -2048 to +2047. Address 0 refers to the left-most pixt This defines the number of bits per pixel as follows: 12-14 Value Bits per Pixel Type Video Modes Allowed In 1 bit/pixel CLUT CRY16, RGB16, & DIRECT 16 2 bits/pixel CLUT " " 4 bits/pixel CLUT ”" " " 8 bits/pixel CLUT " . " 16 bits/pixel Direct 32 bits/pixel Direct RGB24 © 1992-95 Atari Corp. Confidential Information “JER Property of Atari Corporation June 7, 1995 | Jaguar Software Reference Manual - Version 2.4 Page 17 15-17 | PITCH This value defines how much data, embedded in the image data, must be skipped. For instance two screens and their common Z buffer could be arranged in memory in successive phrases (in order that access to the Z buffer does not cause a page fault). The value 8 * PITCH is added to the data address when a new phrase must be fetched. A pitch value of one is used when the pixel data is contiguous - (Sf zero will cause the same phrase to be repeated. 18-27 | DWIDTH This is the data width in phrases. i.e. Dé be found at DATA + 8 * DWIDTH 28-37 | [WIDTH _ ..- This is the image width in phrases (must t clipping. 38-44 | INDEX For images with 1 to 4 bits/pixel the top 7 to 4 the most significant bits of ihe palette address. 45 REFLECT 46 RMW for intensity and the two cole vectors. 47 TRANS Flag to make logical colour zero transparent": 48 RELEASE ; between data fete ‘pixel to be displayed. This can be used to clip the bits depends on the colour resolution of t is scaled. The least significant bit is only ihere the pixels are written into the line viaining bits define the first pair of pixels to be 49-54 | FIRSTPIX ed object. The object must be on a 32 byte boundary in 64 bit RAM. y in 24-bit RGB mode. The first 128 bits are identical to the bit ;. An extra phrase is appended to the object. Description , “This eight bit field contains a three bit integer part and a five bit fractional part. The number determines how many pixels are written into the line buffer for each source pixel. | 8-15 VSCALE This eight bit field contains a three bit integer part and a five bit fractional | part. The number determines how many display lines are drawn for each source line. This value equals HSCALE for an object to maintain its aspect ratio. © 1992-95 Atari Corp. Confidential Information 7E® Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 REMAINDER This eight bit field contains a three bit integer part and a five bit fractional part. The number determines how many display lines are left to be drawn from the current source line. After each display line is drawn this value is decremented by one. If it becomes negative then VSCALE is added to the remainder until it becomes positive. HEIGHT is decremented every time VSCALE is added to the remainder. The new. INDER is written back to the object. This value should be initi fhie.same value as VSCALE to produce a perfectly scaled if 24-63 Unused, write zeroes. This object interrupts the graphics processor, which may act on be Processor resumes when the graphics processor writes to the OBF Field Description Bits [3-63 | DATA 3 vice fautine. They are. | ‘sathe GPU can use | Execution continues with the object in the next 5 eet nclear the (memory mapped) Object Processor flag and this can be us ij he following object B eld De elite 0-2 TYPE Hea Branch object is type three | 3-13 YPOS : This value may béiass Stermine whether the LINK address is used. 14-16 :CC These bits specify Whi tion is used to determine where to continue | sing: ranch to LINK if YPOS == VC or YPOS == 7FF ch to LINK if YPOS > VC 140.LINK if YPOS < VC Branci#é LINK if Object Processor flag is set | Branch to LINK if on second half of display line (HC10 = 1) PWN 17-23 24-42 Thag:defines the address of the next object if the branch is taken. The addzess is defined as described for the bit mapped object. 43-63 | unused _ ij © 1992-95 Atari Corp. Confidential Information JPR Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Verston 24 Page {9 This object stops object processing and interrupts the host. Description TYPE Stop object is type four 3 INT FLAG When set, CPU stop object interrupts are:éfiabled 4-63 DATA These bits may be used by the CPU inté¥rupt service’: They are i memory mapped so the CPU can use thgtn as data or as additional parameters. eae © 1992-95 Atari Corp. Confidential Information TER Property of Atari Corporation June 7, 1995 Page 20 Jaguar Software Reference Manual - Version 2.4 AGUARR Object Processor Quick Reference (inverted fields are modifed by the Object Processor) Bitmap Object TYPE =0 64 56 48 40 32 24 0 | I | { { { { TITLLLILLII TL il LLITi tt TTTTLLLLLOIPiti LELi Lt DATA Pointer (Bits 23-3) LINK Pointer (Bits 23-3) TyPE| 64 56 48 40 32 0 | | | | | TITILILLLI II CLLiTilyi TTTILILCTi tii PET | uUnuseo__| rirsTex | | [|| inoex | wioTH | xpos | ” RELEASE 4 Ih REFLECT TRANSPARENT RMW Scaled (Third phrase only. Phrases 64 56 48 40 8 6) | | | | { { TITLLLLITUTi tt TYITLLELLTT ri ii i HS 5 TILLILILI Ti i il | Unused Me REMAINCER [BRAS | HscALe | 64 56 8 0 | i | } CLIT CIT ti TLLLITITP itil | [rvPe| 64 : 24 16 8 0 | | | | TITLTLLIIITITi TITLILCLiT rrr LEV | Link Pointer (Bits 21-3) | unused | CC | YPOS ITYPE; Stop Object TYPE =4 64 32 24 1é & 8) | { | | | { ! TTCLLLICETT i Tt TTTLLLLILIIT I TITLLLIIIT iT iis Titi ii | DATA | [rvPe] Enable Stop Object Interrupts d © 1992-95 Atari Corp. Confidential Information FER Property of Atari Corporation June 7, 1995 Page 2] Jaguar Software Reference Manual - Version 2.4 e object data path fits into the Tom Chip. All the diagrams that The following two diagrams show where th follow are drastically simplified for clarity. Object Line Processor > Buffer External « Che Processor Bus Bus ; | Bus ee Interface 10 Bus Memory Control : Memory ; Controller Blitter a The processor bus is a 64-bit data, 24-bit addres. cycle basis with no overhead. The external data 16 address bus used for reading an memory controller allows transfers of memory. The bus interface accom nodates 16°and:, multiplexed address for dynamic Ms. The mulfiplexed.address €isction of memory width and number of columns. The memory controll zeyéles. when the row address changes. This allows i contiguous regions of memory to be'aee chip. On one side are the processors and The line buffer is a bridge between two asynchronous parts of side i rs. In fact there are two line buffers. While memory. On the other: e the video timing and pixel gen one is written into by the 1.Processor, the othéE:4 360x32 RAM with indep ite strobes for the hr, Object Data . -> [Write back Path ae : CLUT Address : Bus Object Processor Block Diagram Confidential Information JER Property of Atari Corporation June 7, 1995 © 1992-95 Atari Corp. Page 22 Jaguar Software Reference Manual - Version 2.4 The Object Processor reads object headers and image data and writes back modified headers. The write back logic normally increases the data address by the data width. If the object is scaled then the data address is increased by a multiple of the data width and the vertical remainder is modified. The object data contains either physical colours in the case of 16 and 24 bits-per-pixel objects or logical colours in the case of 1,2,4 and 8 bits-per-pixel objects. Logical colours are translated into physical colours by the colour look up table or CLUT. Processor ° Data Latch Bus | _} Multiplexers CLUT Counter for that header, is exhausted or ur of the object data path ‘the object is scaled. e until the 11 The Object Processor fetches data one phrase at sme invalid. The until the line buffer address (X co-ordinate) has depends on the colour resolution of the object (bits*t ase). The multiplexers select In 24 bits-per-pixel mode each phrase contai ii e CLUT is bypassed for 24 each in turn and one 24-bit pixel is w) bits-per-pixel objects. multiplexers select two pixels at a time and UT is bypassed for 16 bits-per-pixel In 16 bits-per-pixel mode each phr two pixels are written into the line bu objects. In 1, 2, 4 and 8 bits-per- se and 8 pixels respectively. The multiplexers select two pis atime. In 1. 2 an b ixel is made up to eight bits by taking the header). The two eight bit values are used bit physical pixels which are written into the top bits from the top bits 0 as addresses to a pair of identical ® ielding two sixteen h one pixel at a time not pairs. Scaling is achieved by £:the counter controlling the multiplexer. For instance if incrementing: tbe Hip er address independe the line b *emented twice as ofteri’as the counter then the image will be twice as wide. There ar hile A is written by the Object Processor B is being read by the pixel logic. Att e the buffers swap over so A is displayed and B is written. This swap is effectively" ik iplexetsdn all the signals attached to the line buffers. © 1992-95 Atari Corp. Confidential Information JER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 23 The above description is complicated by the following: ° If a pair of pixels must be written to an odd location in the line buffer they must be swapped and one pixel delayed. . The line buffer address decrements if the object is reflected. . The colour to be written into the line buffer can be added to the previa ° One colour may be used as transparent and is not written into the | . The line buffers also appear as memory to the rest of the system The pixel data path is shown in the following diagram. All the logic in this the previous logic, this is the video clock. Line Latch | Buffer Line Buffer Address The operation of the pixel data pa In 24 bits-per-pixel mode the line bi latched and presented at the pins as ré In CRY mode the line butter i is s read at half the video clock frec or brightness. The colo of red, green and blue f most significant bits’ ‘green, bits 6-10 form the five most significant bits of ve most Significant b bits of red. All other bits are set to zero. multiplexer i is driven by the liéck directly. The output of the 2:1 mux is connected directly to the red and green outputs of the chip. is allows 16-bit values to be output at twice the maximum video clock frequency. This provides a video bandwidth of up to four times the video clock. These values should be re- synchronised, de-multiplexed and converted to analogue outside the chip. In this mode the blanking and border signals are output on the blue pins. © 1992-95 Atari Corp. Confidential Information FR Property of Atari Corporation June 7, 1995 ee Page 24 Jaguar Software Reference Manual - Version 2.4 The above picture is slightly complicated by the following: ° The least significant bit in CRY and RGB16 modes can be sacrificed (treated as zero) and used to control an external video switch through the incrust output pin. . In CRY and RGB16 modes a background colour may be written into the line buffer after it has been read. . In CRY and RGB16 modes the least significant bit may be used to dé 1 CRY or RGB16. This could be used to drop a decompressed RGB having to do a RGB to CRY conversion. jer the mode is The average refresh frequency is defined by the REFRATE bits are grouped together in order to lessen the impact on system perf in very large numbers or they would create “dead spots” in which disrupt the display or sound production. EMCON2 register [ However they canno formed was possible. This could Jaguar uses a counter to accumulate a count of refresh:eyeles. When this counter r refresh cycles are done and the counter is set to eighi then eight Refresh cycles are also invoked when the Object Processor executes a STOP object JAGUAR per the refresh counter to zero. : end of the object list. After the Object aS are necessary to decrement S$ as many refres nterrupting the Object © 1992-95 Atari Corp. Confidential Information FER Property of Atari Corporation June 7, 1995 Page 25 Jaguar Software Reference Manual - Version 2.4 Jaguar produces a video output using eight digital bits each for red, gree have two hundred and fifty-six intensity levels, and is enough to allow smé another. This twenty-four bit scheme is known as true-colour. Jaguar can produce a display based on true colour pixels stored in memory in long: unused, and this is known as true colour mode. However, these‘iirty-two bit pixel atge. eRSsMe a lot of memory; and they also consume a lot of memory bandw not need its range 0 colours, True-colour mode is therefore unattractive for general use, as mos lour mode is therefore a and it is desirable to avoid the detrimental effects it has on performance. Trt special case, and when it is used only true-colour images may be displayed. ixteen-bit pixels. Images “HE: ur or eight bit logical “LUT), which contains their In normal operation, the Jaguar display system is. i stored either as sixteen bit pixels, or may be sto : colours are used as indices into a Palette or Cok corresponding sixteen-bit physical colours. Sixteen-bit pixels may be stored as six bits of allows smooth shading. There is theref: intensity, see below) which still all greater detail. lly to meet the requirements of Gouraud Shading. This is a tecanique 34-surface from a set of polygons. The problem the technique helps to source is calculated for each polygon and the polygon is painted surface are each clearly visible. that models the appearans overcome is that if the intensity due to 4 the polygons that make up: hading helps avoid this by calculating the intensity at each vertex, and ther polygon edge, and hence along each scan line that makes up the display. If ered, then the only variation is one of luminous intensity, and not one of se a colour scheme that contains an intensity vector, as the Gouraud be performed for one value, rather than the three values that would ht bits is enough to give smooth intensity shading (and it is a round As there is general agré th a scheme that allowed the colour to be expressed in eight number), 1t was therefore necessary to come up wi bits. © 1992-95 Atari Corp. Confidential Information JER Property of Atari Corporation June 7, 1995 Piel Page 26 Jaguar Software Reference Manual - Version 2.4 The colour space to be modelled may be considered as the RGB cube shown, where the lowest vertex represents black, and the highest white. The three edges running out from black are the three orthogonal vectors red, green and biue. The sum of these three vectors can describe any point in the cube. The three lower vertices therefore represent fully saturated red, green and blue, and the three higher ones yellow, cyan and magenta. BLUE This colour space model is only one of many ways of considering what the human brain ‘sees’, but it has the advantage of modelling: the display system used by colour monitors, and of being mathematically simple. The intensity vector can be considered as that com) lies along the diagonal of the RGB cube from bla weighted sum of red, green, and blue; but it bea It is necessary to come up with a scheme to encodé The following requirements were made on this sche 4. An intensity value of zero m “43, two vectors are required to represent a As the remaining colour.space without intensity is two-dimensi set:requirement two, and so a scheme based on point in it. An r, theta > Command Address Registers Controlling State Machines Counters Address Adders }——_____ Co-processor Co-processor Data In Data Out mA Intensity or Z Adders ‘nerates an address withiaa window of pixels. A window is a packed array of pixels ‘he data associated with an Object Processor object. A window is described by ‘goiter into this window is set up for the Blitter start position, and is terms of its X a ddress. The ability to program the address generator in pixel address simplifies the ta8k preparing Blitter commands. ther registers contain specific values to allow considerable flexibility in jlitter operations. The Blitter has two address genera ion units, used for the source and destination addresses of copy operations, etc. The two address generators are called Al and A2. A1 is normally the destination address register and A2 the source, although these roles may be reversed. Al is more sophisticated in its address generation capabilities than A2. © 1992-95 Atari Corp. Confidential Information “FPR Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 24 Page 51 The address register block looks like this: Al_BASE F02200 Al base address Al_FLAGS F02204 Al control flags Al_CLIP F02208 Al clipping size Al_ PIXEL F0220C Al pixel pointer Al_ STEP F02210 Al step integer part Al_FSTEP F02214 Al step fractional part Al FPIXEL | F02218 A] pixel pointer fraction Al_INC F0221C Al increment integer part Al_FINC F02220 Al increment fractional pa A2_BASE F02224 A2 base address A2_FLAGS F02228 A2 control flags A2_MASK F0222C A2 address ne A2 PIXEL F02230 A2 pixel A2_STEP F02234 eed window. A window is a rectangle of s described by a base register, and size of those pixels, their physical layout in The address itself is gen x and Y value, and again is in pixels. The pointer may point to are side the window, an window. -are sixteen bit values. He yes in the range 0-4095, i.e. it treats Y values as 12-bit unsigned values. The higher js treated as an unsigned 16-bit value, but only values from 0-32767 are valid in dow width from a very simple six-bit floating-point format. The width value has a four: nsigned exponéat, and a three bit mantissa, whose top bit is implicit, and which has the point after the implicit top bit. Thi similar to a cut down version of the IEEE single precision format without the sign bit. It‘ must gi ihole number of phrases in the current pixel size. Valid exponent values are inthe range 0-11. For example, a window width of 640 is 1010000000 binary, i.e. 1.01 x 2“9. Therefore the mantissa takes the value 01 (implicit top bit), and the exponent 1001. The width is therefore 1001 01 in binary. Note that there is a window bounds clipping mechanism for the A1 pointer, which treats the X and Y as signed sixteen bit values. This is described elsewhere. © 1992-95 Atari Corp. Confidential Information PER Property of Atari Corporation June 7, 1995 Page 52 Jaguar Software Reference Manual - Version 2.4 Both Blitter address generators can update their poin Along a scan line, the pointer may be updated either on how the Blitter is currently operating. Refer to the Dat At the end of a scan line, the pointer is updated by a step value, which is the di ai he block, then step to the nex the next scan line. This action of scan across t inner and outer control loops, the inner Joop traversing a scan line, and th Thus the inner loop length is the block width, and the outer loop length th both address registers have certain special modes-*:: ters so that they describe a raster scan over a rectangle. by one pixel or to the next phrase boundary, depending a Path section for further details. and Y to the start of by the Blitter's In addition to these modes, A2 may have a Boolean mask applied to its pointer. This is logi pointers may not exceed the bounds of a rectangle, whose sides: intended to repeat a source texture OF pattern over a larger destinat brick pattern que produces successive Differential An parts, and is used in both of which have integer and Al supports address updates based on a Digital address by adding an increment to the pointers, particular for line-drawing and rotating images. integer parts and sixteen bit fractional The pointer and increment of A1, in both X and ger and fractional parts. parts. The step value used on the outer loop add used to process entire phrases at irty-two bits wide, and are The Blitter has a sixty-four bit dat once, or one pixel at a time. Pixel always stored in a packed manner Data registers are: B_SRCD F02240 Source data, or computed 10 sity fractional parts B_DSTD F0224 Destination da B_DSTZ F0225 B_SRCZ1 B_SRCZ2.. 2260 estination Z @Z1, or computed Z integer parts ar.computed Z fractional parts Pattern data, or computed intensity integer parts | Intensity increment s, arbitrary alignment of the source and destination data is allowed, and the estination data when required. When transferring phrases the source and destination address pointers do not need to be aligned to the same point in a phrase, the Blitter will automatically align the source to the destination, but only for pixels of eight bits or larger. If two source phrases must be read before a destination phrase can be written, then the SRCENX flag must be set to ensure that enough source data is fetched for the blit to operate correctly. Blitter aligns the source tom © 1992-95 Atari Corp. Confidential Information FER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 53 There are therefore two source data registers, to provide current source and previous source for alignment. There is also a destination data register, which can be logically combined with the source, and is also used to restore the destination data area when only parts of it are updated. There is a parallel mechanism for Z data, used for Z-buffering. This allows the depth of the data about to be written to be compared with the depth of the data already present on the screen, and the write of the new data inhibited if the data already present has a higher priority. This applies to Sixtea pixe] mode only. There are therefore two source Z registers and a destination Z register. Write data may come from: * the pattern data register ° the logic function unit * computed Gouraud shaded data The default is the LFU output. The ADDDSEL fla register, and GOURD selects computed data. Write Z may come from * source Z * computed Z The GOURZ flag selects computed destination data. If a mode is ering, then a pre-read of the sizes of less than eight bits. d for bit to pixel expansion, and selects a bit or group of bits from the r which is cleared every time the inner loop is entered. The bit is vritten at the current location. -bit pixel mode to compare the 16-bit un-signed integer Z n the screen, the destination Z, with that about to be written, the source Z, and to ion if the pixel on the screen has a higher priority. 35:48. used to provide a means to make block copies with transparent colours, 40 Help with flood fill by:performing searches. It compares pixel values in either 8 or 16-bit pixel modes?! he source data register with the pattern data register, but it may also compare destination data with the pattern data. The comparators may be uséd fo'achieve three effects: ° When painting pixels one at a time a comparator output can be used to inhibit the write of a pixel, leaving the previous value unchanged. © 1992-95 Atari Corp. Confidential Information FPR Property of Atari Corporation June 7, 1995 Page 54 Jaguar Software Reference Manual - Version 2.4 ° When painting pixels a phrase at a time, the comparator outputs can force destination data to be written back. If this has been previously read then the data will be left unchanged, if not then a background colour can be used, stored in the destination data register ° The action of the Blitter can be stopped altogether. This may be used for collision detection, searching, etc. Note that the bit comparator can only produce a mask to operate over an enti 3%:8-bit pixel mode. The Blitter accesses memory through the 64-bit co-processor bus, and takes fu high-speed of this bus. The Blitter will normally cycle this bus at a rate limited on external memory, although there is a one-tick overhead when tuf#i All external memory is viewed by the Blitter as being phrase wid memory controller expands the transfer into the appropriate numb) The Blitter requests the bus at the start of an operation, and will rot stop requestis until the entire operation is complete. As described elsewhere, higher priority bus masters can req ind be granted the bus during a Blitter operation, and this will suspend Blitt ion until the higher priority:pération has released the bus. “= © 1992-95 Atari Corp. Confidential Information “JER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 tter. The data registers may only The following is a list of all the externally accessible locations within the Bli be written to while the Blitter is idle. All address registers are 32-bits unless otherwise indicated. 32-bit register containing a pointer to the base of the window p aligned. Bits Equate(s) e used to provide alternate r Z data, and for other control of this value, with one special ata phrases are contiguous, 1 “paps, 2 means 3 phrase gaps, but 3 means 2 : chimay be especially useful for double-buffered Z-buffer displays it allows two phrases of pixels to each phrase of Z-buffer data - there is no need to double buffer the Z data.. Hiete the actual pixel size is 2“n, n is the value 3-5 es 0-5 are allowed. This value gives the offset from a phrase of pixel data of its corresponding Z data in phrases. Values of 0 and 7 are not used. June 7, 1995 © 1992-95 Atari Corp. Confidential Information “FER Property of Atari Corporation Page 56 Jaguar Software Reference Manual - Version 2.4 9-14 | See Desc. Width This width is distinct from the width in pixels stored in the window register, and is the width used for address generation. The width is a six-bit floating point value in pixels, with a four bit unsigned exponent, and a three bit mantissa, whose top bit is implicit, and which has the point after the implicit top bit. This is similar to the IEEE single precision format without the sign bit. It must give a whole number of ph SOS Fi: ixxent pixel size. The following is a list of valid width:equates: : WID2560 WID3072 WID3584 WID96 Ap WID112.—s WID 15 unused 16-17 | See Desc. X add ctri. undary (sets phrase mode) 1 size, effectively add one. (11) dthe increment 18 See Desc. hiow the Y pointer is updated within the inner by the X control bits if they are in add increment mode. YADDO0 (0) Add zero Add one 19 | XSIGNSUB in conjunction with the X add pixel size mode ation subtract pixel size. It should not be set with to make the « ther modes. fakes the Y add one mode into Y subtract one. 20 | YSIGNSUB | Y sign contains the size} ‘bounds no write is height an unsigned fifteen bit value i The window origiti when the pointer values the desired clip rectangle dé Js, and is optionally used for clipping writes, so that if the pointer leaves ed. The width is an unsigned fifteen bit value in the low word, the e high word. The top bit of each word is ignored. op left hand corner of the window, and so clipping is performed t when the pointer values are greater than or equal to these values. If have its top left corner at the window origin, then the window base register should be modified to make it the top left corner of the clip rectangle. © 1992-95 Atari Corp. Confidential Information “JPR Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 57 w word) and Y (high word) pointers onto the window, and are the location where the next pixel will be written. They are sixteen-bit signed values. If X and Y values go out of range This register contains the X (lo positively then they will advance through memory (X will wrap onto the next line, Y will go off the end of the window). Only X values in the range 0-32767 and Y values in the range 0-4095 ‘witl produce valid addresses from the address generator, values outside this range are for clipping purpo The step register contains two signed sixteen bit values, which are the X step (363 word). These may be added to the X and Y pointer on each pass.round the outer the inner loop. When calculating the step value for phrase-mode blits, note tha of the first phrase not written by the blit.. Al pointer in the same manner as the The step fraction register may be added to the f scaled or rotated image. step value. This is used when A1 is being used This register contains the fraction address generator, for line-drawi# The increment is added ¢o.the pointer value within the inner loof mode. This register co he two 16 bit signed int word, the Y part in the This is taining a pointer 10:the base of the window pointed to by A2. This address must be phrase aligned. © 1992-95 Atari Corp. Confidential Information IPR Property of Atari Corporation June 7, 1995 Page 58 Jaguar Software Reference Manual - Version 2.4 A set of flags controlling various aspects of the A2 window and how addresses are updated. 5 ame De elite Q-1 | Pitch As Al. 2 unused 3-5. | Pixelsize | As Al. 6-8 | Z offset As Al. 9-14 | Width As Al. i 15 | Mask 1 Enables Boolean AND masking of the A2 pointer By s. window register 16-17 | X add ctrl. These control the update of the X pointer on each pass: the inner loop. : Values are: a ndary) 00 - Add phrase width (truncate to phra 01 - Add pixel size (effectively add oné 10 - Add zero 18 | Y add ctrl. This bit controls how the Y pointer is ‘if 0 - Add zero 1 - Add one . 19 {| Xsign This bit may be set in. operation subtract pixed'size. It shoul C 20 Y sign Makes the Y add one # into Y subtract s sense that if: may:be.used:40 AND mask the pointer This register is used as the window. § causes tht:address to wrap WithiH:4' ‘rectangular area and may be used register when the Mask flag is set.: to give fill patterns. y word) and Y (high: onto the window, and are the location ién. They are sixteen-bit:gieted values. If X and Y values go out of range izh memory (X will wrap onto the next line, Y will go off the end of the and Y values in the range 0-4095 will produce valid addresses nge are for clipping purposes only. This register contains the: where the next pixel will positively then they will i window). Only X values'it the range’ erator, values outsid d.sixteen bit values, which are the X step (low word) and Y step (high ind Y pointer on each pass round the outer loop, between passes through shrase-mode blits, note that the X pointer will be left pointing at the start © 1992-95 Atari Corp. Confidential Information “JER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 59 This register describes the operation of the Blitter. A write to this register igi should be written to last when setting up a Blitter command. Control bits 4 Bit Name _Pescription Bits 0-5 enable corresponding memory cycles within the inner loop. Desti performed (subject to comparator control), but ail other cycle types are optiong operation, so it 0 SRCEN Enables a source data read as part of the inner loop operation: : 1 SRCENZ Enables a source Z read as part of the! 7 unless SRCEN is set. 2 SRCENX Enables an "extra" source data read necessary where data has to be re-alj bit-to-pixel expansion. If SRCENZ is also performed. 3 DSTEN ‘part of inner loop operatiix:, This must always bits, where part of the:destination data &s.previously there. 4 DSTENZ ‘Joop operation. 5 DSTWRZ 6 CLIP_Al 4:pointer lies outsidé:its window boundaries. This has : nner loop, but Blitter 7 _ Bits 8-10 enable address updates wiki is a one-tick overhead per update. 8 UPDAIF 9 UPDAI1 10 | UPDA2 11 | as source to A2 as désti@ation and Al as source. 12: Gouraud shaded data updates within inner loop, i.e. the intensity gradient yal part, repeated four times, is added to the computed intensity fraction er (a.k.a. destination data), then the intensity gradient integer part is added y from the previous add to the computed intensity value register data). ble 13 | ZBUFE 4ygon Z data updates within the inner loop, i.e. add Z fractions to the Z gister (source Z 2), then add with carry the Z integer part to the Z gers (source Z 1). 14 | TOPBEN Enable carry into the top byte of the intensity integers in Gouraud data updates (leave clear for CRY mode). 15 TOPNEN Enable carry into the top nibble of the intensity integers in Gouraud data updates (leave clear for CRY mode). © 1992-95 Atari Corp. Confidential Information “JER Property of Atari Corporation June 7, 1995 Page 60 Jaguar Software Reference Manual - Version 2.4 Bits 16-17 select alternative write data - the default source is the Logic Function Unit, whose output is controlled by the LFUFUNC bits. 16 | PATDSEL Select pattern data as the write data. 17. | ADDDSEL Selects the sum of source and destination data as the write data. Note that the source data is a signed offset. Leave TOPBEN and TOPNEN clear and the source data gives three signed offsets for each of the CRY fields,:and the intensity value will saturate. Set TOPBEN and TOPNEN and six! eee: z performed. This can be used to lighten and darkéi images. Tis: Htks only is 16- bit per pixel modes. : : 18-20 | ZMODE These bits give the conditions under which the Z hibit. Setting them all to zero disables the Z comparator. Fhis abit per pixel mode. bit 0 - source Jess than destination bit 1 - source equal to destination bit 2 - source greater than destination 21-24 | - The bits control the data produced by # Boolean OR of the following minterms: bit 0 - NOT source AND NOT destination bit 1 - NOT source AN: bit 2 - source AND N@& of the above: S&D S*D D Ue NSORD 1S{D LFU_REPLACE S FU_SORND S|!D UFU_SORD S|D :FU_ONE ones 25 CMPDST pare destination data with pattern data rather 26 ‘0 the output from the bit comparator. This works pixel by ver whole phrases only on 8-bit pixels. When operating in ti € does not occur unless BKGWREN is set, but in phrase nbibit o pixel mode then ode destination data‘is'glways written when the comparator determines that the 27 1 should not be written. Sawrite inhibit on the output from the data comparator. This only applies to bit per pixel modes. When operating in pixel mode then the write r unless BKGWREN is set, but in phrase mode destination data is when the comparator determines that the pixel should not be 38 | BKGWREN tite inhibit occurs, this flag enables the Blitter to still perform the write, but té ‘write back destination data. This only applies to pixel mode, in phrase mode destination data is always written. © 1992-95 Atari Corp. Confidential Information “JER Property of Atari Corporation June 7, 1995 4 This bit should not be used due to a bug in th ti: 30 | SRCSHADE | This bit uses the IINC register to modify the intess ‘Gatatead from the source _ | address, and may be used to lighten or darken j conjunction with GOURZ, but not GOURD. TH modified, so source data should be selected usin is particularly intended for performing flat shading’ Description IDLE When set, the blitter is completely idle a8 completed. , 1 | STOPPED Praeee in its collision detestion mode - see the 2 inner IDLE 3 inner SREADX 4 inner SLREADX 5 inner SREAD 6 inner SZREAD 7 inner DREAD 8 inner DZREAD 9 inner DWRITE a 10. | inner DZWRITE “‘PHagnostic OHI. 11 | outer IDLE Diagnostic only. 12 | outer INNER#:.. Diagnostic only. 13. | outer AIFUPBAE Diagnostic only: 14 | outer ALUPD Diagnostic only.* 15 outer A2UPDA: {Diagnostic only. 16-31 | inner count Diagnostic only. terations of the inner loop operation. This is a sixteen bit value which reloads to the inner loop. The high w ons of the outer loop. This is a sixteen bit value which is loaded directly The counters both ae he range 1 to 65536 (encoded as 0). © 1992-95 Atari Corp. Confidential Information “JPR Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 All data registers are sixty-four bits, unless otherwise noted. The source data may be pre-loaded with data for bit-to-byte expansion. The Ster also.serves to hold the four sixteen bit fractional parts of intensity when computing Gouri This 64-bit register holds the destination data - which may be ei unmodified pixels to be written back correctly when in phrase-ma paper colours, if it is not read. olds the integer aa tional parts of the intensity increment used for Gouraud ight bits will modify {i colour value, and should therefore normally be left set to eger and fractional parts of the Z increment used for computed Z polygon drawing. June 7, 1995 © 1992-95 AtariCorp. Confidential Information “JER Property of Atari Corporation Jaguar Software Reference Manual - Version 2.4 Page 63 This registers allows the Blitter to be stopped when an inner loop write inhibit occurs. Blitter stop will occur in painting in pixel-by-pixel mode (X add control is 1), BKGWREN is clear, and one of BCOMPEN, DCOMPEN or ZMODEO-2 is set, along with the matching condition. The Blitter operation may at that point be resumed or aborted. Bit Name Description RESUME Writing a one to this bit when the Blitter has will cause the Blitter to resume operations. Writ 1 ABORT Writing a one to this bit when the Blitter has stopp Writing a zero has no effect. 2 STOPEN Set this bit to enable Blitter collision’ <:.Clear it to disable'té These four registers provide an alternate view 0 computed intensity fractional parts (source data) r ; These registers are analogous tot nsity registers, and are for Z buffer operation. They affect the corresponding parts of the comput eger (source Z1) and computed Z fraction (source Z2) registers. They are 32 bit.values (16.16 bit numbers}: © 1992-95 Atari Corp. Confidential Information PER Property of Atari Corporation June 7, 1995 : | | - Page 64 Jaguar Software Reference Manual - Version 2.4 This section discusses some of the typical modes of operation of the Blitter. It is by no means a complete guide to all possible modes, but will show how to do certain common operations. This is the best way to learn how to use the Blitter. Throughout this section, flags in flags registers that are not mentioned shoulda t to zero. Registers that are not mentioned need not be set up. i The simplest of all Blitter operations is a block move, copying one area of memo will perform this operation one phrase at a time, and it is therefi The source address of the data should be stored in the A2 base re base register. If these are not phrase aligned addresses then they $ Tounded down to a phrase boundary, and the offset (in the pixel size set) from the phrase baaindary written: pointer should be set to zero. , The length of the block should be stored in the inne? ei the largest block that can be copied is 32767 pixeis; where 52: blocks it is usually easier to work in bytes. The outer counter shotil The Blitter needs to be told how to update the poi are set to zero to indicate phrase mode in both addr Rectangle moves are ve: of a block operation. Th A two-dimensional arra .stored in memor finear array of phrases. This will usually be the Sitter has to know the width of this window of pixels. As an address in pointer plus the width times the Y pointer; a multiply operation need for a hardware multiplier in the Blitter address alue Hina Oa epee oded 20 1.01 x 2%4 0100 01 80 000001010000 1.01 x 2%6 0110 01 128 000010000000 1.00 x 2°7 0111 00 640 001010000000 1.01 x 2*9 1001 01 3584 111000000000 4.11 x 2*11 1011 11 © 1992-95 Atari Corp. Confidential Information “JER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 65 The largest width value allowed is the last value one in this table - the smallest width is one phrase in the current pixel size. The width must always be a whole number of phrases in the current pixel size. Rectangles are blitted like a raster scan, i.e. a line of pixels is transferred, then the pointer advances one line and transfers the next scan line of the rectangle. This jump from the end of one line to the start of the next is given by the step value. If pixels are being transferred one at a time, then the s lue for X is the window width minus the rectangle width. If pixels are being transferred one phrase.at iien.the X pointer is left pointing at the start of the next phrase after the end of the block, and so accordingly. Character painting is a particular example of a class of operations requiring bit i ees qund patterns, simple te: is.used as a bit mask. Bits are extracted from ited in the currently selected output data When bit to pixel expansion is being performe: the source data and if they are set then the corresp Character painting can be perfort des, and can also be performed one phrase at a time in eight and sixte The bit selection counter is reset evéry:'time thé:dnner loop isieft, so bit packed data patterns may be up to eight pixels wide. urce image, with the increment integer and fraction set up to describe a anslated bounding rectangle. The step and fraction parts then translate it to the start of't ° Clipping is generated when A1 is outside the bounds of the source image, so that writes at A2 will only be enables when A1 lies within the bounds of the source image, clipping the rotated form correctly. Consider as an example, a 12 pixel square image starting at (10,10) in a window. We would like to rotate this image clockwise by 30 degrees, make it larger by a factor of 1.3, and move it across by 30 pixels. © 1992-95 Atari Corp. Confidential Information “AER Property of Atari Corporation June 7, 1995 Pg gi ip RAAB IT LEER RC EEE Ot A AA TO A SES EGR Page 66 Jaguar Software Reference Manual - Version 2.4 First it is necessary to transpose the square's co-ordinates into the target co-ordinate system. The basic program below shows how to do this: 100 deg30 = .523598775 110 PRINT "Co-ordinates? " 120 INPUT xi, yi 130 x = xi - 16 = yi - 16 140 y 150 xs = (x * COS(deg30)) - (y * SIN(deg30)) 160 ys = (x * SIN(deg30)) + (y * COS(deg30)) 170 x = xs * 1.3 180 y = ys * 1.3 190 x = x + 46 200 y= y + 16 210 PRINT “Translated: ", INT(x + .5), INT(y + .5) This translates the vertices of the square as follows: (10,10) -> (43,5) (21,10) -> (56,12) (21,21) -> (48,25) (10,21) -> (36,18) The bounding box is therefore from X = 36 to 56, and. back to the source co-ordinate system, as shown by: 100 degm30 = -.523598775 110 PRINT "Co-ordinates? ” 120 INPUT xi, yi 5 to 25. The vertices of then translated 130 x = xi - 46 140 y = yi - 16 150 x = x / 1.3 160 y= y/1.3 170 x * 180 yv * 190 x 200 210 PRINT "Reverse cratslated: :5), INT(y + .5) (36,5) -> (56,5) -> (56,25) -> (36,25) -> We then set up Al as the source address source image,:and:its window size the imagé r, making its window base the top left hand corner of the e Al pointer will traverse the translated bounding box. for modelling lit curved surfaces, which are represented by a series of rved, the intensity must vary smoothly, rather than being uniform proximates to the appearance of the curved surface by computing the ormal, and some suitable illumination model. The vertex intensity is olygon edges, and the edge intensities are linearly interpolated across Gouraud sha ng i is a simple technk intensity at each verté: then linearly interpolatec the polygon scan lines. Gouraud shading is only an approximation to the appearance of the curved surface, and may appear unnatural where there are large intensity changes across single polygons. However, it is much more attractive than not graduating the shading at all. Better shading can be achieved with Phong shading, where the normals are interpolated, but this is much more computationally intensive, and is not feasible within the Blitter. © 1992-95 Atari Corp. Confidential Information FER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 67 Z-buffering involves attaching a Z value attribute to each pixel, which corresponds to how far away it is from the observer. When pixels are drawn on the screen, their Z values can be compared with the Z of the pixels already there, and the existing data preserved if closer to the observer. Z-buffering therefore provides a simple means of achieving hidden surface removal. The Blitter can perform Gouraud shading and Z-buffering in sixteen bit pixel mode only. Each blit creates one scan line of a polygon, with the graphics processor responsible for re-calculatin Start, length and gradient parameters for each scan line. Four pixels and their associated Z values cé memory interface can write them out, so the bus rate is always the limiting:factor. To calculate the Z and intensity values, the Blitter contains registers which: a sixteen bit integer and sixteen bit fractional part. The intensity integer als intensity is prevented from overflowing into the colour information. The TOP this overflow, if desired. There are four of these thirty-two bit values for intensity, and fo in parallel. There are also thirty-two bit Z and intensity increment:te each pixel for each write. mount added to hich give the a At each pass round the inner loop; the sixteen-bit fractional part of the intensity ‘ix nt is added to the fractional parts of the intensity values, held in th a.register. Then the eight#big tateger part of the intensity is added with carry out of the fractional Ser pixel values in the pattern data register. Carry is prevented from propagating from int ar mechanism governs Z. Both the intensity and the Z values saturate. Thi are clipped there, rather than wrapping round. Fore FFFF, not the overflow result 0000. To take an example, consider blitt : command registers would be pro stérs:vi¢éd not be written). Al_ BASE 0x01600008 dress Ai_ PITCH i Pixel data and ata alternate Al PSIZE 16-bit pixels Al _ZOFFS se up from cixel data Al WIDTH 1.01 x 2*4 = 0100 01 Al _ADDC : ase" to address Al WIN_X Al WIN Y indow height Al PTR X pixel at address 0,1 j San intensity of C7.2833, and a colour of 00. The intensity . values for the first four pixels have to be set up (the left-most is actually off sity gradient is subtracted from it). Similarly, the Z of the first pixel is Intensity integer parts and colour data Intensity fractions FE Z integer parts Source Z2 I 02 2 fractional parts i Inc FFASB6 tensity increment (four times minus 15.9265) Z Inc SFOF8004 Z increment (four times minus 1818.FFFF) Pattern Source Source 21 }9DC00C700B106: Control information is set up as follows: Inner count 18 Strip width Outer count 1 Single pixel high strip DSTEN 1 Read destination data, to restore if necessary DSTENZ 1. Read destination Z, to compare with computed Z © 1992-95 Atari Corp. Confidential Information “PO® Property of Atari Corporation June 7, 1995 . Page 68 Jaguar Software Reference Manual - Version 2.4 DSTWRZ 1 Write destination 2, restoring or replacing CLIP_Al 1 Clip within window | GOURD 1 Gouraud data computation enabled a GOURZ 1 Z buffer data computation enabled a PATDSEL 1 Write pattern data i ZMODE 3 Overwrite existing data if the new Z value is greater than or equal to the existing 2 lue The numbers here are pretty arbitrary, but they show the general idea. | © 1992-95 Atari Corp. Confidential Information “FER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 69 * Asecond RISC processor (DSP) principally intended for sound synthesis. * Frequency dividers for clock synthesis. * Two programmable timers. * Stereo PWM DAC (requires few external components). ¢ Synchronous serial interface and baud rate generator (12S). * Asynchronous serial interface and baud rate generator (ComLynx). * Joystick interface decodes’ ¢ Six general purpose IO decodes * Two DMA channels (by way of DSP interrupts). Jerry occupies a 64K byte slot in Jaguar's address space. It appears as a 16 however is a 32 bit processor so all transfers to the re done in pairs. (as does all 10). The DSP Jerry is responsible for the synthesis of three im Chroma clock. This is 4.43 MHz for PAL 4 58 MHz for NTS and should have a 50% duty Video clock. i inulti whichis typically between 6 MHz and 12 ry interface, the graphics processor, the } processor. This clock is divided by two to Processor clock. Three registers contro! ‘the clock logié try. The ratio between the video clock and the pixel clock is determined by TOM. frequency will be (N + 1) * CHRDIV where N is the value written to this register. This register is initialised to one on reset. The PCLKDIV output produces a pulse every N + 1 PCLKOSC cycles. © 1992-95 Atari Corp. Confidential Information 7U® Property of Atari Corporation June 7, 1995 Page 70 Jaguar Software Reference Manual - Version 2.4 ten bit register determines the This register is only used if the processor clock is generated by PLL. This the video clock (VCLK) and the video clock divider output (VCLKDIV). As before quency will be frequency ratio between in PLL clock synthesis VCLKDIV is typically locked to CHRDIV so the video.clo (N + 1) * CHRDIV where N is the value written to this register. This register is initialised to produces a pulse every N + 1 VCLK cycles. This six bit register determines the frequency ratio between the ae the chroma clock divider output (CHRDIV). The divider divides:flie chrom where N is the value written to the register. The CHRDIV output has a 50% initialised to 3Fh (divide by 64) on reset. reset (output disabled). Where PLL synthesis is used this register is typ1Cay frequency for generating PCLK and VCLK. ; Jerry contains two identi the pre-scaler) divides th N and M are the values division in the range fou id'stage divides this frequency by M+1, where 's therefore possible to achieve frequency sample rate frequency for sound synthesis and that timer empo frequency. The timers may however be used for other purposes. It ed that writing to:Be: sociated registers presets the counters so they could be used to provide delays. Also the régi fers are readable which can be used to measure time accurately. This ofile code or to help measure the time between joystick events. he timers. The read addresses are different to the write addresses. N +1 where N is the 16 bit value written to them. The pre- the register is written and when they reach zero. They are June 7, 1995 The pre-scalers divide the processor clock by scalers are down counters which are loaded when © 1992-95 Atari Corp. Confidential Information “JPR Property of Atari Corporation Page 71 Jaguar Software Reference Manual - Version 2.4 y the DSP to measure short events with readable, this is really for chip test purposes, but they might be used b precision. These dividers divide the output from the corresponding pre-scalers by N written to them. The dividers, like the pre-scalers, are down counters whié written and when they reach zero. When they reach zero they may interrupt either of the DSP or the CPU. The maskable. There are six interrupt sources which may interrupt th follows: ¢ External « DSP « Timers ¢ Syne. The synchronous seria * UART The asynchronous serial ‘i J EXTENA J DSPENA J] TIMIENA J]_TIM2ENA ‘wo (tempo) interrupts. ous Serial Interface interrupts. Enable Synchrotiéus Serial Interface interrupts. ear pending external interrupts. Cleat'pending Timer Two (Tempo) interrupts. r pending Asynchronous Serial Interface interrupts. J_TIM2CLR J_ASYNCLR az J_SYNCLR 13 | Clear pending Synchronous Serial Interface interrupts. Bits 0 to 5 enable the individual interrupt sources. When read bits 0 to 5 indicate which interrupts are ; pending. Bits 8 to 13 clear pending interrupts from the corresponding interrupt source. June 7, 1995 © 1992-95 Atari Corp. Confidential Information FR Property of Atari Corporation Jaguar Software Reference Manual - Version 2.4 egisters. These are all within the local address space he DSP without any external bus overhead. Other processors may access them at these addresses. All transfers to them should be 32-bit, but the registers themselves are only 16-bit. The synchronous serial interface is controlled by seven r of the DSP, and so may be accessed by t This eight bit register determines the frequency of the internally generated s given by: Serial Clock Frequency = System Clock Frequency / (2 {N+1)) where N is the number written to this register. Description INTERNAL When set this’5it enables RESERVED Set to zero. tobe pulses. When set JERRY 2 WSEN nately high for 16 clock sared Jerry will not generate z INTERNAL is cleared. 3 RISING 4 FALLING EVERYWORD These two sixteen: fa to be transmitted. These two sixteen bit registers hold received data. © 1992-95 Atari Corp. Confidential Information JER Property of Atari Corporation June 7, 1995 4 Jaguar Software Reference Manual - Version 2.4 Page 73 Bit Name Description This bit reflects the state of the Word Strobe pin. Do not use this to check for data ready, use the Interrupt control register. The asynchronous serial interface consists of two wires, UARTI, the receive ‘aa transmit data output. This interface is primarily designed to support ComLynx btit MIDI transmit and receive. A prescaler register is used to allow programmable baud rates. The data transmitter is double buffered, allowing a character t¢ transmission of a previously written character is complete. Th character can be received on the UARTI pin befo i register. @-the data register before the é@ double buffered, a second from the data Data is both transmitted and received in the for \ fOo\/ i\/ 2X \ N/V /N__N One Start jo-c ttt 8 Bit The parity can be ODD, EVEN nd the input can be programmed to be active high or low. The pola rial interface, namely receiver or transmitter table below summarises the interrupts in Two classes of interrupt can be gen ated by the asynchronot interrupts. Each of these classes can be individually enabled. each class. Receiver Interrupts. . Parity Error © 1992-95 Atari Corp. Confidential Information “JER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 This sixteen bit register determines the baud rate at which the asynchronous serial interface works. The frequency generated is given by: Clock Frequency = System Clock Frequency / (N+1) where N is the number written to this register. The frequency generated by this register is further divided by sixteen to givéithe baud rate: Description PAREN Parity enable. When parity is disabled e of the EVEN bit is:transniitted in the parity bit ume 2 TXOPOL Transmitter output polarity. Setting this bit to a 6ne:< be active low. ° 3 | RXIPOL Receiver input polari inverting input. 4 TINTEN Enables transmitte the Interrupt Contro Regie also needs: 5 RINTEN i THES. s.AAs for TINTEN the asynchronous serial interface bit 6 CLRERR 14 TXBRK All unused bits are re: -d and should be written 0 These bits:reflect the state of the register. Receive buffer full. When set this bit indicates that a character has been received and is available in the ASIDATA register. ansmit Buffer Empty. ty Error. This bit indicates that a parity error occurred on a received character. corresponding bits in the ASICTRL | i } Description | 10 | FE Framing Error. A framing error is detected when a non zero character is ééeived without a stop bit at the expected time. 11 | OE ‘Overrun Error. An overrun error is detected when a character is received on the input before the last character was read from the ASIDATA register. 13. | SERIN Serial Input. This bit reflects the state of the UARTI pin. Its sense can be inverted by setting the RXIPOL bit in the ASICTRL register. © 1992-95 Atari Corp. Confidential Information PU™® Property of Atari Corporation June 7, 1995 Page 75 Jaguar Software Reference Manual - Version 2.4 14 | TXBRK Transmit Break. This bit reflects the state of the corresponding bit in the ASICTRL register. 15 ERROR Error. This bit is logical OR of the PE, FE and OE bits. This allows a single test for error conditions. All unused bits are reserved and may return any value. returns the last character received in bits (0..7] When this register is read it buffer ful! condition leaving the way cléai reading this register clears the receive be received. When the ASIDATA register is written bits [0..7] are transmi used and should be written as zero. Jerry has four outputs which together control are two registers ick output latch. Output JOYL2 is asserted iS lised to enable the joystick outputs. This bit is value in bit 15. (active low) during the write. The mast signifieas t (1593 cleared (disabled) by reset. Output JOYL3 is the inverse of th snabled and the data reflects the state of the four button inputs. Output ad. When read the button i JOYLI is asserted (active low) during © 1992-95 Atari Corp. Confidential Information JER Property of Atari Corporation June 7, 1995 i Page 76 Jaguar Software Reference Manual - Version 2.4 Jerry has six general purpose 1O decode outputs which are asserted (active low) in the following address ranges. GPI00 | F14800-F14FFFh RESERVED GPI01 | F15000-FISFFFh RESERVED GP102 | F16000-F16FFFh RESERVED GP103 | F17000-F177FFh RESERVED GPI04 | F17800-F17BFFh RESERVED GP105 | F17CO0-F17FFFh RESERVED The term “General Purpose” is a misnomer because most of the © 1992-95 Atari Corp. Confidential Information “JER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 77 The DSP is part of the Jerry chip in Jaguar, and is a variant of the GPU instruction set and programming model, but there are certain differences. system memory map as a bus master, and its internal memory may be access within the Jaguar System. The DSP performs two réles within Jaguar, its primary functich is sound synthesis: available for additional graphics processing. Sound synthesis may be the playback of sampled sound or algo two. As the DSP is a fast general purpose processor it may be wsed for a Brx It contains several optimisations for sound processing when compared to thé precision multiply / accumulate operations, circular, buffer management, audio way: additional local fast RAM, and audio output ha i full power of the DSP, it may also be System address space, although its bus ell be used with sound synthesis ing something like matrix As many sound generation techniques will not used as an additional graphics processor. It has bandwidth is lower as it has a 16-bit interface i" occurring under an interrupt at sample rate, with the } hw multiplies for 3D object rotation. ° This section assumes an understasi DSP. © 1992-95 Atari Corp. Confidential Information “JER Property of Atari Corporation June 7, 1995 Page 78 Jaguar Software Reference Manual - Version 2.4 Refer to the 'Memory Interface' section of the GPU description for a discussion of the basics of the DSP memory interface. The DSP has 8K bytes of local fast RAM (twice as much as the GPU), and 2K b with sound synthesis. These are laid out as follows: ee F1A000 - FIAIFF DSP control registers F1B000 - F1CFFF local RAM F1D000 - FIDFFF wave table ROM of wave tables to help The wave table ROM contains eight 128 entry wave tables. Thes' extended to 32-bits, so that the ROM appears to occupy 1K 32-bi significant. : i Only the bottom 16 The waves available are as follows: F1D000 ROM_TRI F1D200 ROM_SINE F1D400 ROM_AMSINE F1D600 ROM_12W F1D800 ROM_CHIRP16 FIDAOO ROM_NTRI FIDCO00 ROM_DELTA FIDE0O ROM_NOISE © 1992-95 Atari Corp. Confidential Information AER Property of Atari Corporation June 7, 1995 ae" Jaguar Software Reference Manual - Version 2.4 Page 79 Refer to the Interrupts’ section of the GPU for a general discussion of how DSP interrupts behave. There are six interrupts sources within the DSP. These are allocated as follows: External interrupt 1 External interrupt 0 Timer interrupt 2 Timer interrupt 1 2S interface interrupt CPU interrupt OlRPprm| wp hyo the Tom & Jerry: The timer The external interrupts are inputs from additional Jaguar hardwa n the local synchronous serial interrupts are from Jerry's local programmable timers, the [2S jaterrupt is from interface, and the CPU interrupt is generated by any processor Writing to the DS! DZ; ‘Os, and so on; there is hardware As circular buffers are common aligned to a 2" boundary, where n support for addressing circular b is any practical value. , namely ADDQMOD and SUBQMOD. The support takes the form of two ; ie form of counting modulo 2°. This is These allow pointers to be updated with the value wrapping controlled by the mod i gegister which is a mask on the res € these instructions. Where a bit is 1 in this register, the result of the: ADBOMOD or SUBQMOB unaffected by the instruction, where it is 0 the add may modify it. Normal its of this registé eget to one, and the low bits set to zero as appropriate. ccumulate Instructions’ and the ‘Systolic Matrix Multiplies’ sections of the GPU to and explanation of these instructions. rations are performed, using the IMULTN, IMACN and RESMAC on, the accumulated result is actually calculated as a forty bit signed tively overflow bits, after a RESMAC, they are at F1A120. However, the ty: bit input the register operand as the low thirty-two bits and the eight niniilatoras Its top eight bits, and saturates the forty bit signed integer to thirty two bits; i.e. if it is less than FERGOG0000 it becomes FF80000000 and if it is more than OO7FFFFFFF it becomes OO7FFFFFFF. The SAT32S instruction should therefore only be applied to the result of a multiply / accumulate operation, and before any further multiply / accumulate operations are performed. The SAT16S instruction operates only on its thirty-two bit register operand and takes no account of the overflow bits. © 1992-95 Atari Corp. Confidential Information JPR Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Refer to the ‘Divide Unit' section of the GPU description. Refer to the ‘Register File’ section of the GPU description. Refer to the ‘External CPU Access’ section of the GPU descript Addresses in DSP space are only available as 16-bit memory int the order low address then high address. ZERO_FLAG 3 set iftheresult of the jot affect the flags, see above. 1 | CARRY_FLAG gperations. @ result of the last arithmetic operation 2 | NEGA_FLAG The ALU negative flag, set was negative. the interrupt control logic at the start of the service 3 IMASK Interrupt mask, sek t utine, and is cleare#:y'the interrupt service routine writing a 0. Writing . to this location has no effect. 4-8 | D_CPUENA ™ s-enable bits for interrupts 0-4. The status of these bits is IMASK. These bits correspond to: pt latch clear bits for interrupts 0-4. These bits are used to clear the 9-13 iité#rupt latches, which may be read from the status register. Writing a y to any of these bits leaves it unchanged, and the read value is always D_TIM2CL D_EXTOCLR 14. | REGPAGE Switches from register bank 0 to register bank 1. This function is overridden by the IMASK flag, which forces register bank 0 to be used. © 1992-95 Atari Corp. Confidential Information JPR Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 Page 81 ‘a 15 DMAEN o Interrupt enable bit for interrupt 5. Fu This is EINT{1]. 17 D_EXTICLR Interrupt latch clear bit for interrupt 5. Funct 16 D_EXTIENA WARNING - writing a value to the flag bits and making use o will not work properly due to pipe-lining effects. If it is necess then ensure that at least two other instructions lie between the: STORE| ani it is necessary to use flags set by an indexed STORE instruction, then ensure't instructions lie between the STORE and the flags, dep#adent instruction. set by a STORE irstruction, ; dependent instruction. If east four other Bits Equate(s) 0-3. | MATRIX3—15 4 MATCOL This register determin Bits Equate(s} out of DSP I/O registers. If its current contents are unknown, the same and high 16-bits. This register controls the physi data should:bé:-written to both the Bit Equate(s) Bescription en this bit is set, 32-bit registers in the CPU I/O space are big-endian, Le. the more. significant 16-bits appear at the lower address. 2 BIG_INST When this bit is set the DSP does word program fetches like a big-endian wf processor. © 1992-95 Atari Corp. Confidential Information “JER Property of Atari Corporation June 7, 1995 Page 82 Jaguar Software Reference Manual - Version 2.4 The DSP program counter may be written whenever the DSP is idle (DSPGO is clear). This is normally used by the CPU to govern where program execution will start when the DSPGO bit is set. The DSP program counter may be read at any time, and will give the address of the instruction currently being executed. If the DSP reads it, this must be performed by the MOVE PC,Ru instruction, and not by performing a load from it. The DSP program counter must always be written to before setting the DS then the DSPGO bit is cleared, the program counter value will be corrupted, as at this point j Bits Equate(s) DSPGO externally configur Writing 2 1 to:this:b 1 | CPUINT the DSP to interrupt pt type 0. There is no need for it to zero. Writing a zero has 2 FORCEINTO nabled. This means that ruction, until a SINGLE_GO 3 SINGLE_STEP : SINGLE_STOP, indicates whether the DSP iuld be polled before issuing a further single e DSP is awaiting a SINGLE_GO | SINGLE_GO 5 unused fs for interrupts 0-4. The status of these bits indicate which interrupt request latch is currently active, and the appropriate bit should be cleared by the interrupt service routine, using the INT_CLR bits in the flags register. Writing to these bits has no effect. These bits correspond to: TIM2LAT XTOLAT ' EINT[0] . © 1992-95 Atari Corp. Confidential Information “JER Property of Atari Corporation June 7, 1995 Jaguar Software Reference Manual - Version 2.4 i1 | BUS_HOG Caterevnte Pat Javesar' 3 am-fetches which improves HS r x mnitobeoldente the Px to-ROIG- CATO me vase CoH pres: buch tan cneed—_si-theexpense of anv lower-pHoHtY Aovice 1o450-ERe ba tOWEEPHOTY Gere’ USHHE tHE OES: avecnt Rei CAPS thw Oxr-airy This bit must not be set in the Jaguar.G These bits allow the DSP version codé are: 2 First production release Future variants of the DSP may contain at enhancements, and this value allows software: all versions. It is intended th future versions W DSP. eee 16 | D_EXTILAT Interrupt latch for interrupt 5 6-10 have for interrupts 0- This is EINT[1]. 12-15 | VERSION d by the ADDQMOD and ans that it may be changed. esses to be readily generated for This 32-bit register holds the value which gov; which bits SUBOMOD instructions. A 1 means that the bit will be unaffected,"é: Normally, the higher bits are set to 1 and the lower Hits to 0. This allows: bb circular buffers of size 2" bytes, where n is betweett e calculated. Refer to the This 32-bit register contains a valll x after a division may b section on the Divide Unit. ‘s bit is set, then the divide unit performs division of unsigned 16.16 Bit Equate(s) Description ers, otherwise 32-bit unsigned integer division is performed. igh bits of the accumulated result to be read. After a RESMAC instruction the tains the bottom 32 bits of the accumulated value, and this register ign-extended to 32 bits. he internal DSP space for higher efficiency when ions are mapped into t PWM DACs and the ffectively 32-bit locations. These are the Synchronous Serial Interface June 7, 1995 Confidential Information JER Property of Atari Corporation © 1992-95 Atari Corp. Jaguar Software Reference Manual - Version 2.4 Page 85 TEER GPU and DSP instructions are all sixteen bits, made up as follows: 15 14 13 12 f11 HO] 94} 8]7 61514131211) 0 — opcode _| | reg] Jj | reg? _| * opcode defines the instruction to be executed * reg? is the destination operand, or the only operand of sin + regi is the source operand érand instructions The reg2 and reg] fields usually hold a register number, but have other me ith some instructions. The instruction set is as follows, where the syntax‘4 ,