STE Developer Addendum The Atari ST" Compatible with ST, 1000s of software titles available. New • Extended color palette of 4096 colors, from 512 • Hardware support for horizontal and vertical scrolling • Ready for external GENLOCK • Stereo 8 bit PCM sound • Light gun, paddle and new joystick ports. • 256K ROM from 192K includes Move as well as copy files Rename folder's Autoboot GEM applications New file selector Faster desktop Large palette support Fast hard-disk support Folder limitations lifted Memory management improved Keyboard reset STE Developer Addendum This addendum is a set of documents that allows the ST developer to use the new features of the STE. These new features are in the areas of graphics, sound and interface ports. The STE has a palette of 4096 colors compared to the ST palette of 512 colors. Also the STE has hardware support for vertical and horizontal scrolling. Support has also been added for external GENLOCK. Sound on the STE has the ST sound as well as 8 bit stereo DMA sound with variable playback frequencies. The STE also has two new controller ports that allow for new joysticks as well as a light gun and paddle controllers. Genlock and the STE The ST (and STE) chip set have the ability to accept external sync. This is controlled by bit 0 at FF820A. as documented in the ST Hardware synchronization of the ST video Specification. This was done to allow the with an external source (a process usually known as GENLOCK). However, must also be phase-locked (or in order to do this reliably the system clock synchronized in some other way) to the input sync signals. No way to do this was provided in the ST. as a result the only GENLOCKs available are internal modifications (usually for the MEGA). The STE allows this to be done without opening the case. To inject a and then inject system clock ground pin three (GPO) on the monitor connector The frequency of this clock is the clock into pin 4 (mono detect). internal 32 215905 MHz (NTSC) and 32.084988 MHz (PAL). Note: DO NOT SWITCH CL(X:K SOURCE WHILE THE SYSTEM IS ACTIVE. As a result of this GPO is no longer available. Controllers FF9200 -ire Buttons FF9202 Joy 3 Joy 1 Joy 2 Joy 0 Joy sticks. Four new joystick ports are added. These ports are controlled directly by the 68000. The current state may be sampled at any time by reading the above iocations. Joystick 0 and Joystick 2 direction bits are read/write, if written to they will be driven until a read is performed. Simifarly. they wifi not be driven after a read untii a write is performed. FF9210 nm CXI (X Paddle FF9212 mHBHBHHNHH 1 Mill ' J (Y Paddle FF9214 mgisnsMigena i 1 1 LU 1 I""! (X Paddle FF9216 Nil LU (Y Paddle One pair of paddles can be plugged Into Joystick 0 (Paddle 0). A second set can be plugged into Joystick 1 (Paddle 1). The current position of each of the tour paddles is reported at these locations. The (ire buttons are the same as (or the respective Joystick. The triggers for the paddles are read as bits one and two of FF9202 (JOYO Left and Right) FF9220 lilillMllllili I I M I I I I ri (X Position) FF9222 —WH ii Ilill I i i i i i i iTI (Y Position) Light Gun / Pen. A light gun or pen can be plugged into Joystick 0. The current position that the gun or pen Is pointing to is reported by these registers. The position is accurate to within (X direction only): 4 Pixels in 320x200 Mode 8 Pixels in 640x200 Mode 16 Pixels in 640x400 Mode Accurate to 1 pixel in the Y direction in all modes. Accuracies do not account (or the quality of the light gun or pen. Note that the X position is given in pixels for 320x200 only. In order to get correct results in 640x200 mode this number needs to be shifted left one bit and In 640x400 mode this number needs to be shifted left two bits. STE Technical Documentation 25 May 1989 New Controller Pinout This pinout is for ports 0 and 1. Ports 2/3 are on the other DB15 connector. O CD O C C> \ \ o o o o o / \ 11 / L’ O O O ‘ ‘ / / 1 UPO 2 DNO 3 LTO 4 RTO 5 PAD OY 6 FIREO 7 VCC 8 NC 9 GND 10 FIRE1 11 UP1 12 DN1 13 LT1 14 RT1 15 PAD OX Video Modifications FF8204 (High) FF8206 FF8208 (Low) Video Address Counter. Now read/write. Allows update of the video refresh address during the frame. The effect Is immediate, therefore it should be reloaded carefully (or during blanking) to provide reliable results. FF820C h^hehuteb Low byte of the video base address. This register completes the set on ST Allows positioning screen on word boundaries and thus vertical scrolling. FF820E I ' I 1 I ! I I Offset to next line. . Number of words from end of line to beginning of next line minus one. Allows virtual screen to be wider than physical screen. Acts like an ST when cleared. Cleared at reset. FF8240 iTUcifeui rnkion fiunRiii through Red Green Blue FF82SE Color Pallete. . A fourth bit of resolution is added to each color. Note that the least significant bit ts added above the old most signilicant bit to remain compatible with the ST. FF8264 IWIHIIIilMtaiiMiMijJJ i i Horizontal Bit-wise Scroll. Delays the start of screen by the specilied number ol bits. 25 May 1989 STE Technical Documentation How to Implement Fine Scrolling on the STE. The purpose of this document is to describe how to use the capabilities of the STE to achieve bit'wise fine~scrolling and vertical split screens. Horizontal and vertical ^rolling are discussed and an example program is provided. Split screen effects are discussed and an example program with multiple independent scrolling regions is provided. Three new registers are provided to implement fine*scroUing and split screen displays: 1) HSCROLL - This register contains the pixel scroll offset. If it is zero, t^ is the same as an ordinary ST. If it is non-zero, it iixiicates which data bits consh^te the first pixel from the first word of data. That is, the leftmost displayed pixel is selected from the first data word(s) of a given line by this register. 2) LINEWID - This register indicates the number of extra words of data (beyond that required by an ordinary ST at the same resolution) which represent a single display line. If it is zero, this is the same as an ordinary ST. If it is non-zero, t^t m^y additional words of data will constitute a single video line (thus Rowing vutual screens wider than the displayed screen). CA UT/ON~ In fact, this register contains the word offset which the display processor will add to the video display address to point to the next line. If you are actively scrolling (HSCROLL < > 0), this register should contain the additional width of a display line minus one data fetcJiiin low resolution one data fetch would be four words, one word for monochrome, etc.). 3) VBASELO - This register contains the low-order byte of the video display base address. It can be altered at any time and will affect the next display proce^r data fetch. It is recommended that the video display address be altered only during vertical aiKl horizontal blanking or display gvbage may result. These registers, when used in combination, can provide several video effects. In this document we will discuss only fine-scrolling and split-screen displays. Fine Scrolling: Many games use horizontal and vertical scrolling techniques to provide vutual play fields which are larger than a single screen. We will first discuss vertical scrplling (line-wise), then horizontal scrolling (pixel-wise) and finally the example program "neowall.s" which combines both. Vertical Scrolling: To scroll line-wise, we simply alter the video display address by one line each time we wish to scroll one line. This is done at vertical blank interrupt time by writmg to the three eight- bit video display address registers to define a twenty-four-bit pointer into memory. Naturally, additional data must be available to be displayed. We might imagine this as a tall, skinny screen which we are opening a window onto for the user. The video display address registers define where this window will start Horizontal Scrolling: j j To scroll horizontally we might also adjust the video display address. If that was all we did. x we would find that the screen would jump sideways in sixteen pixel increments. To achieve smooth pixel-wise scrolling we must use the HSCROLL register to select where within each sixteen pixel block we wish to start displaying data to the screen. Finally, we must adji^ the LINEWID register to reflect both the fact that each line of video data is wider than a single display line and any display processor fetch incurred by a non-zero value of HSCROLL. All this is done at vertical blank interrupt time. Naturally, additional data must be available to be displayed. We might imagine this as an extremely wide screen which we are opening a window onto for the user. These registers define where this window will start. For Example: The program ”neowaIl.s" reads in nine NEOchrome™ picture files, organizes them into a three by three grid and allows the user to scroll both horizontally ar^ vertically over the images. The heart of this program (the only interesting thing about it actually) is the vertical blank interrupt server. This routine first determines the pixel offset and loads it into HSCROLL. The LINEWID register is now set to indicate that each virtual line is three times longer than the actual display width. If we are actively scrolling, this amount is reduced to reflect the additional four"planc data fetch which will be caused by the scrolling. Finally, the video display address is computed to designate a window onto the grid of pictures. This twentyfour^bit address determines where the upper left comer of the displayed region begins in memory. Thus, every frame an arbitrary portion of the total image is selected for display. The speed and resolution of this scrolling technique is limited only by the dexterity of the user. Split Screen: In many applications it is desirable to subdivide the screen into several independent regions. On the STE you may reload some video registers on a line-by-line basis (using horizontal blanking interrupts) to split the screen vertically into multiple independent regions. A single screen no longer need be a contiguous block of storage, but could be composed of dozens of strips which might reside in memory in any order. The same data could be repeated on one or more display lines. Individual regions might each have their own individual data and scrolling directions. For Example: The program "hscroll.s" reads in a NEOchrome"^ picture file and duplicates each Ime of the image. This, combined with the proper use of LINEWID. effectively places two copies of the same picture side-by-side. Next, both vertical and horizontal blanking interrupt vectors are captured and the horizontal blanking interrupt is enabled in counter mode. To prevent flicker caused by keyboard input, the IKBD/MIDl interrupt priority is lowered below that of the HBL interrupt. Note that the program 'main loop' doesn't even call the BIOS to check the keyboard, since the BIOS sets the IPL up and causes flicker by locking out horizontal interrupts - this may cause trouble for programs in the real world. The screen is effectively divided into ten regions which scroll independently of one another. There are two ten- element arrays which contain the base address of each region and its current ^roU offset. At vertical blank interrupt time we compute the final display values for each region in advance arxl store them into a third array.We then initialize the display processor for the first region and request an interrupt every twenty lines (actually every twenty horizontal blankings). During each horizontal interrupt service, we quickly reload the video display addre^ registers and the HSCROLL register. This must be done immediately - before the display processor has time to start the current line or garbage may result. Note that horizontal blank interrupts are triggered by the display processor having finished reading the previous data line. You have approximately 144 machine cycles to reload the HSCROLL and video display registers before they will be used again by the display procesror. Finally, the LINEWID register is set, this need only be done before the processor finishes reading the data for the current display line. We then pre-compute the data we will need for the next horizontal interrupt to shave few more cycles off the critical path and exit. hscroit.s Page 1 18:18:32 aa 2-Hay-1989 Hadaac 1.86 (Atar 1 2 HSGROLL.S Horizontal Scrolling Ocw> 3 THE ONE LINE VERSION 4 s Copyright 1988 ATARI CORP 6 Started 9/12/88 Rob Zdybel . . 7 8 9 .text 18 .Include atari SS9 .list 11 12 IJ HAROMRE CONSTANTS 14 15 •FFFF82B0 vtMtcIo • $ffff8266 1 Video Sase Address do) IS "FFFF826F llMHid tffff828f 1 Uldth of a scan-line (Words, olnus 1) 17 FFFr826S tiscroll - Sfffft265 1 Horizontal scroll count (8 .. IS) It 19 26 SY5TCM CtIMSTAHTS 21 22 •66866676 vblvK - $78 Systeo VOlank Vector 2> •88666118 Ikbdvtc • $118 1 IKBO/nOl (6858) Vector 24 •68668128 hblwtc $128 t Horizontal Blank Counter (68961) Vector 25 2E 27 LOCAL CONSTANTS 2t 29 16 11 SystCB Initialization J2 11 start 1 14 66888866 264F owe.l a7,aS IS 88886682 2E7Cxi4iixit ove.l eystack.aT i 6et Our Om Local Stack IS 88688888 26608864 anue.l 4(aS).aS aS • basepage address 17 8668886C 2820668C ove.l TaTSZ(aS).d6 11 86886616 08606614 add.l 0AT6SZ(aS),d6 . 19 68888814 06608610 add.l B5SSZ(aS).d6 46 86688818 066068868186 add.) NSldd.dd 1 RAH req'd • teit*bss*data*BascPageLcngth 41 8888881E 2866 ove.l dO.dd t d4 • RAH req'd Hshrlnk aS.d6 Return Excess Storage 86886628 2F88 6 ove.l d8.- 1 HARHIN6 - Old SSP saved on stack. 47 Fgetdta 6 SMdos $2f.2 8666661C 1F1C682F 6 ove.M M2f,-(sp) 4C41 6 trap 01 6 .If $2 <8 86666642 544F 6 addd 862. sp • else - add.N >$2.sp 46 - .endtf 49 86666644 2848 ove.l d8.a4 56 66666646 08FC661E adda 836,a4 i 44 • FlIcnaM ptr Fsflrst encofllc.M 86668646 1F3C6668 • ove.H e$6.-(sp) 8666864C 2F10XXXXXXXX • ove.l Rneof lle,- 88688666 2F60 6 ove.l a4.-(sp) hscroll.s P«0* 2 lSilti32 m 2-«to«-lM9 Maduc l.ee (Atari ST) eaxMlos SSd.S MSMKS 3PSCM30 MMW.H Itld.-Cip) •MMKC 4E41 trap 81 .If *8 « 8 addq iSS.ip .else add.H 858, sp 54 .cndlf 55 MaM478 4M6 tft d8 56 MtN«72 seeeiaxi bal abort i IF (6rror opening flic) ABORT 57 SB M6SM76 33CexiMXXxi eve 88. handle Fread da.832128.aneobuff N68M7C 2F3Cxxxil»i 8 owc.t 8ncebuff.-(tp) MBMea2 2F3CSeM70Be 8 Mwe.l 887888, -(sp) NNMSt 3FM • aoM.M 88. -(tp) 8 OoMlof t3f.l2 HMtaSA 3F3C8B3F 8 >000. H 8(3f,~(sp) 8S88M8E 4E41 8 trap 81 • .If »C <• 8 addg 8Sc,sp .else 888988 9 8 0EFC8HC 8 add.M 8Sc.sp 59 8 .cndlf 68 88888894 4A88 tst 1 . 88 61 88888896 6B8e»i« bal abort i IF (File Read Error) ABORT Fclose handle 88888898 3F39»xxxxx> 8 apvc.H handle. -(sp) 8 6aados $3c.4 88888888 3F3C883E 8 ove.N 883c. -(sp) 888980 84 4E41 8 trap 81 8 .If $4 <• 8 88888886 584F 8 addq 8$4.sp • .else add.H 8$4,sp 62 - .endlf 63 B888S888 4848 tst d8 64 N89B8A8 6B80ixxx bnl abort ; IF (Error Closing a file) ABORT 65 66 B888888E 4SF9xxxxx«t> lea neobuff*4.a2 67 888B8884 41FB8248 lea palette. a8 68 88888888 43F9ixxxxxxx lea oldpal.al 69 888808BE 3e3C8e8F ove 815, d8 • 78 71 72 73 74 B888nC2 888888C4 888B88C6 B88888CA 3208 3808 51C8FFF8 38308888 .ploop: Mvc.M ovc.H dbra nove (aB).(all* (a2)*,la8)« 88.. ploop 8168,88 i ; i save old color palette create ncM color palette Double each display line 75 888888CE 41F9xiixxxii lea bIgbuff.aB 76 88808804 43F9xxixixii lea ncobuff*128.al 77 88888808 341C88C7 ove 8199,82 78 eeaoeaoE 323cae27 .llnlpi aove 839. dl : FOR (288 Lines) 00 79 80Be88E2 21918888 .dublp: aove.) (al).(ae.de) ; duplicate line 88 88808866 2809 ove.t (al)«,(a8)* 81 80888868 51C9FFF8 dbra dl.. dublp 82 B00800EC 0808 adda dS.aO 83 888888EE SICAFFEE dbra d2,.llnlp 84 85 88B886F2 41F9ixiiixx> lea baseaddr.aO 86 neB88F8 43F9xxiiixii lea xoffset.al 87 80888866 4SF9xiiiixix lea blgbuff,a2 88 88880184 38300889 ove 89 dO, 89 08880108 32F08880 .strip: aove 88,(al>* ; FOR (18 Strips) 00 Init base and offset 98 88888180 28CA ove.l a2.(a8)< 91 B8B0818E 04FC1988 adda 8328*28, a2 92 80808112 5108FFF4 dbra 88, .strip 93 94 88888116 23F8eil8iixxxxxx anve.l Ubdvcc.oldlkbd 95 88888116 21FCxxixxiixeeB8 oue.l 8ikbd,lkbdvec t IPL 5 hack for 1K8D/KIDI 96 97 88808126 23F80078xiixxxxx ove.l vbivcc.oldvbl 98 88888126 21FCxxxxxxxx8888 ove.l aufai.ubluec i Capture Systea VBlank Interrupt 99 188 88088136 21F0xxxxxxxxB068 ove.l Bhbl.hblvec i Capture HBlank Interrupt 181 88888136 8SF88888FA13 bset.b RO.lara 102 80888144 88F8008eFA87 bsct.b *8,lera ; Enable Hblank 183 184 185 ; Scrolling Oeao loop 186 187 navelp: Bconstat COM : Keyboard Polling 88888148 36308882 8 aove.H *C0N.-(sp) 8 Bios 1.4 88888146 3F3C8801 8 xwvc.H asi,-(sp) 88888152 4640 8 trap 813 8 If $4 8 80808154 S84F 8 addo a$4.sp 8 else add.H *54, sp .endlf hscrall.s Page Z 10 ; 18 ! 32 M 2-M«y-lS89 Maduc i.BB (Atari ST) 1B9 BBaiaise 4A48 tst d8 IIB 81888158 E78BISII beq nocx It IF (Keyboard Input Available) THEM Bconin CON eaaaBisc 3F3Ce082 8 MVC.H eCOK.-isp) f Bios 2.4 08888168 3F3Ce682 8 MVC.H >52. -(sp) 88888164 4E40 8 trap >13 8 .If 54 <• 8 88888166 S84F 8 addq >54, sp 8 .else - add.N >54, sp - .endif 111 112 88188168 88308883 CM-b >'C'-64.d8 113 8888816C 67B8XXII beq exit i CTIU.-C ••> EXIT 114 nocx 1 t US 88888178 6808 bra Hawclp U( exit! 117 ; 111 1 Systea Tear-D<»«n 119 1 121 88888172 88888888FA87 bclr.b ao.lcra 121 88888178 Bia88888FA13 bclr.b eo.iara I Disable Hblank 122 8aai8t7E 21F9xxxxxxxx8888 aove.l oldikbd, Ubdve i Restore Systc* IKBO/HIDI Interrupt 123 88888186 21F9miiixxB888 aoue.l oldvbl.vblvcc I Restore Systea VBlank Interrupt 124 Cettiae • Xblos 517.2 8888818E 3F3C8817 8 Boue.H >517, -(sp) 88888192 4E4E 8 trap >14 8 .If 52 <• 8 88888194 544F 8 addq >52. sp 8 else - add .H >52 sp , 12S - .endif 126 88888196 23C8xxxxxxxx aove.l dB.vblteap 6et IKBO Oatc/Tla Tsettlac 08 88H819C 3F88 8 aovc dO.-Isp) 8 6eados 52d,4 8888019E 3F3(»020 8 MVC.H >52d,-(sp) 888881 A2 4C41 8 trap >1 8 If 54 <« 8 88188184 SI4F 8 addq >54, sp 8 .else - add.H >54. sp 127 - .endif Tsctdate vblteM Set CEHOOS Tlae and Date 888881A6 3F39XXXXIXXI 8 aovc ublteM.-(sp) 8 Gcados 52b, 888881AC 1F1C8B2B 8 MVC.H >52b,-(sp) 88888188 4C41 8 trap >1 8 .If 54 <• 8 88888182 584F 8 addq >54, sp 8 .else - add H . >54 sp . 121 - . endl f 129 13B 88888184 41F9IIXXXXXI lea oldpal, a8 131 888881BA 43F88248 lea palette, al 132 888881 BE 383C8B0F aove >15, d8 133 888881C2 3208 .unplpi aove-M (a8)*,(al)« 134 888881C4 51CSFFFC dtir> dO. .unplp i restore old color palette 135 abort) User : return to user aode 8 Gcados 528,6 888I81CS 3nC8828 8 aovc.n >528, -(sp) maiicc 4E41 8 trap >1 0 .If 56 <• 8 888881CC SC4F 8 addq >56, sp 8 .else - add.H *56, sp 136 - .cndlf PtcraS I return to 6&V0S 88IH108 4267 8 cIr.H -(sp) 88IH102 4E41 8 trap >1 137 88888104 4AFC 8 Illegal 131 139 148 1 VOL Vcrtlcal-Blanl 141 ; 142 vbl) 143 88888106 48E7C8E0 aovca.l de-dl/a0-a2.- 144 14S 8888810A 41F9XXIXXXXI Ica uldH.al aB Display list (scroll. base) 146 888881E8 43F9XXXXIXXI lea ioffset,al al • Xoffsct list 147 888801E6 45F9XXXXXXXX lea bascaddr,a2 a2 Base address list 148 888881EC 123CB889 aovc >9,dl 149 •reglp FOR I IB scrolling regions) DO isa 888881F8 3811 aovc (all.de dB • current Xottset ISI 888081F2 88818880 btst.l >e.dl 152 aaa88iF6 66B8IIXI bnc odd . 153 8808B1FA 5240 addq Sl.dO EDEN — > Increeant hscroil.s P««e 4 18il8i3Z «i 2-my-1389 HadMC 1.88 (Atari 5T) 154 8«eeeiFC 88708848 cap ai 68 .d 8 155 88888288 6 O88111111 X bit .Join 156 88888284 7888 ovcq M,d8 ; Urap^ 157 88888286 68B8 XXXI bra Join 158 88888284 5348 .odd: subq . ai.dS ODO — > Oacraaent 153 88888280 60B8XXXX bge .Join 168 88888218 3830889F ova 8153. de i Urap'dnnn 161 88888214 3288 .join: aove d8 . (alJ : Nan Xctfset 162 88888216 E248 atr 01 . dB 163 88888218 C8eC 88 eeFFF 8 and. 1 058fFf8.de i d8 • byte offset nlthln line 164 8888821E 0834 add. 1 (a 2 )«.d 8 ; d8 Regions video base 165 88888228 2888 •ovc . de.CaB) 166 88888222 3819 ova (alJ*.d 8 167 88888224 CB7C888F and 0S8 f.de i d8 • Raglans horizontal scroll count 168 88888228 1888 ova.b d 8 .(aBl 163 8888822A 5888 addq . 04.aB 178 8888822C S103FFC2 dbra dl. .raqlp m 172 88888238 41F9XXXXXXXX laa vidao.aS 173 88888236 1818 ova.b (ae)*,d8 174 88888238 11088265 ova.b de.hscroll 175 8888823C 11088285 anvt.b (a8 )«,vcounthl 176 88888248 11088287 ova.b (ae)*,vcountaid 177 88888244 11088283 ova.b (a 8 )*.vcountlo i Initialize first region 178 179 88888248 32308858 ova 088. dl 1 Double noraal ST line nidth 188 8888824C 4488 t«.b d8 181 88888246 6788XXXX baq .zaro 1 IF (non*zaro scroll count) Reduce Una Hldth 182 88886252 5941 »bq 04.dl 183 88888254 110182BF .zera: ova.b dl.lintMld 184 185 88888258 2818 Nova.l (aeit.dB 186 88888254 6138 roi. 1 08.de 187 888882SC 23CBXXXXXXXX ove.l dB.vIdaodata ; Init next lines data 188 88888262 2308XXXXXXXX ova . aB.vldaoptr i Inlt display list ptr 183 138 88888268 llF08e8BF41B ova.b oa.tbcr 191 888882SE 11F08814F421 ova.b o28,tbdr : Interrupt every tnanty HBlanks 192 88888274 11F08888F418 ova.b OB.tbcr 133 134 88B8827A 4C0F8783 ovaa. 1 (sp)«,dB-dl/a 8 * a 2 135 8888827E 4EF9 .dc.M S4af9 196 88888288 88888888 oldvbl .dc. 1 8 i X> (Old-Vblank) 197 88888284 4AF0 lllaqal 198 199 288 IKBO IK60/HID1 Intarrupt Servar 281 282 Ikbd: 283 88888286 3F8e ova d 8 ,-(sp) 284 - 285 88888288 4808 ova sr,d 8 286 88888284 C87CF8FF and Sf 8 ff.de 287 888882BE 88708588 or 0SS 88 .de 288 88888232 4608 ova de.sr i Set IPL dOMH to 5 283 218 88888294 38tF ova (sp)«.d 8 211 88888296 4EF9 . dc.M S4af9 212 oldikfad: 213 88888298 88088888 .dc.i 8 ; JH> (Old-IKBD) 214 88888230 44F0 lllaqal 215 216 217 ML ««(C tIHE* Norlzontal-Blank Intarrupt Servar 218 219 hblt 228 88888236 48678888 anvao. d8/a8 .-(ip) (44*28*72) 221 222 88888242 2839IIXXXXXX ova . vldaodata.d 8 i d8 • vcount/scroll (28) 223 88888248 41F882BS laa vcountbl,a 8 i a8 aovap base (8) 224 88888240 11088265 ova.b de.hscroll 1 sat nScroll (12) 225 88888288 81088888 ovao.l d 8 .(a 0 ) : sat UldaoBasa (24) 226 (total • 136* cycles) 227 88888284 4488 tst.b dB 228 88888286 6788XXXI baq .zaro i IF (non-zero scroll count) Reduce Una nidth 229 88888284 11F08B4C828F ova.b 076.llnanld 238 88888208 6 BB 81 X 11 bra Join . 231 88888204 11FCBB58828F .zaro> ova.b 088.llnaxld 232 •Join: 233 88888204 2879XXXXIXXX ova. 1 vldaoptr.aB 234 88888208 2818 ova.l ( 8 )*.d 8 235 88888202 6138 rol.l 08 de . 236 88888204 Z30BXIXIXXXX •ova. dB.vIdaodata : Inlt next regions data 237 88888204 23C8XXXIXXXX ova.l aB.vldaoptr 238 239 888882EB 4C0F8181 ovaa. 1 (sp)*.d8/a8 248 88888264 eoaBeaeoFABF bckr.b 08,lsra i Clear In-Service bit 241 888882EA 4673 rte 242 24S 244 DATA STODAOE hscrol 1 . P«gc S 18:18:32 M 2'tt«y-1983 HjdMC 1.88 (Atari ST) 2 « 24C eee082EC .data 247 neof lie: ; N£0 flltnamc search string .dc.b "».neo",8 t 248 88888888 2A2E6E656F88 249 258 even 251 252 253 ; RANOOH DATA STORACE 254 ; 255 88888886 bss 256 257 oldpal 258 88888888 *88888818 .ds.l 16 I Original color palette 259 handlci i Active Handle 260 88888848 *88888881 .ds.H 1 261 262 bascaddrt ; laagc Base address for each strip 263 88888842 *8888888A .ds.l 18 264 xoffseti ! Pixel-offset for each strip 265 8888886A *8888888A .ds.n 18 266 vldeoi : HScroll and Uideo Base address for each strip 267 8888887C *88888888 .ds.l 18 261 vldeoptri i Display list ptr 269 888888A6 *88888881 .ds.l 1 278 uldeodatai I Next regions display Info 271 88888888 *88888881 .ds.l 1 272 273 neobuff i NEO-Iaagc Buffer 274 8888888E *88887088 .ds.b 32128 275 blgbuff : Hcga-Iaagc Buffer . 276 88887C2E *8888FA88 .ds.b 2*32888 277 278 vblteapt ; Ubiank Teaporary Storage 279 88817S2E *88808881 .ds.l 1 288 281 88817832 *88888188 .ds.l 256 ; (stack body) 282 ystack: 283 88817C32 *88888881 .ds.l 1 i Local Stack Storage 284 285 .end Page ( lt
  • S2 M 2-Hag-19l9 Ma*MC l.H (Atari ST) Syabol Table .dublp MMME2 t dtr 88688818 ca tacr FFFFFA19 ca . Join MtN2ia t cnd_os B88884FA ea tadr FFFFf AIF ca .Joln«HM2CA t ctv.jcrltlc 88888484 ca tber FFFFFAIB ca llAlp IHMMC t ct«_tcna 88888488 ca tbdr FFFFFA21 ca .Odd MNnM t ctv-tiaer 88888488 ca teder FFFFFAID ca .pleop M9MK2 t ctu_itra 8888848C ca tedr FFFFFA23 ca .rcglp MN81FI t ezcc-os 8888B4FE ca tddr FFFFFA25 ca .ftrlpMIMlM t cilt 88088172 t thciid B4W8848E ca unpIp ta«MlC2 t FIFO FFFFS686 ca trfcrcg 88888882 ca .zero MMt254 t Flock 8886843E ca trpl4ret 88888486 ca .zero MM62C4 t glaanp 88880888 ca tsr FFFFFA2D ca MIX MNMU ca glbanp 88888888 ca ucr FFFFFA23 ca 6MSE MdaMlI a glc«w 8888668A ca udr FFFFFA2F ca BUN Bwaguc a glcmvlp 8068868C ca wbaschl FFFF8201 ca BPSZ NBMIM ea glFIcnvlp 86888808 ca wbCMlo FFFF8280 ca BSIZE WBBBIBA a gtaizer 88888887 ca vbcMold FFFFS283 ca 8SSSZ BMNUC ea glnelM 88888886 ca ubi 88888106 t OOUNE MIBIBU a gtporta 88S8888E ca ublsca 88808452 ca CM IMMdW ca glportb 88888887 ca VbltMP 0801782E b at IBWMW ca glrcad FFFFS88B ca vblvcc 88888078 ca CURSJLIMC MMBe>2 ca glsclcct FFFFSS88 ca ucounthl FFFFS285 ca CUtS-fiCTRATC bWBBdOS ca gltoocac 88888881 ca vcountlo FFFFS283 ca CURSJaOE BXMBdd ca gitoncaF 88888888 ca vcountald FFFF82B7 ca CMtSjneUIK W0MH5 ca gltonebc 88888883 ca video 8808887E b CURS_SETItATE —«9WI ca gItoncbF 88808882 ca vldcodata D CUtS-SIttU BIIBBB1 ca gltonecc 88888885 ca videoptr 88888046 b OATAsz Bmeaic ca gitonecF 08808884 ca ur FFFFFA17 ca OMSE BtdeMld a gliwlv. FFFF8882 ea nauelp 88888144 t DLEN BSeBeeM a gptp FFFFFA81 ca xoFFset 88888864 b DsizE BsegaeK a gpo B88B8840 ca arts 88888888 ca OTA sme*2« a handle 80088848 b EWiR deBaeszc a hbl ee0862SE t FILE-ID eeeceeBC a hblucc 88886120 ca KEAOSIZE flBBdaeiC ca hdv-boot BB8B847A ca HITPA B8«e084 a hdv_bpb 88888472 ea IKBO BBSSaMC ca hdv-lnlt 8888846A ca LF MBB8BM ca hdv_awdlach 88B8847E ca LOUTPA Beeeaata a hdv_rti 08088476 ca Kioi Beaee«n ca hscroll FFFF826S ca HTDTA aeeeeBzi ca (era FFFFFAB7 ca PARENT BBteenC a lerb FFFFFA83 ca PRT BSaeMM ca Ikbd 88888286 t RMioM eeeMBes ca tkbducc 88888118 ca SSIZE B8B8M8E a lw>a FFFFFA13 ca TAB BBBBfleaS ca larb FFFFFA15 ca TBASE BMBBBit a Ipra FFFFFA8B ea TEXTSZ efleseBSC ca iprb FFFFFA80 ca TUN eeeeBaec a isra FFFFFA8F ca TsizE eeeeean a isrb FFFFFAll ca XXXI 86068612 a keybd FFFFFC82 ea XXX2 0B0808IE a kcyctl FFFFFCB6 ea XXXS S86B881A a llncMld FFFF828F ea XXXX 86888628 a Mcntlr 88888424 ea lUMIUUCF .a aMBConF FFFF8B81 ca _autopath 8B6BB4CA ca a«mal2 68888438 ca Jtiiiotdev 80686446 ea aMCualld 66888428 Ca _btrM 86688482 ea nFp FFFFFA68 ea .cadload 86888482 ca Idi FFFFFC86 ea -drwblti B68884C2 ea tdUtl FFFFFC04 ca -dskbtffp BB8864C6 ca yftack 8B817C12 b -frcleck 00688466 ea neobuFF BB8086AE b -Fverlfy 88888444 ca ncoFlIe BBB8BB8B d J)Z_2B8 B88604BA ea noexIt 88888178 t .Mbot 86868432 ca nvbls 00088454 ca .MCtop 86888436 ca oldlkbd 88688238 t -nflops 888684A6 ca oldpal BB8B888B b _prt_jcnt 688664EE ca Oldvbl 80888288 t .prtabt 888864F8 ca palette FFFF8248 ca -shcll_p 888864F6 ca palawdc 80868448 ca -sysbasc a68B84F3 ea phystop 8888842E ca _tlnr_M 88888442 ca prv_aui 88868512 ca -v_bas-ad 8880644E ca prv_auxo B688858E ea -vbclock 68808462 ca pru_lst 6868858A ca _vbl_llst 8e8084CC ea prv-lsto 66888566 ea _ubl queue 88B884S6 ea resvalld 86686426 ea abort 88888188 t resweetor 08886428 ea aer FFFFFA8) ca rezande FFFFS268 ea baseaddr 88888842 b rsr FFFFFA26 ea blgbuff e 6 B 87 E 2 E b sau_context B80eB4AE ea CMireg 88868688 ea save_roH 68B884AC ca colorptr 88808458 ea savptr 8BB8B4A2 ea constate 88866488 ea scr FFFFFA27 ea contem 68888484 ea scr.dunp 68688582 ea crlticret 8888848A ea screenpt 880a64SE ea datareg 88868886 ea secreg 86888884 ea ddr FFFFFAS5 ea seekrate 60888448 ca defshlttiad 88888444 ea sshlFtnd B8B8844C ea diskctl FFFF8684 ca start 88888688 t dMhl FFFF868S ea strobe 88888828 ea dMio FFFFB68D ea sHV-vee e68B846E ea dMiaid FFFF868B ca syncMldc FFFF828A ea nesHal 1 .s Page 1 18:18:04 a* Z'Mag-lSSS Maduc l.BB (Atari ST I 1 2 NEQUAIL.S Horizontal and Vertical Scrolling Oeew 3 4 Copyright 1988 ATARI CORP. 5 Started 18/18/88 Rob Zdybel . . 6 7 8 .text 9 .include atari S69 net 18 11 12 HAROUAM CONSTANTS IS 14 •FFFF828a vbascio • Sffff828d ; Video Base Address (lo) 15 •FFFF828F llncHld $ff4f828f : MIdth of a scan-1 Inc (Uords. inus 1) 16 •FFFF8285 hscmll * $ffff826S I Horizontal scroll count (8 .. 15) 17 18 19 i SYSTEM CONSTANTS 28 21 •08888878 ubivcct S78 ! Systca VSIanfc Vector 22 23 FFFFFFCE -58 ) LlncA Housc-f4otlon Vector offset 24 •FFFFFDA6 cur_x -682 i LineA Current eouse Xpos 25 •FFFFF0A8 cur_y -688 1 LineA Current aouse Ypos 26 27 28 LOCAL CONSTANTS 29 S8 SI 32 Systea Initialization SS 34 start! 3S 88880808 2A4F aove.l a7.aS 36 08808082 2E7CIIXXXIXX aowc.l Haystack. a7 Bet Our dan Local Stack 37 88808888 2A600084 aove.l 4(aS),aS aS bascpage address 38 8888808C 2620888C aove.l TEXTSZ(aS).d8 39 88088018 08AM814 add.l 0ATASZ(aS).d0 48 88088814 D8A0801C add.l B5SSZ(a51.d8 41 88808818 OOBC08800180 add.l mea.da RAH req'd • text*bss*data«6asePageLength 42 eoooeoiE 2800 aovc .1 dO d4 . d4 > RAH req'd Hshrlnk aS,d8 Return Excess Storage 88008828 2F08 6 aove.l dO.-(sp) 80880822 2F0D • aove.l aS,-(sp) 88800824 4267 • cir.a -(sp) • Ocados $4a.l2 08888026 3F3C884A 0 aoue.H aS4a.-(sp) 8886882A 4E41 • trap Ml 8 If $c <• 8 - addq etc.sp - else 8808882C DEFcaoec • add. a H$c,sp 43 • cndlf 44 45 Other Initialization 46 Super 1 enter supervisor node 08880838 42A7 d cir.l -Isp) 80888032 3F3C0028 8 aowe.a 8628. -(sp) 8800M36 4E41 • trap *1 00880038 SC4F 8 addq 46, sp 47 8080883A 2FN 8 aove.l dO.-(sp) I UARMIN6 - Old SSP sawed on stack. a Fgctdta 8 6Mdos $2f.2 08088838 3F3C082F 8 aove.N asZf.-(sp) 88000848 4E41 8 trap ei 8 .If $2 <• 8 88800842 S44F 8 addq e$2.sp 8 .else - add. a PS2.sp - .endlf 49 so 88080844 2840 aeve.l dO.ad SI 00880046 08FC881E adda 430. a4 o4 Filenaae ptr 52 8608604A 7880 aoveq 40. d4 d4 Loop Count Fsfirst 4ncoflles.48 8000884C 3F3C0800 8 aove.a 4$0.-(sp) OONOOSO 2F3CXXXXXIXX 8 aove.l 4ncof lles.-(sp) 8 Oaados S4e.B 800880S6 3F3C804C 8 aove.a 4$4e.-(spl 088888SA 4E41 8 trap 41 8 If $808 eeoeeosc 584F 8 addq nSO.sp 8 else - add. a efo.sp S3 - endlf 54 .neolodp: FOR (Nine NEO Flies) DO 55 888888SE 4A48 tst dO SB 88888868 6888xxix b«l abort IF (No NEO flics) A80RT ftxonill.T P«9« 2 16il8i64 m 2-ftou-19S9 Hi^ic 1.06 Fopcn «4.88 MMAMU 3F3C0006 6 ova.N 888, -l»p) 2F8C 6 owe.l cO.-tsp) 6 5«m1os 836.8 MMMfiA incaoso 6 owa.ii •836, '(sp) MaM66E 4E41 6 trap >1 6 .If $6 8 < 6666667a 504F 6 ad6q aSt.sp 6 .cist - a66.H 688. tp - .cn6lf 57 5« MMM77 4M6 tst 66 59 66666674 BOOOixii hal abort i IF (Error opening a flic) 600RT 66 66666678 41F9»ix»ix laa hanblist.aO 61 6888667E 31804060 OM 60,(a6.64) ) Save the HanOlc 62 66686682 5444 a66q 82.64 61 66666684 88708016 cap •16,64 64 NMWfS SENxixx bgt .getninc Fsock •128,68, M ; Skip NEO HcaOcr MMMftC 3F3C0600 6 oowc.H aOO.-lsp) 66666696 3F00 6 aovc.N (M,-(sp) 68666692 2FSC88060886 • Mvc.l •860, -(sp) 6 6cados 842.18 66066698 3F3C8642 0 aovc.H •842, -(sp) 0006089C 4E41 6 trap •! 6 .If 8a <8 - a66q •8a, Sp « .else 6a8eeo9E OEF0080A 6 abd.M 88a, sp 65 6 .en6lf 66 4M0 tst.l 66 67 6066XXXX bal abort i IF (File Seek Error) 6606T fsneit 6 6m6os 84f,2 AAAAAAAA 3F3C884F 0 aovc.H ebOf.-lsp) 4E41 6 trap •! 6 .If 82 <• 8 0400Stt^ S44F 0 •66q >82 sp . 0 .else - 68 69 76 I 8 5660 - add.M .endlf bra .gotnlnci Fread •82, sp .ncoloop d8,ai28,«blgbuff 00666682 2F3CXXXXXXXX 0 aove.l bblgbuff .-(sp) 00000868 2F3Ce0000086 0 aovc.l >886. -(sp) 0600006E SFoe 6 aovc.H 66, -(sp) 6 Basdos 83f.l2 066066C6 3F3C603F 6 aove.H R83f.-(sp) OOOe06C4 4E41 0 trap Si 0 .If 8t <« 8 - addq *8c.sp - .else 600686C6 0EFC060C 0 •66. H a8c.sp 71 6 .endlf 77 66068606 4680 tst.l 66 73 W^WVww 6808XXXX tai oi>» aiove. 1 buffptr.aB 98 88888144 1C3C88C7 •ove B193.d6 d6 • Scan Line Count 99 88888148 34308827 . llnlp: •ave Bia.dS FOR (288 Lines) 00 IBB eeeeei4c 2803 tl: Mue. 1 (al)i. (a6)* Copy a line froa scrcenB lai eeeeei4E SICOFFFC bbra d5. .tl 182 88888152 3A3C8827 •ovc tt39.dS 1B3 88888156 280A .t2: MVC. 1 (a2)*.(aei* Copy a line froo screenl 184 88888158 SICOFFFC dbra dS..t2 IBS seeeeisc 3A308827 ovc «39,d5 186 88888168 2808 ,t3: •owc.l (a3)i. (aei* Copy a line fron scrccnZ 1B7 88888162 SICOFFFC dbra dS..t3 IBS 88888166 51CEFFE8 dbra d6.. llnlp 1B9 88888168 23C8xxxxxixi owc.l aS.buffptr lie 88888178 SC47 addq 6.d7 111 88888172 BE7C8eeC cop 812. d7 112 88888176 6F88 blc .roHlp 113 114 88888178 7818 iMvcq 816. d4 US 8888817A 43F3XXXXXXXX lea handlist. a4 116 88888188 37344888 .close! moift (a4.d4).-(sp) FOR (Nine files) 00 Close all Ocodos 63C.4 Fclose 88888184 3F3C883E 8 •ove.M 8$3c,-(sp) 88888188 4E41 8 trap 81 8 .If $4 <• 8 88888188 584F 8 addq 864.SP 8 .else - add.H 8$4. sp - .endlf 117 118 888881 8C 4A48 tst d8 US 8888818E 6688XXXX bat abort ! IF (Error Closing a file) ABORT 128 88888132 5544 subt) 82, d4 121 88888134 6A£A bpl .close 122 123 88888136 4E63XXXIXXXX Jsr Inltaaus i Install our OHn aousc handler 124 12S 8888813C 23F88878XXIXXXXI owc.l ublvcct.oldwbl 126 88888184 21FCxxxxxxxx8888 owe. 1 swbl.vbiwect ; Capture Systca V/Blank Interrupt 127 128 123 * Scrolling OesM loop 13B s 131 Mavclp: Bconstat COK i Keyboard Polling 88888180 37308882 8 ove.H 8C0N.-(sp} 8 Bios 1,4 88888188 3F3C8881 8 •OVC.M 8Sl.-(sp) 88888184 4E40 8 trap 813 8 If $4 <• 8 88888186 584F 8 addq 8$4.Sp 8 else - add.H 864. sp 132 - .endlf 133 88888188 4A48 tst d8 134 B88881BA 6788XXXX beq noextt . IF (Keyboard Input Awallable) THEN Bconln CON 88888186 3F3C8882 8 aove.M CON.-(sp) 8 Bios 2. 4 888881C2 37308882 8 •OVt.H 62. -(sp) 888881C6 4E4D 8 trap 813 8 .If $4 <« 8 888881C8 584F 8 addq 864, sp 8 .else - add.H 64, sp 135 - .endlf 136 888881CA 88308883 cap.b 8'C'-64.d8 137 88888106 6788XIXX beq exit 1 CTRL-C ••> EXIT 138 noexlti 13S 88888102 6808 bra Hawelp 148 exit: 141 ; 142 I Systa* Icar-Ootn 143 ; 144 88888104 21F3xxxxxxxx8eee owc.l oldwbl.wblwcct 1 Restore Systca 081 ank Interrupt 145 146 8888810C 4EB3IXXXXXXX Jsr UOMUS i Restore Systca aousc handler 147 148 eeeeeiE2 41F3XIXXXXXX lea oldpal.aB 143 888881E8 43F88248 lea palette. al 158 eeeeeiEC 38308887 ilove 815. d8 ISl eeaeaiFB 1208 .unolp: aMwe.it (a6)*.(al)* 152 68888172 S1C87F7C dbra d8. .unpIp : restore old color palette 153 abort ! User ; return to user node 8 Geados 628.6 888881F6 17308828 8 ilOVC.M 8628. -(sp) eaeeeiFA 4E41 8 trap 81 8 .if $6 <• 8 eBeaeiFC 5047 8 addq 866. sp 8 else - add.H 866. sp 154 - .endlf P«9t 4 lltltiM m l*M*irlSn (Mmc l.M (Atari ST) PtcraB I return to 6E7O05 •MMIFE 4267 • cIr.H -(fp) MM2ee 4E41 • trap 81 155 MMa2e2 4AFC 8 illegal 156 157 151 I VBL Vertical-Blank Interrupt Server 159 168 ubl i 161 8W82B4 48E7S88e Mvea.l 88/a8.- Scroll count 166 •MHZIS 4M6 tst.b dO 167 MM621S 66aeiiix boc .nonO 1 IF (Scrolling) THEN 4 aord offset 168 NM621C llFC88A882eF Bove.b 8160 ,ltneMld 169 NNaZZZ 68Nnxi bra join 178 888M226 11FC8S9CS28F • nonSi aove.b 8lS6,lloa«ld 171 . Jolni 172 88M822C 41F9xxiixxxi lea blgbuFf.aO 173 88M8232 3839xxxxxxxx aovc yaouse.dS 174 888M218 C8FC81E8 aulu 838168. d8 I Ypos 8 Llnaald • Vertical offset 175 888M23C D1C8 adda.l d8,a8 176 8M8821E 3839xxxxxxxx aovc xaousc.dO 177 88888244 eZ48 asr 81, d8 178 88888246 C87CFFF8 and 85ff48.d0 1 S«(Xpos OIV 16 ) • Line offset 179 88888244 08C8 adds dS.aO 1 aO • Video Base Address 188 8888824C 23C8xxxixxxx aovc.l aB.vbItcap 181 88888252 llF9ixxxxxxx888e aovc.b vb 1 1 eap* 1 , vcountb 1 182 88888254 llF9xxxxxxxx8N8 aove.b vbltaap*2 vcountald , 183 88888262 llF9xxxixxxx8888 aovc.b vbltaap*3 vcount 1 , 184 IBS 88888264 4C0F8181 ovea.l (sp)*,il8/a8 186 8888826E 4EF9 .dc.M $4ef9 187 88888278 88888888 oIBwbli !dc!l 8 I (Old-Vblank) 188 88888274 44FC Illegal 189 198 191 192 HOUSE H4NDLIN6 193 194 195 196 IHITHAUS Capture systc* aouse 197 198 ! 61ven: 199 i Control 288 I 281 Returns: 282 Ulth aotlon and button vectors captured 283 284 : Register Usage: 285 destroys d8-d3 and a8-a3 286 287 ; Externals: 288 none 289 218 InItMus: 211 88888276 4888 •dc.M 9a888 : Llne-A Trap 212 88888278 33E8FD46ixixxxxx aovc cur_x(a8),xaouse 213 88888288 33E8F04Bxxxxxxxx ovc cur^(a8),tfMuse 214 88888288 23E8FFCExxxxxxxx Mve.l envec(iB).anldvec 215 88888298 217CixxxxxxxB8B8 aovc. I RourMUS,aovec(a8) i Take over souse aot Ion 216 88888298 4E75 rts 217 I 218 I Mouse Motion Interrupt 219 228 oursaus; 221 88888294 33CBxxxxxxxx ove dB.xaouse 222 88888248 33Clxxxxxxxx aove dl.yaouse I Save ncM aouse position 223 88888246 4EF9 .dc.M $4cf9 224 oldvec: 225 88888248 88888888 .dc.l 8 : JB> (Old action vector) 226 6888e24C 44FC Illegal 227 228 UltlAUS Restore aouse to systeei 229 238 : Given: 231 ; Control 232 233 ; Returns: 234 i House and button vectors restored to systea 235 236 Register Usage: 237 : destroys d8-d3 and a6-a3 238 239 ; Externals: 248 ; none 241 242 unsMus: neoHill-S Page S ie:18:B4 tm 2-t168666816 .ds.l 16 > Original color palette 264 265 haAdltstt 1 Array of Active Handles (9) 266 68686646 *66668669 .d4.H 9 267 buffptri i Load ptr for bigbuff 268 68686652 >66866681 .ds.l 1 269 blgbuifi i Hega-laage Buffer 278 66666656 >66846568 .ds.b 9(32668 271 thrcebufi 1 Teaporary Trlple-Iaage 6uffer 272 68646556 >66617766 .ds.b »32686 273 274 ubitcapi 1 Ubiank Teaporary Storage 275 6685DCS6 >68666861 .ds.l 1 276 277 IBOUSCI ; Latest aouse Xposn 278 668S0CSA >66666661 .dS.R 1 279 ytMusai ; Latest aouse Yposn 288 688S0CSC >66688881 .ds.M 1 281 282 eee50C5E >86888188 .ds.l 256 ; (stack body) 283 amstack: 284 B8e5E8SC 88668661 .ds.l 1 ! Local Stack Storage 285 286 .end P«gt ( lBiUit4 m 2-4Uvl9n NadMC l.BB (Atari ST) T<6lt .cloat eetNKB t diskctl FFFFB684 ta wv-wcc 8000046E ca .gotninc senM82 t FFFFB669 ta sgncaodc FFFFB28A ea .join MNU2C t dHio FFFFBaaO ta tacr FFFFFAIS ca .llnip •MIW t dMld FFFFBSaB ta ttdr FFFFFAIF ca .omIopp MONKE t dtr aaaaaaia ta tbcr FFFFFAIB ca .none eeem 2t t tnd^ BBaBBtfA aa tbdr FFFFFA21 ca •ploop eNMK4 t ttvjcritic 8666848 > ta tcdcr FFFFFAID ca .rcPIp NMilM t ttv.ttra BB66B I BB ta tcdr FFFFFA2I ta .r«ip eieeier t t ttu-tlaer 66BB6466 ta tddr FFFFFA2S ea .tt BeMei4C t ttv-xtra 66666 IB C aa thMd 66088 4tt ea .t2 MNtlSi t titc-M 668664FE ta thrtcbuf 06046556 b tl• NeMlU t tJilt 66666104 t trkrtg 66668682 ca ,«««lp eMNlFI t «lfo FFFF6(6a ta trpl4rtt 06666 4 86 aa MK MflMeei ta flock 666664SE ta tsr FFFFFA2D ca BU5E neoo mi a glaatp 66666668 ta ucr FFFFFA29 ca BLEU e OOBBB lC a glbaiw 86086663 ta udr FFFFFA2F ea Bpsz eeBeeiie aa glcai« 6666666A aa uraaaus aaoOOZAE t BsizE leeaMM • glcmvlp 86666666 ta ubatthl FFFFBZBl ta BSSSZ BBiaNlC ta glfltnvlp 66666668 aa vImmIo FFFFS28D ca ooLiNC e Bo eeeee a glalatr 66686687 ta vbtstiild FFFFS2B3 ca l»N MiMM2 aa glnoltc 86666M ta vbl 00608284 t O M I IIIBD ta giporta 6666666E aa ubltaa 60066452 ta CWS-BLtNK MMtMZ ta glportb 666666BF at vbltav 00650056 b okSl^etmte eaMaws ta giraad FFFF8B86 ta wblotct 66000878 ca. cunsjiZDE easMsee ta gisaltct FFFF886a aa vcounthl FFFFB285 ta cuRsjraeLiNK eeeeMsi ta gttonaac 66666661 aa tfcountlo FFFFS283 ca cuts^TMTE eaeeeeM ta nltontaf 6668 6 00 6 ta vcountald FFFFB207 ca cu(S.3iw eeeMMi ta gitontbc 66066663 ta wr FFFFFA17 ca MTASZ eeB8N14 ta gitontbf oooaaoaz ta navclp BOeOBlAC t DBASE BSeeaBlB a gltonccc 000 000 65 ta laowe BOOSOCSA b OLEK BBBBBB14 a gltontcf 6IM0B864 ta arts 66068888 ea DSiZE teeBBaas a glNTltt FFFF8B62 ta (paouse 6B6SDCSC b OTA aasaaBza a gpip FFFFFA81 ta ENwiR aaaaaazc a gpo 000 0004 0 ta FILE-ID aaaaaaaa a handliot 6660B040 b HEAOSiZE aaaaaaic ta hdu-^t 0066047A ta HiTPA aaaaaaaa a Mv-Ppa 00000472 ta iKBD aaaaaaaa ta hdu_init 000604GA ta LF aaaaaaaA ta hdv.acdlacl« 0006047E aa laiTPA aaeaBBaa a hdV-TM 66060478 ta Kioi Beaeaaas ta hscroll F^FBZSS ta HYDTA eeeBaBze ta Itra FFFFFA67 ta PARENT aBBBBaza a itrb FFFFFAOS ta PRT aeeeaeee ta lara FFFFFA13 ta RMKON aaaaaeas ta l«-b FFFFFAIS ta ssiZE BBaaeaBE a inltaaus 60680276 t TAB aBBaaaas ta Ipra FFFFFA6B ta TBASE aaaeaeflB a tprb FFFFFA80 ta TEXTsz aaaeeaac ta Isra FFFFFA8F ta TLEN aaeaaaac a Isrb FFFFFAll ta TsiZE Baaaaaaz a ktgbd FFFFF(»2 ta mi Bsaeaeiz a ktyctl FFFFFC8B ta m2 aaeaBBiE a llnmld FFFF828F ta mi BBBaBaiA a MMcntlr 66866424 ta mx aaasaezB • Mconf FFFFBBBl' ta mi aaeaaasE ta a«wal2 80660438 ta -autopath BBaBBaCA ta Mania! Id 60666428 ta jbootdtv BaaeaaAB ta «fp FFFFFA06 ta -bufi eeaBB4B2 ta Idl FFFFFI»6 ta -cadload aaBBaasZ ta aiidlctl FFFFFC64 ta -drvbitt aaeae4C2 ta Mldvtc 6e0682A8 t -dskbufp BBBBaaCb ta ovtc FFFFFFCE ta -frciock eaaae466 ta gstack 00BSE65E b -fvtrlfy oaaaa444 ta ncofUtt 80000008 d -tiz-zea eeeaa4BA ta notklt 60000102 t .jMidiat BeaaB4I2 ta nvblt OB0004S4 ta -Mntop aaBaa4S6 ta oldpal 60000866 b -nflops aaeaB4AE ta oldvbt 60666278 t -prt_Cfit aaBaadEE ta ounaaut 60868238 t -prtabt eBBBB4FB ta paitttc FFFFB248 ta -thtll-p BBaaB4F6 ta palMdt 606B044B ta -Sysbait aeBaB4F2 ta phystop 8ea6642E ta _tlnr_«is BeeeB442 ta prv_aua 68868S12 ta _U-bas_ad B8eBB44E ta pru—auao BOBOOSOE ta -ubclock 06668462 ta prv_lst 66660588 ta -vbl.llst eB06B4CE ta prv-lsto 88668566 ta -ublgutut 86686456 ta rtsualid 66866426 ta abort BB66B1F6 t rtlvtctor 88068426 ta atr FFFFFABJ ta rtzaodt FFFF826B ta bigbuff 6B088BS6 b rsr FFFFFA2B ca buffptr 86886052 b sav-context 88866486 ea cndrtg 68688888 ta save_r(P< 88888480 ca colorptr e6e0845A ta sawptr 00686482 ca constatt 88666488 ta scr FFFFFA27 ea conttm 88886484 ta scr-diaap 68668582 ea criticrtt 86688488 ta scretnpl eBB864SE ea cur_« FFFFFDA6 ta secreg 80068684 ca cur-y FFFFF0A8 ta sttkrate 68880448 ca datartg 88886886 ta sshiftad 68006440 ta ddr FFFFFA0S ta start 80066866 t dtfshiltnid 88668446 ta strobe 68000828 ca STE Digitized Sound Developer information The Atari STE^ family of computers is equipped to reproduce digitized sound using DMA (direct memory access; that is. without using the 68000). This document provides the information required to understand and use this feature. OVERVIEW Sound is stored in memory as digitized samples. Each sample is a number, from ~128 to +127, which represents displacement of the speaker from the "neutral” or middle position. During horizontal blanking (transparent to the processor) the DMA sound chip fetches samples from memory and provides them to a digital-to-analog converter (DAC) at one of several constant rates, programmable as (approximately) 50KHz (kilohertz), 2SKHz. 12.5KHZ. and 6.25KHz. This rate is called the sample frequency. The output of the DAC is then filtered to a frequency equal to 40% of the sample frequency by a four~pole switched low-pass filter. This performs "anti-aliasing" of the sound data in a sample-frequency-sensitive way. The signal is further filtered by a two-pole fixed frequency ( 16kHz) low-pass filter and provided to a National LMC1992 Volume/Tone Controller. Finally, the output is available at an RCA-style output jack on the back of the computer. This can be fed into an amplifier, and then to speakers, headphones, or tape recorders. There are two channels which behave as described above; they are intended to be used as the left and right channels of a stereo system when using the audio outputs of the machine. A monophonic mode is provided which will send the same sample data to each channel. The stereo sound output is also mixed onto the standard ST audio output sent to the monitor s speaker. The ST's GI sound chip output can be mixed to the monitor and to both stereo output Jacks as well. DATA FORMAT Each sample is stored as a signed eight-bit quantity, where -128 (80 hex) means full negative displacement of the speaker, and 127 (7F hex) means full positive displacement. In stereo nKxie, each word represents two samples: the upper byte is the sample for the left channel, and the lower byte is the sample for the ri^t channel. In mono mode each byte is one sample. However, the samples are always fetched a word at a time, so only an even number of mono samples can be played. A group of samples is called a "frame." A frame may be played once or can automatically be repeated forever (until stopped). A frame is describe by its start and end addresses. The end address of a frame is actually the address of the first byte in memory beyond the frame: a frame starting at address 21 100 which is 10 bytes long has an end address of 21 1 10. Before continuing, please familiarize yourself with the DMA souixi chip register set: REGISTER DESCRIPTIONS FF8900 — cc RW Sound DMA Control cc 00 Sound DMA disabled (reset state). 01 Sound DMA enabled, disable at end of frame. 11 Sound DMA enabled, repeat frame forever. FF8902 OOxx xxxx RW Frame Base Address (high) FF8904 xxxx xxxx RW Frame Base Address (middle) FF8906 xxxx xxxO RW Frame Base Address (low) FF8908 OOxx xxxx RO Frame Address Counter (high) FF890A xxxx xxxx RO Frame Address Counter (middle) FF890C xxxx xxxO RO Frame Address Counter (low) FF890E OOxx xxxx RW Frame End Address (high) FF8910 xxxx xxxx RW Frame End Address (middle) FF8912 xxxx xxxO RW Frame End Address (low) FF8920 0000 0000 mOOO OOrr RW Sound Mode Control rr 00 6258 Hz sample rate (reset state) 01 12517 Hz sample rate 10 25033 Hz sample rate 11 50066 Hz sample rate m: 0 Stereo Mode (reset state) 1 Mono Mode FF8922 xxxx xxxx xxxx xxxx RW MICROWIRE"* Data register FF8924 xxxx xxxx xxxx xxxx RW MICROWIRE"* Mask register Note: a zero can be written to the DMA sound control register at any time to stop playback immediately. cof^cutive words each. The high The frame address registers occupy the low bytes of three and is hari^ess to r^d or write them. bytes of these words do not contain anything useful, it read-only, and holds the address of the next sample word The frame address counter register is to be fetched. PROGRAMMING CONSIDERATIONS the start address The simplest way to produce a sound is to assemble a frame in memory, write address of the frame »*^to of the frame into the Frame Start Address register, and the end stereo or niono. and the Frame End Address register, set the Mode register appropriately (set sample frequency), and write a one into the Sound DMA Control register. The frame will play once, then stop. To produce continuous sound, and link frames together, more elaborate techraques are required. is one when tlw The DMA sound chip produces a signal called "DMA sound active" which chip is playing sounds, and zero when it’s not. When a frame ends in the repeat mewe (naode back again on this signal. The signal is 3). there is a transition from "active" to "idle" and presented as the external input to MFP Timer A. You can put Timer A into Event Count mode and use it to generate an interrupt for example when a frame h^ played a ^ven number same of times. Because of the design of the MFP. the active edge for this fgnal as the input on GPIP 14. which is the interrupt line from the keyboard and MIDI mterfaces. It programmed for that, so you need not worry about is. and the Active Edge Register is already that if you use Timer A to count frames. because The DMA Sound chip’s mode 3 (repeat mode) ensures seamless linkage of frames, the start and end re gisters are actually double-buffered. When you write to these regi^ers, what you write really goes into a "holding area". The contents of the holdmg ^ea go into the true registers at the end of the current frame. (Actually, they go in when the chip is idle, which means right away if the chip was idle to begin with.) start and Ifyou have two frames which you want played in succession, you can write the then set control register to 3. The first franic wiU addresses of the first frame into the chip, its begin playing. You can then immediately write the start and end addrepes of the second the holding area until the first frame finishes, men frame into the chip: they will be held in they’ll be copied into the true registers and the second frame will play. The mtemipt between frames will still happen, so you can tell when the first frame has finished. Then, for mstonce, you can write the start and end registers for the start of a Z4w/frame, knowing tlwt it will data mto the fust begin as soon as the second frame has finished. You could even write new frame and write its start and end address into the chip; this kind of ping-pong effect is rather like double-buffering of a graphics display. series of Here is an example of using Timer A in Event Count mode to play a controlled frames. Suppose you have three frames. A, B, and C. and you want to play frame A three times, then frame B five times, and finally frame C twice. The sequence of steps tcIow will bracketed descnptions accomplish this. Numbered steps are carried out by your program; the are of things which are happening as a result. 1 . Set Timer A to event count mode, and its counter to 2 (not 3). 2. Write Frame A‘ss4art& end addresses into the repsters. Write a 3 to the sound DMA control register. [Play begins.] Go do something else 3. until interrupted. [At the end of the second repetition of Frame A, the timer's interrupt fires. At the same time, frame A begins its third repetition.! 4. Write Frame B’s start and end addresses into the DMA sound chip. These values be held until the third repetition of Frame A fini^ies. 5. Set Timer A 's count register to 5, then go away until interrupted [When the current repetition finishes, the start & end registers are loaded from the holding area, and Frame B will begin playing. The end-of-frame sigi^ wm Timer A to count from 5 to 4. At the end of Frame B’s fourth repetition, its fifth will occur.! will start, the timer will count down from 1 to 0, and the interrupt 6. Write frame C's start end addresses into the registers, and program Timer A & to count to 2. Go away until interrupted. (When the current repetition (B’s fifth) finishes, the start & end registers arc loaded from the holding area, and Frame C will begin playing. The end-of-frame signal causes Timer A to count down from 2 to 1 When Frame C finishes its first . repetition. Timer A counts down from 1 to 0 and interrupts.) 7. Write a 1 to the DMA Sound Control Register to play the current frame, then stop. Disable Timer A and mask its interrupt. You’re done. the number of As you can see. you program the timer to interrupt after one repetition /ssrthan while the DMA times you want a frame to play. That is so you can set up the next frame linkage ol sound chip is playing the last repetition of the current frame. This ensures seamless frames. INTERRUPTS WITHOUT TIMER A Besides going to the external input signal of Timer A. tte DMA .sound-active signal, high, is exclusive-ORcd with the monochrome-detect signal, and together they form the GPIP interrupt-driven sound 17 input to the M68901 MFP. The intent of this is to jM-ovide for timer the MFP is a little trickier to u«, drivers without using up the last general-purpose in It . the end of every frame, not after a si^ified however. For one thing, it causes the interrupt at number of frames. For another, the "interesting" edge on this signal depends on what kind of monitor you have. On an ST. monochrome monitors ground the mono-detect signal, so when you r^d the bit in the MFP you get a zero. Color monitors do not ground it. so it reads as a one. When the (1). the mono- DMA sound is idle (0). this is still the case. However, when the sound is activeway. (The one detect signal is inverted by the XOR. so the bit in the MFP reads the opposite place where the OS reads this bit is atVBLANK time, to see if you've changed monitors. The ROMs on any machine with DMA sound are appropriately modified, so you need not worry about this.) Ifyou want to use the mono-detect / DMA interrupt signal, you have to set up the register in the MFP to cause the interrupt at the right time. The interesting edge on tlw DMA finishc^. U signal is the falling edge, that is, from active to idle; this happens when a frame . you have a monochrome monitor, this edge is seen as a transition from 1 to 0 on MFP bit 17. Therefore, However, with a color monitor, the edge will be seen as a transition from 0 to 1, you have to program the MFP's active-edge regi^er differently depending on which momtor check you have. Make sure the DMA sound is idle (write a zero to the control register), then edge. If s zero, MFP 17: if it's one, you have a color monitor, and you need to see the rising it you have a monochrome monito*- and you need to see the falling edge. was The DMA sound active signal goes from "active" to "idle" when a frame fu^hes. If it playing in mode 1, it stays "idle" and the control register reverts to zero. If it was playmg m mode 3. the signal goes back to "active" as the next frame begins. In this case, the signal is actually in the "idle" state for a very short time, but the MFP catches it and causes the interrupt, so don’t worry. Additional Considerations Regardless of how you manage your interrupts, there is more you should know: the si^ial goes from "active" to "idle" when the DMA sound chip has y&/«&«/the last sample in the frame. There is a four-word FIFO in the chip, however, so it will be eight sample-times If you are using mode 1. you can use this in stereo mode) before the sound actually finishes. as time to set up the chip with the start and end addresses of the next frame, so it will start soon as the current one ends. However, if the interrupt should be postponed for four or eight for sample-times, you could miss your chance to start the sound seamlessly. Therefore, sear^ess linkage, use the pre-loading technique described above. MICROWIRE™ Interface The MICRO WIRE™ interface provided to talk to the National LMC 1992 Computer Controlled Volume I Tone Control is a general purpose MICROWIRE™ interface to allow the future addition of other MICROWIRE™ devices. For this reason, the following descnption of its use will make no assumptions about the device being addressed. The MICRO WIRE™ bus is a three wire serial connection and protocol designed to allow data multiple devices to be individually addressed by the controller. The length of the serial stream depends on the destination device. In general, the stream consists of N bits of address, followed by zero or more don't care bits, followed by M bits of data. The hardware interface actual provided consists of two 16 bit read/write registers: one data register which contains the bit stream to be shifted out. and one mask register which indicates which bits are valid. data bit For this Let's consider a mythical device which requires two address bits and one regi^r pair nwy be device the total tat stream is three bits (nuninuim). Any three bits of the used. However, since the most signiHcant bit is drifted Hrst the command will be revived by the device soonest if the three most significant lats are used. Let s assume: 01 is tlK deviM s address. D is the data to be written, and X's m don’t cares. Then all of the foUowmg register comlanations will provide the same information to the device. 1110 0000 0000 0000 Mask OIDX xxxx xxxx xxxx Data 0000 0000 0000 0111 Mask xxxx xxxx xxxx XOID Data 0000 0001 1100 0000 Mask xxxx xxxo IDXX XXXX Data 0000 1100 0001 0000 Mask xxxx OIXX XXXD xxxx Data 1100 0000 0000 0001 Mask OIXX xxxx xxxx XXXD Data As you can see, the address bits must be contiguous, and so must the data bits, but they don t have to be contiguous with each other. The mask register must be written before the data register. Sending commences whw the data reoster is vmttcn and takes approximately 16psec. Subsequent ^tes to &e daU and rnask rensters are blocked until seiiding is complete. Reading the registers while sending ism progress wiU return a snapshot of the shift register shifting the data and mask out TI^ rncans registers (or either one) return that you know it is safe to send the next command when these mask register does not need to be rewritten u it is already to their original state. Note that the register only needs to be correct. That is. when sending a series of commands the mask written once. Volume and Tone Control The LMC1992 is used to provide volume and tone control. Before you go and find a data sheet for this part, be warned that we do not use aU of its features. Commands for the features we do use are listed below. Communication with this device is achieved using the MICROWIRE^ interface. See MICROWIRE INTERFACE the section for details. The device has a two bit add^ field, address » 10. and a nine bit data field. There is no way to reading the current settings. Volume / Tone Controller Commands Device address = 10 Data Field Oil DDD ODD Set Master Volume 000 000 -80 dB 010 100 -40 dB 101 XXX 0 dB 101 XDD DDD Set Left Channel Volume 00 000 -40 dB 01 010 -20 dB 10 IXX 0 dB 100 XDD DDD Set Right Channel Volume 00 000 -40 dB 01 010 -20 dB 10 IXX 0 dB 010 XXD DDD Set Treble 0 000 -12 dB 0 110 0 dB (Flat) 1 100 +12 dB 001 XXD DDD Set Bass 0 000 -12 dB 0 110 0 dB (Flat) 1 100 +12 dB 000 XXX XDD Set Mix 00 -12 dB 01 Mix GI sound chip output 10 Do not mix GI sound chip output 11 reserved attenuate in 2 dB steps Note: The volume controls attenuate in 2 dB steps. The tone controls at 50 Hz and 15 kHz (Note: These frequencies may change). Using the MICROWIRE™ Interface and the Volume/Tone Control Chip you’ll never have to The MICROWIRE'^ interface is not hard to use: once you get it right, figure it out again. wnunai^. The easiest way to use it is to ignore the flexibility, and just use one form for all of 1 1 bits of a^r^and Since the Volume/Tone chip is the only device, and it has a total data, your mask should be $07ff. If you're picky, you can use SffeO. becaus^e high-order conceptual complexity. With a mask of $07ff, the lower 9 bits are shifted out first, but it adds bits of the data regsiter are used for the data, and the next higher two bits are for the address. Mask: %0000 0111 1111 1111 Data : %xxxx xlOd dddd dddd this combination sets the Replace the d’s with the command code and its data. For example, master volume to $14: Mask: %0000 0111 1111 1111 Data: %xxxx xlOO 1101 0100 registers as The other important concept you must understand is that the bits shift out of soon as you write the data, and it takes an appreciable time (16 psec) to fimsh. You wnt attempt another write until the first one is finished. If you read either register wble it s being shifted. You know the shifting is shifted out. you will see a "snapshot" of the data being (TWs theory is wrong if you use a mask complete when the mask returns to its original value. never does.; which equals its original value sometime during the shifting, but $07ff routine can be Assuming you write $07ff into the mask register ahead of time, the following used to write new data from the DO register to the volume/tone control chip. MWMASK equ $ffff8924 MWDATA equ $ffff8922 mwwrite cmp. w #$07ff .MWMASK wait for prev to finish bne s . mwwrite loop until equal move . dO, MWDATA write the data rts and return completp. Tlus loop The purpose of the loop at the beginning is to wait until a previous write is at the beginning of the routine, not the end. because waiting at the end would always force at 16 psec delay, even if it’s been longer than that since the last write.