@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@W!( L(1   Y I`  d  Ld M * @  $ % CC$$)%1 Udߥ$9%: !0 S$% DD˙`  }J)Lr d M * @  $ % CC$$)%1 Udߥ$9%: !0 S$%} DD˙`  }J)Lr J  ((  p L ()   J}L= ( L 0q A    IB JC;? D W } LL  ` W )LA!  ߰")-݆ p" } $G@LL 08`Q")<2Q0 -G$Ș݆ UL# ; p8(()(0ʥ)NQ` }$GȘ݆LU )L ݆ L GȘ ݆LL )W>Z   HH)H }p h  hyhy D L> L JJ    ! LA*` BF }7'8  M HN H` 8 Z  \LdJJ!"! GFE@F (!L }EE !E^ ^ E E7EȩEdE/EȩE  D } .L }  ;F d  ;?F7F? ( .   Z D LL d } . D  L    p  E` , d)  D L) 0BM݊L݉} ML  N݆ L NLML [ TEqEHȱEqEh 0Gȹ G} HLL GɛL  LFREE SECTORS G) *Gȩ GȽG GȌ*jj >G} C8jJ3j2CD( C202C ԠBX` N 1? l LlD:RAMDISK}.COMLu L1 L ;LHL  T`  `8  ɐ     `TU  } L ? .  t`GBJ ~DEHI B V0dV!}QDEHI VF9 ,0 ,0 s0hhL  L` H hDHEh"}DEL8HI4 0 HI,0 0  9 .G VLO#},0 L4*IJ`llD1:AUTORUN.SYSNEED MEM.SAV TO LOAD THIS FILE.D8:MEM.SAV J y08 B|DEHI$} V0 0`B;DEL`?<0LV`@ʆ v s? F0Ξ05: [ BDEHI%} VY8 B V  @  /DE `E:D8:DUP.SYSERROR-SAVING USER MEMORY ON DISKTYPE Y TO &}STILL RUN DOS B;DE J  (` 9 V⪍ ઍ  -'}LLu ÝDEHILV 9 .l 9 .l  `` s$B BH(}I|DE V BLV nB,DE JLV B V BLVDEIʩ BꭝLu } 3E:}DISK OPERATING SYSTEM II VERSION COPYRIGHT 1984 ATARI CORP.A. DISK DIRECTORY I. FORMAT DISKB. RUN CARTRIDG*}E J. DUPLICATE DISKC. COPY FILE K. BINARY SAVED. DELETE FILE(S) L. BINARY LOADE. RENAME FILE M. RUN AT ADDRES+}SF. LOCK FILE N. CREATE MEM.SAVG. UNLOCK FILE O. DUPLICATE FILEH. WRITE DOS FILES P. FORMAT SINGLEL !N',}#"&))9(&*)/h)''-&؆莟R'S  vL/ˢ L }Insert DOS 2.0s, type Y Λx -}DEfHI 1莏#q! @ y0ɛ8A0,' ȅ 1 1ild! 1L!NO SUCH ITEMSELECT.} ITEM OR FOR MENU! 0 .z:*{}.|{ 1 0 0JB 18L%|DL/}%DIRECTORY--SEARCH SPEC,LIST FILE?[# 0 0 &|D3" 1L!NOT A DISK FILEN !B 1L!E# 1 !BD0}ED:}:1BJ|DE 1DEBHI 1 h0ߢ 0.1}  0?詛 1 y0YЛ 1 ;#L" ;#L! BL1TYPE "Y" TO DELETE...DELETE FILE SPEC2}COPY--FROM, TO?OPTION NOT ALLOWED697 FREE SECTORS COPYING---D8:COPY32.COMl# 0|D .L/%#3}##JB|DE 1BHID#E 1#0: B 1L!#͑### B 1#c$0SY4}S1}:## # # .#Ƚ# # 𩛙## 1,#PD#ELJ- <.BJD#E 5}1 1HH 0hh|DL%1}:̳# L% #D#EL% 1 0 . .0O% 1L!WILD CARDS NOT A6}LLOWED IN DESTINATION 0 <.|K}N 2 FORMAT. t* 5) 1L!`) 0NΞ 0 L1) 1 L!BAD LOAD FILELOAD FROM WHAT FILE?) 0 ?}0#B 1L!WHAT FILE TO LOCK?) 0 0$B 1L!WHAT FILE TO UNLOCK?DUP DISK-SOURCE,DEST DRIVES?TYPE "Y" IF OK TO US@}E PROGRAM AREACAUTION: A "Y" INVALIDATES MEM.SAV.FE! +L1   `*  70 2 2A} 0.* 1 y0 0)INSERT BOTH DISKS, TYPE RETURN^, 1 y038逍 N, 1L! ,B}C, t*  Lx+, 0 ^, 1 y0 , ,0,0 ,L+ ,I0 ,Vǭ0C}Ξ, 0 }, 1 y0C,ШC, 0K'!" H H 'h h Lx+!EF 5L1L!D,I,HhD}` NOT ENOUGH ROOMINSERT SOURCE DISK,TYPE RETURNINSERT DESTINATION DISK,TYPE RETURNE}`  `8 rL1`-* 1P* 1 y0Y`hhL!NAME OF FILE TO MOVE?- 0 0|DL% <.F},^ 1 70 0 .@L# .BJ 1  DEHIB V L1 ,} 1 70,L.  G}JB|,#P#DE 1 HI BDEHHII 1 B 1 ,^ 1 70,0La- B V,#PH},^ 1 70 0L#L!-* 1P* 1 y0Yj383}mm ݭI}}`8}``|* ? ɛ,`|:-)| / 1L!`DESTINATION CANT BE DOJ}S.SYS0 0H{ 24Δ 28/L!/) 2 Π 2 0 ξK}hAΞB,0 J 1 BDEHI,HÝDE 1HIHIDELSAVE-GIVE L}FILE,START,END(,INIT,RUN)O S0 1`BDEPHI V` S0H 1 L!M}0 0 1L~0`PLEASE TYPE 1 LETTER,0`hhL! 70 1L0L<1 ,;ɛ7,"ɛ:ݦ1ݥN}A"D|ݤD|ȩ:|ȩ|ɛ,,(/+.ީ1 1,ɛ`轤{NAMEO} TOO LONG B VL!` L1I H1EΝDL1|mDiE` V0`8d/8 i:222 1 LP}!ERROR- 164ɛ+,' 20*.. өr2 1``2TOO MANY DIGITSINVALID HEXAQ}DECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8uR} ECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8u05  15 2 2151^116115ύ011$r2ԭ5 3)5)5ԭx GT}@@L00)+& 2 L0=ɛ -L!1LV1L1 /3 3ȹ441L-4 v3 25 2H 2h͔5U}L3L3 2 k3U hh`DOC`QL3P1Lk0S1H /3h0B k3@ VL0LU!#$53 1181118V}1111Ε5 1Lk0552 1Ȍ1i111i11115Lk0pppB4f5&&&&&&&&^6f^6&&&&&W}&&A1@BJ D2ELVK@BHILV^Щ6 2BD2EJ VBD5EHI0 V0%5X}5 2iХiL[2 25 25`D:*.*` i@`8 ``@i `8@`0 BLV525<4Y}5`HH i ԍΗ552 ԍhh@ Lح1Э1Ѣ 24.4 24Z}4`D4E` 2BJ k3LVRH` 2BD4EhK)I JLV333 BASIC language TUR > TURBO BASIC OBJ| f}COM > MACHINE language DOC > DOCumentation PIC|MIC|FNT|MVM > Graphics AMS|MUS|MBD > Music LST > BASIC g} LISTing -Some MACHINE language programs can only be run by loading the MENU without BASIC! ------- -For s h}ome programs, XL/XE models may require a "TRANSLATOR" program (available from BELLCOM) to be loaded first! -Most i}programs are relatively self-explanatory; however, some may have separate DOCumentation files. Some BASIC programs m j}ay contain instructions in their program listings. LIST to read. -To view DOCumentation files one page at a time, k} press [START], [Return], or the Joystick Trigger to display the highlighted DOC file. Pressing the [Esc] key cau l}ses a return to MENU. -To print out a hard-copy of any DOCumentation file, [Q]uit the MENU, boot DOS, and then from m} DOS, use the (C)Copy command: D:Filename.DOC,P: -To use this great MENU program on your own disks, simply n} copy the file "AUTORUN.SYS". D:Filename.DOC,P: -To use this great MENU program on your own disks, simply ! ==== ==== ==== ==== ==== ===p}=== == == == == == == == == == [R] _________________________________ q}ATARI * SYSTEM REFERENCE MANUAL _________________________________ A voluntary payment of $1.50 is requested for thisr} SHAREWARE disk. I will give any technical support I can to those who have paid this fee and include a S.A.S.E. withs} their questions. Write to the address on the title page of this Manual: Bob DuHamel, 6915 Casselberry t}Way, San Diego, CA. 92119 This double sided disk contains parts 3 and 4 of an extensive 4- part systems refeu}rence Manual for Atari 8-bit computers, consisting of 20 chapters, plus 3 appendices. The Manual is written for the Av}tari 400/800, but updates for latest XL/XE models are included. The Manual may be read from the SCREEN and/or PRINTED w}out by using the READER.OBJ program included, or it may be dumped to a PRINTER by using your own favourite Word Procex}ssor. It is recommended that the Manual be printed out, due to it's large size and the need for referral. Also, as ty}he Manual is written in 80-columns, it is much easier to read in a printed form. ADDITIONAL PRINz}TING INSTRUCTIONS _____________________ The files on this disk were written with AtariWriter, and for an Epson{} MX80 printer. You should be able to load them into another Word Processor and easily change them to work with it an|}d a different printer. If you have AtariWriter and an Epson compatible printer, load and print each CHAP/APNDX file }}(CHAP1-CHAP20 / APNDXA-APNDXC). Ignore the files with extensions (i.e. CHAP1.1) as they will auto- matically chain to t~}he previous CHAP file. Change the following codes for a different word processor or printer: [CTRL][O]27E starts }NLQ mode " [O]27F stops NLQ mode " [O]27G starts BOLD mode " [O]27H stops BOLD mode " [V]D:... chai}ns new file " [E] page eject " [L] left margin " [R] right margin " [T] top margin (hal}f " [B] bottom margin lines) " [Y] page length " " [C] center " [C][C] right justify} _________________________________ (Advertisement) **************************** * DO YOU PROGRAM IN BA}SIC? * **************************** Add over 40 powerful new commands to Atari and compatible BASICs with the Ata}ri BASIC Power Pack; a function library for Atari BASIC. Just some of it's features are: = High speed disk access d}irectly to strings. = High speed graphics saving and loading. = Custom character set loading. = Mixed text a}nd graphics in mode 8. = English error messages. = Decimal aligned number columns. = Five color, 40 column text} mode. It is written in standard Atari BASIC with some machine language in strings. It's easy to use too because} all commands are called by name, not by address or line number. For information on how to obtain this terrific utility} by Bob DuHamel, write to: |BELLCOM |Public Domain Software Library |P.O. Box 1043, Peterborough |ONTARIO, CANADA} K9J 7A5DuHamel, write to: |BELLCOM |Public Domain Software Library |P.O. Box 1043, Peterborough |ONTARIO, CANADA $d0L 2L>%L-Lx%Lo(L(L(L(L4)L2)L%L%L%L%L%LU,L`,L(L)L,L(L+L$(L".L,L(L'L'L'Lm'Lv'L,L,L'L(L'L'L.L.Lk}.L.L.L.L.L.L.L#*L.*L&L&L.&L=&LF&LQ&Lk&Lr&L{&L&L&L&L)L)L)L)L,.L)L:'L'L&LL'L['LR'L*L*L.L&L&L&La'LB(LR(L}.L(L/L9/L6/L/L/L/L/L0L0L+0LC0L/L^(Lj(L)'L@'Lo/Lr/LO/L%L'L%L% -膚 ɩҍD҅ 2 22}2 a(2222 ` -Lq -l ԤՄԅ`ȱ`ȱ`ȥ`}ԑȥՑ`ԤՄ`ԤԅդՅ` '0=D '04.5 '0.( '0 ' ' 8`ԅ`} & & & &ѐ & &ʥ %аЪ %Зьɛ &0 &0 `}ԥ`Ɠƒ` % &LS* %LS* %օ0֥0 S*` %eԥe` %La* % % o*L% %Lo* % &L|* %L|* %}L% % Ʌ` BLV䅆L' %ԅ`TU HH 'hhL, B VԩL%p v'P}KJBDEL, &fL=) %ԅ`Ę eĘ +L4( % & %` %Ԅԅ`} -``&eԅԥeՅ`L% o(ԨL%Ԅ & %eԥe` Ԅ &ɛ +0` d) ذI} ( 8ԅԩՅL%L,ȹɛ꩛` d)f & 8fԆՅɛ摥0L}?)$0`2 2L,(,ɛM(M( )ɛ )򩀅` %ԍ`ԄL%}ԄL%ɛԆL% &󅐩f =) ؐL(L4,ԅԥՅL%82ԭ 2L%ԤՄԅե`}8ե`eեe` B* K+fL% B* +fL%8ԨՄԅL% & B*ԥՄԩՅօפԥFf G+}ԥ K+ԅՅԥզЦ`ԅՅʩ0B+=+ B+ 08f$˹ `' d }+1ԦԄզՄFԐ eਊe&Lh+Ԇ`hh L, +Ff&֐ݥ ԆՅԠ&&&8થ}օԈ`քע +Ե 8`晄 ,L,`GHFH` U,0ɛȄ ؐL,HI h 8}ԅԩՅL%?S, ,򦅩DEBHIL,ɛ +` +` %HI BL,}՝HIB VL,L%B Vú.hh -l. -0dd-8/ i - 0-- ,}@ . ,... + x' $(.Ԏ.8ե ".LO-- , `,ɛD(C` ذ -L- -L 2 -- ,}L- - -L-l lp '8`ERROR- ?Run address> BASIC exitTrace:P8Յթԅ` ,.L, .-}ȘH *h00,)` & ҅ԭ ) |*օեׅ` L,0թԅթᨊઐ}```Յ`8Յթԅ`0 ԩ`ԅ`` ' %`BԝK)I JD/ELVS:)H)h y}` & % & %TԅUՅV`&B ,NLսM` & %ԝL՝MN%BL, & /` BHIL, & /`}B JKL, %ԅUՅV & %ԅT`)ҩҊ H) hҘ` %)xԩL% %))Lc&LZ& %})pԩL% %)|LZ&Lc& V0L-$2~2'@'@DDhDDL 2 $ppҠD Z$1@ H$ ?$ $ <}G@vD $K@D $5@ !$PD '$5@ !$R22D '$N@hD $Z@D $a@} !$ $D $ h9 Z$ ?$ Z$c@ H$ Z$ -$ᢐD <$2}3թ@D $L*3L}3ԩթ@D $LY3L3ԩթ@D $~33L3@wD $L3 h9}L2 h9 Z$ ?$ Z$@ H$ Z$ -$ᢐD <$ԩթ@D $L43{4L%6ԩթ@}D $L/4L%6ԩթ@D $Ls4@D $Ly4 h9L3 h9|44 Z$ ?$ Z$@ }H$ Z$ -$ᢐD <$ԩթڅ@D $L4LV5ppҠDԩթ@4z5D }$L5LV5ԩթ܅@D $LP5/@ !$PD '$LV5 h9Ly4 h9 Z$ ?$ Z$ޠ@ H$ Z$ -${55}ᢐD <$ԩթڅ@D $L5L%6ԩթ@D $L5L%6ԩթ@}5y6D $L6/@ !$RD '$L%6 h9LV5 h9 Z$ ?$ Z$A H$ Z$ -$ hD <$ԩթ @h}D $z66L6N@hD $L> h9 Z$ ?$ Z$A H$ ?$ Z$ ?$ Z$5A H$ ?$Щ r$LD '$LD !$C@} $L6L7LD6x7 !$?@ $L7L 2L6 Z$1@ H$ ?$8 %vD{D $hD~D $ Z$}{D f$ Q$ Z$y77ᢌD f$ Q$ppҠD =ԩթ@D $L8 Z$1@ }H$ ?$ Z$ ?$ Z$ ?$ Z$ ?$ Z$Q7x8A H$ ?$ Z$ `$FD '$ԩթjAD $L?8 ~; Z$FD !$ }$ᢀ K$FD !$a@ $L8 Z$y88ᢧD K$ ?$L8é r$HD '$RHD !$pA $L8 Z$ ?$ Z}$rA H$ ?$ Z$ ?$L9 Z$ ?$ Z$A H$HD !$ E$8x9A H$ ?$ Z$ T$ Z$ T$0 Z$ T$ppҠD Z$A H$ ?$Щ} r$LD '$LD !$C@ $L_9Lb9L69L 2L$5@ !$OA $$ $y99 Z$ؠA H$ ?$A !$B $$ $ Z$wD K$ ?$}ԩթjAD $L9A !$A@ $$ $ Z$B H$9x: ?$ԩթ@D $LH:}A !$A@ $$ $ Z$ B H$ ?$PD !$5@ $L:A !$B $$ $ Z$By:: H$ ?$PD !$/@ $L:A !$}B $$ $ Z$B H$ ?$RD !$5@ $L:A !$'B $$ $ Z$)B H$ ?$RD !$/@:v; $L$;A !$'B $$ $} Z$,B H$ ?$A !$'@ $$ $ Z$0B H$ ?$A !$'@ $$ $ Z$ hD K$ ?$5@ !$E@w;; $$ $`T r$JD '$}^D !$3@ $L; Z$ ?$ Z$ $L> Z$A@ !$ $ᢀ K$RD !$/@ $L> Z$)D !$ $ᢀ K$-D !$ $}ᢀ K$/D !$n>> $ᢀ K$` Z$1@ H$ ?$/@ !$^D '$8 %vDD $0 Z$ T$ R Z$1@} H$ ?$0 Z$ᢓD f$>l? Q$ppҠD Z$3D H$vD K$7D H$ ?$ Z$ ?$? %/@ !$ND '$0 Z$ }`$`D '$ Z$`D !$ $ᢀm?? K$`D !$a@ $L? Z$ᢧD K$ ?$ ~;ND $BD $LE?é r$HD }'$pA $L?L83@ !$^D '$ ~;R?b@ Z$ ?$0 Z$ T$5@ !$^D '$ Z$1@ H$ ?$ ---- 24 blank lines (8 each command) 112 $70 / 66 $42 ----- load memory scan counter with $9C}24 64 $40 \__ next two bytes and display one line 156 $9C / \ of ANTIC 2 characters 2 $0}2 -\ | 2 $02 | \- address of display data buffer 2 $02 | 2 $02 \--- 2nd ANTIC 2 }instruction - --- 2 $02 ----- 24th ANTIC 2 instruction 65 $41 \ } 32 $20 >---- jump back to start of list 156 $9C /$9C40 ??? ?? first byte of display data buf}fer --- --$9FFF ??? ?? last byte of buffer$A000 start of ROMA display li}st for a higher resolution graphics mode would require more instructions and might cross a 1K boundary. It would then includ}e a jump instruction to cross the boundary.MULTIPLE DISPLAYSIt is possible to set up multiple displays and use one at a t}ime. The technique of changing from one display to another is called page flipping. Below is the simplest way to set up two} displays.setting up two displays 11Call a graphics mode through CIO or by using a BASIC GRAPHICS command.Store the d}isplay list pointers, SDLSTL and SDLSTH, and the CIO screen pointer, SAVMSC [$0058,2 (88)].Move the start-of-ROM pointer, R}AMTOP [$006A (106)] to below the current display list. RAMTOP is a one byte pointer so it changes in increments of one page }(256 bytes).make another graphics call as in the first step.store the new display list pointer and CIO screen pointer. 1}0This will set up two displays, each with it's own display list. If the displays are in the same graphics mode, or you will} not make any changes in the displays with CIO commands, (PLOT, PRINT, etc.) you can flip between the two simply by changing  }the display list pointer.If the screens are in the same graphics mode and you want to change which one to do CIO commands t!}o, Change the CIO screen pointer, SAVMSC [$0058,2 (88)]. This way, you can display one screen while drawing on the other.I"}f you want to do CIO commands to screens of different graphics modes, you will have the move RAMTOP and do a graphics call to#} change screens.If your manipulation of RAMTOP causes the display data buffer to cross a 4K boundary, the screen may be scr$}ambled.DISPLAY LIST INTERRUPTSDLIs are not used by the operating system. However, other programs can initiate and use th%}em. Use the following steps to set up display list interrupts.Setting up DLIs 11Set bit 7 of the display list instruct&}ion for the line before you want the interrupt to occur. (The interrupt routine should set WSYNC and wait for the next line '}to execute.)Set bit 7 of NMIEN [$D40E (54286)] to enable DLIs.Set the DLI routine vector, VDSLST [$0200,2 (512)] to point(} to your machine language DLI routine. 10Your DLI routine should set WSYNC [$D40A (54282)]. STA WSYNC will do. THis will )}cause the 6502 to wait for the next horizontal sync. This will keep the DLI routine from changing something in the middle of*} a T.V. line.The DLI routine must end with an RTI instruction.SCROLLINGScrolling is controlled by a combination of scro+}ll position registers, and changing the memory scan counter. Basically, course scrolling is done by reloading the memory sca,}n counter and fine scrolling is done by changing the scroll registers.VERTICAL SCROLLINGVertical scrolling is very simple-}. Follow the steps below to set up vertical scrolling of graphics.Steps to use vertical scrolling 11Set bit 4 of the f.}irst byte of the display list instruction for each line to be scrolled.Put the number of T.V. lines to offset the graphics /}vertically in the vertical scroll register, VSCROL [$D405 (54277)] 10The vertical scroll register can offset the graphics u0}pward by 0 - 7 T.V. lines in the 24 line graphics modes (ANTIC modes 2 and 4). In 12 line graphics modes (ANTIC modes 5 and 1}7) it can vertically offset the graphics by 0 - 15 T.V. lines. To offset the graphics an 8th (or 16th) line, the scroll regi2}ster is reset to 0 and the memory scan counter is reloaded with the address of the next line of graphics in the display data 3}buffer. If the entire screen is being scrolled, the load-memory-scan-counter command (near the beginning of the display list4}) is changed to point to the address of the second line of graphics.HORIZONTAL SCROLLINGHorizontal scrolling works much l5}ike vertical scrolling. It is enabled by setting bit 5 of the instruction for each line to be scrolled. The horizontal scro6}ll register, HSCROL [$D404 (54276)], sets the offset. The small difference is that graphics are moved twice as far per chang7}e (two graphics 8 pixels instead of one). Also, when HSCROL = 0 the graphics are offset beyond the left edge of the screen b8}y 16 color clocks (32 Graphics 8 pixels). When HSCROL = 15, the graphics line is shifted one color clock (2 Graphics 8 pixel9}s) to the left of the screen.The big difference is that the memory scan counter gets messed up. This means that you must u:}se a reload-memory-scan-counter command for each line of graphics. This is a major modification of the display list. It wil;}l require you to move and build the list yourself.The advantage of this is that you can have a scrolling window in a large <}graphics map. The technique is to move the window by reloading the memory scan counter, then fine scrolling to the invisible=} bytes beyond the edges of the screen. 575useful data base variables and OS equatesSAVMSC $0058,2 (88): pointer>} to current screen for CIO commandsRAMTOP $006A (106): start-of-ROM pointer (MSB only)VDSLST $0200,2 (512): DLI?} vectorRAMSIZ $02E4 (740): permanent start-of-ROM pointer (MSB only)DLISTL $D402 (54274@}): display list pointer low byteDLISTH $D403 (54275): " high byteHSCROL $D404 (54276): horizontal scroll rA}egisterVSCROL $D405 (54277): vertical scroll registerNMIEN $D40E (54286): NMI enable (DLIs)Shadow registersB}SDLSTL $0230 (560): DLISTLSDLSTH $0231 (561): DLISTH0E (54286): NMI enable (DLIs)Shadow registersF12 4 1 5 0 10 70 2 12 13227E27H16-@CHAPTER 16PLAYER AND MISSILE (PM) GRAPHICSPlayers and missiles (c!D}alled sprites on some computers) are movable objects which are independent of the normal graphics.Player and missile graphi!E}cs are fairly straight forward. Once the computer is set-up for PM graphics, five 8-pixel-wide columns can be displayed on t!F}he screen. The horizontal resolution (width of each pixel) and the vertical resolution (number of scan lines per pixel) are !G}variable. The horizontal position of each column is determined by it's horizontal position register. Each column is simply !H}a representation of a bit map in a certain block of memory. If you want to draw an object on the screen, you simply put a bi!I}t map representing it in the proper memory block. The vertical position of an object is determined by the location of it's b!J}it map in memory. For example, if you want to draw a happy face in the middle of the screen, you put a happy face bit map in!K} the middle of one of the memory blocks controlling one of the columns.One column (player) displayed on the screen !L} ---------- first byte of a block | | | | ------------------------------ | | !M} | | | | | | | | | | | | | !N} | | | | | | | | | | | ++++ | visible | | !O}| + + | | | |+ + + +| | | |+ +| area | | |++ ++| !P} | | |+ ++++ +|--object | | | + + | bit map | | | ++++ | | | !Q} | | | | | | | | | | | -------------------!R}----------- | | | | ---------- last byte of a block Horizontal positions!S}$00 $30 $CE $FF(0) (48) (206) (255) | | | !T} | | Left edge right edge | | | Far left !U} far rightTo move the happy face vertically you would move the entire bit map in memory. To move the happy face horizonta!V}lly you change the number in the horizontal position register for the proper player.One of the players can be (and often is!W}) split into four columns of two pixels wide each. These columns are then called missiles. In this case, each missile has i!X}t's own horizontal position register.SETTING UP PM GRAPHICSPM graphics are enabled by the direct memory access control r!Y}egister, DMACTL [$D400 (54272)]. The program using PM graphics will usually use the shadow register, SDMCTL [$022F (559)].!Z}DMACTL (SDMCTL) 7 6 5 4 3 2 1 0 ----------------- |0|0| control | ----------------- bits 5 1 ![}= enable display list reading 4 0 = one line player resolution 1 = two line player resolution 3 1 =!\} enable four players 2 1 = enable fifth player or missiles 1 & 0 00 = no background 01 = narrow backgroun!]}d (128 color clocks, 1 color clock equals 2 GRAPHICS 8 pixels) 10 = normal background (160 color clock!^}s) 11 = wide background (192 color clocks)Normally, bits 5 and 1 are set to 1. Bits 4, 3 and 2 are used to enable!_} players and/or missiles accordingly.Once DMACTL is set up for the type of PM graphics to enable, the graphics control regi!`}ster, GRACTL [$D01D (53277)], is used to actually enable the PM graphics.GRACTL 7 6 5 4 3 2 1 0 ----------------!a}- |not used | | | | ----------------- Bits 2 1 = latch paddle triggers 1 1 = enable four players!b} 0 1 = enable fifth player or missilesIf only DMACTL is set up, the ANTIC chip will access memory for PM graphics b!c}ut will not display them.Next, the memory area used for the PM bit maps must be set. This block must start on a 2K (8 page!d}) boundary if single line resolution is used and a 1K (4 page) boundary for two line resolution.The page number where the b!e}it map starts is stored in the PM base register, PMBASE [$D407 (54279)]. For one line resolution this number will be a multi!f}ple of 8. For two line resolution it will be a multiple of 4. PMBASE holds the MSB of the address of the PM bit map. The L!g}SB will always be 0 so it need not be specified.The PM bit maps 2 line resolution 128 bytes (1/2 page) per!q}cB%DOS SYSB*)DUP SYSB SAUTORUN SYSB_HELP DOCBoMANUAL DOCBBREADER OBJB:CHAP15 B<CHAP15 1 B2CCHAP16 BE~CHAP16 1 B*CHAP17 B7CHAP18 B$CHAP19 B.?CHAP20 player ----------------- start + 0 | |\ +---------------+ 1-1/2 page | | !r}(384 bytes) +===============+ unused | |/ +---------------+ +$180 (384) |M3 |M2 |M1 |M0 | !s}fifth player or missiles +===============+ +$200 (512) | player 0 map | +---------------+ +$280 (640) !t}| player 1 map | +===============+ +$300 (768) | player 2 map | +---------------+ +$380 (896) | playe!u}r 3 map | +===============+ +$400 (1024) 1 line resolution 256 bytes (1 page) per player ------!v}----------- start + 0 | |\ + + | | +===============+ | !w} | 768 bytes + + | | (3 pages) +===============| | !x} | unused + + | |/ +===============+ +$300 (768) | | | | | fifth p!y}layer +M3 |M2 |M1 |M0 | or missiles | | | | | +===============+ +$400 (1024) | | !z} + player 0 map + | | +===============+ +$500 (1280) | | + player 1 map !{} + | | +===============+ +$600 (1536) | | + player 2 map + | !|} | +===============+ +$700 (1792) | | + player 3 map + | | +======!}}=========+ +$800 (2048)D:CHAP16.1792) | | + player 3 map + | | +====== 'Example of using P/M graphics in BASIC 110 REM ---LABEL REGISTERS ETC10 LINES=220 VERT=12022 IF LINES=2 THEN VERT=VERT/%}230 PM0=102432 IF LINES=2 THEN PM0=PM0/240 HORIZ=12050 PCOLR0=70460 SDMCTL=55970 SIZEP0=5325680 HPOSP0=5324890 SDMCTL%}=559100 PMRAM=PEEK(106)-16110 PMBASE=54279120 GRACTL=53277130 PMSTART=PMRAM*256+PM0200 REM ---SET REGISTERS210 POKE SDM%}CTL,62212 IF LINES=2 THEN POKE SDMCTL,46220 POKE SIZEP0,1230 POKE HPOSP0,HORIZ240 POKE PCOLR0,88250 POKE PMBASE,PMRAM26%}0 POKE GRACTL,3300 REM ---DRAW PLAYER310 POKE PMSTART+VERT,60320 POKE PMSTART+VERT+1,66330 POKE PMSTART+VERT+2,165340 PO%}KE PMSTART+VERT+3,129350 POKE PMSTART+VERT+4,195360 POKE PMSTART+VERT+5,189370 POKE PMSTART+VERT+6,66380 POKE PMSTART+VER%}T+7,60 10The above program will draw a happy face in about the middle of the screen using player 0. To move the player hor%}izontally, poke a different number into HPOSP0. To draw the player in a different vertical position, change VERT. To use a %}different player or missile, use the memory maps above to find the starting address of the player you want to use. For examp%}le, to use player 1 change line 40 to PM1=1280. Then change line 130 to PMSTART=PMRAM*256+PM1. The variable "LINES" determi%}nes the vertical resolution. The number poked into SIZEP0 determines the width.P/M PRIORITYThe priorities of players, m%}issiles and non-P/M graphics can be controlled by the PRIOR register [$D10B (53275)] and its shadow register, GPRIOR [$26F (6%}23)]. Objects with higher priority will appear to move in front of lower priority objects. The format of PRIOR is as follow%}s:PRIOR bit assignment 7 6 5 4 3 2 1 0 ----------------- | | | | | | | | | ----------------- 1%} 6 3 1 8 4 2 1 2 4 2 6 8Bits 7-6 Control the GTIA graphics modes. 00 = normal 01 = mode%} 9 10 = mode 10 11 = mode 11 5 1 = multiple color player enable. Permits overlappin%}g of players 0 and 1 or 2 and 3 with a third color in the overlapped region. 4 1 = fifth%} player enable. All missiles will assume the color controlled by COLOR3 [$2C7 (711)]. missiles %}are positioned together to make the fifth player. 3-0 Controls the priorities of players, %}missiles 20and other graphics. Objects with higher priority will appear to move in front of those with lower priority.Th%}e following chart may need some clarification. In the chart: 22PM0 = player 0 and missile 0 C0 = COLOR0, plotted graphic%}s controlled by color register 0 in the SETCOLOR command. P5 = all four missiles when combined into one p%}layer.BAK = the background, known as COLOR4 or color register 4 in the SETCOLOR command. 10Etc.Bits 0-3 of PRIO%}R and P/M prioritiesBit 3=1 2=1 1=1 0=1 C0 C0 PM0 PM0 highest C1 C1 PM1 PM1 %}priority PM0 C2 C0 PM2 PM1 C3+P5 C1 PM3 PM2 PM0 C2 C0 PM3 PM1 C3+P5 %} C1 C2 PM2 PM2 C2 C3+P5 PM3 PM3 C3+P5 lowest BAK BAK BAK BAK priorityOnly one p%}riority bit can be set at a time. If more than one priority bit is 1, overlapping areas of conflicting priorities will turn %}black.COLLISIONSEach player or missile has a register showing overlap (collisions) with other objects. Each player has t%}wo registers assigned to it; one to detect collisions with other players and one to detect collisions with plotted objects. %}Likewise each missile has two registers; one to detect collisions with players and one to detect collisions with plotted obje%}cts. Careful use of these 16 registers can detect any type of collision.Each register uses only the lower 4 bits. The bi%}ts which equal 1 tell what the associated object has collided with. For example, to detect collisions of player 1 to other p%}layers examine P1PL [$D00D (53261)].P1PL, player 1 to player collisions 7 6 5 4 3 2 1 0 -----------------P1PL%} |unused | | | | | ----------------- 8 4 2 1 3 = 1 collision with player 3 2 = 1 collision wi%}th player 2 1 = 1 invalid 0 = 1 collision with player 0Etc.When looking for collisions with plotted objects,%} the bit number tells what color register is assigned to the object the collision was with. For example, to detect collision%}s between player 1 and plotted objects (officially called the play field), P1PF [$D005 (53253)] is used.P1PF, player 1 to %}ploted object collisions 7 6 5 4 3 2 1 0 -----------------P1PF |unused | | | | | ----------------- %} 8 4 2 1 3 = 1 collision with COLOR3 2 = 1 " COLOR2 1 = 1 " COLOR1 0 =%} 1 " COLOR0Etc.Once a collision occurs it remains indicated in its collision register. To clear out all c%}ollision registers, write anything to HITCLR [$D01E (53278)]. STA HITCLR or POKE 53278,0 will do.Useful database variabl%}es and OS equates 575HPOSP0 $D000 (53248): write: horizontal position of player 0M0PF " " : read: mis%}sile 0 to plotted graphics collisionsHPOSP1 $D001 (53249): write: horizontal position of playe%}r 1M1PF " " : read: missile 1 to plotted graphics collisionsHPOSP2 $D002 (5325%}0): write: horizontal position of player 2M2PF " " : read: missile 2 to plotted graphics %} collisionsHPOSP3 $D003 (53251): write: horizontal position of player 3M3PF " " : read: missile 3 t%}o plotted graphics collisionsHPOSM0 $D004 (53252): write: horizontal position of missile 0P0P%}F " " : read: Player 0 to plotted graphics collisionsHPOSM1 $D005 (53253): write: horizontal position of %}missile 1P1PF " " : read: Player 1 to plotted graphics collisionsHPOSM2 $D006 (53254): write: horizontal%} position of missile 2P2PF " " : read: Player 2 to plotted graphics collisionsHPOSM3 $D007 (53255): writ%}e: horizontal position of missile 3P3PF " " : read: Player 3 to plotted graphics collisionsSIZEP0 $D008 %}(53256): write: size of player 0M0PL " " : read: missile 0 to player collisionsSIZEP1 $D009 (53257): wri%}te: size of player 1M1PL " " : read: missile 1 to player collisionsSIZEP2 $D00A (53258): write: size of %}player 2M2PL " " : read: missile 2 to player collisionsSIZEP3 $D00B (53259): write: size of player 3M3P%}L " " : read: missile 3 to player collisionsSIZEM $D00C (53260): write: widths for all missilesP0PL %} " " : read: player 0 to other player collisionsGRAFP0 $D00D (53261): write: player 0 graphics (used by OS)%}P1PL " " : read: player 1 to other player collisionsGRAPF1 $D00E (53262): write: player 1 graphicsP2PL %} " " : read: player 2 to other player collisionsGRAFP2 $D00F (53263): write: player 2 graphicsP3PL " %} " : read: player 3 to other player collisionsGRAPF3 $D010 (53264): write: player 3 graphicsGRAFM $D011 %}(53265): write: missile graphics (used by OS)COLPM0 $D012 (53266): color for player/missile 0COLPM1 $D013 (53267): %} 1COLPM2 $D014 (53268): 2COLPM3 $D015 (53269): %} 3COLPF0 $D016 (53270): color register 0COLPF1 $D017 (53271): 1COLPF2 $D018 (53272): %} 2COLPF3 $D019 (53273): 3COLBK $D01A (53274): background color (register 4)PRIOR $D01B %} (53275): priority select, GTIA modesGRACTL $D01D (53277): graphics controlHITCLR $D01E (53278): writing anything%} clears all collision bitsDMACTL $D400 (54272): direct memory access (DMA) controlPMBASE $D407 (54279): start of P/%}M memoryShadow registersSDMCTL $022F (559): DMACTLGPRIOR $026F (623): PRIORPCOLR0 $02C0 (704): COLPM%}0PCOLR1 $02C1 (705): COLPM1PCOLR2 $02C2 (706): COLPM2PCOLR3 $02C3 (707): COLPM3COLOR0 $02C4 (708)%}: COLPF0COLOR1 $02C5 (709): COLPF1COLOR2 $02C6 (710): COLPF2COLOR3 $02C7 (711): COLPF3COLOR4 $02C8 %} (712): COLBK $02C5 (709): COLPF1COLOR2 $02C6 (710): COLPF2COLOR3 $02C7 (711): COLPF3COLOR4 $02C8 $12 4 1 5 0 10 70 2 12 13227E27H17-@CHAPTER 17SOUNDGenerating sound can be very simple. For simple s)}ounds there are four audio channels, each controlled by two control registers.GENERATING SOUNDSTo generate a sound in cha)}nnel 1, put the frequency and volume codes into the frequency and control registers. The frequency register for channel 1, A)}UDF1 [$D200 (53760)] can have any number from 0 to $FF (255). 0 causes the highest frequency; 255 causes the lowest. The vo)}lume/noise (control) register for channel 1, AUDC1 [$D201 (53761)] is more complicated.Audio channel control (volume/noise)}) register 11 7 6 5 4 3 2 1 0 -----------------AUDCx | noise | volume| ----------------- 1 6)} 3 1 8 4 2 1 2 4 2 6 8 10The noise bits can have various values. The best way to learn to use them is by e)}xperimentation. The technical details of the polynomial counters which generate the noise has little bearing on what is hear)}d. The two special values of interest are: $1 (volume+16 in decimal), which causes a DC voltage proportional to the volume b)}its and; $A (volume+160), which causes a pure tone (square wave). The volume bits select the relative volume, 0=off. Theref)}ore, the number, $A8 (168 [8+160]) in AUDC1, will cause the frequency selected by AUDF1 to be a pure tone of medium volume.)}27GIn BASIC the dirty work is done fore you. The SOUND command will do all the calculations for you. The Sound command for)}mat is shown below.The BASIC sound command format SOUND channel,frequency,noise,volumeThe channel numbers is 0 to 3 i)}nstead of 1 to 4. The frequency, 0 to 255, is put into the frequency register. The noise is put into the high bits of the ch)}annel control register with volume in the low bits. Therefore... SOUND 0,125,10,8will produce a pure tone of medium freq)}uency and volume in channel 0 (called channel 1 in assembly language).ADVANCED SOUND27HThe Audio Control register, AUDCT)}L [$D208 (53768)], (not to be confused with the four audio channel control registers), adds more control for assembly languag)}e programmers. Again, to go into technical details will be less productive than experimentation.The audio control registe)}r. (AUDCTL) 7 6 5 4 3 2 1 0 ----------------- AUDCTL | | | | | | | | | ----------------- )}1 6 3 1 8 4 2 1 2 4 2 6 8 7 0 = 17 bit polynomial noise 1 = 9 bit below polynomial noi)}se 6 0 = clock channel 1 with 64 KHz 1 = clock channel 1 with 1.79 MHz 5 0 = clock channel 3 wit)}h 64 KHz 1 = clock channel 3 with 1.79 MHz 4 0 = clock channel 2 with 64 KHz 1 = clock channel)} 2 with channel 1 3 0 = clock channel 4 with 64 KHz 1 = clock channel 4 with channel 3 2 1 = ins)}ert logical high-pass filter in channel 1, clocked by channel 3 1 1 = insert logical high-pass filte)}r in channel 2, clocked by channel 4 0 0 = 64 KHz main clock 1 = 16 KHz main clock 11Al)}l bits of AUDCTL are normally zero. The BASIC sound command causes it to be reset to zero. 10By clocking one channel with )}another, the range can be increased. This essentially allows two channels with twice the range as each of the four normal ch)}annels. This is called 16 bit sound.To calculate exact frequencies, use the following formulas. The exact clock frequenci)}es are also given if more accuracy is needed. The clock frequencies are acquired by dividing the signal from the TV color-bu)}rst crystal. This crystal has a frequency of 3.579545 MHz.Clock frequencies: 1.7897725 MHz (color-burst/2) )} 63.920446 Khz (color-burst/56) 15.699759 KHz (color-burst/228)Formulas: For 1.79 MHz )} clock clock f = ------------ f = ------------ 2(AUDFn + 7) )} 2(AUDFn + 4) 16 bit 8 bit AUDFn is the number in the audio frequency register. For)} 16 KHz and 64 KHz clock f = ------------ 2(AUDFn + 1)AUDIO TIMER INTERRUPTSW)}hen the audio timers count down to zero they generate IRQ interrupts (if enabled). The timers can be reset by writing any nu)}mber to STIMER [D209 (53769)].THE CONSOLE SPEAKERThe console speaker is where key clicks and the cassette signals come f)}rom. On XL and XE models this speaker is heard through the TV speaker. It is operated by toggling bit 3 of CONSOL [$D01F (5)}3279). This bit always reads 0 but it is actually set to 1 during vertical blank.Useful data base variables and OS equat)}esCONSOL $D01F (53279): bit 3 controls console speakerAUDF1 $D200 (53760): Audio frequency 1AUDC1 $D)}201 (53761): audio control 1AUDF2 $D202 (53762):AUDC2 $D203 (53763):AUDF3 $D204 (53)}764):AUDC3 $D205 (53765):AUDF4 $D206 (53766):AUDC4 $D207 (53767):AUDCTL $D208 (537)}68): general audio controlSTIMER $D209 (53769): audio timer reset207 (53767):AUDCTL $D208 (537(M12 4 1 5 0 10 70 2 12 13227E27H18-@CHAPTER 18THE JOYSTICK PORTSThe joystick ports are the I/O ports -}of the PIA chip. This means that they are bidirectional, capable of output as well as input. The joystick ports are usually-} set up for input. To read them, simply read the port registers. PORTA [$D300 (53016)] will read joystick ports 1 and 2. P-}ORTB [$D301 (54017)] will read joystick ports 3 and 4. Joystick ports 3 and 4 are used for memory control on the XL/XE model-}s and don't have external connectors.Each bit of each port can be configured independently for input or output. To reconfi-}gure a port, the port control registers, PACTL and PBCTL [$D302 (54018) and $D303 (54019)], are used. The port control regis-}ters also control some lines on the serial I/O connector.The port control registers 11 7 6 5 4 3 2 1 0PACTL -} -----------------or |n 0 1 1 n n 0 n|PBCTL ----------------- 1 6 3 1 8 4 2 1 2 4 2 6 -} 8 bits PACTL 7 Peripheral A interrupt status. Set by peripheral interrup-}t; reset by reading PORTA. 3 Cassette motor control (0 = on: 1 = off). 2 0 = PORTA is now port A direction co-}ntrol. Writing to PORTA will now set bits for input or output. 0 sets bit for input; 1 sets -}bit for output. 1 = PORTA operational 1 1 = peripheral A interrupt enabled. PBCTL -} 7 Peripheral B interrupt status. Set by peripheral interrupt; reset by reading PORTB. 3 Serial conn-}ector command line. 2 0 = PORTB is now port B direction control. Writing to PORTB will now set bits for in-}put or output. 0 sets bit for input; 1 sets bit for output. 1 = PORTB operational 1 -}1 = peripheral B interrupt enabled.The electronic configuration of the controller ports is as follows. ----------- --}---------- \0 1 2 3 R/ \4 5 6 7 R/ \t + - L/ \t + - L/ ------- ------- 110 through 7 -}are the binary data bits for port A or port B.+ and - are +5 volts and ground respectively.R and L are the left and right-} game paddles.t is the joystick trigger line. 10The data bits in the joystick ports are used as follows for the joysticks.} and game paddles.The joysticks and the port registers 11 7 6 5 4 3 2 1 0 -----------------PORTA .} |U|D|L|R|U|D|L|R| ----------------- 1 6 3 1 8 4 2 1 2 4 2 6 8paddle | | .} | |triggers 3 2 1 0PORTB -----------------(400/800 |U|D|L|R|U|D|L|R|only) -----------------paddle .} | | | |triggers 7 6 5 4 U = up D = down L = left R = right 10The joysticks may be r.}ead either directly from the port registers or from the joystick shadow registers. During vertical blank, the data in the po.}rt registers is separated and put into the shadow registers. These registers are, STICK0 [$0278 (632)], STICK1 [$0279 (633)].}, STICK2 [$027A (634)] and STICK3 [$027B (635)]. The triggers may be read from the joystick trigger registers, TRIG0 - TRIG3.} [$D010 - $D013 (53264 - 53267)]. These register have shadow registers, STRIG0 - STRIG3 [$0284 - 0287 (644 -647)]. If these.} registers read zero the associated triggers are pressed. The paddle triggers may be read from their shadow registers also. . }They are, PTRIG0 - PTRIG 7, [$027C - $0283 (236 - 643)].THE GAME PADDLE REGISTERSAlthough the game paddles are plugged in. }to the joystick ports, they are not read from the port registers. The game paddles are read by first writing any number to t. }he start-pot-scan register, POTGO [$D20B (53771)]]. This turns off the capacitor dump transistors and allows the pot reading. }capacitors to begin charging. It also sets the TV scan line counter to zero. As each capacitor crosses a certain trigger. } voltage, the number of TV lines scanned is put in the respective pot value register. When the scan counter reaches 228, the.} capacitor dump transistors are turned on and the number 228 is put into any pot value registers which are still empty.Befo.}re reading the pot value registers, ALLPOT [$D208 (53768)] should be checked. In this register, each bit corresponds to the .}validity of a pot value register. If a bit is zero, its' associated pot value register is valid. If bit 2 of SKCTL, [$D20F .}(53775)], is 1, the pots go into the fast scan mode. In this mode the paddles are read in only 2 TV scan lines. They can al.}so be read without regard to POTGO or ALLPOT.The pot value registers contain the number of TV scan lines it last took for t.}he paddle reading capacitors to charge (up to 228). These registers are POT0 - POT7 [$D200 - $D207 (53760 -53767)]. Their s.}hadow registers are PADDL0 - PADDL7 [$0270 - $0277 (624 - 631)].THE LIGHT PEN REGISTERSWhenever a joystick trigger is pre.}ssed, the light pen registers, PENH and PENV are updated. PENH [$D40C (54284)] takes a value based on a color clock counter..} The value can be from 0 to 227. PENV [$D40D [54285)] takes the 8 highest bits of the vertical line counter. A light pen i.}s simply a photo transistor connected to a joystick trigger line and focused on the TV screen. When the electron beam strike.}s the part of the screen the light pen is focused on, the transistor turns on pulling the trigger line low. The light pen re.}gisters then contain numbers relative to where the light pen was pointing. The shadow register for PENH and PENV are LPENH [.}$0234 (564)] and LPENV [$0235 (566)). 5Useful operating system equatesTRIG0 $D010 (53264): joystick trigger.}s |TRIG3 $D013 (53268):POT0 $D200 (53760): paddle value |POT7 $D207 (53767):ALLPOT .}$D208 (53768): reads validity of pot valuesPOTGO $D20B (53771): starts paddle readSKCTL $D20F .}(53775): bit 2 enables fast pot scanPORTA $D300 (53016): port A dataPORTB $D301 (53017): port B dataPA.}CTL $D302 (54018): port A controlPBCTL $D303 (54019): port B controlPENH $D40C (54284): ligh.}t pen horizontal value PENV $D40D (54285): light pen vertical valueShadow registersLPENH $0234 . } (564): light pen horizontal valueLPENV $0235 (566): light pen vertical valuePADDL0 $0270 (624): gam.!}e paddle values |PADDL7 $0277 (631)STICK0 $0278 (632): joystick registers |STICK0 $027B ."} (635):PRTIG0 $027C (636): paddle triggers |PTRIG7 $0283 (643):STRIG0 $0284 .#}(644): joystick triggers |STRIG3 $0287 (647): |PTRIG7 $0283 (643):STRIG0 $0284 ,?12 4 1 5 0 10 70 2 12 13227E27H19-@CHAPTER 19MISC HARDWARE REGISTERS AND INFORMATIONVERTICAL LINE CO2%}UNTERThe ANTIC chip has a vertical line counter at $0D4B (54283). This counter shows the high 8 bits of a 9 bit counter. 2&}This gives two line resolution. The value of this counter is placed into PENV [$D40D (54285)] when a joystick trigger is pre2'}ssed.SERIAL PORT REGISTERSThe POKEY chip has some registers which control the serial port.The serial port control regis2(}ter, SKCTL [$D20F (53775)], controls the serial port configuration and the game paddle scan mode. and some keyboard circuitr2)}y.The serial port control register 7 6 5 4 3 2 1 0 ----------------- SKCTL | | | | | | | | |2*} ----------------- 1 6 3 1 8 4 2 1 2 4 2 6 8 bits 0 1 = enable keyb2+}oard debounce 1 1 = enable keyboard scan both 0 = set initialization mode. 2 1 = fast pot scan 3 2,} 1 = serial output is two tone (for cassette) instead of logical true/false 4\ 5 >- serial port mode con2-}trol 6/ 7 1 = forced logical 0 on outputIf the serial port control register is read from it gives the serial 2.}port status. The register is then called SKSTATSerial port status register 7 6 5 4 3 2 1 0 -----------------2/} | | | | | | | |1| ----------------- 1 6 3 1 8 4 2 1 2 4 2 6 8 bits 0 not used, reads 20}1 1 0 = serial input shift register busy 2 0 = last key is still pressed 3 0 = shift key pressed 21} 4 0 = direct from serial input port 5 0 = keyboard over-run 6 0 = serial data input over-run 7 1 22}= serial data input frame errorThe serial port status is latched and must be reset by writing any number to its' reset regi23}ster, SKRES [$D20A (53770)].SERIAL PORT INPUT AND OUTPUT DATAWhen a full byte of serial input data has been received, it 24}is read from the serial input data register, SERIN [$D20D (53773). Serial output data is written to the same register, which25} is then called the serial output data register, SEROUT. This register is usually written to in response to a serial output 26}data interrupt (bit 4 of IRQST).HARDWARE CHIP MEMORY ALLOCATIONThe addresses for the hardware chips are not completely de27}coded. For example, the PIA needs only four bytes of memory but is active from $D300 - D3FF. Enough room for 64 PIA chips. 28} A second pair of parallel ports could be added by accessing the address bus and further decoding the address for a second PI29}A. (This would also require a small modification of the computer's circuit board to disable the original PIA when the new on2:}e is active.) Similarly, there is room for 15 more POKEY or ANTIC chips and 7 gtia chips, should you ever need them. (GTIA 2;}uses $D000 - D0FF, POKEY uses $D200 - $D2FF and ANTIC uses $D400 - $D4FF.)Useful data base variables and OS equates 52<}75SKRES $D20A (53770): serial port status resetSEROUT $D20D (53773): serial output dataSERIN $D20D (53773): 2=}serial input dataSKCTL $D20F (53775): serial port controlSKSTAT $D20F (53775): serial port statusVCOUNT $D40B 2>} (54283): vertical line counterOs shadow registersSSKCTL $0232 (562): SKCTL serial port statusVCOUNT $D40B 0Y12 4 1 5 0 10 70 2 12 13227E27H20-@27GCHAPTER 20THE XL AND XE MODELSBASIC B BUGSMost of the Atari6@} 600XL and 800XL models were supplied with the "debugged" version B of Atari BASIC. This new BASIC got rid of the minor bugs6A} of BASIC A and introduced some new major bugs of it's own. 11Each time a program is saved, 16 extra bytes are tagged onto 6B}the end of the program. After many saves and reloads, as when developing a long program, the program becomes too large for t6C}he memory.The computer may lock up unpredictably.Program line links may get messed up, leaving garbage in the listing and6D} the program unrunable.Large LISTed programs may not run unless SAVed and reLOADed.If the length of a listed program is a6E} multiple of a certain number of bytes, it will not run unless the length is somehow changed. 10BASIC version B has been re6F}placed by version C. All of the XE models have this truly debugged version of BASIC.NEW OPERATING SYSTEM PROBLEMSI have 6G}heard of only one bug in the operating system in XL and XE models. This is a mishandling of the printer timeout. The comput6H}er cannot tell if there is a printer attached or not. This may have been fixed in the XE models. However, many programs, so6I}me even formerly sold by Atari, do not jump through published jump vectors when using the operating system. These programs w6J}ill not run on XL/XE models. (Some of these programs are Atari Word Processor (not Atariwriter) and LJKs Letter Perfect and 6K}Data Perfect.) Since the operating system ROM can be switched to RAM, a "translator" can be used to load the 800 operating s6L}ystem into an XL or XE model.130XE MEMORY MANAGEMENTThe 130XE has an extra 64K bank of memory. It is divided into four 6M}blocks of 16K each. Each block can be switched to replace part of the main bank of RAM from $4000 (16384) to $7FFF (32767). 6N} Furthermore, it can be switched in such a way that only the 6502, or the ANTIC chip can see the extra memory.27HPort B (f6O}ormerly the two extra joystick ports of the 400/800) is used to manage the memory.Port B and memory management 11 6P} 7 6 5 4 3 2 1 0 -----------------PORTB |T|U|A|C|S S|B|R| ----------------- 1 6 3 1 86Q} 4 2 1 2 4 2 6 8 R 1 = OS replaced by RAM B 0 = BASIC enabled S S bank select bit6R}s C 0 = CPU sees switched RAM at $4000 A 0 = ANTIC sees switched RAM U unused T 0 = self test 16S}0Bits 2 and 3 of PORTB select which block of the extra bank of memory is switched in.Bank select bits bits blo6T}ck 2 3 address ------------------------- 0 0 $0000 - $3FFF 0 1 $4000 - $7FFF 1 0 6U} $8000 - $BFFF 1 1 $C000 - $FFFFBits 4 and 5 select which chip sees the switched in RAM at $4000 - $7FFF6V}Chip select bits bits ANTIC 6502 4 5 -------------------------- 0 0 Ext. Ext. 06W} 1 Ext. Main 1 0 Main Ext. 1 1 Main MainTHE XL PARALLEL PORT Pin out o6X}f the parallel port top from rear 111112222233333444445 2468024680246802468024680 6Y} ------------------------- ------------------------- 11111222223333344444 13579135796Z}135791357913579 1 2 GND 3 A1 4 A0 5 A3 6 A2 7 A5 86[} A4 9 GND 10 A6 11 A8 12 A7 13 A10 14 A9 15 A12 16 A11 16\}7 A14 18 A13 19 A15 20 GND 21 D1 22 D0 23 D3 24 D2 25 D5 6]} 26 D4 27 D7 28 D6 29 GND 30 GND 31 GND 32 phase 2 clock 33 RESET 6^} 34 35 RDY 36 IRQ 37 37 39 40 41 GND 42 43 RAS 446_} 45 R/W 46 GND 47 +5V 48 +5V 49 GND 50 11The phase 2 clock runs at 1.8 MHz. Wh6`}en the clock is high, the address and R/W lines are valid. The clock goes from high to low, when the data lines are also val6a}id. All lines then become invalid. 10The 130XE doesn't have the parallel port. However, it has a cartridge slot expansion6b}. This is a small cartridge-slot-like connector with the necessary connector to use parallel expansion.FINE SCROLLINGIf 6c}address $026E (622) is $FF, graphics 0 will be in the fine scroll mode.OTHER ADDRESSESDSCTLN [$0D25,2 (725)] is the disk 6d}sector size. should be $80 (128).DMASAV [$02DD (735)] is a copy of the DMA control register, SDMCTL [$022F (559)]. It is 6e}set up when a channel is opened to the screen. The value is moved to SDMCTL whenever a key is pressed. It is used to restor6f}e the display if DMA is disabled.PUPBT [$033D,3 (829-831)] is used to test memory integrity when [RESET] is pressed. If th6g}ese bytes are not $5C, $93 and $25, the computer will do a cold start when [RESET] is pressed.The self-test ROM is from $D06h}00 to $D7FF, the same addresses as the hardware registers. This part of the operating system ROM is disabled when not used. 6i} When The computer is put into the self-test mode, This part of ROM is copied to $5000 to $57FF and run from there.GINTLK [6j}$03FA (1018)] is a logical 1 if a cartridge is installed (built-in BASIC is considered a cartridge). BASIC can be disabled b6k}y poking 1018 with a non-zero number. If [RESET] is then pressed, the computer will attempt to load the DUP.SYS file and bas6l}ic will be completely disabled.ber. If [RESET] is then pressed, the computer will attempt to load the DUP.SYS file and bas4!