Amiga Hardware Reference Manual -2nd Edition eBook-EnG

Download Amiga Hardware Reference Manual -2nd Edition eBook-EnG

Post on 03-Dec-2014

106 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

<p>Hardware Reference Manual Commodore Business Machines,Inc. Amiga Hardware Reference Manual CommodoreBusiness Machines,Inc. Amiga Technical ReferenceSeries Addison-WesleyPublishing Company,Inc. Reading,MassachusettsMenlo Park, CaliforniaDon Mills,Ontario Wokingham,EnglandAmsterdamSydneySingaporeTokyo MadridBogotaSantiagoSanJuan LibraryofCongressCataloging-in-Publication Data Mainentry undertitle: Amiga hardwarereferencemanual. Includes index.1.Amiga (Computer)I.Commodore Business Machines. QA76.8.A177 A651986004.16585-26650 ISBN0-201-1io77-6 BCDEFGHIJ-BA-89876 The text of this manual was writtenby Robert Peck, Susan Deyl,Jay Miner,and Chris Raymond. Special thanks to Bill Kolb,DaveNeedle,LeeHo,and Dale Luck. COPYRIGHT1986byCommodore-Amiga,Inc. Thismanualiscopyrightedandallrightsarereserved.Thisdocumentmaynot,inwholeorinpart,becopied,photocopied,repro-duced,translatedorreducedtoanyelectronicmediumormachinereadableformwithoutpriorconsent,inwriting,from Commodore-Amiga, Inc. DISCLAIMERS COMMODORE-AMIGA,INC.,("COMMODORE")MAKESNOWARRANTIES,EITHEREXPRESSEDORIMPLIED,WITH RESPECTTO THE PROGRAMSDESCRIBEDHEREIN,THEIRQUALITY,PERFORMANCE,MERCHANTABILITY,OR FIT-NESSFORANYPARTICULARPURPOSE.THESEPROGRAMSARESOLD"ASIS."THEENTIRERISKASTOTHEIR QUALITYANDPERFORMANCEISWITHTHEBUYER.SHOULDTHEPROGRAMSPROVEDEFECTIVEFOLLOWING PURCHASE,THEBUYER(ANDNOTTHECREATOROFTHEPROGRAMS,COMMODORE,THEIRDISTRIBUTORSOR THEIR RETAILERS)ASSUMESTHE ENTIRECOSTOFALLNECESSARYDAMAGES.INNOEVENTWILLCOMMODORE BE LIABLEFOR DIRECT,INDIRECT,INCIDENTALORCONSEQUENTIALDAMAGESRESULTINGFROM ANYDEFECT INTHE PROGRAMSEVEN IF IT HASBEEN ADVISEDOF THE POSSIBILITYOFSUCHDAMAGES.SOME LAWSDONOT ALLOWTHE EXCLUSIONORLIMITATIONOFIMPLIEDWARRANTIESORLIABILITIESFOR INCIDENTALORCONSE-QUENTIAL DAMAGES,SOTHE ABOVE LIMITATIONOR EXCLUSIONMAYNOT APPLY. THEAMIGACOMPUTERMEETSTITLE47OFTHECODEOFFEDERALREGULATIONSFORCLASSBCOMPUTING EQUIPMENT.THE FCCSTRICTLY FORBIDSTHE USEOFUNSHIELDEDCABLETOANYAMIGACONNECTORSWITH THEEXCEPTIONOFACPOWER.COMMODORE-AMIGASHALLNOTBEHELDLIABLEFORINTERFERENCEGEN-ERATED BYPERIPHERALSNOT AUTHORIZEDINWRITING BYCOMMODORE-AMIGA,INC. Amiga isatrademark of Commodore-Amiga,Inc. CBM Product Number 327272-02 Second Printing, July 1986 PREFACE ThismanualprovidesinformationabouttheAmiga[tm]graphicsandaudiohardware andabouthowthe Amiga talksto the outsideworldthroughperipheraldevices.A por-tionof thismanualisatutorialonwritingassemblylanguageprogramsto directlycon-trol the Amiga's graphics andhardware. This bookisintendedforthe followingaudiences: oAssemblylanguage programmers whoneedamoredirect way of interacting with the systemthantheroutinesdescribedinthe Amiga ROM Kernel Manual.You canfindinformationheretohelpyoumakeyourprogramsrunfasterordo thingsthat the ROM kernelroutines don't do. oAnyonewhowantsto addnewperipheralsto theAmiga or just wantsto know howthe hardware works. Wesuggestthat youusethisbookaccordingto yourlevelof familiaritywiththe Amiga system.Hereare some suggestions: oIfthisisyourinitialexposuretotheAmiga,readchapter1,whichgivesasur-veyofallthehardwarefeaturesandabriefrundownofgraphicsandaudio effects createdbyhardwareinteraction. oIf youarealreadyfamiliarwiththesystemandwanttoacquaintyourselfwith howthevariousbitsinthehardwareregistersgovernthewaythesystemfunc-tions,browsethroughchapters2through8.Examplesareincludedinthese chapters. oFor advancedusers,theappendixesgivea concise summary of the entire register setandtheusesof theindividualbits.Onceyouarefamiliarwiththe effects of changesinthevariousbits,youmaywishto refermoreoftento theappendixes thanto theexplanatory chapters. Hereisabrief overviewof thecontents: Chapter1,Introduction.Anoverviewofthehardwareandsurveyofthe Amiga's graphics andaudio features. Chapter 2,CoprocessorHardware.UsingtheCopper coprocessorto controlthe entiregraphicsandaudio system;directingmid-screenmodificationsingraphics displaysanddirecting registerchanges duringthetimebetweendisplays. -v-Chapter 3,Playfield Hardware.Creating,displayingandscrollingtheplayfields, oneofthebasicdisplayelements of the Amiga;howtheAmiga producesmulti-color,multi-graphical bit-mappeddisplays. Chapter 4,Sprite Hardware.Usingthe eight sprite direct-memoryaccess (DMA) channelstomake spritemovableobjects;creatingtheirdata structures,display-ingandmovingthem,reusing the DMA channels. Chapter 5,Audz'oHardware.Overviewof sampledsound;howto producequal-ity sound, simple andcomplex sounds,andmodulated sounds. Chapter6,BlitterHardware.UsingtheblitterDMAchanneltocreateanima-tion effectsanddrawlinesinto play fields. Chapter7,SystemOontrolHardware.Usingthecontrolregisterstodefine deptharrangementofgraphicsobjects,detectcollisionsbetweengraphics objects,control direct memoryaccess,andcontrol interrupts. Chapter8,InterfaceHardware.HowtheAmigatalkstotheoutsideworld throughcontrollerports,keyboard,audiojacksandvideoconnectors,serialand parallelinterfaces;informationaboutthediskcontrollerandRAMexpansion slot. Appendixes.Alphabeticalandaddress-orderlistingsofallthegraphicsand audiosystemregistersandthefunctionsoftheirbits,systemmemorymap, descriptions ofinternalandexternalconnectors,specificationsfortheperipheral interface ports,and specifications forthe keyboard. Glossary.After the appendixes,thereisaglossary of important terms. Youmaywishtolookat the followingbooksandmanuals forfurtherinformationabout the Amiga: oThe Amiga ROM Kernel Manual contains informationabout the Exec multitask-ingroutinesandisthesourceforalltheClanguageprimitives forAmiga graph-ics,animation,andaudio. oThe followingmanuals containinformationaboutthe AmigaDOSoperating sys-tem: oAmigaDOS User'sManual -vi-oAmigaDOS Developer's Manual oAmigaDOS Technical Reference Manual Itisourpolicytomakecertainthattheinformationcontainedhereisaccurate,con-sistent,andupto date.If youshouldfindanymaterial confusing,inaccurate,or incom-plete,please feelfreeto contact Amiga withyour questions or comments. -vii-Table of Contents Chapter 1INTRODUCTION ............................................................................................1 Components of the Amiga ...........................................................................................1 THE MO68000 ANDTHE AMIGA SPEOIAL-PURPOSE lIARDWARE.....................................................................................................................2 VOR ANDDIREOT OAMERA INTERFAOE .....................................................5 PRIMARY ANDSEOONDARY MEMORY.........................................................5 PERIPHERALS................................................................................................................5 System Expandability and Adaptability ..........................................................6 Chapter 2COPROCESSOR HARDWARE ..........................................................7 Introduction .............................................................................................................................7 ABOUT THISOHAPTER ............................................................................................8 What isaCopper Instruction?.................................................................................8 The MOVEInstruction ..................................................................................................9 The WAIT Instruction ....................................................................................................11 HORIZONTAL BEAM POSITION..........................................................................12 VERTIOAL BEAM POSITION.................................................................................12 THE OOMPARISON ENABLE BITS.....................................................................13 UsingtheCopper Registers .........................................................................................13 LOOATION REGISTERS............................................................................................13 JUMPSTROBE ADDRESS .........................................................................................14 OONTROL REGISTER ................................................................................................14 Putting Together aCopper Instruction List .................................................15 OOMPLETE SAMPLE OOPPER LIST.................................................................17 LOOPS ANDBRANOHES..........................................................................................19 Starting and Stopping theCopper ........................................................................19 STARTING THE OOPPER AFTER RESET ......................................................19 STOPPING THE OOPPER........................................................................................19 AdvancedTopics .................................................................................................................20 THE SI(IP INSTRUOTION........................................................................................20 OOPPER LOOPS ANDBRANOHES ANDOOMPARISON ENABLE ..............................................................................................................................21 USINGTHE COPPER IN INTERLACED MODE...........................................22 USINGTHE OOPPER WITH THE BLITTER..................................................23 THE COPPER ANDTHE 68000..............................................................................24 Summary of Copper Instructions...........................................................................24 -ix-Chapter 3PLAYFIELD HARDWARE .....................................................................27 Introduction .......................................................................................................... ,..................27 ABOUT THISCIIAPTER ............................................................................................28 PLAYFIELD FEATURES............................................................................................28 Forming aBasic Playfield............................................................................................33 HEIGHT AND WIDTH OF THE PLAYFIELD..................................................34 BIT-PLANES ANDCOLOR .......................................................................................34 SELECTING RESOLUTION ......................................................................................38 ALLOCATING MEMORY FOR BIT-PLANES ..................................................41 CODING THE BIT-PLANES FOR CORRECT COLORING......................44 DEFINING THE SIZE OF THE DISPLAY WINDOW...................................46 TELLINGTHE SYSTEM HOW TO FETCH ANDDISPLAY DATA...................................................................................................................................49 DISPLAYING AND REDISPLAYINGTHE PLAYFIELD.............................52 ENABLINGTHE COLOR DISPLAY.....................................................................52 SUMMARY .........................................................................................................................53 EXAMPLESOF FORMING BASIC PLAYFIELDS ..........................................55 Forming aDual-playfield Display..........................................................................58 Bit-Plane Assignmentin Dual-playfield Mode.............................................60 COLOR REGISTERS IN DUAL-PLAYFIELD MODE....................................62 DUAL-PLAYFIELD PRIORITY ANDCONTROL...........................................64 ACTIVATING DUAL-PLAYFIELD MODE.........................................................64 SUMMARY .........................................................................................................................65 Bit-planes and Display Windows of AllSizes ...............................................65 WHEN THE BIG PICTURE ISLARGER THAN THE DISPLAY WINDOW...........................................................................................................................65 MAXIMUM DISPLAY WINDOW SIZE.................................................................72 Moving(Scrolling) Playfields.....................................................................................73 VERTICAL SCROLLING............................................................................................73 HORIZONTAL SCROLLING .....................................................................................74 SUMMARY .........................................................................................................................78 AdvancedTopics .................................................................................................................79 INTERACTIONS- PLAYFIELDS ANDOTHER OBJECTS ....................79 HOLD-AND-MODIFY MODE....................................................................................79 FORMING A DISPLAY WITH SEVERALDIFFERENT PLAYFIELDS....................................................................................................................82 USINGAN EXTERNAL VIDEOSOURCE.........................................................82 SUMMARY OF PLAYFIELD REGISTERS.........................................................83 Summary of Color Selection .......................................................................................86 COLOR REGISTER CONTENTS ...........................................................................86 SOME SAMPLECOLOR REGISTER CONTENTS ........................................86 COLOR SELEOTION IN LOW-RESOLUTION MODE................................87 COLOR SELEOTION IN HOLD-AND-MODIFY MODE ...............................89 COLOR SELEOTION IN HIGH-RESOLUTION MODE ................................89 -x-Chapter 4SPRITE HARDWARE .................................................................................91 Introduction .............................................................................................................................91 ABOUTTHISClIAPTER ............................................................................................92 Forming aSprite.................................................................................................................92 SCREEN POSITION ......................................................................................................92 SIZEOF SPRITES..........................................................................................................95 SlIAPE OF SPRITES .....................................................................................................95 SPRITE COLOR ..............................................................................................................96 DESIGNING ASPRITE...............................................................................................98 BUILDINGTHE DATA STRUCTURE .................</p>