2IMGSHEP@@@ 8L2C)pJJJJ IH(ȱH:=IH[H`@HcH  $ +   I/H`JLNGȄBȄF aK  haaFF  mJm# KKJ UJ )J ۈ) ;J3ȱJFȱJGJKaȄM  aaNNJFLGJL L? &PRODOS `DaElH$?EGvѶK+`L HHLy XP LM ŠϠĠӠS)*+,+`F)) (*=GJFjJJA QE'+ '== `@ STSP8QSS8 m P o R(8RLnSOS BOOT 1.1 SOS.KERNEL SOS KRNLI/O ERRORFILE 'SOS.KERNEL' NOT FOUND%INVALID KERNEL FILE: xةw,@  ȱlmi8#)!) >dLԡm#i㰼m#iЕOLԡȱfg hi !dLԡ憦  Ljmkm l y`2 Lԡ8(Je稽)ʈ@LWAP2005URCE&) ' @DEMO.STUFF&* y& HP.ASM Z&Z&HP.STUFF &+ *DABBLER.STUFF &+ : BRICK.STUFF &+  DALEKS.STUFF &+  CLOCK.STUFF &+ DMOV.PICTUFF( c%SIMP:C DSIMP.SRC<<C C SIMP.ROOTC C SIMP.A C C SIMP.MACROSC C @?DEMO.STUFFuHUSTON!&* ' ')PROJ.HEAD0/y& y& )PROJ.MAIN"$E r)PROJ.DATA .7[$ [# +PROJ.MACROSc  r ******************************************************** * Demo program data section * ******************************************************** QuitStuff DATA QuitFlg DC i'0000' program termination flag OpenParms anop ref_num ds 2 ; returned pathname ds 4 io_buffer ds 4 ; returned QuitParms dc i4'0' dc i4'0' dc i4'0' ReturnParms dc i4'0' OHP.STUFFuHUSTON!&+ ' 'HPm*RC, * $PIC1AC, G5 $PIC2AC, G5 $PIC3AC- G6 $PIC4[AC- G6 (FONT.ASMa"C- 0# &HP.ASMFI!   (INIT.ASMX$C. 4 &IO.ASMl,C. + (MENU.ASMq'C. ,2 (MODE.ASM C. !  (PACK.ASM)NC/ 4 DABBLER.STUFFuHUSTON!&+ ' ',DABBLER1.SRC7k: : .DABBLER.MACROSc }  ,DABBLER2.SRCE7(+ (+ ,DABBLER.KAARn!E?  BRICK.STUFFuHUSTON!&+ ' '+GAME.MACROS %,r )GAME.MAINP  )GAME.TECH%QG  DALEKS.STUFFuHUSTON!&+ ' '-DALEKS.MACROS N t *DALEKS.SRC K  +DALEKS.FONT ~ W2 +DALEKS.SRC24e W2 +DALEKS.SRC1<t( ( BUILD&8 C EFGHIJKLMNOPQRSTUVWXYZ[\]^_******************************************************************* * Apple IIGS Demo Launcher * * January 6, 1987 v1.0 * * * * * (c) Copyright 1986, 1987 Apple Computer, Inc. * * * * All rights reserved. * *   * * This program and its derivatives are licensed only for * * use on Apple computers. * * * * Works based on this program must contain and * * conspicuously display this notice. * * * * This software is provided for your evaluation and to * * assist you in developing software for the Apple IIGS * * computer. * * * * This is not a distribution license. Distribution of * * this and other Apple software requires a separate * * license. Contact the Software Licensing Department of * * Apple Computer, Inc. for details. * * * * DISCLAIMER OF WARRANTY * * * * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT * * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, * * WITH RESPECT TO ITS MERCHANTABILITY OR ITS FITNESS * * FOR ANY PARTICULAR PURPOSE. THE ENTIRE RISK AS TO * * THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH * * YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND * * NOT APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE) * * ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, * * REPAIR OR CORRECTION. * * * * Apple does not warrant that the functions * * contained in the Software will meet your requirements * * or that the operation of the Software will be * * uninterrupted or error free or that defects in the * * Software will be corrected. * * * * SOME STATES DO NOT ALLOW THE EXCLUSION * * OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY * * NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC * * LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS * * WHICH VARY FROM STATE TO STATE. * * * ******************************************************************* Title 'Apple IIGS Demo Launcher' ABSADDR ON List off symbol off MCOPY proj.MACROS 65816 ON KEEP demo launcher start jmp MainProgram end ******************************************************************* * Zero Page usage section starts here * ******************************************************************* ZPage start Window1 GEqu $10 Window2 GEqu Window1+4 WindowE GEqu Window2+4 Dialog GEqu WindowE+4 ZPPointer Gequ Dialog+4 ZPHandle GEqu ZPPointer+4 ToolPointer Gequ ZPHandle+4 ToolHandle GEqu ToolPointer+4 TempPtr GEqu ToolHandle+4 AdDialog GEqu TempPtr+4 ScreenMode GEqu $80 MaxX GEqu 640 end ******************************************************************* * Direct Page offsets for tools are kept here * ******************************************************************* ToolsDPages start EventOffset GEqu $300 CtrlOffset GEqu $400 LineEdOffset GEqu $500 SoundOffset GEqu $600 MenuOffset GEqu $700 end ******************************************************************** * Main Program Loop this section is generic to all programs * ******************************************************************** MainProgram START Using RAM using QuitStuff phk plb tdc ; save off current ZP sta OZP ; and save it for the moment Jsr ToolInit Start up... Jsr ShowAd Jsr EventLoop ...do something... PushLong AdDialog _CloseDialog Jsr ShutDown ...and quit. lda OZP tcd _Quit QuitParms ******** If this comes back, we're dead ******** ErrorDeath 'We just came back from a quit call!!!' OZP ds 2 END ******************************************************************** *ToolInit * ******************************************************************** ToolInit START using RAM ;----------------------------------------------- ; ; Now we initialize all the tools we are going ; use. ; _TLStartup ; Tool locator ;------------------------------------------------- ; ; Initialize the memory manager. ; PushWord #0 _MMStartup ErrorDeath 'Could not init Mem Mgr.' pla sta MyID ;------------------------------------------------- ; ; Initialize misc tools. ; _MTStartup ErrorDeath 'Could not init Misc Tools.' ;------------------------------------------------------ ; ; Initialize the desk manager ; _DeskStartup ;------------------------------------------------------ ; ; First get some memory for the zero page we need! ; PushLong #0 ; space for handle PushLong #$800 ; eight pages PushWord MyID PushWord #$C001 ; locked, fixed, fixed bank PushLong #0 _NewHandle ErrorDeath 'Could not get zero page.' pla sta 0 sta ZPHandle pla sta 2 sta ZPHandle+2 lda [0] sta ZPPointer lda ZPPointer ; zp to use pha PushWord #ScreenMode PushWord #160 ; max size of scan line PushWord MyID _QDStartup ErrorDeath 'Could not start QuickDraw.' lda ZPPointer ; zp to use = qd zp +$300 clc adc #$300 pha PushWord #20 ; queue size PushWord #0 ; x clamp low PushWord #MaxX ; x clamp high PushWord #0 ; y clamp low PushWord #200 ; y clamp high PushWord MyID _EMStartup ErrorDeath 'Could not start Event Manager.' PushWord #10 PushWord #10 _MoveTo PushWord #0 _SetBackColor PushWord #$f _SetforeColor PushLong #MomentStr _DrawString ;------------------------------------------------------- ; ; Load the tools I need ; LoadAgain PushLong #ToolTable _LoadTools ToolsLoaded anop PushWord MyID _WindStartup ErrorDeath 'Could not start the window manager.' PushLong #$0000 _Refresh PushWord MyID lda ZPPointer ; zp to use = qd zp +$400 clc adc #$400 pha _CtlStartup ErrorDeath 'Could not start Control Manager.' PushWord MyID lda ZPPointer clc adc #$500 ; zp to use = qd zp +$500 pha _LEStartup ErrorDeath 'Could not start Line Edit.' PushWord MyID _DialogStartup ErrorDeath 'Could not start Dialog Manager.' PushWord MyID *********************************************************** * Project main program file. This is the event loop for * * the demo program. * *********************************************************** **************************************************************** * EventLoop * * Main loop of the program. All menu setups will go here to * * to start with * ***********!#$%&'()*+,-./0123456789:;<=>?@ABCD***************************************************** EventLoop Start Using In_Loc Using RAM using QuitStuff jsr ClearVars Clear out all temp storage and ZP jsr MakeMenuBar now create and post our menu bar MainLoop ANop Bit QuitFlg check to see if quit selected bpl ML0010 nope no quit rts yes do the quit ML0010 ANop PushWord #0 room for result PushWord #$FFFF PushLong #Event pass the event record _TaskMaster and get the next appl event pla get the event type beq MainLoop if no event do it again ; Now check to see what event was hit and handle it accordingly cmp #InSysMenu was it a menu select event? bne ML0020 nope.. try next event jsr MenuSelect handle it jmp MainLoop and go back to beginning ML0020 ANop cmp #InGoAway bne ML0030 jsr CloseWindow close this window jmp MainLoop ML0030 ANop pea 0 room for result PushLong #Event check for ad updating _IsDialogEvent pla beq ML9999 nothing happened pea 0 room for result PushLong #Event PushLong #temp1 we don't really care about these PushLong #temp2 _DialogSelect make it active and update it pla jmp MainLoop ML9999 Anop Jmp MainLoop go back to the beginning Temp1 ds 4 Temp2 ds 2 END **************************************************************** *ClearVars * * This routine zeros out all program variables and inits the * * various memory stuff we need. * **************************************************************** ClearVars START Using QuitStuff stz QuitFlg rts END **************************************************************** *MakeMenuBar * * this routine creates the menu bar that the program is going * * to use and draws it on the screen * **************************************************************** MakeMenuBar START Using RAM PushLong #0 PushLong #DemoMenu _NewMenu MenuPtr:=NewMenu(DemoMenu) PushWord #0 _InsertMenu InsertMenu(MenuPtr,0) PushLong #0 PushLong #EditMenu _NewMenu Pea 0 _InsertMenu PushLong #0 room for result PushLong #FileMenu menu data to create _NewMenu and form the menu Pea 0 Posn in menu bar _InsertMenu now insert it into our Bar PushLong #0 PushLong #AppleMenu _NewMenu Pea 0 _InsertMenu PushWord #1 _FixAppleMenu Pha Height:=FixMenuBar _FixMenuBar pla _DrawMenuBar and draw the menu bar! rts END **************************************************************** *CloseWindow * * This routine will put away the top most window when the * * go away button is pressed * **************************************************************** CloseWindow START Using RAM PushLong TaskData Push the pointer to the window to close _HideWindow and get it off the screen rts END **************************************************************** *MenuSelect * * This routine will accept the menu item hit from the event * * record and act on it. * **************************************************************** MenuSelect START Using RAM lda TaskData get the item # hit and #$00FF strip off the high byte asl A multiply by 2 TAX put it into our index lda MenuDisp,x and get the address from the table pha put the address on the stack rts and jump to it {sneaky eh?} MenuDisp ANop table of menu routines dc i'AboutDemo-1' dc i'Quit-1' dc i'EditUndo-1' These are all disabled anyway dc i'EditCut-1' dc i'EditCopy-1' dc i'EditPaste-1' dc i'Demo1-1' Daleks dc i'Demo2-1' Color Dabbler dc i'Demo3-1' Windows dc i'Demo4-1' Slide Show dc i'Demo5-1' Scrolling Note dc i'Demo6-1' QuickDraw Sampler dc i'Demo7-1' GS Paint dc i'Demo8-1' Keyboard Sounds dc i'Demo9-1' BrickOut END **************************************************************** *UnHiLite * * This routine should be called at the end of every menu * * selection to turn off the inversed title bar and return to * * the main loop * **************************************************************** UnHiLite START Using RAM PushWord #0 UnHiLight flag lda TaskData+2 get the menu number selected pha _HiLiteMenu RTS END **************************************************************** *AboutDemo * * This routine will draw the about demo dialog box and then * * call modal dialog. Exit via UnHiLite * **************************************************************** AboutDemo START Using RAM PushLong #0 PushLong #MyModal _GetNewModalDialog pla sta Dialog pla sta Dialog+2 PushWord #0 for result PushLong #0 filter proc _ModalDialog handle dialog events pla nuke the result PushLong Dialog take it away _CloseDialog jmp UnHiLite END **************************************************************** *Quit * * This routine simply gets the 'return-to-previous-app' * * parms and calls the routine that dispatches the stuff * **************************************************************** Quit START Using QuitStuff lda #ReturnParms jmp DemoQuit END **************************************************************** * Edit Stuff * * These are all disabled, so what's the point?.... * **************************************************************** EditUndo start jmp unhilite end EditCut start jmp unhilite end EditCopy start jmp unhilite end EditPaste start jmp unhilite end **************************************************************** * * * Demo.x * * * **************************************************************** Demo1 start ; Daleks using QuitStuff lda #QParms1 jmp DemoQuit end Demo2 start ; Color Dabbler using QuitStuff lda #QParms2 jmp DemoQuit end Demo3 start ; Windows using QuitStuff lda #QParms3 jmp DemoQuit end Demo4 start ; Slide Show using QuitStuff lda #QParms4 jmp DemoQuit end Demo5 start ; (Eagle) (Scrolling Note) using QuitStuff lda #QParms5 jmp DemoQuit end Demo6 start ; QuickDraw Sampler using QuitStuff lda #QParms6 jmp DemoQuit end Demo7 start ; GS Paint using QuitStuff lda #QParms7 jmp DemoQuit end Demo8 start ; Keyboard Sounds jsr Simp jmp UnHilite end Demo9 start ; BrickOut using QuitStuff lda #QParms9 jmp DemoQuit end DemoQuit start using QuitStuff using AlertStuff sta TempPtr ldy #2 lda (TempPtr) sta QuitParms lda (TempPtr),y sta QuitParms+2 iny iny lda (TempPtr),y sta QuitParms+4 ; ; let's add a little something here that will check to see if the program ; is on the disk before we try to quit to it. ; lda QuitParms sta pathname ; for opening the file sta ATDescr2 ; for saying we can't open it lda QuitParms+2 sta pathname+2 sta ATDescr2+2 ora QuitParms ; Don't try to open a null pathname! beq launch jsl $e100a8 ; see if we can open the file dc i'$10' dc i4'OpenParms' php ; save the return status pha ; and the error number jsl $e100a8 ; now close the file dc i'$14' dc i4'OpenParms' ; use the same ref_num pla plp bcc launch pea 0 ; space for itemhit PushLong #Alert PushLong #0 ; no filterproc _StopAlert pla ; discard this lda #0 sta QuitFlg jmp UnHilite launch anop lda #-1 sta QuitFlg jmp unhilite end **************************************************************** * * simp: very simple sound * * An example for using the note synthesizer. * **************************************************************** * Simp START Using RAM jsr LoadSound pushword #150 ; 60 hz updates pushlong #0 ; no IRQ routine for me _NSStartup cli ; this seems to be necessary PushLong #0 PushLong #SoundModal _GetNewModalDialog pla sta Dialog pla sta Dialog+2 PushWord #0 for result PushLong #SoundProc+$80000000 filter proc (+ builtin handling) _ModalDialog handle dialog events pla nuke the result PushLong Dialog take it away _CloseDialog _NSShutdown rts END SoundProc START using in_loc *** These are parameters for mucking around with the stack rtnAddr equ 2 itemHit equ rtnaddr+4 theEvent equ itemHit+4 theDialog equ theEvent+4 result equ theDialog+4 NewReturn equ result-4 phd ; save direct page tsc ; make stack DP tcd ldy #0 lda [theEvent],y ; what happened? and #$00ff ; nuke the upper byte cmp #inKey bne handleNothing ldy #2 lda [theEvent],y ; get the key hit and #$7F jsr PlaySound ; pass ascii to note synth HandleNothing anop ply ; get original DP lda #0 ; set result to FALSE sta result lda rtnaddr ; move return address up sta NewReturn lda rtnaddr+2 sta NewReturn+2 tsc ; and fudge the stack pointer clc adc #NewReturn-rtnAddr tcs tya ; now restore DP tcd rtl END **************************************************************** * * Load Sound * **************************************************************** * * First you need a waveform. This bit creates a one page triangle wave. * Remember that the samples have the hi bit flipped compared to two's * complement numbers. (zero level is $80). Also $00 halts the oscillator! LoadSound START ldx #0 lda #$40 SetMode8 ; 8 bit accumulator uphill sta waveform,x inc a ; ramp from $40 up to $C0 inx cpx #128 bne uphill downhill sta waveform,x ; ramp from $C0 down to $40 dec a inx cpx #256 bne downhill SetMode16 ; 16 bit accumulator * then you have to pump it over to the DOC, using the sound tools. pushlong #waveform ; arg1: src ptr pushword #0 ; doc start address pushword #$100 ; byte count _WriteRamBlock ErrorDeath 'Error Here...' rts waveform ds 256 END **************************************************************** * * PlaySound * * Inputs: contents of a register used as pitch of note * * Outputs: sound * **************************************************************** * PlaySound START using instdef sta semitone pushword #0 space for result pushword #64 middle of the road priority _AllocGen ErrorDeath ' Alloc error ' pla sta gennum pushword gennum pushword semitone pushword #112 ( med volume ) pushlong #instrum ; long ptr to instrument def _NoteOn ErrorDeath ' Note on rejected ' * normally, you would wait before issuing a note off. Since this * instrument has a fast attack and a long release, it really isn't * necessary... pushword gennum pushword semitone _NoteOff ErrorDeath ' NoteOff ? ' rts semitone ds 2 gennum ds 2 END APPEND Proj.data dc i2'0' QParms1 dc i4'QName1' Ptr to name of program to which to quit dc i2'$c000' Push onto stack and re-entrant QName1 dc i1'QName1End-QName1-1' dc c'1/Daleks' QName1End anop QParms2 dc i4'QName2' dc i2'$c000' QName2 dc i1'QName2End-QName2-1' dc c'1/Dabbler' QName2End anop QParms3 dc i4'QName3' dc i2'$c000' QName3 dc i1'QName3End-QName3-1' dc c'1/HodgePodge/Hp' QName3End anop QParms4 dc i4'QName4' dc i2'$c000' QName4 dc i1'QName4End-QName4-1' dc c'1/Basic' ; this will run 'STARTUP' QName4End anop QParms5 dc i4'QName5' ; To be installed (scrll Note) dc i2'$c000' QName5 dc i1'QName5End-QName5-1' dc c'1/Scrolling.Note' QName5End anop QParms6 dc i4'QName6' dc i2'$c000' QName6 dc i1'QName6End-QName6-1' dc c'1/QD.Sampler' QName6End anop QParms7 dc i4'QName7' dc i2'$c000' QName7 dc i1'QName7End-QName7-1' dc c'1/Paint' QName7End anop QParms9 dc i4'QName9' dc i2'$c000' QName9 dc i1'QName9End-QName9-1' dc c'1/Brick' QName9End anop end RAM data MyID dc i'0' program ID word ItemHit dc i4'0' MyTemp dc i4'0' ToolTable dc i'11' dc i'4,$0100' dc i'5,$0100' dc i'6,$0100' dc i'14,$0100' dc i'15,$0100' dc i'16,$0100' dc i'20,$0100' dc i'21,$0100' dc i'22,$0100' dc i'23,$0100' dc i'25,$0100' Event ANop EventWhat ds 2 EventMessage ds 4 EventWhen ds 4 EventWhere ds 4 EventModifiers ds 2 TaskData ds 4 TaskMore DC i4'$00001fff' AppleMenu dc c'> @\XN1',i1'13' dc c' About this demo...\VN256',i1'13' dc c'.' FileMenu dc c'> File \N2',i1'13' dc c' Quit\N257*Qq',i1'13' dc c'.' EditMenu dc c'> Edit \N3',i1'13' dc c' Undo\DVN258*Zz',i1'13' dc c' Cut\DN259*Xx',i1'13' dc c' Copy\DN260*Cc',i1'13' dc c' Paste\DN261*Vv',i1'13' dc c'.' DemoMenu dc c'> Demo \N4',i1'13' dc c' Daleks\N262',i1'13' dc c' Color Dabbler\N263',i1'13' dc c' HodgePodge\N264',i1'13' dc c' Slide Show\N265',i1'13' ; dc c' Scrolling Note\N266',i1'13' dc c' QuickDraw Sampler\N267',i1'13' dc c' GS Paint\N268',i1'13' dc c' Keyboard Sounds\N269',i1'13' dc c' BrickOut\N270',i1'13' dc c'.' OK equ 1 Cancel equ 2 ButtonItem equ 10 CheckItem equ 11 RadioItem equ 12 ScrollBarItem equ 13 UserCtlItem equ 14 StatText equ 15 LongStatText equ 16 EditLine equ 17 IconItem equ 18 PicItem equ 19 UserItem equ 20 ItemDisable equ $8000 ******************************************************** * About this program Dialog Template with data * ******************************************************** MyModal ANop MMRect dc i'30,30,180,346' MMVis dc i'0001' MMRefCon dc i4'0' MMItem1 dc i4'MyButton' MMItem2 dc i4'MyLongStat' MMItem3 dc i4'MyIcon' MMTerm dc i4'0000' MyButton ANop MBID dc i'OK' MBRect dc i'126,240,0,0' MBType dc i'ButtonItem' Button Item MBDescr dc i4'MBTitle' MBValue dc i'0' MBFlag dc i'0' MBColor dc i4'0' MBTitle str 'OK' MyLongStat ANop MLSID dc i'$2001' MLSRect dc i'6,10,105,306' MLSType dc i'LongStatText+ItemDisable' MLSDescr dc i4'MLSData' MLSValue dc i'MLSDataEnd-MLSData' MLSFlag dc i'0' MLSColor dc i4'0' MLSData anop dc c' Apple IIGS Demo Launcher',h'0d' dc c' by: Keith Rollin',h'0d' dc h'0d' dc c' Special Thanks to:',h'0d' dc c' Eagle, for paving the way, and',h'0d' dc c' Mensch, for keeping me on the path',h'0d' dc h'0d' dc c'Copyright Apple Computer, Inc., 1986-87',h'0d' dc c'All Rights Reserved',h'0d' dc c'February 26, 1987 ' dc c' v1.1',h'0d' MLSDataEnd Anop MyIcon anop MIID dc i'$2002' MIRect dc i'108,20,0,0' MIType dc i'IconItem' MIDescr dc i4'IconDataH' MIValue dc i'0' MIFlag dc i'0' MIColor dc i4'0' IconDataH dc i4'IconData' IconData anop dc i'0,0,34,64' dc h'00000000000000000000000000000000' DC h'0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0' DC h'0F0000000000000000000000000000F0' DC h'0F0FFFFFFFFFFFFFFFFFFFFFFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFFFFF88FFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFFF8888FFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFF88888FFFFFF0F0' DC h'0F0FFFFFFFFFFFFFF88888FFFFFFF0F0' DC h'0F0FFFFFFFFFFFFF888888FFFFFFF0F0' DC h'0F0FFFFFFFFFFFFF88888FFFFFFFF0F0' DC h'0F0FFFFFFFFFFFFF8888FFFFFFFFF0F0' DC h'0F0FFFFFF8888FFF88FF8888FFFFF0F0' DC h'0F0FFFF88888888FFF88888888FFF0F0' DC h'0F0FFF888888888888888888888FF0F0' DC h'0F0FFeeeeeeeeeeeeeeeeeeeeFFFF0F0' DC h'0F0FFeeeeeeeeeeeeeeeeeeeFFFFF0F0' DC h'0F0FFeeeeeeeeeeeeeeeeeeFFFFFF0F0' DC h'0F0FF666666666666666666FFFFFF0F0' DC h'0F0FF666666666666666666FFFFFF0F0' DC h'0F0FF666666666666666666FFFFFF0F0' DC h'0F0FF4444444444444444444FFFFF0F0' DC h'0F0FF44444444444444444444FFFF0F0' DC h'0F0FF4444444444444444444444FF0F0' DC h'0F0FFF555555555555555555555FF0F0' DC h'0F0FFF555555555555555555555FF0F0' DC h'0F0FFFF5555555555555555555FFF0F0' DC h'0F0FFFF1111111111111111111FFF0F0' DC h'0F0FFFFF11111111111111111FFFF0F0' DC h'0F0FFFFFF111111FFF111111FFFFF0F0' DC h'0F0FFFFFFF1111FFFFF1111FFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFFFFFFFFFFFFF0F0' DC h'0F0000000000000000000000000000F0' DC h'0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0' dc h'00000000000000000000000000000000' ******************************************************** * Keyboard Sound Dialog Template with data * ******************************************************** SoundModal ANop SMRect dc i'30,30,150,600' SMVis dc i'0001' SMRefCon dc i4'0' SMItem1 dc i4'SoundButton' SMItem2 dc i4'SoundText' SMTerm dc i4'0000' SoundButton ANop SBID dc i'1' SBRect dc i'90,400,110,528' SBType dc i'10' Button Item SBDescr dc i4'SBTitle' SBValue dc i'0' SBFlag dc i'0' SBColor dc i4'0' SBTitle dc i1'5',c'Done!',i1'0' SoundText ANop STID dc i'$1001' STRect dc i'10,10,50,500' STType dc i'16+$8000' LongStsttext+ItemDisable STDescr dc i4'STData' STValue dc i'STDataEnd-STData' STFlag dc i'0' STColor dc i4'0' STData anop dc c'Press the character keys to hear the sounds. The ASCII value of the' DC h'0d' dc c'key pressed will be used to generate a semitone with a fast attack' dc h'0d' dc c'and a slow decay. Use the SHIFT key for more notes. Click on the DONE!' dc h'0d' dc c'button or press RETURN when you are done.' STDataEnd Anop end ******************************************************** * Alert Dialog Template with data * ******************************************************** AlertStuff data Alert ANop AlRect dc i'30,170,100,470' AlID dc i'$1000' AlStages dc i4'$81818181' visible alerts AlItem1 dc i4'AlertButton' AlItem2 dc i4'AlertText1' AlItem3 dc i4'AlertText2' AlTerm dc i4'0000' AlertButton ANop ABID dc i'1' OK (default) ABRect dc i'50,180,65,290' ABType dc i'10' Button Item ABDescr dc i4'ABTitle' ABValue dc i'0' ABFlag dc i'0' ABColor dc i4'0' ABTitle dc i1'2',c'OK',i1'0' AlertText1 ANop ATID1 dc i'$1002' ATRect1 dc i'10,80,19,280' ATType1 dc i'15+$8000' StatText+ItemDisable ATDescr1 dc i4'ATData1' ATValue1 dc i'0' ATFlag1 dc i'0' ATColor1 dc i4'0' ATData1 str 'Cannot find the program:' AlertText2 ANop ATID2 dc i'$1003' ATRect2 dc i'20,100,29,300' ATType2 dc i'15+$8000' StatText+ItemDisable ATDescr2 dc i4'0' this gets patched later ATValue2 dc i'0' ATFlag2 dc i'0' ATColor2 dc i4'0' END **************************************************************** * Instument Data Definition for Simp * **************************************************************** instdef DATA instrum dc i1'$7f,0,$7F' ; env: ramp $7F00 to level $7F dc i1'$00,$40,0' ; decay at a slow rate of $0040 dc i1'0,0,0' ; to zero; use this stage for dc i1'0,0,0' ; release also. dc i1'0,0,0' dc i1'0,0,0' dc i1'0,0,0' dc i1'0,0,0' ; fill out 8 stages with 0's dc i1'1' ; release segment - 1 dc i1'32' ; priority inc dc i1'2' ; pitch bend range dc i1'75' ; slight vibrato dc i1'85' ; vibrato speed dc i1'0' ; spare dc i1'1' ; number of waveptrs for osc A dc i1'1' ; number of waveptrs for osc B AWavelist dc i1'127,0,0,0,0,0' ;topkey,addr,size,ctrl,pitch BWavelist dc i1'127,0,0,0,16,0' ; detune b by 16/256 semitone END ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; These values are returned by FindWindow and TaskMaster. They ; describe locations and results to be acted on in_loc DATA ; --- These are Event Codes returned by the Event Manager, ---------- ; --- which may be processed by TaskMaster ---------- inNull equ $00 No further action required. inButtDwn equ $01 Button down event. inButtUp equ $02 Button up event. inKey equ $03 Key event. ; $04 (Not defined.) inAutoKey equ $05 Auto-Key event. inUpdate equ $06 Update event. ; $07 (Not defined.) inActWind equ $08 Activate window event. inSwitch equ $09 Switch event. inAccess equ $0A Desk Accessory event. inDevice equ $0B Device driver event. ; $0C Application defined. ; $0D Application defined. ; $0E Application defined. ; $0F Application defined. ; --- These are values returned by FindWindow and TaskMaster, ------ ; --- and may mean different things depending on who returns it. ------ ; inDesk equ $10 On the desktop. inSysMenu equ $11 In system menu bar inSysWind equ $12 In system window (desk accessory). inContent equ $13 In a content region. inDrag equ $14 In a drag region. inGrow equ $15 In a grow (size) region. inGoAway equ $16 In a go-away (close box) region. inZoom equ $17 In a zoom (zoom box) region. inInfo equ $18 In the information bar. inVerScrl equ $19 In the vertical scroll bar. inHorScrl equ $1A In the horizontal scroll bar. inFrame equ $1B On a window frame, other than above. inDrop equ $1C On a window drop shadow. ; ; END 3 *******************************************e * * * SlideShow *( * *2 *******************************************- 3 * *_ 4 * Copyright Apple Computer, Inc., 1986-87 * 5 * All rights reserved * 6 * January 6, 1987 v1.0 * 7 * *' 8 ******`'()*+,-1 MACRO &LAB PUSHWORD &WHATTOPUSH LCLC &CHAR &CHAR AMID &WHATTOPUSH,1,1 AIF "&CHAR"="#",.IMMEDIATE &LAB LDA &WHATTOPUSH PHA MEXIT .IMMEDIATE &CHAR AMID &WHATTOPUSH,2,100 &LAB DC I1'$F4' DC I2'&CHAR' MEND MACRO &LAB PUSHLONG &WHATTOPUSH LCLC &CHAR &CHAR AMID &WHATTOPUSH,1,1 AIF "&CHAR"="#",.IMMEDIATE &LAB LDA &WHATTOPUSH+2 PHA LDA &WHATTOPUSH PHA MEXIT .IMMEDIATE &CHAR AMID &WHATTOPUSH,2,100 &LAB DC I1'$F4' DC I2'(&CHAR)|-16' DC I1'$F4' DC I2'&CHAR' MEND MACRO &LAB STR &STUFF &LAB DC I1'L:&sbdefghijktuff' DC C"&STUFF" MEND MACRO &lab setmode8 &lab sep #$30 longa off longi off MEND MACRO &lab setmode16 &lab rep #$30 longa on longi on mend MACRO &lab ErrorDeath &text &lab bcc end&syscnt pea 0 pea 0 pha ldx #$2A0B jsl $E10000 pla sta >y&syscnt pla sta >y&syscnt+2 pea x&syscnt|-16 pea x&syscnt ldx #$200C jsl $E10000 brk $F0 x&syscnt dc c"&text" dc c' Error was $' y&syscnt ds 4 dc i1'13,10,0' end&syscnt anop mend MACRO &lab _TLStartup &lab ldx #$0201 jsl $E10000 MEND MACRO &lab _TLShutdown &lab ldx #$0301 jsl $E10000 MEND MACRO &lab _LoadTools &lab ldx #$0E01 jsl $E10000 MEND MACRO &lab _MMStartup &lab ldx #$0202 jsl $E10000 MEND MACRO &lab _MMShutDown &lab ldx #$0302 jsl $E10000 MEND MACRO &lab _NewHandle &lab ldx #$0902 jsl $E10000 MEND MACRO &lab _DisposeHandle &lab ldx #$1002 jsl $E10000 MEND MACRO &lab _MTStartup &lab ldx #3+256*2 jsl $E10000 MEND MACRO &lab _MTShutDown &lab ldx #3+256*3 jsl $E10000 MEND MACRO &lab _QDStartup &lab ldx #4+256*2 jsl $E10000 MEND MACRO &lab _QDShutDown &lab ldx #4+256*3 jsl $E10000 MEND MACRO &lab _MoveTo &lab ldx #4+256*58 jsl $E10000 MEND MACRO &lab _ShowCursor &lab ldx #4+256*145 jsl $E10000 MEND MACRO &lab _SetForeColor &lab ldx #4+256*160 jsl $E10000 MEND MACRO &lab _SetBackColor &lab ldx #4+256*162 jsl $E10000 MEND MACRO &lab _DrawString &lab ldx #4+256*165 jsl $E10000 MEND MACRO &lab _DeskStartup &lab ldx #$0205 jsl $E10000 MEND MACRO &lab _DeskShutdown &lab ldx #$0305 jsl $E10000 MEND MACRO &lab _FixAppleMenu &lab ldx #$1E05 jsl $E10000 MEND MACRO &lab _EMStartUp &lab ldx #6+256*2 jsl $E10000 MEND MACRO &lab _EMShutDown &lab ldx #6+256*3 jsl $E10000 MEND MACRO &lab _SoundStartup &lab ldx #$0208 jsl $E10000 MEND MACRO &lab _SoundShutDown &lab ldx #$0308 jsl $E10000 MEND MACRO &lab _WriteRamBlock &lab ldx #$0908 jsl $E10000 MEND MACRO &lab _MenuStartup &lab ldx #15+256*2 jsl $E10000 MEND MACRO &lab _MenuShutDown &lab ldx #15+256*3 jsl $E10000 MEND MACRO &lab _InsertMenu &lab ldx #15+256*13 jsl $E10000 MEND MACRO &lab _FixMenuBar &lab ldx #15+256*19 jsl $E10000 MEND MACRO &lab _DrawMenuBar &lab ldx #15+256*42 jsl $E10000 MEND MACRO &lab _HiliteMenu &lab ldx #15+256*44 jsl $E10000 MEND MACRO &lab _NewMenu &lab ldx #15+256*45 jsl $E10000 MEND MACRO &lab _WindStartup &lab ldx #14+256*2 jsl $E10000 MEND MACRO &lab _WindShutDown &lab ldx #14+256*3 jsl $E10000 MEND MACRO &lab _HideWindow &lab ldx #14+256*18 jsl $E10000 MEND MACRO &lab _TaskMaster &lab ldx #14+256*29 jsl $E10000 MEND MACRO &lab _Refresh &lab ldx #14+256*57 jsl $E10000 MEND MACRO &lab _CtlStartup &lab ldx #16+256*2 jsl $E10000 MEND MACRO &lab _ctlShutDown &lab ldx #16+256*3 jsl $E10000 MEND MACRO &lab _DialogStartup &lab ldx #21+256*2 jsl $E10000 MEND MACRO &lab _DialogShutDown &lab ldx #21+256*3 jsl $E10000 MEND MACRO &lab _NewModelessDialog &lab ldx #21+256*11 jsl $E10000 MEND MACRO &lab _CloseDialog &lab ldx #21+256*12 jsl $E10000 MEND MACRO &lab _ModalDialog &lab ldx #21+256*15 jsl $E10000 MEND MACRO &lab _IsDialogEvent &lab ldx #21+256*16 jsl $E10000 MEND MACRO &lab _DialogSelect &lab ldx #21+256*17 jsl $E10000 MEND MACRO &lab _DrawDialog &lab ldx #21+256*22 jsl $E10000 MEND MACRO &lab _StopAlert &lab ldx #21+256*24 jsl $E10000 MEND MACRO &lab _GetNewModalDialog &lab ldx #21+256*50 jsl $E10000 MEND MACRO &lab _GetNewDItem &lab ldx #21+256*51 jsl $E10000 MEND MACRO &lab _LEStartUp &lab ldx #20+256*2 jsl $E10000 MEND MACRO &lab _LEShutDown &lab ldx #20+256*3 jsl $E10000 MEND MACRO &lab _NSStartup &lab ldx #$0219 jsl $E10000 MEND MACRO &lab _NSShutdown &lab ldx #$0319 jsl $E10000 MEND MACRO &lab _AllocGen &lab ldx #$0919 jsl $E10000 MEND MACRO &lab _NoteOn &lab ldx #$0B19 jsl $E10000 MEND MACRO &lab _NoteOff &lab ldx #$0C19 jsl $E10000 MEND MACRO &lab _QUIT ¶ms &lab jsl $E100A8 dc i2"$29" dc i4"¶ms" MEND 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""333333333333333333333333333033333333333333333333333333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333wwwwwwwp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333wwwwwwwp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333wwwwwwwp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333pwpwwwwp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333pwpwwwwp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333pwpw@wp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333pwpwp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333pwpwwp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333pwpwwwp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333pwpw@wp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333wwwwwwwp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333wwwwwwwp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333wwwwwwwp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333033333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330wwwwwwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330wwwwwwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330wwwwwwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330>>pwpwwwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330ppwwwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330ppwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330pppwpwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330p|wwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330pwwwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330>>pwpwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330wwwwwwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330wwwwwwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330wwwwwwwp3333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333033333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330wwwwwwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330wwwwwwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330wwwwwwwp33333303333333333333333333333333333333333333333333333333333333333333333333333333333333333330?>wtwwwwp33333303333333333333333333333333333wppwwwwp3333330?3333333333333333333333333333w@p7wp33333303333333333333333333333333333>wwwwp33333303333333333333333333333333333?twwp33333303333333333333333333333333333pwwpwwp33333303333333333333333333333333333? <pwwpwwp33333303333333333333333333333333333pw@wwwwp3333330ptwwwwp3333330??p@wwwp3333330?pwwwwp3333330>p@wwwwp3333330ptwwwp3333330pw@wwwp3333330wwwwwwwp3333330wwwwwwwp3333330?wwwwwwwp33333303333330?wwwwwwwp3333330?wwwwwwwp3333330?wwwwwwwp3333330??pwpwwwwp3333330pwpwwwwp3333330??tw@wp3333330?w@7wpwp3333330twwp3333330pwpwwwp3333330??pwpw@wp3333330wwwwwwwp3333330wwwwwwwp3333330wwwwwwwp33333303333330wwwwwwwp3333330wwwwwwwp3333330wwwwwwwp33333303?>wwwwwp33333303333333333wtwwwp3333330333333333333333333333333330?wtp7p33333303333333333333330wwpwp3333330333333333333333330wtpwp33333303333333333333333330wwpwp333333033333333333333333330??wwpwp3333330333333333333333333330wwppwpwwwwwwwp3333330333333333333333333330wwp???pwpwwwwwwwp3333330333333333333333333330wwp? 0?wpwwwwwwwp3333330333333333333333333330wwp 0?wwp33333303333333333333333330wwp 0?wwp333333333333333333333333330333333333330 0?33333333333333333333333333033333033333333333333333333333333033333333333333333333333333333330333333333333333333333333330333333333333333333333333330333333333333333333333333330"""""/doddoo333333333333333333333333330..FFFFFFFFFFoo333333333333333333333333330"..".""FoFodOOO333333333333333333333333330"..".oFOodfDoOd333333333333333333333333330..".....OFDdoddddfdFdDDOOO333333333333333333333333330..."....dFOFFoooddFFFFFfo333333333333333333333333330.""...OdDODodfddfdDDfFDofF333333333333333333333333333333...."."...OfDfOdFFOFOFdDFFDdodOoooodoo333333333333333333333333333333."..""...".DFddooddoOddFfFFFFFFOFDo333333333333333333333333333333...."..".oOoOFFFdDdddoooDDD333333333333333333333333333333......OddooddFDfOOFOOOFDdDODOddd333333333333333333333333333333....."OfFF@@fOfodDDdDdfddoO333333333333333333333333333333""""......OdodfFffFDOFOFFF333333333333333333333333333333""""".."FFFFFfFdfodOfdfdooooO333333333333333333333333333333"......dodoOFddFfdDFFFd333333333333333333333333333333""".""""".""""...FOOFoOdddddDO333333333333333333333333333333"""".."".!odddoOofOOfDDd333333333333333333333333333333""""""""."""""""33330OOFODfDOdDFF333333333333333333333333333333"""""/33330ooooodOFFDDdo33333333333333333333333333333333330OOFFFOfFFfooO333333333333333333333333333333ddddDFdo333333333333333333FOOOFdffFF333333333333333333oddd`ddoOdfdDdo333333333333333333FFOOOoFOO333333333333333333ddodDddD333333333333333333FFOFFOfO333333333333333333?ddodo?333333333333333333FOOOFFFFO333333333333333333ddooodd333333333333333333OFFFF333333333333333333oddd?333333333333333333@FFF333333333333333333DDDDDDD@333333333333333333DDDDDFDDDDD@33333333333333333331DDDDDDDDDDDDDDD3333333333333333333333333333333333333333DDDDDFDDDDD@3333333333333333333333333333333333333333DDDDDDD@3333333333333333333333333333333333333333@@@@@@@3333333333333333333333333333333333333333?3333333333333333333333333333333333333333@@@@@@@@@@@@@@@?3333333333333333333333333333333333333333???3333333333333333333333333333333333333333?@@@@@@@@@@@@@@@33333333333333333333333333333333333333333333333333333333333333333333333333333333@@@@@@@@@@@@@@@?3333333333333333333333333333333333333333??3333333333333333333333333333333333333333@@@@@@@@@@@@@@@33333333333333333333333333333333333333333333333333333333333333333333333333333333@@@@@@@@@@@@@@@333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333330@@@@@@@@@@@@3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333033333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333303333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333033333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333303333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333033333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333330333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333303333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333033333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 U      а Ȍ     Р  Ȉ       Њ Ȉ   ʨˀ  л +ʪ    Ȉ ˌȀ    ̻  ɻ Ȫ Ȩ     ̪ ɬ  ʬ  Ȝ     ڊ    ˈ  Ȑ  ̻   ̋   ̬̐     ʪ  Ј  ɨ ʪɘ     ʪ     ʪ  ʠ̙  ˚    ̚    ʪ  ə  ʬ ə  ɬ   ݈   Ȁ     Ȉ      ɜ ɛ    ʪ                ˻ș     ʬ ʬʨ      Ƞ Ȫ   ̬    ̪ʪ  ̊ Ȩ        ̠  ʀ ȈȚ      Ȁ ̈         ̈ȋ    ̚         Ȁ        ʪ ɻ        ˋ   ș       Ȑ ȸ ɀ ʊ           Ɍ ʬ        ȸ      ʚ ʬ                  ʬȈ  ʙ      ʩ         Ȭ Ɋ             ɩ Ȉ ؊    Ɍ .--. .    Ȭˋ ̙Ɍ 蚊   蒙Ƞ  ̌ ̌ș ʙʰ ..  . Țə  ⩜ʊȘ  ə-......  ....̈  ̌ ʠ  ڡ  ə ̀ -...---n. .*.. ʪ ɘب ʪ   .-...m1 ."  ̜  ʪ ʙ ̜ .---..-.ڮ...  Ѫѭ"ʪ     ...-....-.ʪ    ɐ    :(Ѣ    ................-.....ʮ*Ȉ   ?: ʈ  Ȁ    => -.- Ȉ   LLLLLLLLLLL LLLLLLLLLLLLLL? ȉʀ Ș   ?<ܪ-.. Ȉ ș  LLLLLLLLLLLLLLLLLLLLLLLLLLL ѡ?=< ڡ ʬ ̬ʩ  ܬ.Ɍɼ ʪ  ЙLLLLLL@= ̘̜ έ=<ή ʨ̪ ʪ  LLL<Ѫѡњȋ ʩ̘ ʈʪ ll` llll` lll llll` lllllllll` lllllllll` lllllllll` lllllllll3ͮ ʌʪɛ  Ȍʪ LL@3ؘڑ ɚ ̌ʪ    ?ìޮ  ɚʻ Ɉʠ  @ LLLLLLLLL@ LLLLLLLLLLLLOL?Ѫ     ?ή ʩ ̙ ""*  " 3ё ə Ȩɚ **  "  0330<3 030?0< ??L@L@LL ꈈ؈!Њ Ѐ!. ! ш0>3030?       0= 00?LLLLlljꊊ老!(ю .. ! ވ!Ѐ?333 0= 0=?Ψ     00030? L@LLLLj шсс !*( *.!  .!؁ ?33<?? Ύ    0 0<??@L@LL`j舊с! ***! !! .( .!с Ʈ     8LL@L@@L ၁*** . !*Ѐή       @@L@L@l !. * *聁ڀЀƮ    @LLLLL !! *Ѐ.***! (.рЀ⮮@L@@@l`  ခ!Ѐ** 耀 ƎLL@L@LL   !>13 @L@LL@`L ( ƈ    @@LLL@llh ! Ȩ`@@LL@L@H   ခ     @@LLLLL`      LLLLLLLL@    n n@L`LL@@ j 耈 =nfnffΎ  nnn@@LLLLLL ` 0n`j h@@LLLL@@``芊   ALLLLLLL   @@L@L@LLL , LAALA݊ han@@@LL@Lllll LLLءڈш ndaalaс݁ݍL@LLLLLLLLll`AAѡݪꊀlllllaala ڊځю`@@LL@LL`Lllb ء ꊊꊊ a ݨl@L@LLLLLLLlL`ll Ѩݪ ꊊ ݈ݍڎޭ ݎ@l@L@@LLLLLLl@`ݡحبڍ ݍ ڊڮ ݊ޭЮݠ@L@@@LLLLLllll L ѡ ݠڨݭ Ȉ ڊ ڍݍݍڊݨ ݨL@@@@@L@LLLl Ll`"ЭݪݪЊ&ݍ؈ڊݍ݊ڍڊ݊ݎ@L@@@@LL@l@ll llb؀حݭؠݨѩح訠݈ځڈݍڍ ڊ؎ݍ`@lL@@@LLL@lLLL@@ll`ѡݭݨэحبب٭ݨ航ݍڊ݊ݍ ڊ@LL@@@LL@L @lLL` ؀ؘ݁؀ݨڨت ؈  ݊ݍڎ@Ll@@@`@"ݨءѭؠЈЈЭЭѭ٨݁ڀ"Ѝڊڊݍ ڍ݈ ڞڈ݁ݍގލ`@ @@` ݡ؁ؠр݁ ݍ ب ݍتъڈ  ݍ ؈ ؈@@B @ Ll ؀Ш ؝݈ݨب݈ؠ   ݊ڊ   ݈݉ ݍ ڈlL @ @`ѡ ݡѭЀىؐبРؠ  ݈ ъؙݍ  ڈ؊ڈ  ڈ@@ Ll рة حЈبЍ"  ؈ ݍ ݈ ؊рف ڊ  ݭ݈э݀حݩوݩ݈  ؊  ؀ ڊ  ژ ݉ڍ ݀ЭШ ݠحِݍ؉ݨ݈ب݀ ݈  ڍؐ ڐݚڈ݈ڈ݀ЈݍШݠ٨ح  ڊ ؊݊ ݈؊Шؠ؀؀ݨ ٨حوЍڍڍ ڍڊڍ݈݈ ؍ ݉ ݈ح ؈ݍݨݍ؍ؐݭؐݭ݊ ڈ ݊ ؘڈ݊ sta X2 ph sta Y2 pha _LineTo rts *===== * * Drag brush * DragBrush ENTRY jsr AddMouseToUndo lda BrushX ; theDDDDDDDDDDDDD@UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUDDDDDDDDDDDDDDDUUUUUUUUPDDDDDDDDDD@UUUUDDDDDDDDDDDDDDDUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUDDDDDDDDDDDDDDDUUUUUUUUPDDDDDDDDDDD@UUUUDDDDDDDDDDDDDD@UUUUUUUUUUUUUUUUUUUUUUUUUUUDDDDDDDDDDDDDD@UUUUUUUUPD@DDDDDDD@UUUUDDDDDDDDD !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNPQRSTUVWXYDDDDD@UUUUUUUUUUUU@fffff`UUUUUUUUUUUPDDDDDDDDDDDDD@UUUUUUUUPDDfDDDD@UUUU DDDDDDDDDDDDDDDUUUUUUUUUPD@ffffffffffffffUUUUUUUUUUPDDDDDDDDD@UUUUUUUPDDfffDDDD@UUUU DD@UUUUUUUUUUDDDfffffffffffffffUUUUUUUUUUUUUUPDDDDDDDDD@UUUUUUPDDfffDDDD@UUUU UUUUUUUUUUUUUUUUUUUUUUUUUPDDD@fffffffffffffffUUUUUUUUUUUUPDDDDDDDDDD@UUUUPDD@fffD@UUUU UUUUUUUUUUUUUUUUUUUPUUUUUUUUUPDDDDD@ffffffffffffffUUUUUUUUUUPDDDDDDDDDDf`UUUPDD@ffffffUUU UUUUUUUUUUUUUUUUUUUUPUUUUUUUUUPDDDDD@D@fffffffffffff`UUPUDDDDDDD@ff`wUUPDD@fffffffUU UUUUUUUUUUUUUUUUUUUUUPUUUUUUUUUDDDD@ DD@fffffffffffff`UUDDDDDDDfffwwUUDDDfffffffffUU UUUUUUUUUUUUUUUUUUUUUUUUUUUPD DDDffffffffffff`UDDDDD@ffffwwwpUDDDfffffffffUU UUUUUUUUUUUUUUUUUUUUUUUUPЈDDDD@ffffffffffff`DDDDDffff`wwwwD@DDDDD@fffffff`UUUUUUUUUUUUUUUUUUUUUUU Ј DDDD@UUffffffff`DDDDDDDffff`wwwwwwDD@DDDDDDD@fffffff`UUU UUUUUUUUUUUUUUUUUUUPЈ DDDDDUUUUPfffffffDDDD@`DDDfffff`wwwwwwwwDDDDDDDDDDffffff`UUUUUUUUUUUUUUUUUP DDDDDD UUUUUUffffffDDDDD@fD@ffffff`wwwwwwwwwDDDDDDDDDD@ffffff`UUUUUUUUUUUUUUUUUU  DDDDDD UUUUUUPffffffDDDDDD@f`ffffffwwwwwwwwDDDDDDDDDDDfffffUUUD UUUUUUUUUUUUUUUЈDDDDDD UUUUUUPffffffDDDDDDfff`fffff`wwwwwwwwDDDDDDDDDDD@fffffUUUDDDDD@UUUUUUUUUUUUUPw  DDDDDD UUUUUUffff`DDDDDDDffffffffffwwwwwwDDDDDDDDDDfff`UUUUDDDDDDDD@ UUUUUUUUUUUUPw DDDDDDD@UUUUUUPffff`DDDDDDDfff`ffff`wwwwwwwpDDDDDf`UUUUUDDDDDDDD@ UUUUUUUUUUUw ЈDDDDDDDD UUUUUUPffffDDDDDDD@fff`fffwwwwwwDDDffffff`UUUUUUUDDDDDDDDD@UUUUUUUUUUP DDDDDDDD@UUUUUUfffDDDDDD f f`wwwwwwwpDD@fffffffff`UUUUUUUUUDDDDDDDDDDUUUUUUUUw pDDDDDDDDDpUUUUUUfffD@fwwwwwwwwDDfffffffff`UUUUUUUUUDDDDDDDDDDD@ UUpUUUUww w DDDDDDD@wUUUUUPfff`wwwwwwD@ffffffffff`UUUUUUUUUDDDDDDDDDDDD@PPpUUUUww ww DDDDDDGpUUUUUff`wwwwwwwwwww@fffffffffffUUUUUUUUDDDDDDDDDDDDD@UUUPwpUUUUwwwwpDDDDDD@UUUUf`fwwwwwwffffffffffffUUUUUUUUDDDDDDDDDDDUUUUUUP wUUUPwpwwwpDDDDDOpUUUUP fwwwwwffffffffffffff`UUUUUUUUDDDDDDDDDD@UUUUUUUUUUwUUwwwwDDDD@UUU wwwwwpfffffffffffffff`UUUUUUUUDDDDDDDDDDUUUUUUUUUUPwPw wpwwwwpDDDOUUw`wwwwwwwpfffffffffffffff`UUUUUUUUDDDDDDDDD@UUUUUUUUUUUU wwwpwwwww DDp Pw`wwwwfofofffffffff`UUUUUUUDDDDDDDDD@UUUUUUUUUUUU ww wwwwwwwwwwwwpDDwp`wwp` ffffffffffffUUDDDDDDDDD@UUUUUUUUPUPwwwwwwwpwwwwwww ww fffffffffffUPDDDDDDDDD@UUUUUUUUPwwwwwwww wwwwwwpwpwfww ffffffffffDDDDDDDDD@UUUUUUUP Јwwwwwwwwwwwwwwpwwwwwwf`wwp fffffffffD@DDDDDDDUUUUUUU wwwwwwwwpwwwwwwwwwwwwpww `wpfffffffffPDDDDD@UUUUUUU ww wwwwwwwwwwwwwwwwwww  fffffffff`UUUDDD`UUUUUUUPwww wwwwwwwpwwwwwwwwp wpwww wwffffffff`UUUPDffffUUUUUUPwww wwwwwp wwwwwwwp wwwpwww w ffffffffffUUUPffffffUUUUUUPwwwwwwwwwwwp pwwwwww ffffffffffUUUPfffffff`UUUUUUPwww  wwwwwwp p wpwwwww ffffffffffUUUUfffffffUUUUUPww wwww ww Pwwwww fffffffff`UUUUfffffff`UPUUUPwwwwww ww wwwwwww _ffffffff`UUUUfffffff`UUUPwww wwwwww wp wwwwww _UUfffffff`UUUUPffffffffUPwww wwww wwwwp _UUPfffffff`UUUUPfffffff`Pw wwww  wwwwwp UUUffffff`UUUUPfffffffwp wwww "" wwwww UUUPffffff`UUUUUffffff  wwwww "" wwwwwwwp UUUfffff`UUUUUPffffff " ww "" wwwwwwp  UUUffff`UUUUUUffff`"ww "" wwwwwwww """" UUPffff`UUUUUUPffff` "ww3 "" wwwwp """" _UUUUfff`UUUUUUUfff`" ww 3330 "" wwwwww """""_UUUUPffffUUUUUUUPfff` " www 3330 " wwwp """UUUUUUfffUUUUUUUUfff  www 3330 " w """ UUUUUUffUUUUUUUUPff  wp 333 www""" UUUUUPffUUUP` w 330"  ww "" UUUUUUUUfUUU 30"  w "" UUUUUUUUPfUUP 3" ww ""UUUUUUUUU`@UUP   3  wwp ""UUUUUP`D@Uwp 0"  ww ""UUUU`DDwwww     ww "" UUUU`DDwwwp   3 "" UUP`DD@wwwp    3  UU`DDDwww    " 3 """  UU`DDDwww " "" 30 """"  33 U`DDDwpww " " "" 30 """" 33 Ј `DDDwwwwwp "" " " "" 33 3 "" 33 `DDD@wwwwp "" " " " 33 3   3330 w `DDDD@wwwwp "" ""    330 3 " 3330 www `DDDD@wwwp"""""   33 0   3 www𪪪`DDDD@wwwp"""   33 0  0 wwww `D@wwwwp30"""   33 0 . 0wwwwp`DDwwwwwwp 30 ""   30  0wwwp `DDwwwwp 330 ""  30 0wwwww`DDww p3330 ""  30  330wwwpDDwp3330 ""   30 "  30wwwwDD333 "  0 3   30 wwwpDD  333   33 3   30 wwDD 3330"""  33 03   33 wDD 3330 00 333 33 3 "  33 wpDDD333 3300 333030 3  "  33 wDDD 333 333330 333030 30 ""   33 w DDD333333333 33333030 " 3  0 DDDD33 3333333333 33 330  33  0 DDDDD 03 33003333 33 330 3330  0 DDDDD 303 03 333 333 DDDDD 33  330  DDDDDD  30    DDDDDDDD DDDDDDDD Ј  DDDDDDDD  DDDDDDDD DDDDDDD@ pDDDDD w DDD w DDD ЪDD@ wwpDDD@` www DDD@` wwwwpDDD@` wwww DD@` wwwwwwpDD@` wwww D@` www ` p wwwww ` wp www `wwp wwwp`ww """" ww𪪪`www """"" " w𪪪fwL""""""""" "" ww fwwp "" """ 𪪪fwww "" """" w ffwwwwp """ "" p `ffwwwwp""" "" w`ffwwww "" "  wpff ffww " "" wwff`f`wwwwp "" "" wfff`ffwwwp ""  " fffff ffwwwwwp"""""" ffff`f`wwwww """ """"  fff`fwwwww"""  """"  ffff`www   """ """  " ffffwwww  " "" "" ffD@www "" " 30 ЈDDDDDwww " 3330 DDDDDD@wwwp   333""" DDDDDDDDw " 330"""" ЈDDDDDDDDDww """"" 333""""" DDDDDDDDDDwww""  """  333"""" DDDDDDDDDDD@wwp"  """  3330 "" DDDDDDDDDDDDw"   "" " ""33330""   ffDDDDDDDDDDDDw 3  ." " ""33330"   fff`DDDDDDDDDDDD@wp  30  .  "" 3333 "  ffff`DDDDDDDDDDD@pw   30"""" . " 3333" ЈffffffDDDDDDDDDDDDww 30""" 030 " 333  ЈfffffffDDDDDDDDDDD@w w30"" 0330 ""0" """"fffffff`DDDDDDDDDDDDtp 330 " 3330 "  ffffffff`DDDDDDDDDDDDDD  3333 3"330 "" ffffffff`DDDDDDDDDDDDDD  "330 303" 330" Ѐffffffff`DDDDDDDDDDDD@ "  ""330 3330" 330"  ffffffff`DDDDDDDDDDDD """  ""330  30 30 "  fffffff`DDDDDDDDDDD@ ""  ""30 33 " fffffff`DDDDDDDDDDD@"""   "30  33  "  3 fffffff`DDDDDDDDDD@ """  " 0 30  330 fffffff`DDDDDDDD@ """     3 30 30 wffffffDDDDDDDD@w """"  30 3 000 " 0wwpffffffDDD@DDD@w """"  30   33""0wwwpfffffDDDDDD@ """ 0 30    330   30wwfffDD@DDD w""3  33 333"  3wwf`DD@""30 33    3333  33wwDD@w "333  33   3330  30wwwDD@w"3333 33   3333" .3330wwwDD@w"33330 330   33333 3330wwwpDD@ww" 333330330 "3303333wwwDD@www"333 30  330wwwwwwDDDww     wwwwDDDww  wwwDDD@ p p wwwpDDD@   wp ww  wDDDD`w0 p p wwfDDDD `wp ww wp  wff`DDDD wp  wpw < w w   ffpDDDD wwwww ww   wwfffwDDDD   wwwww ww ww  wfffffwDDDD wwwwww p    wvffffffpDDDD ww wwo`w p  wp wp pwpffffffDDDDwwwpwwffwwwpw ` wwpfffffDDD wwwwwwff`wwwpwppwffwwfffff`DD@ wwwpff`wpww w`pwwfff` wffffff`DD  w ffffff`wwpwww ffwwffff wffffff`D@ wwfff`ff`wwpwowpffffff wfffffff`DwpffffffwU_w `f`p wffffff f`ffffffff`DwpfffwU_Pwwfffff`DD  ff`pfffff fff`fffffffffff`D@f`wUUPffffffffD p ff`pffffff ffff`ffffffffff`D@@pwwwUUpffffffffDDD@ ff` ffffff ffffo@ffffffffff`DD@ wpUU_ffffffffDDD@ff`ffffff ffff` (UTIL.ASMC/  *WINDOW.ASMA~C/ ! $DATA NC0  )PRINT.ASM  C0 1 (PLAY.ASM C0 6 )HP.MACROS&C0 )+ HP.ROOT2C1 * HP.A4gC1 * *DIALOG.ASM3:qe4 e4 (LIST.ASM;C2 ) *E16.DIALOG *E16.WINDOW%!! SIMP C6 C6 oDfffffffff`DDD  ЪwUUUfffffffffDDD@ off`ffffff fff`foD@fffffffff`DDDD w ЪwUUPffffffffDDDD offf`ffffff fff`f`DDDfffffffffDDDD O@ЪUPffffffff`DDDD f ffff`fffff`fff`wvf`DDDDDDD@`ffffffffDDDDDDDOUUD@UPfffffff`DDDDfffofffffffffffff``ffffwf`DDDDDDDDffffffff`DDDDD OD UUPDDD@Ufffffff`DDDDDffffffffffff`f`ffffff``ffffgwf`DDDDDDD@fffffffffDDDDDD D@ UUUUDDDDUPffffff`DDDDD@fffffffffffffffffffff`ffff`vf`DDDDDDDffffffff`DDDDDDD pDDD D UUUUDDDDD@UPfffffffDDDDDDfffffffffffff`fffffffff fffff`f`DDDDDD@fffffff`DDDDDDDDDDDDUUUUUUUPfffff`DDDDDD@UUPffffffDDDDDDDHffffffffffffffffffffff fffffffDDDDD@fffffffDDDDDD DDDDDDD@UUUUUUUPfffff`DDDDUUPffffffDDDDDDDffffffffffffff`ffffffff ffffffff`DDDDD@ffffff`DDDDDDUUUUUUUUUPffffff`DDDDUUUUUPfffff`DDDD@fffffffffffffffffffffff`ffffffff`DDDDDffffffDDDDDUUP UUUUUPffffffffDD@UUUUUUfffff`DDDDffff`fffffffffffffffffffffffff ffffffff`DDDDDffffff`DDDDDUUU UUPffffff`DDD@UUUUffff`DDDDffffffffffffffffffffffffffffff ff`fff`DDDD@ffffffDDDUUUUPPffff`DDDD@`UUffff`DDDDffffffffffffffffffffffffffff`ff`fDDDD@fffff`DDDUUUUUUUUUfff`DDDDD@fffffff`DDD@ffffffffff`ffffffffffffffffff`ffDDDD@fffffDAUUUUUUUUUUU f`DDDDDD@fffffff`fff`DDD@ffffffffffffffffffffffffffff`DDDD@ffff sta X2 ph sta Y2 pha _LineTo rts *===== * * Drag brush * DragBrush ENTRY jsr AddMouseToUndo lda BrushX ; the]e]]mmmV^e]]mm]]]]]]n]]]]]em]feeffm]f]ef]ff]eefV]e]m]]]f^e]m]]efeefeeef]ffmef]fff]f]fefmf]feff]ffffffme]feemmmmV]]n]^e]mmee]mmf]f]ffef]ff]fmfefmfefmfffefmfeff]feffff]ffmmffV^m]mn^^]mn]^eZ\]^_`abcdefghijklmnopqrstuvwxyz{|}~mmmm]]em]m]f]ff]ef]f]efmf]f]ff]fffefffffeffffff]f]mfeemen]mm]ne]]mm]mmmf]emem]ff]efffmffefefmfef]feffffffmffffeffeffeefV^m^m]]mmne]m]]mmefm]efemff]eeef]ef]f]fefffmffffffff]ffffmff]ff]]mfem]m]ememnemem]mm]fm^fmf]f]memffmffmf]f^feffff]feff]ffff]ffffmfff]e]efmne]]mefmfmmfef]f]mmfmeffmffefmfff]ff]feffffffffmffmmefme]m]nVne]mmm]em]e]ee]ff]f]fmfmf]fmfeffmffff]fmf]feffffffeffffm]]^ff^me]m]n^]nemm]me]ef^effmf]f]f]f]ff]f]feffmfVfmfmfmfefeffff]ffefffmeeefme]emmm^ene]]me]em]e]^ef]mf]f]fefff]fmfffnfefefmfmfmffffff]ff]fm]m]^ff^^me]em^enem]]]efmmmf]mf]f]ffmefeeff]fffffefmfmffmfffefeffeffff]fefmme]mfnVnemmmmm]fmefe]mmf]f]ef]fmf]fmfmfefVf]fffefmff]fffmffmff]ffeefmnffV^]e]Vmfemmmm]e]e^m^ef]]fmeef]fef^f]ffff]fnfeffVfeffnff]ffff]ffffeffemm]fnmmeemnVfem^]mm]]eef^mmVmeef]fmfffefmfnfmfffff^feff^ffffffffeff]ffm]]]enff^]f^]]emm^]m]m^m^mefenefef]ffmeef]f]ffffff]fnffffVfffffeff]ffmfffmfff]fnnnnmmmfmm]emm]m]mef]feffef]ef]fmfmffefVfmfffmfnffffffefffmfefffff]ff]eemfnff]fm]emm]m^me^mne]f]]ff]effVf]fef]fefefffefefffffmffff]ffmffmfff]fff]eem]mfffVVV^^]mVVmen]m]m]efeVmmff]effef]ffVf]fffffff]ffffnfffefffffffffffmem]f]ffeeemmmmfVmen]]^mee^mfVmffemff]meefmffmfffefff]ffff]ffffVfffmffmff]ffffffeeemfmeVfVVfVVmen]mmmm^]eee^feeff]meff]fmfffffffmffff]ffffffff]ff]ffeffeffffffem]e]]efefnn^V]fn]nmen]mmm^]meVmff]mffef]f]mmffff]fefffmffefffmfffffffffeff]ffefff]fffeemfmffVfVmnmm]neen]n^]^^nmeenmef]ff]f]fmfnffeff]fffffffffmfffffffeffmffeffefffmffffmeenfemfffnVfemeefnVmV^ffVfmf]]f]f^fVffmfmefff]fff]fffmfffffffmffffffmfffeffff]fffe^ee]^fffen^VfeefV]mmmmnmeef]nfe]mf]f^fff^f^fmffeffmfffefffffff]ffmffmfffmffffffffffffmefefVemfeffffen^^feffVVVVVVVVVfeeffmmf^fVffffffffVffefffefffffffff]fffff]ffff]ffffmffffeff]efVm^e^ffffVmmfffVeeeffffmmf^feffefnfmffnfff]fffeffffffmffeffmfff]fff]ffff]fffffff]f]ef]f]fffVffen^ffVmmmnnfVVVfmVf^emf^ffffnfVffffffmffefffffff^ff]fffffffffmffffffff]ffff]fmfmeff]efnfffffVf^fVfen^]nVVeeffenfnfefVffffffffefffffeffffffffffffff]ffffffefffeffffmfffff]fmemeefneVffffn^fmf^fen^^VefVfff]ffefefVefffffff^ffffffffffffffffffmffeffeffffffffmffffefffffmfefeeffV]efffffemfef^feVnVefnfmfff^efVfffffffefffffVffffffffffffff]ffefff]ffffffffffffffffmf^feefeffffffefef^fenefffffffff^ffVfffffffnfffffnfff^fffffffffffeffmfffmfffeffffffffff]fffffnfVfefmfefffffVfnfefmfnffff^ffVnffffffffffffffefff^ffffffffffffffmfffeffffmffff]fffffeffffffmf]fmefnfefmf^ffffffVfnfmfn^efffffeffffffffffffnffffffff^ffffffffffmfff]ffffffff]ffffmfffffffffffeffffffVef]ffffffnfVnfnfVffffffffeffffffffffffffffffffffffffffܝfff]fffffffeffffefffffmffffffff]fefmffffVff]fefffffeffffnfefffffnfffffffffffffffffffffffffffffmffhfff]ffffmffffffffffeffffff]ffffff]fmffff^ffffffffffnfffffffffefffffffffffffffffffffffffffeԌf͌fffmffff]ffff]fffff]ffffffmfmffffffeff]f]fmfffnffefffffVffffenfffffffffffffffffffffffffffffff]ffhHHffffffffmfffffmffffffm]ffffffffffffmff]ffffffnffeffffffnfffVfVffffffffffffffffffffffffffffeffe܌d Ffmffffmfffffffffffef]fmf]mefffffeffffff^fefmffffffnfffffefffffffffffffffffffffffffffffff]ffmhHfffefffffmfffffffffffffeffffffmfff]ffffffffffeffmffVfmfVffffffffffffffeffffffffffffffffffffffffmffmfffm̌ ̝fffffeffffff]ffffffff]fffff]ffffmffffffffffeff]ffeffffff]ffffffffffffVfffnfffffffffffffffffffffffffmfffef`fd ffffffmffffffffmfffffffffmffeffmffffVffffffffffffffVfffffffffffffffffffmfff]ffflfffff`l ffmfffffffffffffffffffffffffffffffffe.ffffffffffmffeffffffffffffffffffffffffffffffffffffffff]ffffhffHfh ̀ffffffffffffffffffffffffefffbffnffffffffffffffefffffefffffffffffffffffffffffffffffnfffffffffflffLffl fffffffffffffffffffff]fffeffe.eތ.ffffffffffffffffffffffffffffffffffffffffffffffffffffffffHH ffffffffmfffffffff]fffefmffffffffffffffffffffff]fffffffffffffffffffffffffffffffffffffffd ffffffffffffffffmff,fffh.,fffffffffffffffffffffffffffffffffffffffffffffffffffffffff Ȉ؈fffffffffffffffffffm]ɁȦffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffl ̀ HLfffffffffffffffffffffffffffeffffnܮffnȮ.Jeffffmfffmffffffffffffffffffffffffffffffffffffffffffffffffffffffh  ȄffffffffffffffffffffffeeffbfHȍfffffmffffffffffffffffffffffffffffffffffffffffffffffffffffffd@ @  ̀ LfFffffffffffffffffffffffffffe 쨦.Ύff..fffffffe Ȉ  .!.ȁ  .." "숑-".-숑.!--"ȑ -  ȑ ,.-ɀ ‘!؈ ,.,!     " , . ,      -    ,  -  .., !. Б, ..Ȓ ,,,,..- ,.̍ , .. Б., 쭁 Б-  -   Б"!-- .,.   .-щ -..   " !..-.   "! ȁȀɀ..!!! ȁȈȀȁ )  " ʀ ȐȁȈȁ.   ʈ Ȑ   .."!.  .၁ ȑ  .Б...., !    , Ј  !) .".,...    ΁.!Ȋ ȘȘ  -..!..,..-.,-!..-..    !-"Э " ؀ ю. - ,!-.! ...,!    "ሮ(ȀȀ ,...!.,.!,-...̮ .     О "ȁ ȁ  Ȁ ... !.....)..-..,"쌑" ,    " ! ( ""Ɉ,Ɉ   Ȉ ..,- .-!- ,--..-..-!, ,    !- - -,"! ɀ ..-" ."!!, -.,....-.!-,! ,  ""ȁИ""" ! -  ؈ɀ . ".., .ጮ....Ќ.̑..,..,!--ΐ,   "с-    ؐΈшȀ .."!-!. ..쌒  . ь,,, . ., . ...! !БȠ ""  ɉ.,! ..,...!,!.윎.. ,,,,Ȟ-܀.茌.   " " !( ""ʀА옑  Ɂ..,...,   .!.,  . (..΀,(!  "!  " АɈH(    ɀɎ.,.!,.К.(, .-..ሁ  ,.  ,쀒 !(́ !""-Ёш ∁ шȈ"QȀȑȀ؈Ȉ .. ... ,!.  . .,, ,.с    Бт Ȑ". " И(ȑ  ɂА  ؉Ȉ  ȈȀȈ " ., ,,..   *, ,с( !, ,쌈     . ȉ ؘ"ȎɉȈȈȈɈȈ   .,Ύ.,    (Ș큁 .!-       ȉ     X 舉蘐 Ȉ ȈȈ -Ɏ͍,.̎̈  , , . 숉     ВБ Ȉ ށЉȀɈ ȀȀ .Ȉ, .    ,     "-,ЊɁ   ȈЈ  ɉɈ؈ȁ遈ȁ.. - ؉         - 수 ȉɈȘ؈ Ȉ숈 ȀȀȈ  ,舐           (   Ȉ ȈɉȑɈȀȈ ,           ȈȈȈ ؀ȀșȘ ȈȈ ,      ȉ  ȈȈ ȈɀȀȈȀ -        ɈɈɈ ȈȈȈHȈ ɉȀ          тȉȈȈȈшȈȈ ɉȈȀȈ      ȈȈ ȈȈȈȘȈȀ Ȁ         ȈȈȈɈȈɀȈȈ           ȉ ɉȈȈ ɀȈȘȈ ȀȀ          ȈȈȑȉȈȈȀȁȉ ȁȀ Ȉ     ȈȀɈɉȈȀȈ ȈȀȀ ȀȀ         Ȉ Ȉ ȁȀȈ Ȁ  ȀȀ             ȉȈ؀ȀȀȈȈ  Ȁ Ȉ  Ȉ             ɈȈȀȈȈ  Ȁ            ȘɀȈ   Ȉ             Ȉ  Ɉ Ȉ              ɈȀ Ȉ Ȉ          Ȉ   Ȁ Ɉ             Ȁ ɈȀ                   Ȁ Ȉ              ȀɈ ȈȀȀ ȀȀ        ؀Ȁ Ȁ  ȀȀɈ ȀȈ       ɁȈȀȈ  ȀȀȀȀȈȈȀȀ           ɀ ȀȀ ȀȀ                    @ *************************************************************** * * FontData * **************************************************************** FontDATA DATA FontWinPtr ds 4 DesiredFont dc i4'$0800FFFE' ; System Font size 8 MonoFlag dc i2'0' ; start out showing proportional CurFontInfo anop CFAscent ds 2 CFDescent ds 2 CFLeading ds 2 CFMaxWid ds 2 CurHeight ds 2 LineCounter ds 2 CurPos ds 4 NumLines equ 13 LineTable MACRO &LAB PUSHWORD &WHATTOPUSH LCLC &CHAR &CHAR AMID &WHATTOPUSH,1,1 AIF "&CHAR"="#",.IMMEDIATE &LAB LDA &WHATTOPUSH PHA MEXIT .IMMEDIATE &CHAR AMID &WHATTOPUSH,2,100 &LAB DC I1'$F4' DC I2'&CHAR' MEND MACRO &LAB PUSHLONG &WHATTOPUSH LCLC &CHAR &CHAR AMID &WHATTOPUSH,1,1 AIF "&CHAR"="#",.IMMEDIATE &LAB LDA &WHATTOPUSH+2 PHA LDA &WHATTOPUSH PHA MEXIT .IMMEDIATE &CHAR AMID &WHATTOPUSH,2,100 &LAB DC I1'$F4' DC I2'(&CHAR)|-16' DC I1'$F4' DC I2'&CHAR' MEND MACRO &LAB STR &STUFF &LAB DC I1'L:sys&SYSCNT' sys&SYSCNT DC C"&STUFF" MEND MACRO &lab ErrorDeath &text &lab bcc end&syscnt pea 0 pea 0 pha ldx #$2A0B jsl $E10000 pla sta >y&syscnt pla sta >y&syscnt+2 pea x&syscnt|-16 pea x&syscnt ldx #$200C jsl $E10000 brk $F0 x&syscnt dc c"&text" dc c' Error was $' y&syscnt ds 4 dc i1'13,10,0' end&syscnt anop mend MACRO &lab _TLStartup &lab ldx #$0201 jsl $E10000 MEND MACRO &lab _TLShutdown &lab ldx #$0301 jsl $E10000 MEND MACRO &lab _LoadTools &lab ldx #$0E01 jsl $E10000 MEND MACRO &lab _TLMountVolume &lab ldx #$1101 jsl $E10000 MEND MACRO &lab _MMStartup &lab ldx #$0202 jsl $E10000 MEND MACRO &lab _MMShutDown &lab ldx #$0302 jsl $E10000 MEND MACRO &lab _NewHandle &lab ldx #$0902 jsl $E10000 MEND MACRO &lab _DisposeHandle &lab ldx #$1002 jsl $E10000 MEND MACRO &lab _MTStartup &lab ldx #3+256*2 jsl $E10000 MEND MACRO &lab _MTShutDown &lab ldx #3+256*3 jsl $E10000 MEND MACRO &lab _QDStartup &lab ldx #4+256*2 jsl $E10000 MEND MACRO &lab _QDShutDown &lab ldx #4+256*3 jsl $E10000 MEND MACRO &lab _GrafOff &lab ldx #4+256*11 jsl $E10000 MEND MACRO &lab _SetPort &lab ldx #4+256*27 jsl $E10000 MEND MACRO &lab _GetPort &lab ldx #4+256*28 jsl $E10000 MEND MACRO &lab _SetPenSize &lab ldx #4+256*44 jsl $E10000 MEND MACRO &lab _SetSolidPenPat &lab ldx #4+256*55 jsl $E10000 MEND MACRO &lab _MoveTo &lab ldx #4+256*58 jsl $E10000 MEND MACRO &lab _LineTo &lab ldx #4+256*60 jsl $E10000 MEND MACRO &lab _SetRect &lab ldx #4+256*74 jsl $E10000 MEND MACRO &lab _InsetRect &lab ldx #4+256*76 jsl $E10000 MEND MACRO &lab _EraseRect &lab ldx #4+256*85 jsl $E10000 MEND MACRO &lab _PaintOval &lab ldx #4+256*89 jsl $E10000 MEND MACRO &lab _GlobalToLocal &lab ldx #4+256*133 jsl $E10000 MEND MACRO &lab _Random &lab ldx #4+256*134 jsl $E10000 MEND MACRO &lab _ShowCursor &lab ldx #4+256*145 jsl $E10000 MEND MACRO &lab _SetFont &lab ldx #4+256*148 jsl $E10000 MEND MACRO &lab _GetFont &lab ldx #4+256*149 jsl $E10000 MEND MACRO &lab _SetForeColor &lab ldx #4+256*160 jsl $E10000 MEND MACRO &lab _SetBackColor &lab ldx #4+256*162 jsl $E10000 MEND MACRO &lab _DrawChar &lab ldx #4+256*164 jsl $E10000 MEND MACRO &lab _DrawString &lab ldx #4+256*165 jsl $E10000 MEND MACRO &lab _DrawCString &lab ldx #4+256*166 jsl $E10000 MEND MACRO &lab _DeskStartup &lab ldx #$0205 jsl $E10000 MEND MACRO &lab _DeskShutdown &lab ldx #$0305 jsl $E10000 MEND MACRO &lab _FixAppleMenu &lab ldx #$1E05 jsl $E10000 MEND MACRO &lab _EMStartUp &lab ldx #6+256*2 jsl $E10000 MEND MACRO &lab _EMShutDown &lab ldx #6+256*3 jsl $E10000 MEND MACRO &lab _GetNextEvent &lab ldx #6+256*10 jsl $E10000 MEND MACRO &lab _Int2Dec &lab ldx #$260B jsl $E10000 MEND MACRO &lab _HexIt &lab ldx #$2A0B jsl $E10000 MEND MACRO &lab _ReadChar &lab ldx #$220C jsl $e10000 MEND MACRO &lab _MenuStartup &lab ldx #15+256*2 jsl $E10000 MEND MACRO &lab _MenuShutDown &lab ldx #15+256*3 jsl $E10000 MEND MACRO &lab _InsertMenu &lab ldx #15+256*13 jsl $E10000 MEND MACRO &lab _FixMenuBar &lab ldx #15+256*19 jsl $E10000 MEND MACRO &lab _DrawMenuBar &lab ldx #15+256*42 jsl $E10000 MEND MACRO &lab _HiliteMenu &lab ldx #15+256*44 jsl $E10000 MEND MACRO &lab _NewMenu &lab ldx #15+256*45 jsl $E10000 MEND MACRO &lab _EnableItem &lab ldx #15+256*48 jsl $E10000 MEND MACRO &lab _DisableItem &lab ldx #15+256*49 jsl $E10000 MEND MACRO &lab _WindStartup &lab ldx #14+256*2 jsl $E10000 MEND MACRO &lab _WindShutDown &lab ldx #14+256*3 jsl $E10000 MEND MACRO &lab _NewWindow &lab ldx #14+256*9 jsl $E10000 MEND MACRO &lab _SelectWindow &lab ldx #14+256*17 jsl $E10000 MEND MACRO &lab _HideWindow &lab ldx #14+256*18 jsl $E10000 MEND MACRO &lab _ShowWindow &lab ldx #14+256*19 jsl $E10000 MEND MACRO &lab _TaskMaster &lab ldx #14+256*29 jsl $E10000 MEND MACRO &lab _BeginUpdate &lab ldx #14+256*30 jsl $E10000 MEND MACRO &lab _EndUpdate &lab ldx #14+256*31 jsl $E10000 MEND MACRO &lab _Refresh &lab ldx #14+256*57 jsl $E10000 MEND MACRO &lab _SETPREFIX ¶ms &lab jsl $E100A8 dc i2"9" dc i4"¶ms" MEND MACRO &lab _GETPREFIX ¶ms &lab jsl $E100A8 dc i2"$0A" dc i4"¶ms" MEND MACRO &lab _QUIT ¶ms &lab jsl $E100A8 dc i2"$29" dc i4"¶ms" MEND MACRO &lab _CtlStartup &lab ldx #16+256*2 jsl $E10000 MEND MACRO &lab _ctlShutDown &lab ldx #16+256*3 jsl $E10000 MEND MACRO &lab _DialogStartup &lab ldx #21+256*2 jsl $E10000 MEND MACRO &lab _DialogShutDown &lab ldx #21+256*3 jsl $E10000 MEND MACRO &lab _LEStartUp &lab ldx #20+256*2 jsl $E10000 MEND MACRO &lab _LEShutDown &lab ldx #20+256*3 jsl $E10000 MEND ******************************************************************* * * * Apple II GS Daleks program * * by Eagle I. Berns * * * * * January 6, 1987 v1.0 * *  * * (c) Copyright 1987 Apple Computer, Inc. * * * * All rights reserved. * * * * This program and its derivatives are licensed only for * * use on Apple computers. * * * * Works based on thisDaleks10 START DC I'$0005' ; {offset word} DC I'$0002' ; {FontID} DC I'$0000' ; {style} DC I'$000A' ; {size} DC I'$0100' ; {version} DC I'$B000' ; {FontType} DC I'$0000' ; {FirstChar} DC I'$003B' ; {LastChar} DC I'$000A' ; {WidMax} DC I'$0000' ; {KernMax} DC I'$FFFE' ; {nDescent} DC I'$0008' ; {fRectWidth} DC I'$000A' ; {FrectHeight} DC I'$0089' ; {owTLoc} DC I'$0009' ; {ascent} DC I'$0001' ; {descent} DC I'$0000' ; {leading} DC I'$0007' ; {RowWords} * BitImage: DC H'00 00 00 00 00 00 00 00 00 00 00 00 E4 FC 3C FC' DC H'18 3F 10 18 08 03 18 C0 30 3C E4 1F 42 F8 3C 1F' DC H'30 7E 0C 07 18 E0 3C 5A E0 18 FF F0 7E 0F 70 18' DC H'0E 8E 18 71 56 7E E7 DC DB F8 FF 1F FF 7E FF DC' DC H'18 3B 7F 24 E7 1F FF DC 18 3B FF 99 FF F8 FF 1F' DC H'B5 18 E3 E0 BD 8E 18 71 70 3C 0E F0 7E 0F EB E7' DC H'E7 03 3C 07 18 E0 30 66 0C F8 3C 1F BD 3C E0 00' DC H'FF 03 18 C0 10 66 08 FC 18 3F FB E7 E0 00 00 00' DC H'00 00 00 00 00 00 00 00 00 00 00 00' * LocTable: DC I'$0000' ; Char (00) DC I'$0000' ; Char (01) DC I'$0000' ; Char (02) DC I'$0000' ; Char (03) DC I'$0000' ; Char (04) DC I'$0000' ; Char (05) DC I'$0000' ; Char (06) DC I'$0000' ; Char (07) DC I'$0000' ; Char (08) DC I'$0000' ; Char (09) DC I'$0000' ; Char (0A) DC I'$0000' ; Char (0B) DC I'$0000' ; Char (0C) DC I'$0000' ; Char (0D) DC I'$0000' ; Char (0E) DC I'$0000' ; Char (0F) DC I'$0000' ; Char (10) DC I'$0000' ; Char (11) DC I'$0000' ; Char (12) DC I'$0000' ; Char (13) DC I'$0000' ; Char (14) DC I'$0000' ; Char (15) DC I'$0000' ; Char (16) DC I'$0000' ; Char (17) DC I'$0000' ; Char (18) DC I'$0000' ; Char (19) DC I'$0000' ; Char (1A) DC I'$0000' ; Char (1B) DC I'$0000' ; Char (1C) DC I'$0000' ; Char (1D) DC I'$0000' ; Char (1E) DC I'$0000' ; Char (1F) DC I'$0000' ; Char (20) DC I'$0000' ; Char (21) DC I'$0000' ; Char (22) DC I'$0000' ; Char (23) DC I'$0000' ; Char (24) DC I'$0000' ; Char (25) DC I'$0000' ; Char (26) DC I'$0000' ; Char (27) DC I'$0000' ; Char (28) DC I'$0000' ; Char (29) DC I'$0000' ; Char (2A) DC I'$0000' ; Char (2B) DC I'$0000' ; Char (2C) DC I'$0000' ; Char (2D) DC I'$0000' ; Char (2E) DC I'$0000' ; Char (2F) DC I'$0000' ; Char "0" DC I'$0008' ; Char "1" DC I'$0010' ; Char "2" DC I'$0018' ; Char "3" DC I'$0020' ; Char "4" DC I'$0028' ; Char "5" DC I'$0030' ; Char "6" DC I'$0038' ; Char "7" DC I'$0040' ; Char "8" DC I'$0048' ; Char "9" DC I'$0050' ; Char ":" DC I'$0058' ; Char ";" DC I'$0060' ; Missing Symbol DC I'$0063' ; Total Width in Pixels * OWTable: DC I'$FFFF' ; Char (00) DC I'$FFFF' ; Char (01) DC I'$FFFF' ; Char (02) DC I'$FFFF' ; Char (03) DC I'$FFFF' ; Char (04) DC I'$FFFF' ; Char (05) DC I'$FFFF' ; Char (06) DC I'$FFFF' ; Char (07) DC I'$FFFF' ; Char (08) DC I'$0104' ; Char (09) DC I'$FFFF' ; Char (0A) DC I'$FFFF' ; Char (0B) DC I'$FFFF' ; Char (0C) DC I'$0104' ; Char (0D) DC I'$FFFF' ; Char (0E) DC I'$FFFF' ; Char (0F) DC I'$FFFF' ; Char (10) DC I'$FFFF' ; Char (11) DC I'$FFFF' ; Char (12) DC I'$FFFF' ; Char (13) DC I'$FFFF' ; Char (14) DC I'$FFFF' ; Char (15) DC I'$FFFF' ; Char (16) DC I'$FFFF' ; Char (17) DC I'$FFFF' ; Char (18) DC I'$FFFF' ; Char (19) DC I'$FFFF' ; Char (1A) DC I'$FFFF' ; Char (1B) DC I'$FFFF' ; Char (1C) DC I'$FFFF' ; Char (1D) DC I'$FFFF' ; Char (1E) DC I'$FFFF' ; Char (1F) DC I'$FFFF' ; Char (20) DC I'$FFFF' ; Char (21) DC I'$FFFF' ; Char (22) DC I'$FFFF' ; Char (23) DC I'$FFFF' ; Char (24) DC I'$FFFF' ; Char (25) DC I'$FFFF' ; Char (26) DC I'$FFFF' ; Char (27) DC I'$FFFF' ; Char (28) DC I'$FFFF' ; Char (29) DC I'$FFFF' ; Char (2A) DC I'$FFFF' ; Char (2B) DC I'$FFFF' ; Char (2C) DC I'$FFFF' ; Char (2D) DC I'$FFFF' ; Char (2E) DC I'$FFFF' ; Char (2F) DC I'$010A' ; Char "0" DC I'$010A' ; Char "1" DC I'$010A' ; Char "2" DC I'$010A' ; Char "3" DC I'$010A' ; Char "4" DC I'$010A' ; Char "5" DC I'$010A' ; Char "6" DC I'$010A' ; Char "7" DC I'$0109' ; Char "8" DC I'$0008' ; Char "9" DC I'$0109' ; Char ":" DC I'$0008' ; Char ";" DC I'$0104' ; Missing Symbol DC I'$0000' ; End of Table - (often -1) END *************************************************************************** * * DoLastS : Set flag and keep moving Daleks (till display turns mode off) * *************************************************************************** DoLastS START USING GLOBALDATA lda #3 jsr UnHilite lda #1 STA LastStand DoLastLp jsr MoveDk lda LastStand bne DoLastLp rts END ***************************************************************************** * * Display(a) : if a zero : redraw an existing board. * a pos. : generate a new board of "a" daleks. * **************************************************************************** display START using GLOBALDATA using WINDOWDATA sta DispTyp PUSHLONG DwinPtr _SetPort PUSHLONG #0 _GETFONT ;prev. font - leave on stack til exit PUSHLONG FontHDL ;set daleks character font _SETFONT NewRound stz numDs ; init number of daleks found lda DispTyp ; what type - new or draw old sta dcnt beq disp1 PUSHLONG #DwinArea _EraseRect ldx #$03FC ;32 by 16 by words clrlop stz table,x ;zero it out dex dex bpl clrlop stz ppos ; init this inc dcnt ; No. of daleks +1 for player bra playloop disp1 jsr initsearch ; init. search for daleks bcs done ; clc means one found ldy ppos ; always do player first tya asl a tax lda table,x ; (so we can draw arrows) bra drawit drawloop jsr searchnext bcs done ; sec and we're done cpy ppos ; got one, but we've already done beq drawloop ; player, so skip it bra drawit done jmp chkND ; done, unless no more daleks(new round) playloop PUSHWORD #0 _RANDOM pla ;check if it exists and #$01FF ; nine bits only tay ;save it in y asl a tax lda table,x bne playloop lda ppos bne dostor sty ppos lda #64 bra dostor2 dostor lda #1 dostor2 sta table,x ;no, so add it in drawit sta itemtyp tya and #$1F ;low 5 for column: 0000 0000 000c cccc asl a ; *2 to index word tenstable tax lda tenstable,x tax ; column saved in x tya ;orig. random number and #$01E0 ;row: 0000 000r rrr0 0000 lsr a lsr a lsr a lsr a ; row *2 to access tenstable tay lda tenstable,y tay clc adc #8 ; +8 for character height inx ; +1 to center in stx hpos ; need horiz. pos later sta vpos ; vertical also phx ; Now, Move to spot pha _MOVETO lda dalchar ;assume dalek (usually) ldy itemtyp cpy #1 ;is it? bne sk1 jmp Pdoadraw sk1 lda heapchar ;heap o' junk? cpy #33 bge sk2 jmp doadraw sk2 lda playchar cpy #65 ; player? bge gamedone ; no, we got hit, game done lda #3 ;set the player to blue pha _SetForeColor lda playchar and #$FF pha _DrawChar ; draw player stz aioffset ; draw arrows around it stz acoffset np ldx aioffset ; point to arrow index offsets cpx #36 beq endloop lda hpos clc adc arwiofst,x pha lda vpos clc adc arwiofst+2,x pha _moveto ldx acoffset lda arwChars,x and #$FF pha _drawChar inc aioffset inc aioffset inc aioffset inc aioffset inc acoffset bra np gamedone PUSHWORD #midTeleport ;disable teleport _DISABLEITEM PUSHWORD #midSonics ;disable sonic screwdriver _DISABLEITEM stz allowclick ;disable clicking stz LastStand ;no matter what lda donechar ;draw death and #$FF pha _DrawChar _setFont rts Pdoadraw inc numDs ;count daleks found to check end round doadraw and #$FF pha _DrawChar endLoop lda #0 pha _SetForeColor ; back to black dec Dcnt bmi jdrawloop ; if it started at zero, its draw bne jplayloop ChkND lda NumDs ; did we draw any daleks beq nextrnd ; no, go set up for next round _SETFONT ;reset font - handles still on stack lda NumDr ;at start we had Numdr sec sbc NumDs ;at end we had Numds asl a ; diff.*10 add to score pha ;*2 asl a ;*4 asl a ;*8 clc adc 1,s ;*8+*2=*10 clc adc score sta score ;score:=score+10*{number killed} pla ;(get rid of extra) lda numDs sta numDr ;now ready for next move rts nextrnd lda NDaleks clc adc #5 sta NDaleks sta NumDr sta DispTyp ;(needed for when we go back) PUSHWORD #midSonicS ; re-enable sonic Screwdriver _ENABLEITEM lda LastStand ;are we in last stand mode? beq NewRdJ ;no, go do next round stz LastStand ;yes, turn it off and get out NewRdJ jmp NewRound jdrawloop jmp drawloop jplayloop jmp playloop arwiofst dc i'-10,-10,0,-10,10,-10' ; order that follows significant dc i'-10,0,10,0' dc i'-10,10,0,10,10,10' DalChar dc c'0' HeapChar dc c':' DoneChar dc c';' PlayChar dc c'5' arwchars dc c'1' ;order that follows significant dc c'2' dc c'3' dc c'4' dc c'6' dc c'7' dc c'8' dc c'9' END *****DEBUG*DEBUG*DEBUG*DEBUG*DEBUG * * (ring buffer stores of whatever's in a reg.) * DORING START phy phx pha lda RBP inc a inc a and #$1FF sta RBP tax pla sta RB,x plx ply rts RBP dc i'510' RB dc i'0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0' ds 492 ;(492+20=512) END * *****DEBUG*DEBUG*DEBUG*DEBUG*DEBUG ***************************** * * note: first attempt uses trivial (slow) search. get fancy later * ***************************** * *********************************************************************** * * InitSearch: Initialize search variables and prepare to scan for * Daleks. * ********************************************************************** INITSEARCH START USING GLOBALDATA lda NDaleks bne init0 ldx #table+32*16*2 ;end of table stx NextIndex sec ; sec=none to find rts init0 ldx #0 ;where we start stx nextIndex clc ; clc=they exist rts END ********************************************************************** * * SearchNext: Find the next dalek - return table offset in Y, item in A * ********************************************************************* SEARCHNEXT START USING GLOBALDATA ldx NextIndex s1 cpx #32*16*2 ; at end? beq noneleft ; yep, get out lda table,x ; is it a anything? inx inx cmp #0 beq s1 pha ; value to return in a SerOut stx NextIndex txa lsr a tay dey ; now y has true row,col spec pla ; A has item type clc ; clc if found rts noneleft sec rts END ********************************************************************** * * MoveDk : Move Daleks one step towards player * ********************************************************************** MoveDk START USING GLOBALDATA USING WINDOWDATA jsr InitSearch bcc movlop rts movlop jsr searchnext ;go find a dalek bcc gotit ;it's in Y if found jmp redraw gotit cmp #1 ; only move daleks beq doit cmp #128 ; if >=128 it's something which was blt movlop ; moved prev. in this round tya ; so reset it asl a tax lda table,x ; first, get rid of 128 flag value sec sbc #128 sta table,x bne mck inc table,x ; if nothing was here, it's 1 now bra movlop mck cmp #1 ; if 1 left, we gotta move it bne movlop ; if not, something else - leave alone inc table,x ; set so we leave a 1 in here though doit phy ; orig @ 1,s tya and #$01E0 ; get row only pos. pha ; now, orig @ 3,s , row @ 1,s tya and #$001F pha ; orig @ 5,S , Row @ 3,S , Col @ 1,S ldy #3 ; now use y as "move forward" flag lda ppos ;here's the player and #$01E0 cmp 3,s beq docol ;don't change row bge addrow lda 3,s ;subtract from row sec sbc #$0020 sta 3,s dey bra docol addrow lda 3,s ;add to row clc adc #$0020 sta 3,s iny iny ; always see it again if row inc docol lda ppos and #$001f cmp 1,s beq donadj ;don't change column bge addcol lda 1,s dec a ;subtract from column sta 1,s dey bra donadj addcol lda 1,s inc a ;add to column sta 1,s iny donadj pla ;get new column ora 1,s ;'OR' in the row sta 1,s ; now, new in 1,S , old in 3,S pla ;NEW asl a tax ;index entry for new item lda table,x ;bump its value cmp #64 ;if player, he's been done first beq playman cmp #128 beq addxtra ;if 128, sec. one, add an extra bge playman ;if over 128, just inc cpy #4 ;we moving a dalek forward? blt playman ; no, go just set to 1 clc adc #128 ; 128 for move fwd. sta table,x bra adjs1 addxtra inc table,x bra playman ckmore cmp #64 ; 64 & up we hit player! bge playman cmp #33 ; don't get above 32 bge adjs1 playman inc table,x adjs1 pla ;OLD asl a tax lda table,x ;dec its value beq adjs2 ;not below zero though dec table,x adjs2 jmp movlop ;back for more END ********************************************************************** * * MovePL(x,y) : Move player one step : reg. x = neg {left} * 0 {no change} * pos {right} * * reg. y = neg {up} * 0 {no change} * pos {down} * ********************************************************************** MovePL START USING GLOBALDATA USING WINDOWDATA phx ; save awhile lda ppos ;get old position asl a tax lda table,x ; not here no more sec sbc #64 sta table,x plx ;get x back cpy #0 ; y coord. of move beq doneY ; zero easy bpl movedown ; go move down moveup lda ppos ; find player and #$01E0 ; row only beq doneY ; can't go below zero lda ppos sec sbc #$0020 ; up a row sta ppos ; save it bra doneY movedown lda ppos ; find player and #$01e0 ; row only cmp #$01e0 ; can't go past last beq doneY lda ppos clc adc #$0020 sta ppos DoneY cpx #0 ; x coord. of move beq done ; zero easy bpl movergt ; go move right moveleft lda ppos ; find player and #$001F ; col only beq done ; can't go below zero dec ppos ; leftward bra done movergt lda ppos and #$001F cmp #$001F ; can't go past last beq done inc ppos ; rightward done lda ppos ;get new position asl a tax lda table,x clc adc #64 sta table,x ; now we are here rts END ********************************************************************** * * DoClick : See if mouse down where we should move player * ********************************************************************** DoClick START USING GLOBALDATA PUSHLONG DwinPtr ; set port 'cause of wmgr bug _SetPort lda allowclick ;we allowing clicks? bne StrtDoC rts strtDoC PUSHLONG #EventWhere ;localize the points location _GlobalToLocal lda EventWhere ;get row ldx #0 ; find in tenstable the row docloop inx inx cmp tenstable,x bge docloop txa lsr a dec a pha ; row in 1,s lda EventWhere+2 ldx #0 ; find in tenstable the col doclop2 inx inx cmp tenstable,x bge doclop2 txa lsr a dec a ; a now contains the col pha ; row in 3,s col in 1,s ldx #0 ; x=0 same col? (maybe) lda ppos ; get player pos. and #$001f ; heres the column cmp 1,s ; we near it? beq chkrow ; same col - go check row bge low1 ; lower col, is it by 1 though inc a ; higher col, is it by 1 cmp 1,s bne notnear ; nope, so we're not near player ldx #1 ; x=1 means move right bra chkrow low1 dec a ; is it lower col by 1? cmp 1,s bne notnear ; nope, so we're not near player ldx #$ffff ; x=-1 means move left chkrow ldy #0 ; y=0 same row lda ppos ; get player pos. lsr a lsr a lsr a lsr a lsr a ; heres the row cmp 3,s ; we near it? beq doMov ; same row, so can do move bge low2 ; lower row, is it by 1 though inc a ; higher row, is it by 1 cmp 3,s bne notnear ; nope, so we're not near player ldy #1 ; y=1 means move down bra DoMov low2 dec a ; is it lower row by 1? cmp 3,s bne notnear ; nope, so we're not near player ldy #$ffff ; y=-1 means move up DoMov jsr MovePl ; do the move of the player jsr MoveDk ; ...and move the daleks (and show 'em) notnear pla ; get rid of stack excess pla rts END **************************************************************************** * * teleport * **************************************************************************** teleport START using GLOBALDATA lda #3 jsr UnHilite PUSHLONG DwinPtr ; set port 'cause of wmgr bug _SetPort lda #0 jsr gotoP ;do a "MOVE TO" ppos lda ppos ;old position asl a tax stz table,x PUSHWORD #0 _RANDOM pla and #$01FF ; nine bits only sta ppos ; new position lda #1 jsr gotoP ; do a "LINE TO" ppos lda ppos asl a tax lda table,x ;if <>0 we teleported onto something beq oktel lda #65 ;if we did - die! bra strtel oktel lda #64 ; else, o.k. to put player here strtel sta table,x jmp MoveDk ******* * * GotoP(a) a=0 _MOVETO where player is * a=1 _LINETO where player is * ******* GotoP tay ;save arg lda ppos ;get position and #$1f ;get col asl a tax lda tenstable,x pha ;arg for moveto or lineto lda ppos and #$01e0 lsr a lsr a lsr a lsr a tax lda tenstable,x pha cpy #0 ;get orig arg. bne gotoL ;on zero, go handle lineto _MoveTo rts gotoL lda #8 ;make a fat pen pha pha _SetPenSize lda #3 ;make the line blue pha _SetSolidPenPat _LineTo ;(parms still on stack) lda #0 ;be nice, set things back pha _SetSolidPenPat lda #1 pha pha _SetPenSize ldx #$1ffff ;let 'em see it awhile dxlp dex bne dxlp rts END **************************************************************************** * * Redraw : redraw the current screen * **************************************************************************** redraw START using GLOBALDATA using WINDOWDATA PUSHLONG DwinPtr _SetPort PUSHLONG #DWinArea ; redraw stuff _EraseRect lda #0 jmp display END **************************************************************************** * * Sonic Screwdriver * **************************************************************************** SonicS START using GLOBALDATA lda #3 jsr UnHilite PUSHWORD #midSonics ; disable sonic _DisableItem PUSHLONG DwinPtr _SetPort PUSHLONG #SonicRect lda ppos and #$001f asl a tax lda tenstable,x sec sbc #10 pha ;LEFT lda ppos and #$01e0 lsr a lsr a lsr a lsr a tax lda tenstable,x sec sbc #10 pha ;TOP lda 3,s clc adc #30 pha ;RIGHT lda 3,s clc adc #30 pha ;BOTTOM _setrect lda #15 ;count 16 rects. lp pha ;save count pha ;count=arg to setsolidpen pat also _SetSolidPenPat PUSHLONG #sonicRect _PaintOval ldx #$0fff dexlop dex bne dexlop PUSHLONG #SonicRect ;now, shrink it lda #1 pha pha _InsetRect pla ;get back counter dec a bne lp ; repeat until 0 lda ppos ; current player pos. row jsr Three ; wipe out the immed. three lda ppos and #$01e0 ; check other rows beq doUp ; 0 row - so just go check higher ones lda ppos sec ; go to row below sbc #$0020 jsr Three ; wipe out three in lower row lda ppos and #$01e0 cmp #$01e0 ; in last row? beq done ; if so, wee're done DoUp lda ppos clc adc #$0020 ; do higher row jsr Three ; wipe out three in higher row done lda ppos ; put the player back in first asl a ; (we wiped him out too, remember?) tax lda #64 sta table,x jmp MoveDk ;go do next step ************ * * Three: local routine to wipe out three things together * ************ Three tay ; save off arg asl a ;compute table offset tax lda table,x ; besure its a dalek cmp #1 bne skpM stz table,x ;thats the one in the middle gone skpM tya ;reget arg and #$001f ;column only beq DoHi ;zero col - go try higher tya ;get arg again dec a ;back a col. asl a ;get true table index tax lda table,x cmp #1 bne skpL stz table,x ;thats the one on the left gone skpL tya ;now for the upper col. and #$001f cmp #$001f beq fini ; last col - then done DoHi tya ;reget col inc a ; one higher asl a tax lda table,x cmp #1 bne fini stz table,x ;thats the one on the right gone fini rts END absaddr on GEN off SYMBOL off KEEP daleks mcopy daleks.macros Daleks START bra DoIt ;---------------------------------------------------- ; ; Global equates used throughout the program. ; True gequ $8000 False gequ $0000 ScreenMode gequ $00 ; 320 MaxX gequ 320 midAbout gequ 256 ;menu ID for About Daleks... midQuit gequ 257 ;menu ID for Quit  !"#$%:; midBegin gequ 258 ;menu ID for Begin New Game midTeleport gequ 259 ;menu ID for TelePort midSonics gequ 260 ;menu ID for Sonic ScrewDriver midLastStand gequ 261 ;menu ID for Last Stand midScore gequ 262 ;menu ID for Score END DoIt start using GlobalData ;---------------------------------------------------- ; ; Set the data bank to code bank so I can use absolute ; addressing. ; phk plb jsr InitStuff bcs SkipIt ;---------------------------------------------------- ; ; Initialize system flags. ; stz QuitFlag ;---------------------------------------------------- ; ; Take events until user quits. ; jsr PlayWithIt ;-------------------------------------------------- ; ; All is done, let's shut down. ; SkipIt _GrafOff _DeskShutDown _DialogShutdown _LEShutDown _CtlShutdown _MenuShutDown _WindShutDown _EMShutDown _QDShutDown _MTShutdown PushLong ZPHandle _DisposeHandle PushWord MyID _MMShutdown _TLShutdown _Quit QuitParams ; Do a ProDOS Quit call brk $F0 END **************************************************************** * * GlobalDATA * **************************************************************** GlobalData DATA VolNotFound equ $45 MomentString dc i1'EndStr-MomentString-1' dc c'One moment please...' EndStr anop ZPHandle ds 4 QuitParams dc i4'0' dc i4'0' MyID ds 2 ToolTable dc i'8' dc i'4,$0100' ; quickdraw dc i'5,$0100' ; desk manager dc i'6,$0100' ; event manager dc i'14,$0000' ; window manager from disk! dc i'15,$0100' ; menu manager from Disk! dc i'16,$0100' ; control manager from disk! dc i'20,$0100' ; Line Edit dc i'21,$0100' ; dialog manager tenstable dc i'0,10,20,30,40,50,60,70,80,90' dc i'100,110,120,130,140,150,160,170,180,190' dc i'200,210,220,230,240,250,260,270,280,290' dc i'300,310,320' FontHDL dc i4'FontPtr' FontPTR dc i4'DALEKS10' *WARNING: The above Handle isn't quite Kosher, you should use the * memory manager to get a handle and move the font to it. * eventually, this would cause the program to blow up, but * for a sample program, we'll "leave it as an exercize for * the student" - EIB. (what a cop-out!) EventRecord anop EventWhat ds 2 EventMessage ds 4 EventWhen ds 4 EventWhere ds 4 EventModifiers ds 2 TaskDATA ds 4 TaskMask dc i4'$1FFF' DwinPtr ds 4 ;DALEKS's Window Pointer SwinPtr ds 4 ;SCORE Window Pointer DialogPtr ds 4 * * VARS: * NDaleks ds 2 ;current no. of daleks disptyp ds 2 ;used locally in display NextIndex ds 2 ;index to next daleks pos. ItemTyp ds 2 ;what type item being inspected ppos ds 2 ;position of player Dcnt ds 2 ;daleks counter in display hpos ds 2 ;horiz. pos. of player on screen vpos ds 2 ;vert. pos. of player on screen acoffset ds 2 ;holds offset to arrow chars aioffset ds 2 ;holds offset to arrow indexes NumDs ds 2 ;number of daleks found at end round NumDr ds 2 ;number of daleks at begin round QuitFlag ds 2 ;set at game end fontholder ds 4 ;holds current font while daleks used allowclick ds 2 ;1=allow clicks, 0=disallow (end game) score ds 2 ;players score LastStand ds 2 ;last stand signal sonicRect ds 8 ;rect used to form sonic blast * * main playing table * table ds 32*16*2 ;play field table END list off copy daleks.font ;font DALEKS10 list off **************************************************************** * * HexOut * * Little routine to print integer as hex on text screen. * Integer is passed in a-reg. * **************************************************************** HexOut START PushLong #0 pha _HexIt pla sta codes pla sta codes+2 PushLong #Codes _DrawCString rts Codes ds 4 dc i1'0' END **************************************************************** * * WaitForKey * * Calls ReadKey to pause until keypress. * **************************************************************** WaitForKey START PushWord #0 PushWord #1 ; echo _ReadChar pla rts END **************************************************************** * * InitStuff * * Gets space in bank zero for use as zero page by tools and * then initializes QuickDraw, EventManager, WindowManager * MenuManger. * * After the tools are inited, the menu is created and * displayed. * * QuickDraw and the event manager are initialized before * the tools are loaded so that * * 1) a message may be displayed indicating the machine * is not dead. * 2) a dialog can be displayed if the boot volume is off * line and the tools must be loaded. * **************************************************************** InitStuff START using GlobalData using MenuData ;----------------------------------------------- ; ; Now we initialize all the tools we are going ; use. ; _TLStartup ; Tool locator ;------------------------------------------------- ; ; Initialize the memory manager. There should be ; no error here. ; PushWord #0 _MMStartup ErrorDeath 'Could not init Mem Mgr.' pla sta MyID ;------------------------------------------------- ; ; Initialize misc tools. ; _MTStartup ErrorDeath 'Could not init Misc Tools.' ;------------------------------------------------------ ; ; Now, get some memory for the zero page we need for ; other tools. ; PushLong #0 ; space for handle PushLong #$700 ; five pages PushWord MyID PushWord #$C001 ; locked, fixed, fixed bank PushLong #0 _NewHandle ErrorDeath 'Could not get zero page.' pla sta 0 sta ZPHandle pla sta 2 sta ZPHandle+2 lda [0] sta 4 ;--------------------------------------------------- ; ; Start up quickdraw ; PushWord 4 ; zp to use PushWord #ScreenMode PushWord #160 ; max size of scan line PushWord MyID ; my id for memory _QDStartup ErrorDeath 'Could not start QuickDraw.' ;--------------------------------------------------- ; ; Start up the event manager. ; lda 4 ; zp to use = qd zp +$300 clc adc #$300 pha PushWord #20 ; queue size PushWord #0 ; x clamp low PushWord #MaxX ; x clamp high PushWord #0 ; y clamp low PushWord #200 ; y clamp high PushWord MyID ; id for mem _EMStartup ErrorDeath 'Could not start Event Manager.' _ShowCursor PushWord #30 PushWord #30 _MoveTo PushWord #0 _SetBackColor PushWord #$F _SetForeColor PushLong #MomentString _DrawString ;------------------------------------------------------- ; ; Load the tools i need ; LoadAgain PushLong #ToolTable _LoadTools bcc ToolsLoaded cmp #VolNotFound bne Die jsr MountBootDisk cmp #1 beq LoadAgain rts Die sec ErrorDeath 'Could not load tools.' ToolsLoaded PushWord MyID _WindStartup ErrorDeath 'Could not start the window manager.' PushLong #0 ; do entire desktop _Refresh PushWord MyID lda 4 ; zp to use = qd zp +$400 clc adc #$400 pha _MenuStartup ErrorDeath 'Could not start Menu Manager.' ; add the control and dialog manager - 11/20 - kaar PushWord MyID lda 4 clc adc #$500 pha _CtlStartup ErrorDeath 'Could not start Control Manager.' PushWord MyID lda 4 clc adc #$600 pha _LEStartup ErrorDeath 'Could not start Line Edit.' PushWord MyID _DialogStartup ErrorDeath 'Could not start Dialog Manager.' PushLong #0 ; space for return PushLong #MenuL3 _NewMenu ! pointer to menu bar already on stack PushWord #0 _InsertMenu PushLong #0 ; space for return PushLong #MenuL2 _NewMenu PushWord #0 _InsertMenu PushLong #0 ; space for return PushLong #MenuL1 _NewMenu PushWord #0 _InsertMenu PushWord #1 ; append das to menu 1 _FixAppleMenu PushWord #0 _FixMenuBar pla ; discard menu bar height _DrawMenuBar jsr SetUpWindows _ShowCursor stz NDaleks stz AllowClick stz LastStand ;------------------------------------------------- ; ; Init the desk manager ; _DeskStartup ErrorDeath 'Could not init Desk Manager.' rts END **************************************************************** * * PlayWithIt * * This contains the main event loop. * **************************************************************** PlayWithIt START using GlobalData Again anop lda QuitFlag bne AllDone PushWord #0 ; keep the game random _Random pla PushWord #0 PushWord #$FFFF PushLong #EventRecord _TaskMaster pla beq Again jsr HandleTask bra Again AllDone rts END **************************************************************** * * HandleTask * * This is the task handler. The task to handle comes in in * the a-reg. * **************************************************************** HandleTask START asl a tax jmp (TaskTable,x) TaskTable anop ;---------------------------------------------------- ; ; Event manager events ; dc i'ignore' ; 0 null dc i'ignore' ; 1 mouse down dc i'ignore' ; 2 mouse up dc i'ignore' ; 3 key down dc i'ignore' ; 4 undefined dc i'ignore' ; 5 auto-key down dc i'DoUpdate' ; 6 update event dc i'ignore' ; 7 undefined dc i'DoActivate' ; 8 activate dc i'ignore' ; 9 switch dc i'ignore' ; 10 desk acc dc i'ignore' ; 11 device driver dc i'ignore' ; 12 ap dc i'ignore' ; 13 ap dc i'ignore' ; 14 ap dc i'ignore' ; 15 ap dc i'Ignore' ; 0 in desk ;---------------------------------------------------- ; ; Task master events dc i'DoMenu' ; 1 dc i'ignore' ; 2 in system window dc i'Doclick' ; 3 in content of window dc i'ignore' ; 4 in drag dc i'ignore' ; 5 in grow dc i'DoGoAway' ; 6 in goaway dc i'ignore' ; 7 in zoom dc i'ignore' ; 8 in info bar dc i'ignore' ; 9 in ver scroll dc i'ignore' ; 10 in hor scroll dc i'ignore' ; 11 in frame dc i'ignore' ; in drop END **************************************************************** * * WaitForButton * * Returns here after the button is pressed. * **************************************************************** WaitForButton START using GlobalData Again anop PushWord #0 PushWord #$FFFF PushLong #EventRecord _GetNextEvent pla beq Again lda EventWhat cmp #1 bne Again AllDone rts END **************************************************************** * * Ignore * * Does not do a whole lot. * **************************************************************** Ignore START rts END **************************************************************** * * DoMenu * * Called when task master tells me that a menu item has * been selected. * **************************************************************** DoMenu START using GlobalDATA lda TaskDATA AND #$00FF asl a tax jmp (MenuTable,x) MenuTable anop dc i'doAboutItem' dc i'doQuitItem' dc i'NewGame' dc i'teleport' dc i'SonicS' dc i'DoLastS' dc i'ShowScore' END **************************************************************** * * Menu Data * **************************************************************** MenuData DATA NormalColor dc i'$F0' SelectColor dc i'$0F' Return equ 13 MenuList anop MENUL1 dc c'>L@\XN1',i1'RETURN' dc c' LAbout Daleks...\N256',i1'RETURN' MENUL2 dc c'>L File \N2',i1'RETURN' dc c' LQuit\N257',i1'RETURN' MENUL3 dc c'>L Daleks \N3',i1'RETURN' dc c' LBegin New Game\N258V',i1'RETURN' dc c' LTeleport\DN259',i1'RETURN' dc c' LSonic ScrewDriver\N260DV',i1'RETURN' dc c' LLastStand\N261V',i1'RETURN' dc c' LScore\N262',i1'RETURN' dc c'.' ; end of menu END **************************************************************** * * Unhilite * * Turns off hiliting for menu passed in a-reg * **************************************************************** UnHilite START PushWord #0 ; turn off highlighting pha _HiliteMenu rts END **************************************************************** * * doQuitItem * * Sets quit flag and jumps to unhilite. * **************************************************************** doQuitItem START using GlobalDATA lda #$8000 sta QuitFlag lda #2 jmp UnHilite END **************************************************************** * * doAboutItem * * Brings up about box and waits until button press until * it puts it away. * **************************************************************** doAboutItem START using globalData using WindowData PushLong DialogPtr _SelectWindow PushLong DialogPtr _ShowWindow PushLong #0 ; save the port _GetPort PushLong DialogPtr _SetPort ;---------------------------------------------------- ; ; Draw something in it ; PushWord #80 PushWord #10 _MoveTo PushLong #Msg1a _DrawCString PushWord #100 PushWord #20 _MoveTo PushLong #Msg1b _DrawCString PushWord #60 PushWord #30 _MoveTo PushLong #Msg1c _DrawCString PushWord #10 PushWord #50 _MoveTo PushLong #Msg3a _DrawCString PushWord #10 PushWord #60 _MoveTo PushLong #Msg3b _DrawCString PushWord #10 PushWord #70 _MoveTo PushLong #Msg3c _DrawCString PushWord #50 PushWord #90 _MoveTo PushLong #Msg2 _DrawCString ;---------------------------------------------------- ; ; Wait til user pushes mouse button. ; jsr WaitForButton ;---------------------------------------------------- ; ; Hide the window and restore the port. ; PushLong DialogPtr _HideWindow _SetPort ; using pointer still on stack lda #1 jmp UnHilite Msg1a dc c'Daleks' dc i1'0' Msg1b dc c'by' dc i1'0' Msg1c dc c'Eagle I. Berns' dc i1'0' Msg3a dc c'Copyright Apple Computer, Inc.,',i1'0' Msg3b dc c'1986-87, All Rights Reserved',i1'0' Msg3c dc c'January 6, 1987 v1.0',i1'0' Msg2 dc c'Click to continue.' dc i1'0' END **************************************************************** * * ShowScore * * Brings up score box and waits until button press until * it puts it away. * **************************************************************** ShowScore START using globalData using WindowData PushLong SwinPtr _SelectWindow PushLong SwinPtr _ShowWindow PushLong #0 ; save the port _GetPort PushLong SwinPtr _SetPort ;---------------------------------------------------- ; ; Draw something in it ; PushWord #10 PushWord #10 _MoveTo PushLong #MsgScore _DrawCString PUSHWORD SCORE ;integer to convert PUSHLONG #scorstr ;ptr to output PUSHWORD #7 ;allow 7 chars PUSHWORD #0 ;unsigned _Int2Dec PUSHLONG #scorstr _DrawCString ;---------------------------------------------------- ; ; Wait til user pushes mouse button. ; jsr WaitForButton ;---------------------------------------------------- ; ; Hide the window and restore the port. ; PushLong SwinPtr _HideWindow _SetPort ; using pointer still on stack lda #3 jmp UnHilite MsgScore dc c'Score: ' dc i1'0' ScorStr dc c' ' ;must be 7 long (see above) dc i1'0' END **************************************************************** * * DoUpdate * * Handle update events. * **************************************************************** DoUpdate START using GlobalDATA using WindowDATA PushLong TaskData _BeginUpdate lda TaskData cmp DwinPtr bne Not1 lda TaskData+2 cmp DwinPtr+2 bne Not1 lda NDaleks bne redisp ; if they exist, draw 'em PUSHLONG DwinPtr ; else, just clear screen _SetPort PUSHLONG #DwinArea _EraseRect bra allDone redisp lda #0 ; display(0) redraws table jsr Display bra AllDone Not1 anop AllDone PushLong TaskData _EndUpdate rts END **************************************************************** * * DoActivate * **************************************************************** DoActivate START rts END **************************************************************** * * DoGoAway * **************************************************************** DoGoAway START using GlobalDATA PushLong TaskData _HideWindow rts END **************************************************************** * * NewGame * * start a new game * **************************************************************** NewGame START using GlobalDATA PushLong DwinPtr _SelectWindow PushLong DwinPtr _ShowWindow lda #3 jsr unHilite PUSHWORD #midTeleport ;enable teleport _ENABLEITEM PUSHWORD #midSonicS ;enable Sonic ScrewDriver _ENABLEITEM stz score ;init the score stz lastStand ;init not lastStand Lda #5 Sta NDaleks Sta NumDr ; number of daleks at start round sta allowclick ; <>0 means clicks allowed jsr Display rts END **************************************************************** * * SetUpWindows * * Opens each of the windows used by the program. * **************************************************************** SetupWindows START using GlobalData using WindowDATA PushLong #0 ; space for result PushLong #DlogPARM _NewWindow pla sta DialogPtr pla sta DialogPtr+2 PushLong #0 ; space for result PushLong #DwinPARM _NewWindow pla sta DwinPtr pla sta DwinPtr+2 PushLong #0 ; space for result PushLong #SwinPARM _NewWindow pla sta SwinPtr pla sta SwinPtr+2 rts END WindowDATA DATA DwinArea dc i'0,0,160,320' DwinTitle str ' Daleks ' SwinPARM anop dc i'SwinEnd-SwinPARM' dc i'%0000000000000000' ;Window Frame Type dc i4'0' ;Title dc i4'0' ;refcon dc i'0,0,0,0' ;zoomed size dc i4'0' ;color table dc i'0,0' ;Vert,Horiz Origin Offset dc i'0,0' ;ht,wid data area dc i'0,0' ;ht,wid max content for growing dc i'0,0' ;vert,horiz scroll amt. dc i'0,0' ;vert,horiz page amt dc i4'0' ;info bar refcon dc i'0' ;info bar height dc i4'0' ;Frame DefProc dc i4'0' ;info bar defproc dc i4'0' ;Content defProc SwinRect dc i'60,30,76,150' ;content rectangle dc i4'-1' ;window front-to-back position dc i4'0' ;storage SWinEnd anop DlogPARM anop dc i'DialogEnd-DlogPARM' dc i'%0000000000000000' ;Window Frame Type dc i4'0' ;Title dc i4'0' ;refcon dc i'0,0,0,0' ;zoomed size dc i4'0' ;color table dc i'0,0' ;Vert,Horiz Origin Offset dc i'0,0' ;ht,wid data area dc i'0,0' ;ht,wid max content for growing dc i'0,0' ;vert,horiz scroll amt. dc i'0,0' ;vert,horiz page amt dc i4'0' ;info bar refcon dc i'0' ;info bar height dc i4'0' ;Frame DefProc dc i4'0' ;info bar defproc dc i4'0' ;Content defProc DialogRect dc i'60,30,160,260' ;content rectangle dc i4'-1' ;window front-to-back position dc i4'0' ;storage DialogEnd anop DwinPARM anop dc i'DWinEnd-DWinParm' dc i'%1100000010100000' ;Window Frame Type dc i4'DwinTitle' ;Title dc i4'0' ;refcon dc i'0,0,0,0' ;zoomed size dc i4'0' ;color table dc i'0,0' ;Vert,Horiz Origin Offset dc i'0,0' ;ht,wid data area dc i'0,0' ;ht,wid max content for growing dc i'0,0' ;vert,horiz scroll amt. dc i'0,0' ;vert,horiz page amt dc i4'0' ;info bar refcon dc i'0' ;info bar height dc i4'0' ;Frame DefProc dc i4'0' ;info bar defproc dc i4'0' ;Content defProc DwinRect dc i'30,0,190,320' ;Content Rectangle dc i4'-1' ;window front-to-back position dc i4'0' ;storage DWinEnd anop END **************************************************************** * * Deref * * Derefs and locks the handle passed in a,x. Result passed back * in a,x. Trashes 0 on zp. * **************************************************************** Deref START sta 0 stx 2 ldy #4 lda [0],y ora #$8000 sta [0],y de x65816 ************************************************************************ * * Slide mover program * * This is used with the slide show program to move slides into * into the super hires buffer * * Entry points: * INIT - Sets up ssuper hires and turns off shadowing * SAVEPIC - Saves $2000 - $5FFF from bank 1 into bank2 * MOVEPIC - Moves $2000 - $5FFF from bank 1 to $6000 - $9FFF in bank $E1 * and $2000 - $5FFF from bank 2 to $2000 - $5FFF in $E2 * *******************************************************************************. Y B d64096: $6000Y iSH1: super hirese nD$(4)| sKB124096: $C000 uTT10 xNM$(100),LA$(100),TYP$(100),LN%(100) {D$"prefix":OP$: Save the old prefix |D$"prefix,D2": set prefix to drive 2 }D$"prefix":PFX$# @ 1045: Get a catalog Q (27);(17)[ 9000 SHĺD$"BLOAD ";OP$;"MOVEPIC.0,A$300": If OK to show SuperHires, load the ml service routines SCRIPT500: If there's a script, read it and follow( 2000: Display every slide this directoryF 49193,1: super res offq ,:: Everything exits through here... D$;"bye"  3000: Show by script X300   Get a ProDOS catalog of this area PFX$""  First make little ML program to get current prefixn 768,32:769,0:770,191:771,199:772,7:773,3:774,96:775,1:776,10:777,3 768:L(778) 49234,0: set all graphics K779778L:PFX$PFX$((K)):   Yes, I changed the entry point...D$;"OPEN ";PFX$;",T15"$$D$;"READ ";PFX$4)S$:S$:S$E.K1100:S$U3S$""11008NM$(K)(S$,2,15):TYP$(K)(S$,18,3):LN%(K)((S$,22,7)):LA$(K)(S$,76,4)B(NM$(K),6)"SCRIPT"TYP$(K)"TXT"SCRIPTKGLD$;"CLOSE"VNFK1: # of files this directory`  C Display a single hires slides First load into other screen then displayPT0: Not hires LA8192: $2000CYCLA16384: $4000D$;"BLOAD ";NM$(K);",A";LA(KB)1601250S$ (KB)1281246DPT2ı: If SuperHires don't fiddle with the switcheso49232,0:49239,0: Set HIRES graphics49236,0: Anticipate primary pageCYCĹ49237,0CYCCYC49164,0:49247,0: Anticipate regular hiresPT1Ĺ49246,0:49165,0:DHIRES and 80col on$ I Display a double hires screenjPT1:A double hires picture(LA8192: $20002T$",T$08"<D$"BLOAD ";NM$(K);",A";LA;",L$2000";T$FD$;"BSAVE /RAM/PIC1,A";LA;",L$2000"PD$;"BLOAD ";NM$(K);",A";LA;",B$2000,L$2000";T$BZCYC0:1242: only in page 1, for now.Iw jx Display a SuperHires slidePT2: A quadruple hires ("SuperHires") picture768: Do the init for this picture type...D$;"BLOAD ";NM$(K);",A$2000,L$4000"771: Move away the first halfKD$;"BLOAD ";NM$(K);",A$2000,B$4000,L$4000"n774: Assemble the picture...CYC0:1242: just one page in this case  Display everything that looks like its a slideCYC0: Start out on the right foot K1NF9100.DB0:LN%(K)27DB1TYP$(K)"BIN"LN%(K)17(LA$(K)"2000"LA$(K)"4000")İ1200: Display another one(TYP$(K)"BIN"TYP$(K)"$08")LN%(K)33İ1300: Display a double hires oneSHTYPE$(K)"BIN"LN%(K)65İ1400: do a super hires one)(KB)15520403S$:=9200I:2010P3 i Do a scripted show D$;"OPEN ";NM$(SCRIPT) D$;"READ ";NM$(SCRIPT) K1100 NM$(K) NM$(K)""(NM$(K),1)";"3040 NM$(K)"end script"3070  NFK1 D$;"CLOSE"' CYC03 K1NF (NM$(K),1)"*"NM$(K)(NM$(K),(NM$(K))1):1300:NM$(K)"*"NM$(K):3085 1200 (KB)1553095 S$: :3080(# poke in time routine-#BASE7681602#I028:BYTE:BASEI,BYTE: <### get starting time7#BASE:TS(766)=#[# wait till NS has passedo#BASE:TE(766)$TETSTETE60$TDTETS$TS,TE,TD$TDTTī9210"$%24,251,194,48,72,72,72,72,72,162,3,13,34,0,0,225,104,141,254,2,104,104,&/0****************************** skp 3 * * Equates * grmode equ $C029 shadow equ $C035 cya equ $C036 org $300 jmp init jmp savepic jmp movepic skp 3 *********************************************************************** * * INIT - Sets up the graphics mode * ********************************************************************** init equ * memory8 index8 lda #$80 ;Fast mode tsb cya lda #$18 ;Inhibit shadowing tsb shadow lda #$C0 ;Super hires and linear map tsb grmode rts skp 3 * * SAVEPIC - Saves away the first half of the picture * savepic equ * index16 memory16 clc xce ;Native mode rep #$30 ldx #$2000 ldy #$2000 lda #$3FFF mvn $000000,$010000 phk plb sec xce rts skp 3 * * Movepic * movepic equ * index16 memory16 clc xce ;Native mode rep #$30 ldx #$5FFF ldy #$9FFF lda #$3FFF mvp $000000,$E10000 ldx #$5FFF ldy #$5FFF lda #$3FFF mvp $010000,$E10000 phk plb sec xce rts 104,104,226,48,56,251,96d**************************************************************** * * WarningDialog * **************************************************************** WarningDialog START using GlobalData pha pushlong #alerttemp pushlong #$0000 _CautionAlert pla ; get the item hit rts alerttemp dc i'99,170,175,470' ; bounds rect dc i'2374' ; id d2456789BCDQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~c h'81' dc h'81' dc h'81' dc h'81' dc i4'item1' dc i4'item2' dc i4'0000' item1 dc i2'1345' ; id dc i2'50,225,00,00' ; bounds rect for button dc i2'ButtonItem' ; type dc i4'But1' ; item descreptor dc i2'00' ; item value dc i2'0' ; item flag dc i4'0' ; item color item2 dc i2'1348' ; id dc i2'30,10,40,280' ; bounds rect for button dc i2'StatText' ; type dc i4'Msg' ; item descreptor dc i2'00' ; item value dc i2'0' ; item flag dc i4'0' ; item color But1 str 'OK' Msg str 'The printing manager is not available.' end **************************************************************** * * doAboutItem * * Brings up about box and waits until button press until * it puts it away. Shows how to build a dialog window by hand. * **************************************************************** doAboutItem START using globalData PushLong #0 ; get space for Icon PushLong #34*16+8 ; #lines * bytes/line + rect PushWord MyId PushWord #0 ; don't care where it goes PushLong #0 _NewHandle pla plx bcc ok lda #$81 ; out of memory jmp FatalError ok anop sta AppleIconH stx AppleIconH+2 jsr deref sta 0 stx 2 ldy #0 ;move Icon to new space lda ThisMode ;which mode for icon width and #$0080 bne Copy640 Copy320 lda AppleIcon320,y sta [0],y iny iny cpy #34*16+8 bne Copy320 bra FixDBox Copy640 lda AppleIcon640,y sta [0],y iny iny cpy #34*16+8 bne Copy640 FixDBox anop lda ThisMode ; determine location and width for and #$0080 ; dialog box bne Use640Rect ldx #30 lda #320-30 bra JoinRect Use640Rect ldx #160+30 lda #640-160-30 JoinRect anop stx DRect+2 sta DRect+6 PushLong #0 ; output PushLong #DRect PushWord #True ; visible PushLong #0 ; refcon _NewModalDialog pla SIMPuHUSTON!C '  '(SIMP.SRC<<C  :SIMP.ROOTC D:SIMP.A C D:+SIMP.MACROSC  :$SIMPC " :**************************************************************** * * simp: very simple sound * * An example for using the note synthesizer. * **************************************************************** * keep simp 65816 on absaddr on mcopy simp.macros longi on longa on simp START jmp begin end *************************************************************** begin START phk ; (a trick;=>?@A for short addressing) plb jsr SoundStartup jsr LoadSound jsr NoteStartup cli ; this seems to be necessary Println ' hit keys to play notes; esc to quit ' Println ' key codes become semitones. try shift...' loop PushWord #0 PushWord #0 ; no echo _ReadChar ; take any key pla and #$7F cmp #$1B ; escape? beq exit jsr PlaySound ; pass ascii to note synth bra loop exit jsr shutdown _Quit QuitParams QuitParams anop dc i4'0' dc i2'0' END **************************************************************** * * wake up tools I need * **************************************************************** SoundStartup START _TLStartup pushword #0 _MMStartup ErrorDeath ' Memory Manager Mess up ' pla sta MyID _MTStartup ErrorDeath ' Misc Tools touchy ' Println ' loading note synth tool ' pushlong #Tooltable _LoadTools ErrorDeath ' error loading note tools ' * Now startup the sound tools. Get a page of bank 0. pushlong #0 ; room for handle pushlong #$100 ; one page pushword MyID pushword #$C001 ; type: locked, fixed pushlong #0 _NewHandle ErrorDeath ' no memory ! ' pla sta 0 ; aren't we cheeky pla ; using zero page sta 2 lda [0] ; get low word of ptr pha ; and pass it to _SoundStartup ; Sound tool startup ErrorDeath ' bad sound tool startup ' rts MyID ds 2 ToolTable dc i'1,25,0' ; one tool: #25, version 0 end **************************************************************** * * Load Sound * **************************************************************** * LoadSound START * first you need a waveform. This bit creates a one page triangle wave. * Remember that the samples have the hi bit flipped compared to two's * complement numbers. (zero level is $80). Also $00 halts the oscillator! ldx #0 lda #$40 SetMode8 ; 8 bit accumu sta MDialogPtr pla sta MDialogPtr+2 PushLong MDialogPtr PushWord #1 PushLong #ButtonRect PushWord #ButtonItem PushLong #ButtonText PushWord #0 PushWord #0 PushLong #0 _NewDItem PushLong MDialogPtr PushWord #2 PushLong #AppleIconRect PushWord #IconItem+ItemDisable PushLong AppleIconH PushWord #0 PushWord #0 PushLong #0 _NewDItem PushLong MDialogPtr PushWord #4 PushLong #Text1Rect PushWord #StatText+ItemDisable PushLong #Text1 PushWord #0 PushWord #0 PushLong #0 _NewDItem PushLong MDialogPtr PushWord #5 PushLong #Text2Rect PushWord #StatText+ItemDisable PushLong #Text2 PushWord #0 PushWord #0 PushLong #0 _NewDItem PushLong MDialogPtr PushWord #6 PushLong #Text3Rect PushWord #StatText+ItemDisable PushLong #Text3 PushWord #0 PushWord #0 PushLong #0 _NewDItem DoModal PushWord #0 ; result ********************************************************************** * * * HodgePodge * * * * * * March 3, 1987 v2.1 * * * * (c) CopyrEGHIJKLMNOPight 1986, 1987 Apple Computer, Inc. * * * * All rights reserved. * * * * This program and its derivatives are licensed only for * * use on Apple computers. * * * * Works based on this program must contain and * * conspicuously display this notice. * * * * This software is provided for your evaluation and to * * assist you in developing software for the Apple IIGS * * computer. * * * * This is not a distribution license. Distribution of * * this and other Apple software requires a separate * * license. Contact the Software Licensing Department of * * Apple Computer, Inc. for details. * * * * DISCLAIMER OF WARRANTY * * * * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT * * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, * * WITH RESPECT TO ITS MERCHANTABILITY OR ITS FITNESS * * FOR ANY PARTICULAR PURPOSE. THE ENTIRE RISK AS TO * * THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH * * YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND * * NOT APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE) * * ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, * * REPAIR OR CORRECTION. * * * * Apple does not warrant that the functions * * contained in the Software will meet your requirements * * or that the operation of the Software will be * * uninterrupted or error free or that defects in the * * Software will be corrected. * * * * SOME STATES DO NOT ALLOW THE EXCLUSION * * OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY * * NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC * * LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS * * WHICH VARY FROM STATE TO STATE. * * * ********************************************************************** * * ********************************************************************** * * * by the Apple IIGS tools team * * * * Eagle I. Berns * * Art Cabral * * Cheryl Ewy * * Steven Glass * * Suki Lee * * Bennet Marks * * Dan Oliver * * Keith Rollin * * * * These source routines demonstrate various features of the * * APPLE IIGS tools. They can be copied in part or whole and used * * by anyone desiring to write applications for the machine. No * * guarantees are made as to their absolute correctness (i.e there * * may still be bugs) nor to their being the "best" way to perform * * the various tasks included. All efforts will be made however, * * to keep this program up-to-date and as bug-free as possible. * * * * Note. There are still a number of places where our code and * * comments are not as clean as we would like them to be. Please * * forgive any ambiguities or inaccuracies. We hope to improve * * upon this in the future. * * * * * * First Release 17 PushLong #0 ; no filterproc _ModalDialog pla ; chuck the item hit PushLong MDialogPtr _CloseDialog PushLong AppleIconH _DisposeHandle rts DRect dc i'20,30,192,320-30' AppleIconH ds 4 AppleIconRect dc i'135,20,0,0' AppleIcon640 anop dc i'0,0,34,64' dc h'00000000000000000000000000000000' DC h'0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0' DC h'0F0000000000000000000000000000F0' DC h'0F0FFFFFFFFFFFFFFFFFFFFFFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFFFFF88FFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFFF8888FFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFF88888FFFFFF0F0' DC h'0F0FFFFFFFFFFFFFF88888FFFFFFF0F0' DC h'0F0FFFFFFFFFFFFF888888FFFFFFF0F0' DC h'0F0FFFFFFFFFFFFF88888FFFFFFFF0F0' DC h'0F0FFFFFFFFFFFFF8888FFFFFFFFF0F0' DC h'0F0FFFFFF8888FFF88FF8888FFFFF0F0' DC h'0F0FFFF88888888FFF88888888FFF0F0' DC h'0F0FFF888888888888888888888FF0F0' DC h'0F0FFeeeeeeeeeeeeeeeeeeeeFFFF0F0' DC h'0F0FFeeeeeeeeeeeeeeeeeeeFFFFF0F0' DC h'0F0FFeeeeeeeeeeeeeeeeeeFFFFFF0F0' DC h'0F0FF666666666666666666FFFFFF0F0' DC h'0F0FF666666666666666666FFFFFF0F0' DC h'0F0FF666666666666666666FFFFFF0F0' DC h'0F0FF4444444444444444444FFFFF0F0' DC h'0F0FF44444444444444444444FFFF0F0' DC h'0F0FFF444444444444444444444FF0F0' DC h'0F0FFF555555555555555555555FF0F0' DC h'0F0FFF555555555555555555555FF0F0' DC h'0F0FFFF5555555555555555555FFF0F0' DC h'0F0FFFF1111111111111111111FFF0F0' DC h'0F0FFFFF11111111111111111FFFF0F0' DC h'0F0FFFFFF111111FFF111111FFFFF0F0' DC h'0F0FFFFFFF1111FFFFF1111FFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFFFFFFFFFFFFF0F0' DC h'0F0000000000000000000000000000F0' DC h'0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0' dc h'00000000000000000000000000000000' AppleIcon320 anop dc i'0,0,34,32' dc h'00000000000000000000000000000000' DC h'0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0' DC h'0F0000000000000000000000000000F0' DC h'0F0FFFFFFFFFFFFFFFFFFFFFFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFFFFFaaFFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFFFaaaaFFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFFaaaaaFFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFaaaaaFFFFFFF0F0' DC h'0F0FFFFFFFFFFFFFaaaaaaFFFFFFF0F0' DC h'0F0FFFFFFFFFFFFFaaaaaFFFFFFFF0F0' DC h'0F0FFFFFFFFFFFFFaaaaFFFFFFFFF0F0' DC h'0F0FFFFFFaaaaFFFaaFFaaaaFFFFF0F0' DC h'0F0FFFFaaaaaaaaFFFaaaaaaaaFFF0F0' DC h'0F0FFFaaaaaaaaaaaaaaaaaaaaaFF0F0' DC h'0F0FF99999999999999999999FFFF0F0' DC h'0F0FF9999999999999999999FFFFF0F0' DC h'0F0FF999999999999999999FFFFFF0F0' DC h'0F0FF666666666666666666FFFFFF0F0' DC h'0F0FF666666666666666666FFFFFF0F0' DC h'0F0FF666666666666666666FFFFFF0F0' DC h'0F0FF7777777777777777777FFFFF0F0' DC h'0F0FF77777777777777777777FFFF0F0' DC h'0F0FFF777777777777777777777FF0F0' DC h'0F0FFFcccccccccccccccccccccFF0F0' DC h'0F0FFFcccccccccccccccccccccFF0F0' DC h'0F0FFFFcccccccccccccccccccFFF0F0' DC h'0F0FFFF4444444444444444444FFF0F0' DC h'0F0FFFFF44444444444444444FFFF0F0' DC h'0F0FFFFFF444444FFF444444FFFFF0F0' DC h'0F0FFFFFFF4444FFFFF4444FFFFFF0F0' DC h'0F0FFFFFFFFFFFFFFFFFFFFFFFFFF0F0' DC h'0F0000000000000000000000000000F0' DC h'0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0' dc h'00000000000000000000000000000000' Text1Rect dc i2'4,14,50,279' text1 dc i1'es1-text1-1' dc c' HodgePodge',h'0D' dc h'0D' dc c' A potpourri of routines which',h'0D' dc c' demonstrate many features of',h'0D' dc c' the APPLE IIGS tools.',h'0D' es1 anop Text2Rect dc i2'53,14,99,279' text2 dc i1'es2-text2-1' dc c' by The Apple II Tools Group',h'0D' dc c' Eagle I. Berns, Art Cabral,',h'0D' dc c' Cheryl Ewy, Steven Glass,',h'0D' dc c' Suki Lee, Bennet Marks,',h'0D' dc c' Dan Oliver & Keith Rollin',h'0D' es2 anop Text3Rect dc i'102,14,130,279' text3 dc i1'es3-text3-1' dc c' Copyright Apple Computer, Inc.,',h'0D' dc c' 1986-87, All Rights Reserved',h'0D' dc c' March 3, 1987 v2.1',h'0D' es3 anop ButtonRect dc i'153,180,0,0' ButtonText str 'OK' MDialogPtr ds 4 END **************************************************************** * * ShowMsg / HideMSG * * Brings up a window and immidiately puts message in it * (without waiting for update event). * **************************************************************** ShowMsg START using globalData PushLong #0 ; save the current port _GetPort pla sta OrigPort pla sta OrigPort+2 PushLong #0 PushLong #DialogTemplate _GetNewModalDialog pla sta MsgWinPtr pla sta MsgWinPtr+2 PushLong MsgWinPtr ; begin the updating process _BeginUpdate PushLong MsgWinPtr _DrawDialog PushLong MsgWinPtr _EndUpdate rts HideMSG ENTRY PushLong MsgWinPtr ; hide the window _CloseDialog PushLong OrigPort ; restore the port _SetPort rts MsgWinPtr ds 4 DialogTemplate anop dc i'30,120,80,640-120' ; bounding box dc i'True' ; visible dc i4'0' ; refcon dc i4'item1' dc i4'0000' item1 anop dc i2'1348' ; id dc i2'20,10,40,280' ; bounds rect for button dc i2'StatText' ; type dc i4'Msg' ; item descreptor dc i2'00' ; item value dc i2'0' ; item flag dc i4'0' ; item color Msg str 'Please wait while we set things up.' END **************************************************************** * * MountBootDisk * * This is a routine that is called whenever the application * needs to get something off the boot volume and the * boot volume is not on line. * * This can occur when loading fonts, tools or drivers. * **************************************************************** MountBootDisk START _SetPrefix SetPrefixParams _GetPrefix GetPrefixParams PushWord #0 ; space for result PushWord #195 ; x pos PushWord #30 ; y pos PushLong #PromptStr ; prompt string PushLong #VolStr ; vol string PushLong #OKStr PushLong #CancelStr _TLMountVolume pla rts PromptStr str 'Please insert the disk' OKStr str 'OK' CancelStr str 'Shutdown' GetPrefixParams dc i'7' dc i4'VolStr' SetPrefixParams dc i'7' dc i4'BootStr' VolStr ds 16 BootStr str '*/' END **************************************************************** * * Fatal Err Dialog * **************************************************************** FatalError START using GlobalData pha ; save the error number _InitCursor pla short ; go into 8 bit A & X for this ldy #0 ; try to identify the error loop anop cmp ErrNums,y beq KnownErr ; we know it - say something smart iny bcs loop long ; back to 16 bit mode pha ; use a generic message PushLong #Msg+17 PushWord #2 _Int2Hex lda #Msg sta ErrMsgPtr lda #^Msg sta ErrMsgPtr+2 bra ShowDialog KnownErr anop long ; back to 16 bit mode tya asl a asl a tay lda ErrPtrs,y sta ErrMsgPtr lda ErrPtrs+2,y sta ErrMsgPtr+2 ShowDialog anop pha ; space for result pushlong #FatalTemp ; pointer to template pushlong #$0000 ; filter procedure _StopAlert pla ; get the item hit sec ; set the error flag rts FatalTemp dc i'40,30,115,330' ; bounds rect dc i'6666' ; id dc h'81' dc h'81' dc h'81' dc h'81' dc i4'OKButton' dc i4'Message' dc i4'0000' OKButton dc i2'1345' ; id dc i2'50,225,00,00' ; bounds rect for button dc i2'ButtonItem' ; type dc i4'OKName' ; item descreptor dc i2'00' ; item value dc i2'0' ; item flag dc i4'0' ; item color Message dc i2'1348' ; id dc i2'30,10,40,280' ; bounds rect for text dc i2'StatText' ; type ErrMsgPtr dc i4'Msg' ; item descreptor dc i2'00' ; item value dc i2'0' ; item flag dc i4'0' ; item color OKName str 'OK' ErrNums anop ; ProDOS erros dc i1'$27,$28,$2b,$2e,$40,$43,$44,$45,$46' dc i1'$47,$49,$4a,$4b,$4c,$4d,$4e,$50,$52' dc i1'$57' ; Internal errors dc i1'$80,$81' ; End of list flag dc i1'$ff' ErrPtrs anop dc i4'Err27,Err28,Err2b,Err2e,Err40,Err43,Err44,Err45,Err46' dc i4'Err47,Err49,Err4a,Err4b,Err4c,Err4d,Err4e,Err50,Err52' dc i4'Err57' dc i4'Err80,Err81' Msg str 'ProDOS: Error #$ ' Err27 str 'I/O Error' Err28 str 'No Device Connected' Err2b str 'Disk Write Protected' Err2e str 'Disk Switched before FLUSH' Err40 str 'Invalid Pathname syntax' Err43 str 'Invalid reference number' Err44 str 'Path not found' Err45 str 'Volume Directory not found' Err46 str 'File not found' Err47 str 'Duplicate File Name' Err49 str 'Volume Directory Full' Err4a str 'Incompatible File Format' Err4b str 'Unsupported storage type' Err4c str 'EOF has been encountered' Err4d str 'Postion out of range' Err4e str 'Access error. Cannot change file' Err50 str 'File is already open' Err52 str 'Not a ProDOS disk' Err57 str 'Duplicate Volume online' Err80 str 'Error unpacking file' Err81 str 'Out of Memory' end **************************************************************** * * SFPDHook - this routine will handle hits on the radio * buttons added to the SFPPutFile dialog. All other * hits are passed back to SF for it to handle. * * On entry, the stack looks like this: * * | previous contents | * |------------------------------| * | pointer to Dialog Port | long * |------------------------------| * | pointer to item hit word | long * |------------------------------| * | return address | 3 bytes * |------------------------------| * | | <- SP * **************************************************************** SFPDHook start using GlobalData OrigD equ 1 OrigB equ OrigD+2 RTLAdr equ OrigB+1 IHitPtr equ RTLAdr+3 DPortPtr equ IHitPtr+4 phd ; Save the direct page phb ; and DBR phk ; reset to my bank plb lda MyZP ; Put in our own direct page tcd lda DPortPtr,s ; get the Dialog Pointer sta DialogPtr lda DPortPtr+2,s sta DialogPtr+2 lda IHitPtr,s ; get the pointer to the item hit # sta 0 lda IHitPtr+2,s sta 2 lda [0] ; get the number of the item hit cmp #13 beq RadioButton cmp #14 bne NotRadioButton RadioButton anop cmp SaveType ; did the type change? beq NoChange ; no, don't change the screen sta SaveType PushWord #1 ; Turn button on PushLong DialogPtr PushWord SaveType _SetItemValue PushWord #0 ; Turn button off PushLong DialogPtr sec ; this gives use the item number of lda #13+14 ; the other button (add 2 id's together sbc SaveType ; and subtract one leaves you with pha ; other.) _SetItemValue NoChange anop lda #0 ; tell Standard File that we sta [0] ; handled the selection NotRadioButton anop plb ; restore DBR and DP pld lda 1,s ; Now move the return address back sta 9,s ; up the stack... lda 2,s sta 10,s tsc ; ...fix the stack pointer... clc adc #8 tcs rtl ; ...and return DialogPtr ds 4 end SFP640Temp start using Names dc i'0,0,135,320' ; dialog rect dc i'True' ; vis flag dc i4'0' ; refcon dc i4'SaveButton' dc i4'OpenButton' dc i4'CloseButton' dc i4'NextButton' dc i4'CancelButton' dc i4'ScrollBar' dc i4'PathName' dc i4'Files' dc i4'Prompt' dc i4'FileName' dc i4'FreeSpace' dc i4'CreateButton' dc i4'NormalButton' dc i4'PackedButton' dc i4'0' ; terminator SaveButton anop dc i'1' ; ID dc i'87,204,99,310' ; item rect dc i'ButtonItem' ; item type dc i4'SaveName' ; item descriptor dc i'0' ; value dc i'0' ; flag dc i4'0' ; color table OpenButton anop dc i'2' dc i'49,204,61,310' dc i'ButtonItem' dc i4'OpenName' dc i'0' dc i'0' dc i4'0' CloseButton anop dc i'3' dc i'64,204,76,310' dc i'ButtonItem' dc i4'CloseName' dc i'0' dc i'0' dc i4'0' NextButton anop dc i'4' dc i'15,204,27,310' dc i'ButtonItem' dc i4'NextName' dc i'0' dc i'0' dc i4'0' CancelButton anop dc i'5' dc i'104,204,116,310' dc i'ButtonItem' dc i4'CancelName' dc i'0' dc i'0' dc i4'0' ScrollBar anop dc i'6' dc i'26,169,88,194' dc i'ScrollBarItem' dc i4'0' dc i'0' dc i'3' ; has up and down arrows dc i4'0' PathName anop dc i'7' dc i'0,10,12,315' dc i'UserItem' dc i4'0' dc i'0' dc i'0' dc i4'0' Files anop dc i'8' dc i'26,10,88,170' dc i'UserItem' dc i4'0' dc i'0' dc i'0' dc i4'0' Prompt anop dc i'9' dc i'88,10,100,199' dc i'UserItem' dc i4'0' dc i'0' dc i'0' dc i4'0' FileName anop dc i'10' dc i'100,10,116,195' dc i'EditLine' dc i4'0' dc i'0' dc i'0' dc i4'0' FreeSpace anop dc i'11' dc i'12,10,22,199' dc i'StatText+ItemDisable' dc i4'KbFreeStr640' dc i'0' dc i'0' dc i4'0' CreateButton anop dc i'12' dc i'29,204,41,310' dc i'ButtonItem' dc i4'CreateName' dc i'0' dc i'0' dc i4'0' NormalButton anop dc i'13' dc i'121,10,0,0' dc i'RadioItem' dc i4'NormalName' dc i'1' ; this set as default dc i'0' dc i4'0' PackedButton anop dc i'14' dc i'121,155,0,0' dc i'RadioItem' dc i4'PackedName' dc i'0' dc i'0' dc i4'0' end SFP320Temp start using Names dc i'0,0,145,280' ; dialog rect dc i'True' ; vis flag dc i4'0' ; refcon dc i4'SaveButton' dc i4'OpenButton' dc i4'CloseButton' dc i4'NextButton' dc i4'CancelButton' dc i4'ScrollBar' dc i4'PathName' dc i4'Files' dc i4'Prompt' dc i4'FileName' dc i4'FreeSpace' dc i4'CreateButton' dc i4'NormalButton' dc i4'PackedButton' dc i4'0' ; terminator SaveButton anop dc i'1' ; ID dc i'93,175,105,265' ; item rect dc i'ButtonItem' ; item type dc i4'SaveName' ; item descriptor dc i'0' ; value dc i'0' ; flag dc i4'0' ; color table OpenButton anop dc i'2' dc i'54,175,66,265' dc i'ButtonItem' dc i4'OpenName' dc i'0' dc i'0' dc i4'0' CloseButton anop dc i'3' dc i'72,175,84,265' dc i'ButtonItem' dc i4'CloseName' dc i'0' dc i'0' dc i4'0' NextButton anop dc i'4' dc i'15,175,27,265' dc i'ButtonItem' dc i4'NextName' dc i'0' dc i'0' dc i4'0' CancelButton anop dc i'5' dc i'111,175,123,265' dc i'ButtonItem' dc i4'CancelName' dc i'0' dc i'0' dc i4'0' ScrollBar anop dc i'6' dc i'26,144,88,157' dc i'ScrollBarItem' dc i4'0' dc i'0' dc i'3' ; has up and down arrows dc i4'0' PathName anop dc i'7' dc i'0,10,12,266' dc i'UserItem' dc i4'0' dc i'0' dc i'0' dc i4'0' Files anop dc i'8' dc i'26,10,88,145' dc i'UserItem' dc i4'0' dc i'0' dc i'0' dc i4'0' Prompt anop dc i'9' dc i'88,10,100,170' dc i'UserItem' dc i4'0' dc i'0' dc i'0' dc i4'0' FileName anop dc i'10' dc i'100,10,118,158' dc i'EditLine' dc i4'0' dc i'0' dc i'0' dc i4'0' FreeSpace anop dc i'11' dc i'12,10,22,170' dc i'StatText+ItemDisable' dc i4'KbFreeStr320' dc i'0' dc i'0' dc i4'0' CreateButton anop dc i'12' dc i'33,175,45,265' dc i'ButtonItem' dc i4'CreateName' dc i'0' dc i'0' dc i4'0' NormalButton anop dc i'13' dc i'129,10,0,0' dc i'RadioItem' dc i4'NormalName' dc i'1' dc i'0' dc i4'0' PackedButton anop dc i'14' dc i'129,155,0,0' dc i'RadioItem' dc i4'PackedName' dc i'0' dc i'0' dc i4'0' end Names data SaveName str 'Save' OpenName str 'Open' CloseName str 'Close' NextName str 'Disk' CancelName str 'Cancel' CreateName str 'New Folder' NormalName str 'Save Unpacked' PackedName str 'Save Packed' KbFreeStr640 str '^0 free out of ^1K.' KbFreeStr320 str '^0K/^1K' end lda ZPPointer ; zp to use = qd zp +$600 clc adc #$600 pha _MenuStartup ErrorDeath 'Could not start Menu Manager.' lda ZPPointer ; zp to use = qd zp +$700 clc adc #$700 pha _SoundStartup ErrorDeath 'Could not start Sound Tools.' _ShowCursor rts MomentStr str 'One moment please...' END **************************************************************** *ShutDown * * Is used to shut down all the tools I started up.. * **************************************************************** ShutDown START Using RAM _DeskShutDown _SoundShutdown _MenuShutDown _DialogShutDown _LEShutDown _CtlShutDown _WindShutDown _EMShutDown _QDShutDown _MTShutDown PushLong ZPHandle _DisposeHandle PushWord MyID _MMShutDown _TLShutDown RTS END ShowAd start using AdData PushLong #0 ; room for result PushLong #Rect PushLong #0 ; no title PushLong #-1 ; window plane (frontmost) PushWord #$0023 ; frame stuff bits PushLong #0 ; don't need a refcon PushLong #0 ; zoom same size as normal _NewModeLessDialog pla ; save dialog pointer sta AdDialog pla sta AdDialog+2 PushLong AdDialog PushLong #Template _GetNewDItem PushLong AdDialog _DrawDialog rts end AdData data Rect dc i'154,10,195,278' Template anop dc i'$3001' ID dc i'4,4,40,265' dc i'16' LongStatText dc i4'Text' Pointer to text dc i'TextEnd-Text' Length of Text dc i'0' Flag (visible) dc i'0' Color Text anop dc c' Apple Demo Launcher',h'0d' dc c' Apple Technical Communications',h'0d' dc h'0d' dc c'Select Demo to run from "Demo" menu',h'0d' TextEnd anop end APPEND Proj.main Dec 86 * * * * Second Release 20 Jan 87 * * * * The code has been cleaned up quite a bit. Error handling * * is much more intelligent. The ErrorDeath macro is no * * longer used. We've added more examples of using dialogs * * and an example using the listlator uphill sta waveform,x inc a ; ramp from $40 up to $C0 inx cpx #128 bne uphill downhill sta waveform,x ; ramp from $C0 down to $40 dec a inx cpx #256 bne downhill SetMode16 ; 16 bit accumulator * then you have to pump it over to the DOC, using the sound tools. pushlong #waveform ; arg1: src ptr pushword #0 ; doc start address pushword #$100 ; byte count _WriteRamBlock ErrorDeath ' writing wave ' rts waveform ds 256 END **************************************************************** * * NoteStartup * **************************************************************** * NoteStartup START pushword #70 ; 60 hz updates pushlong #0 ; no IRQ routine for me _NSStartup ErrorDeath ' Note synth startup error ' rts end **************************************************************** * * PlaySound * * Inputs: contents of a register used as pitch of note * * Outputs: sound * **************************************************************** * PlaySound START using instdef sta semitone pushword #0 space for result pushword #64 middle of the road priority _AllocGen ErrorDeath ' Alloc error ' pla sta gennum pushword gennum pushword semitone pushword #112 ( med volume ) pushlong #instrum ; long ptr to instrument def _NoteOn ErrorDeath ' Note on rejected ' * normally, you would wait before issuing a note off. Since this * instrument has a fast attack and a long release, it really isn't * necessary... pushword gennum pushword semitone _NoteOff ErrorDeath ' NoteOff ? ' rts semitone ds 2 gennum ds 2 END **************************************************************** instdef DATA instrum dc i1'$7f,0,$7F' ; env: ramp $7F00 to level $7F dc i1'$00,$40,0' ; decay at a slow rate of $0040 dc i1'0,0,0' ; to zero; use this stage for dc i1'0,0,0' ; release also. dc i1'0,0,0' dc i1'0,0,0' dc i1'0,0,0' dc i1'0,0,0' ; fill out 8 stages with 0's dc i1'1' ; release segment - 1 dc i1'32' ; priority inc dc i1'2' ; pitch bend range dc i1'75' ; slight vibrato dc i1'85' ; vibrato speed dc i1'0' ; spare dc i1'1' ; number of waveptrs for osc A dc i1'1' ; number of waveptrs for osc B AWavelist dc i1'127,0,0,0,0,0' ;topkey,addr,size,ctrl,pitch BWavelist dc i1'127,0,0,0,16,0' ; detune b by 16/256 semitone END **************************************************************** * * shutdown * **************************************************************** * shutdown START _NSShutdown ErrorDeath ' shutdown failed? ' Println ' note synth has been shu manager. We've reorganized * * the code a bit by putting all the routines for handling * * dialogs in a single file separate from other routines. * * * * A couple of mode changing and initialization bugs have * * been fixed. * * * ********************************************************************** absaddr on LIST ON SYMBOL ON KEEP HP mcopy HP.Macros **************************************************************** * * The main program * **************************************************************** HodgePodge START using GlobalData ;---------------------------------------------------- ; ; Global equates used throughout the program. ; True gequ $8000 False gequ $0000 ;---------------------------------------------------- ; ; Set the data bank to code bank so I can use absolute ; addressing. ; phk plb ;------------------------------------------------------ ; ; Save address of D for use later ; tdc sta MyZP ;------------------------------------------------- ; ; Load Init everything. ; jsr InitStuff bcs AllDone ;---------------------------------------------------- ; ; Initialize system flags. ; stz QuitFlag stz Windex ;---------------------------------------------------- ; ; Take events until user quits. ; jsr PlayWithIt ;-------------------------------------------------- ; ; All is done, let's shut down. ; AllDone anop jsr ShutDownStuff _Quit QuitParams END COPY E16.WINDOW COPY E16.DIALOG COPY INIT.ASM COPY PLAY.ASM COPY UTIL.ASM COPY MENU.ASM COPY WINDOW.ASM COPY DIALOG.ASM COPY MODE.ASM COPY IO.ASM COPY PACK.ASM COPY FONT.ASM COPY PRINT.ASM COPY LIST.ASM COPY DATA ******************************************************************* * * * File: E16.DIALOG * * * * Version: 1.0 * * * * (c) Copyright 1986, 1987 Apple Computer, Inc. * *  * * All rights reserved. * * * * This program and its derivatives are licensed only for * * use on Apple computers. * * * * Works based on this program must contain and * * conspicuously display this notice. * * * * This software is provided for your evaluation and to * * assist you in developing software for the Apple IIGS * * computer. * * * * This is not a distribution license. Distribution of * * this and other Apple software requires a separate * * license. Contact the Software Licensing Department of * * Apple Computer, Inc. for details. * * * * DISCLAIMER OF WARRANTY * * * * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT * * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, * * WITH RESPECT TO ITS MERCHANTABILITY OR ITS FITNESS * * FOR ANY PARTICULAR PURPOSE. THE ENTIRE RISK AS TO * * THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH * * YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND * * NOT APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE) * * ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, * * REPAIR OR CORRECTION. * * * * Apple does not warrant that the functions * * contained in the Software will meet your requirements * * or that the operation of the Software will be * * uninterrupted or error free or that defects in the * * Software will be corrected. * * * * SOME STATES DO NOT ALLOW THE EXCLUSION * * OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY * * NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC * * LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS * * WHICH VARY FROM STATE TO STATE. * * * ******************************************************************* GetInitView GEQU $01 ; Command - GetInitTotal GEQU $02 ; Command - GetInitValue GEQU $03 ; Command - ScrollLineUp GEQU $04 ; Command - ScrollLineDown GEQU $05 ; Command - ScrollPageUp GEQU $06 ; Command - ScrollPageDown GEQU $07 ; Command - ScrollThumb GEQU $08 ; Command - ButtonItem GEQU $0A ; Item Type - CheckItem GEQU $0B ; Item Type - RadioItem GEQU $0C ; Item Type - ScrollBarItem GEQU $0D ; Item Type - UserCtlItem GEQU $0E ; Item Type - StatText GEQU $0F ; Item Type - LongStatText GEQU $10 ; Item Type - EditLine GEQU $11 ; Item Type - IconItem GEQU $12 ; Item Type - PicItem GEQU $13 ; Item Type - UserItem GEQU $14 ; Item Type - UserCtlItem2 GEQU $15 ; Item Type - ItemDisable GEQU $8000 ; Item Type - MinItemType GEQU $0A ; Item Type Range - MaxItemType GEQU $15 ; Item Type Range - Ok GEQU $1 ; ItemID - Cancel GEQU $2 ; ItemID - InStatText GEQU $09 ; Part Code - InEditLine GEQU $0B ; Part Code - InUserItem GEQU $0C ; Part Code - InLongStatText GEQU $0D ; Part Code - InIconItem GEQU $0E ; Part Code - OkDefault GEQU $00 ; Stage Bit Vector - CancelDefault GEQU $40 ; Stage Bit Vector - AlertDrawn GEQU $80 ; Stage Bit Vector - oATBoundsRect GEQU $00 ; AlertTemplate - [Rect] oATAlertID GEQU $08 ; AlertTemplate - [Integer] oATStage1 GEQU $0A ; AlertTemplate - [Byte] oATStage2 GEQU $0B ; AlertTemplate - [Byte] oATStage3 GEQU $0C ; AlertTemplate - [Byte] oATStage4 GEQU $0D ; AlertTemplate - [Byte] oATItemList GEQU $0E ; AlertTemplate - [Longint] oDTBoundsRect GEQU $00 ; DialogTemplate - [Rect] oDTVisible GEQU $08 ; DialogTemplate - [Boolean] oDTRefCon GEQU $0A ; DialogTemplate - [DblWord] oDTItemList GEQU $0E ; DialogTemplate - (starts list of ptrs/NIL) [Longint] oIconRect GEQU $00 ; IconRecord - [Rect] oIconImage GEQU $08 ; IconRecord - [Byte] oItemID GEQU $00 ; ItemTemplate - [Integer] oItemRect GEQU $02 ; ItemTemplate - [Rect] oItemType GEQU $0A ; ItemTemplate - [Integer] oItemDescr GEQU $0C ; ItemTemplate - (or string & len. varies) [Ptr] oItemValue GEQU $10 ; ItemTemplate - [Integer] oItem MACRO &LAB PUSHWORD &WHATTOPUSH LCLC &CHAR &CHAR AMID &WHATTOPUSH,1,1 AIF "&CHAR"="#",.IMMEDIATE &LAB LDA &WHATTOPUSH PHA MEXIT .IMMEDIATE &CHAR AMID &WHATTOPUSH,2,100 &LAB DC I1'$F4' DC I2'&CHAR' MEND MACRO &LAB PUSHLONG &WHATTOPUSH LCLC &CHAR &CHAR AMID &WHATTOPUSH,1,1 AIF "&CHAR"="#",.IMMEDIATE &LAB LDA &WHATTOPUSH+2 PHA LDA &WHATTOPUSH PHA MEXIT .IMMEDIATE &CHAR AMID &WHATTOPUSH,2,100 &LAB DC I1'$F4' DC I2'(&CHAR)|-16' DC I1'$F4' DC I2'&CHAR' MEND MACRO &lab _SetPort &lab ldx #4+256*27 jsl $E10000 MEND MACRO &lab _HideCursor &lab ldx #4+256*144 jsl $E10000 MEND MACRO &lab _ShowCursor &lab ldx #4+256*145 jsl $E10000 MEND MACRO &lab _GetNextEvent &lab ldx #6+256*10 jsl $E10000 MEND MACRO &lab _NewWindow &lab ldx #14+256*9 jsl $E10000 MEND MACRO &lab _TaskMaster &lab ldx #14+256*29 jsl $E10000 MEND MACRO &lab _InsertMenu &lab ldx #15+256*13 jsl $E10000 MEND MACRO &lab _FixMenuBar &lab ldx #15+256*19 jsl $E10000 MEND MACRO &lab _DrawMenuBar &lab ldx #15+256*42 jsl $E10000 MEND MACRO &lab _HiliteMenu &lab ldx #15+256*44 jsl $E10000 MEND MACRO &lab _NewMenu &lab ldx #15+256*45 jsl $E10000 MEND MACRO &lab _DrawCString &lab ldx #4+256*166 jsl $E10000 MEND MACRO &lab _SetSolidPenPat &lab ldx #4+256*55 jsl $E10000 MEND MACRO &lab _GetPort &lab ldx #4+256*28 jsl $E10000 MEND MACRO &lab _SelectWindow &lab ldx #14+256*17 jsl $E10000 MEND MACRO &lab _HideWindow &lab ldx #14+256*18 jsl $E10000 MEND MACRO &lab _ShowWindow &lab ldx #14+256*19 jsl $E10000 MEND MACRO &lab _SetRect &lab ldx #4+256*74 jsl $E10000 MEND MACRO &lab _InvertRect &lab ldx #4+256*86 jsl $E10000 MEND MACRO &lab _HexIt &lab ldx #$2A0B jsl $E10000 MEND MACRO &lab GoToXY &X,&Y &lab lda &X PHA lda &Y PHA ldx #4+256*58 jsl $E10000 MEND MACRO &lab _EraseRect &lab ldx #4+256*85 jsl $E10000 MEND MACRO &lab _GetMouse &lab ldx #6+256*12 jsl $E10000 MEND MACRO &lab _PaintRect &lab ldx #4+256*84 jsl $E10000 MEND MACRO &lab _AddPt &lab ldx #4+256*128 jsl $E10000 MEND MACRO &lab _FillRect &lab ldx #4+256*87 jsl $E10000 MEND MACRO &lab _Random &lab ldx #4+256*134 jsl $E10000 MEND MACRO &lab _SetRandSeed &lab ldx #4+256*135 jsl $E10000 MEND MACRO &lab _TickCount &lab ldx #6+256*16 jsl $E10000 MEND MACRO &lab ErrorDeath &text &lab bcc end&syscnt pea 0 pea 0 pha ldx #$2A0B jsl $E10000 pla sta >y&syscnt pla sta >y&syscnt+2 pea x&syscnt|-16 pea x&syscnt ldx #$200C jsl $E10000 brk $F0 x&syscnt dc c"&text" dc c' Error was $' y&syscnt ds 4 dc i1'13,10,0' end&syscnt anop mend MACRO &lab _TLStartup &lab ldx #$0201 jsl $E10000 MEND MACRO &lab _TLShutdown &lab ldx #$0301 jsl $E10000 MEND MACRO &lab _LoadTools &lab ldx #$0E01 jsl $E10000 MEND MACRO &lab _MMStartup &lab ldx #$0202 jsl $E10000 MEND MACRO &lab _MMShutDown &lab ldx #$0302 jsl $E10000 MEND MACRO &lab _NewHandle &lab ldx #$0902 jsl $E10000 MEND MACRO &lab _MTStartup &lab ldx #3+256*2 jsl $E10000 MEND MACRO &lab _MTShutDown &lab ldx #3+256*3 jsl $E10000 MEND MACRO &lab _QDStartup &lab ldx #4+256*2 jsl $E10000 MEND MACRO &lab _QDShutDown &lab ldx #4+256*3 jsl $E10000 MEND MACRO &lab _GrafOff &lab ldx #4+256*11 jsl $E10000 MEND MACRO &lab _EMStartUp &lab ldx #6+256*2 jsl $E10000 MEND MACRO &lab _EMShutDown &lab ldx #6+256*3 jsl $E10000 MEND MACRO &lab _IntStartup &lab ldx #$020B jsl $E10000 MEND MACRO &lab _IntShutDown &lab ldx #$030B jsl $E10000 MEND MACRO &lab _MenuStartup &lab ldx #15+256*2 jsl $E10000 MEND MACRO &lab _MenuShutDown &lab ldx #15+256*3 jsl $E10000 MEND MACRO &lab _WindStartup &lab ldx #14+256*2 jsl $E10000 MEND MACRO &lab _WindShutDown &lab ldx #14+256*3 jsl $E10000 MEND MACRO &lab _Refresh &lab ldx #14+256*57 jsl $E10000 MEND MACRO &lab _CtrlShutDown &lab ldx #16+256*3 jsl $E10000 MEND MACRO &lab _QUIT ¶ms &lab jsl $E100A8 dc i2"$29" dc i4"¶ms" MEND MACRO &lab _InitCtrlMgr &lab ldx #16+256*2 jsl $E10000 MEND MACRO &lab setmode8 &lab sep #$30 longa off longi off MEND MACRO &lab setmode16 &lab rep #$30 longa on longi on mend MACRO &lab _SoundStartup &lab ldx #$0208 jsl $E10000 MEND MACRO &lab _SoundShutDown &lab ldx #$0308 jsl $E10000 MEND MACRO &lab _WriteRamBlock &lab ldx #$0908 jsl $E10000 MEND MACRO &lab _NSStartUp &lab ldx #$0219 jsl $E10000 MEND MACRO &lab _NSShutDown &lab ldx #$0319 jsl $E10000 MEND MACRO &lab _AllocGen &lab ldx #$0919 jsl $E10000 MEND MACRO &lab _NoteOn &lab ldx #$0B19 jsl $E10000 MEND MACRO &lab _NoteOff &lab ldx #$0C19 jsl $E10000 MEND ******************************************************************* * BrickOut demo main program/Event loop * * By Jim Mensch (c) 1986-87 ProSoft Software & Apple Computer,Inc * * * * All rights reserved. * * * * This program and its derivatives are licensed only for * * use on Apple computers. 󵶷 * * * * Works based on this program must contain and * * conspicuously display this notice. * * * * This software is provided for your evaluation and to * * assist you in developing software for the Apple IIGS * * computer. * * * * This is not a distribution license. Distribution of * * this and other Apple software requires a separate * * license. Contact the Software Licensing Department of * * Apple Computer, Inc. for details. * * * * DISCLAIMER OF WARRANTY * * * * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT * * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, * * WITH RESPECT TO ITS MERCHANTABILITY OR ITS FITNESS * * FOR ANY PARTICULAR PURPOSE. THE ENTIRE RISK AS TO * * THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH * * YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND * * NOT APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE) * * ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, * * REPAIR OR CORRECTION. * * * * Apple does not warrant that the functions * * contained in the Software will meet your requirements * * or that the operation of the Software will be * * uninterrupted or error free or that defects in the * * Software will be corrected. * * * * SOME STATES DO NOT ALLOW THE EXCLUSION * * OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY * * NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC * * LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS * * WHICH VARY FROM STATE TO STATE. * * * ******************************************************************* * * * This is the meat of the Brick Out demo program. It * * actually defines the menus and windows to be used in * * the demo program * ******************************************************************* EventLoop Start Using Defaults Using RAM Using In_Loc lda #$FFFF ldx #63 MakePat sta MyPat,x stz $0,x dex bpl MakePat STZ QuitFlag Zero out my quit flag fro this demo stz ActWind Zero out Active window pointer stz Computer Mark it as human use PushLong #0 Room for result _TickCount and get the tick count from machine po _SetRandSeed lda #$FFFF sta CrsFlag ************************************************************* * SetUp the system menu bar now. Note This uses a Text type * menu definition * PushLong #0 PushLong #GameMenu Push pointer to my menu data _NewMenu and turn it into a menu data struct Pea 0 Push insert posn on stack _InsertMenu PushLong #0 PushLong #AplMenu Push pointer to my menu data _NewMenu and turn it into a menu data struct Pea 0 Push insert posn on stack _InsertMenu Pha stace for return value _FixMenuBar set the menu bar height Pla and pull of the actual height _DrawMenuBar draw the menu bar on the screen Jsr AllocateWin Allocate windows and storage space ; Begin the event loop MainLoop ANOP start of the main event loop lda ActWind first lets check out the active wind beq *+5 to see if it needs updating jsr DoWindowAnim If a window is up do any stuff for it Bit QuitFlag Test to see if we are done bpl *+3 If not continue rts If so then just leave the event loop PushWord #0 PushWord #$FFFF PushLong #Event pass the event that just happened _TaskMaster and give it all to task master pla get the returned value beq MainLoop If zero Task master did everything ; If taskmaster does not return a value, then the event must also be ; handled by our application cmp #InSysMenu check if menu was selected bne ML0010 If not go on to next test jsr MenuSelect If so, process the choice jmp MainLoop and go back to the beginning .. ML0010 Anop cmp #InGoAway Check to see if mouse in go away bne ML0030 if not next test jsr CloseWindow if so close the window Jmp MainLoop and back to the beginning ML0030 Anop cmp #InContent Check to see if mouse down in content bne ML0040 jsr ShowHide Show/hide the cursor jmp MainLoop ML0040 ANop jmp MainLoop END ***************************************************************** * ShowHide * This routine will either show or hide the cursor when the user * presses the mouse button in the content window * ShowHide START Using RAM lda CrsFlag see if the cursor is here bne SH0010 if not zero then hide it _ShowCursor else show it lda #$FFFF sta CrsFlag rts SH0010 _HideCursor or hide it.. lda #$00 sta CrsFlag rts END **************************************************************** * MenuSelect is the routine that does the actual dispatch whenever * a menu choice has been made. * MenuSelect START using RAM lda TaskData get the item number selected from and #$00FF Strip off the highbit of menu choice asl a double it { cheap table lookup } tax use this as our index lda MenuDisp,x and load the address of the routine pha put it on to of the stack rts and 'jump' to routine MenuDisp ANOP Table of handler routines dc i'AboutDemo-1' Put up the about this demo window dc i'HumanGame-1' Start the human play mode dc i'CompGame-1' Start compputer play mode dc i'DoQuit-1' /File/Quit Menu option END *************************************************************** * UnHiLite is a generic routine that will unlite the menu * that you selected and return * UnHiLite START Using RAM PushWord #0 flag to unhighlight Lda TaskData+2 Get the menu selected pha pass it to unlite _HiLiteMenu and do it RTS END *************************************************************** * DoQuit will be executed if the user selects the quit menu option * DoQuit START Using RAM Lda #$FFFF set the quit flag to I wanna quit mode sta QuitFlag so the event loop will end Jmp UnHiLite and go unhilight the menu END **************************************************************** * Dummy is the routine that will be called if the user selects * an unimplemented menu option. * Dummy START Jmp UnHiLite END **************************************************************** * Close Window will close the topmost window * for this demo * CloseWindow START Using RAM lda TaskData+2 Task master has already found what pha window to close lda TaskData for us pha _HideWindow lda #$0000 and set Active window to zero sta ActWind CW0010 Jmp UnHilite END **************************************************************** * HumanGame * HumanGame START using RAM lda #$0000 sta Computer BRA NewGame END **************************************************************** * CompGame * Computer play mode * CompGame START using RAM lda #$FFFF sta Computer ; jsr CloseWindow BRA NewGame END **************************************************************** * New Game * NewGame START Using RAM jsr FillBricks turn all the bricks on PushLong Window1 First select the window _SelectWindow PushLong Window1 Now make it visible _ShowWindow PushLong Window1 Now set the grafport. _SetPort PushLong #Win1Rect clear out the window... _EraseRect Lda #$1111 Now store the window that is currently Sta ActWind active for later use.. Lda #$0000 Now set up the X Coordinate sta XCord sta temp sta TempPt sta TempPt+2 sta Score lda #$FFFF sta BallFlg lda #0005 sta BallCnt lda #$0001 now init the paddle pos... sta CompOff sta PdlPos jsr DrawPdl and draw the paddle on the screen.. jsl ReDrawB and now draw the bricks on the screen jmp UnHiLite rts END ***************************************************************** * FillBricks * FillBricks start using RAM ldy #00 DB0010 Anop tya set this column of bricks on.. asl A tax lda #%0000000111111111 sta BrickAry,x iny cpy #18 bne DB0010 rts END ****************************************************************** * ReDrawB * This will redraw the brick array on the screen... * ReDrawB start using RAM lda #0 sta TempPt RF0005 ANop Now draw the bricks on the screen lda #00 sta TempPt+2 RF0010 Anop lda #00 ldx TempPt get the column number inx sec and now we are gonna shift the mask in RF0012 ROL A and shift it one.. dex lower the index bne RF0012 and go back if not done yet sta Window2 RF0015 lda TempPt+2 get the row of bricks we are in asl A multiply it by 2 tax and use it as an index... lda BrickAry,x and Window2 now and it with our mask to see if beq RF0020 has a brick there... jsr DrawBrick RF0020 inc TempPt+2 lda TempPt+2 cmp #18 bne RF0010 inc TempPt lda TempPt cmp #09 bne RF0005 rtl END **************************************************************** * NewBall * This procedure will draw a new ball on the screen and start it moving.. * NewBall START using RAM lda BallCnt bne NB0001 jmp DrawEnd if no more balls then end the game... NB0001 PushLong #0 PushWord BallCnt _HexIt pla sta MyMess11 pla sta MyMess11+2 GotoXY #100,#100 PushLong #MyMess1 _DrawCString NB0010 Anop PushWord #0 PushWord #$FFFF PushLong #Event _GetNextEvent pla beq NB0010 lda EventWhat cmp #1 bne NB0010 PushLong #MyRect Now erase those words.. PushWord #080 PushWord #080 PushWord #300 PushWord #140 _SetRect PEA 0015 _SetSolidPenPat Pushlong #MyRect _PaintRect lda #0060 sta BallPos sta BallPos+2 lda #0001 sta BallOffset sta BallOffset+2 jsr DrawBall lda #$0000 sta BallFlg dec BallCnt rts END **************************************************************** * DrawPdl routine will place the paddle on the screen at the current * PdlPos. NOTE: If a paddle is already on the screen where the pdlpos * Points to.. then this routine will erase the paddle.. * DrawPdl Start Using RAM Human PushLong #MyRect First set up our rectangle.. PushWord PdlPos the left hand pos.. PushWord #145 the top of the paddle lda PdlPos now Add 10 to the paddle.. clc adc #20 so that he paddle is 20 pixeks long.. pha and push it on the stack.. PushWord #149 and now the bottom _SetRect PushLong #MyRect Now we draw/erase the rectangle.. _InvertRect on/from the screen rts CompPdl lda BallPos get the ball position clc adc CompOff add the computer offset sta PdlPOS save it as the new paddle pos jmp human and treat it as normal END ****************************************************************** * dummy drawing routine to get rid of flicker in the paddle.... * DrawDummy Start using RAM PushLong #MyRect PushWord #0 PushWord #0 PushWord #19 PushWord #4 _SetRect PushLong #MyRect PushLong #MyPat _FillRect rts END *************************************************************** * DrawBall * This routine will simply draw the ball on the screen and do * nothing else... * DrawBall start using RAM PushLong #MyRect set up the rectangle... PushWord BallPos now push the points for the ball PushWord BallPos+2 clc lda BallPos adc #03 pha clc lda BallPos+2 adc #03 pha _SetRect PushLong #MyRect _InvertRect RTS END EraseBall start using RAM PushLong #MyRect set up the rectangle... PushWord BallPos now push the points for the ball PushWord BallPos+2 clc lda BallPos adc #03 pha clc lda BallPos+2 adc #03 pha _SetRect PEA 0015 _SetSolidPenPat PushLong #MyRect _PaintRect RTS END **************************************************************** * DrawBrick will accept a brick Horiz and Vert posn in TempPt and * will co\vert that into a position on the screen and draw the brick * on the screen... DrawBrick start Using RAM lda TempPt+2 lets set up our rectangle... clc first get the brick horiz posn by asl A Multiplying by 16.... asl a asl a asl a sta MyRect and resaving it... lda TempPt Now get the vert posn.. asl a Multiply it by two tax and make it the index value.. lda BrickTbl,x from the master table sta MyRect+2 Inc MyRect Now increment the horiz by one.. phx now set the brick color _SetSolidPenPat PushLong #MyRect Now set up the brick rect.. PushWord MyRect first the left PushWord MyRect+2 Now the top lda MyRect clc adc #14 now the right {adjusted} pha lda MyRect+2 clc adc #4 pha and the bottom _SetRect PushLong #MyRect and draw the brick... _PaintRect rts BrickTbl dc i'10,15,20,25,30,35,40,45,50' END **************************************************************** * EraseBricK will accept a brick Horiz and Vert posn in TempPt and * will convert that into a position on the screen and draw the brick * on the screen... EraseBrick start Using RAM lda TempPt+2 lets set up our rectangle... clc first get the brick horiz posn by asl a Multiply by 8..{its already been asl a multiplied by 2... asl a sta MyRect and resaving it... lda TempPt Now get the vert posn.. asl a Multiply it by two tax and make it the index value.. lda BrickTbl,x from the master table sta MyRect+2 Inc MyRect Now increment the horiz by one.. PEA 0015 now set the brick color _SetSolidPenPat PushLong #MyRect Now set up the brick rect.. PushWord MyRect first the left PushWord MyRect+2 Now the top lda MyRect clc adc #14 now the right {adjusted} pha lda MyRect+2 clc adc #4 pha and the bottom _SetRect PushLong #MyRect and draw the brick... _PaintRect inc Score and up the score.... dec BrickLeft and subtract a brick... jsr EraseBall Now clear out the ball.... jsr DrawBall and redraw a new one... rts BrickTbl dc i'10,15,20,25,30,35,40,45,50' END **************************************************************** * About this demo window * This will put up the about this demo window and wait for the * user to click in the go away box to continue. * AboutDemo START Using RAM jsr EraseBall PushLong WindowF First select the window _SelectWindow PushLong WindowF Now make it visible _ShowWindow PushLong #0 Now save the current port _GetPort PushLong WindowF Now set the grafport. _SetPort TextLoop GoToXY #10,#10 now move to 10,20 PushLong #MyString1 Push a pointer to our first data string _DrawCString and draw it... GoToXY #10,#20 PushLong #MyString2 _DrawCString GoToXY #10,#30 PushLong #MyString3 _DrawCString GoToXY #10,#40 PushLong #MyString4 _DrawCString GoToXY #10,#50 PushLong #MyString5 _DrawCString GoToXY #10,#60 PushLong #MyString6 _DrawCString ButWait Anop PushWord #0 Wait for button press b4 window goes PushWord #$FFFF away from screen PushLong #Event _GetNextEvent pla beq ButWait lda EventWhat Cmp #1 bne ButWait PushLong WindowF Now put the window away... _HideWindow _SetPort and reset the port to what it was jsr DrawBall jmp UnHiLite rts END **************************************************************** * DoWindowAnim will move both the paddle and the ball is need be.. * DoWindowAnim START Using RAM lda BallFlg cmp #$FFFF bne *+5 jmp NewBall its not... so get next ball PushLong #TempPt first find out the current _GetMouse Mouse location.. lda Computer cmp #$FFFF beq CompAnim Lda TempPt+2 Now see where the mouse is... cmp PdlPos see if it jives with the paddle pos beq NoMove If so the user didn't move the pdl CompAnim jsr DrawPdl Howeve, if it is different then the pdl lda Computer beq HAnim lda BallPos sec sbc CompOff sta PdlPos bra HA0010 HAnim lda TempPt+2 was moved to erase and redraw it sta PdlPos in the new position HA0010 jsr DrawPdl bra MoveBall NoMove Anop jsr DrawDummy Take up the same amount of time as jsr DrawDummy draw pdl.... MoveBall Anop jsr DrawBall erase the ball.... PushLong #BallOffSet now calc the new Ball Posn.. PushLong #BallPos _AddPt jsr DrawBall and redraw the ball.. ; now see if the ball hit the sides or the top.... jsr CheckWalls check the walls first.... jsr checkPdl now check the paddle... jsr CheckBrick and see if we hit a brick... Anim0010 rts END ****************************************************************** *CheckWalls.... first the routine to see if we hit a wall... * CheckWalls start using RAM lda BallPos get ball horiz posn... cmp #0001 see if it hit the left wall... bcs CW0010 nope so skip this... lda #$40 jsr Beep lda #0 is so.. subtract current val from zero sec sbc BallOffSet sta BallOffset and resave it.. CW0010 ANop lda BallPos now check the right wall.. cmp #0300 bcc CW0020 nope we are done... lda #$40 jsr Beep lda #0 sec sbc BallOffset sta BallOffset CW0020 anop rts END ****************************************************************** * CheckPdl.... * CheckPdl start using RAM lda BallPos+2 cmp #145 see if its below the paddle... bcs CP0003 brl CP0010 CP0003 ANop Its on the paddle plain lda #0 irst reverse the Ball sec sbc BallOffSet+2 sta BallOffSet+2 lda BallPos Now subtract the pdlpos fron the ball sec sbc PdlPos pos to get the relative ball loc. clc adc #$03 Now allow for ball width! cmp #24 BGE Missed if >20 no hit pha Now save this number for later CP0006 Anop he hit the ball lda BrickLeft Ball Hit starts here cmp #0 bne *+5 jsr FillBricks lda #$60 ; try $60-78 or so jsr Beep pla Now see where he hit the ball.. asl A Multiply by 2 tax use it as an index... lda BallOffset+2 now see if we are in fast mode cmp #2 if so use a different table... beq CP0008 lda AngleTbl,x and get the new ball angle.. sta BallOffSet save it brl CP0010 now go on.... CP0008 lda AngleTb2,x get the fast angle sta BallOffSet and save it... brl CP0010 now finish the checks... Missed anop oops ball over... jsr DrawBall erase that ball.... lda #$FFFF sta BallFlg CP0010 anop lda BallPos+2 cmp #2 bcs CP0020 bit Computer bpl CP0028 PushWord #0 new comp offset _Random pla and #$001F and strip off all the high bits cmp #19 see if its bigger than 20 bcc CP0027 If not then use it... sbc #13 If not... then make it so! CP0027 sta CompOff and save it! CP0028 lda #$45 jsr Beep lda #2 sta BallOffSet+2 jsr CkBrick see if any bricks left bne CP0020 jsr FillBricks jsl ReDrawB CP0020 rts CkBrick ANop Now see if any bricks left lda #$00 ldy #$00 CK0010 ora BrickAry,y Add in this new brick bne CK0020 if nonzero then end now! iny iny cpy #36 blt CK0010 cmp #$00 Do the final compare! CK0020 rts END *************************************************************** * Check Brick * CheckBrick start using RAM ldx #00 CB0010 txa asl a tay lda BrickTbl1,y cmp BallPos+2 bcs CB0020 in a brick row... inx cpx #10 bne CB0010 jmp CB0030 CB0020 ANop In a brick Row... cpx #00 bne *+5 jmp CB0030 dex now decrement X stx TempPt store the row away.. lda BallPos now figure out the brick # clc Divide by 16.... ror A clc ror A clc ror A clc ror A Now has Brick Column... asl A sta TempPt+2 save it.. ldx TempPt get the row number... inx add 1 lda #1 zero the CB0025 dex cpx #0 beq CB0026 clc rol A jmp CB0025 CB0026 sta Window2 store it in another temp.. ldx TempPt+2 lda BrickAry,x get the apropriate column info.. and Window2 bne *+5 Brick is their so hit it... jmp CB0030 no brick so end... lda BrickAry,x first remove the brick.. eor Window2 from the active list.. sta BrickAry,x jsr EraseBrick now remove the brick... lda #$70 jsr Beep lda #0 Reverse the ball. sec sbc BallOffset+2 sta BallOffset+2 bit Computer bpl CB0030 PushWord #0 new comp offset _Random pla and #$001F and strip off all the high bits cmp #19 see if its bigger than 20 bcc CB0027 If not then use it... sbc #13 If not... then make it so! CB0027 sta CompOff and save it! CB0030 rts BrickTbl1 dc i'09,14,19,24,29,34,39,44,49,54' end ****************************************************************** * DrawEnd * Tell the user that that is it!!!! * DrawEnd start using RAM gotoxy #100,#100 PushLong #MyMess2 _DrawCString PushLong #0 PushWord Score _HexIt pla sta MyMess31 pla sta MyMess31+2 gotoxy #100,#150 PushLong #MyMess3 _DrawCString lda #0000 sta ActWind The game is over.... rts end ****************************************************************** * ALLOCATEWIN This routine is to be performed just once at the start * of the program. It calls the window manager and allocates storage * for All the windows to be used in this application. as well as * defining them all. * AllocateWin Start using RAM using In_Loc ; First make the about window... PushLong #0 Room for return value PushLong #WindowRecF Bounds Rectangle _NewWindow make/get and draw the new window pla get the window pointer Sta WindowF and store it in my window pointer pla sta WindowF+2 ; Now make the QDDemo 1 window PushLong #0 PushLong #WindowRec1 _NewWindow pla sta Window1 pla sta Window1+2 RTS END **************************************************************** * Data definition section This section contains all of the data * storage for the program. * RAM DATA True equ $0001 False equ $0000 MyID DS 02 Computer ds 02 CompOff ds 02 MyTemp DS 04 MyRect DS 08 BallPos DS 04 A Point that contains the ball loc.. PdlPos DS 02 location of the paddle.. BrickLeft DS 02 NUMBER OF BRICKS LEFT ON THE SCREEN.. TempPt DS 04 A temp point var... BallOffSet DS 04 Amount to move the ball BallFlg ds 02 if ball is active... BallCnt ds 02 Number of balls.. Score ds 02 Running score... AngleTbl dc i'-2,-2,-2,-1,-1,-1,-1,-1,-1,0,0,1,1,1,1,1,1,2,2,2,20,2,2' AngleTb2 dc i'-4,-4,-35,-3,-8,-2,-2,-1,-1,0,1,1,2,2,2,8,3,3,4,4,15,9,7' CrsFlag ds 02 cursor flag... BrickAry ANop array of rectangles for the bricks.. ds 100 enough room for a buncha bricks.. QuitParms dc i4'0' dc i4'0' ToolTable dc i'7' dc i'4,$0100' dc i'5,$0100' dc i'6,$0100' dc i'14,$0100' dc i'15,$0100' dc i'16,$0100' dc i'25,0' ; one tool: #25, version 0 Event Anop Event record 16 bytes long EventWhat DS 2 EventMessage DS 4 EventWhen DS 4 EventWhere DS 4 EventModifiers DS 2 TaskData DS 4 TaskMask dc h'FF0F' QuitFlag DS 02 Quit Flag for this demo ODirPage DS 02 Storage for the old direct page address ActWind DS 02 Storage for the current Active window XCord ds 02 An integer for the animation stuff YCord ds 02 and another... temp ds 02 Temp variable for various stuff MyPat ds 80 A pattern storage area WindowTit1 dc i1'15',c' Brick Out ',h'0D' WindowTitF dc i1'3',c'JM',H'0D' WindowRec1 dc i'Wind1End-WindowRec1' dc i'%1100000000000000' Frame type dc i4'WindowTit1' pointer to the title.. dc i4'$11111111' RefCon dc i'00,00,00,00' zoomed rect dc i4'0' Color Table dc i'0,0' Verticle and horiz offsets ******************************************************************* * * * Apple II GS brick out game program By Jim Mensch * * (c) 1986 Jim Mensch/ProSoft Software * * * * January 6, 1987 v1.0 * * * * (c) Copyright 1986, 1987 Apple  Computer, Inc. * * * * All rights reserved. * * * * This program and its derivatives are licensed only for * * use on Apple computers. * * * * Works based on this program must contain and * * conspicuously display this notice. * * * * This software is provided for your evaluation and to * * assist you in developing software for the Apple IIGS * * computer. * * * * This is not a distribution license. Distribution of * * this and other Apple software requires a separate * * license. Contact the Software Licensing Department of * * Apple Computer, Inc. for details. * * * * DISCLAIMER OF WARRANTY * * * * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT * * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, * * WITH RESPECT TO ITS MERCHANTABILITY OR ITS FITNESS * * FOR ANY PARTICULAR PURPOSE. THE ENTIRE RISK AS TO * * THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH * * YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND * * NOT APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE) * * ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, * * REPAIR OR CORRECTION. * * * * Apple does not warrant that the functions * * contained in the Software will meet your requirements * * or that the operation of the Software will be * * uninterrupted or error free or that defects in the * * Software will be corrected. * * * * SOME STATES DO NOT ALLOW THE EXCLUSION * * OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY * * NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC * * LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS * * WHICH VARY FROM STATE TO STATE. * * * ******************************************************************* * * ******************************************************************* * * Version Notes: * 0.5 Game now functions. Paddle moves ball moves * bricks disappear when hit.. score kept... * * 0.7 Implement first new feature. when ball hits back of * brick it bounces back up... * * 2.0 Using tools as of Aug 8 1986 * Program now refreshes the brick array * and has been fixed for updates... * * 3.0 Public domain version Oct 1, 1986 * This version supports computer play * as well as many other options * Also Added sound to the game! { Thanks to Keith Rollin } * * ****************************************************************** TITLE ' Brick out silly game version 3.0 ' ABSADDR ON GEN OFF SYMBOL OFF list off MCOPY game.macros 65816 ON KEEP Brick ********************************************* * * RECORD TYPE DEFINITION SECTION * In this section I will define some of the common data * structures that I will use in the program. * Defaults DATA mode equ $00 320 graphics mode=$00 MAXX equ 320 MenuNor equ $00F0 Menu text normal MenuSel equ $001F Menu text color select END EventStruct DATA what equ 0 This is the basic structure of an message equ what+2 event record. when equ message+4 where equ when+4 modifiers equ where+4 END in_loc DATA ; --- These are Event Codes returned by the Event Manager, ---------- ; --- which may be processed by TaskMaster ---------- inNull equ $00 No further action required. inButtDwn equ $01 Button down event. inButtUp equ $02 Button up event. inKey equ $03 Key event. ; $04 (Not defined.) inAutoKey equ $05 Auto-Key event. inUpdate equ $06 Update event. ; $07 (Not defined.) inActWind equ $08 Activate window event. inSwitch equ $09 Switch event. inAccess equ $0A Desk Accessory event. inDevice equ $0B Device driver event. ; $0C Application defined. ; $0D Application defined. ; $0E Application defined. ; $0F Application defined. ; --- These are values returned by FindWindow and TaskMaster, ------ ; --- and may mean different things depending on who returns it. ------ ; inDesk equ $10 On the desktop. inSysMenu equ $11 In system menu bar inSysWind equ $12 In system window (desk accessory). inContent equ $13 In a content region. inDrag equ $14 In a drag region. inGrow equ $15 In a grow (size) region. inGoAway equ $16 In a go-away (close box) region. inZoom equ $17 In a zoom (zoom box) region. inInfo equ $18 In the information bar. inVerScrl equ $19 In the vertical scroll bar. inHorScrl equ $1A In the horizontal scroll bar. inFrame equ $1B On a window frame, other than above. inDrop equ $1C On a window drop shadow. ; ; END ; Zero page equates ZeroPage DATA Window1 GEqu 0 Window2 GEqu Window1+4 Window3 GEqu Window2+4 Window4 GEqu Window3+4 WindowF GEqu Window4+4 ButtonF GEqu WindowF+4 Wind GEQU ButtonF+4 FoundCtrl GEqu Wind+4 block Gequ FoundCtrl+4 Lock Gequ Block+4 purgelev GEqu Lock+2 BlockSize GEqu PurgeLev+2 END ************************************************************* * Program Main Section. This will be the main program loops * It will init the program/vars/tools and then run the event * loop. * * PrgStart START Using RAM Main phk set DBR for absolute addressing PLB Jsr MemoryInit Init the meory manager Jsr ToolInit and now start the rest of the tools Jsr EventLoop Start the event loop up Jsr ShutDown event loop done close up stuff _Quit QuitParms quit back to ProDOS... rts and the program is done.. END ************************************************************* * Memory Init will tell the memory manager what memory we intend * to use. * MemoryInit START Using RAM _TLStartup Start the tool locator PushWord #0 Now init the memory mgr _MMStartup and see if we get an error ErrorDeath 'Could not start the memory manager.' pla If the code gets here the current ID sta MyID is on the top of the stack.. _MTStartup now start up the misc tools... ErrorDeath 'Could not start Misc tools' ;---------------------------------------------------------------- ; now to call the loader to load the tools needed. PushLong #ToolTable _LoadTools ErrorDeath ' could not load specified tools... ' rts END ********************************************************************* * ShutDown allows is a standard end to an application.. we are going to * now go in and tell the tools that we are done with them so that they can * free up memory and clean up the system... so that I can leave clean * ShutDown START Using RAM jsr NoteShutDown _SoundShutdown _Grafoff Turn off the various tools.. _MTShutDown _IntShutDown _CtrlShutDown _WindShutDown _MenuShutDown _EMShutDown _QDShutDown PushWord MyID and tell the mem mgr to free us up _MMShutDown _TLShutDown and turn off the tool locator.. rts END ********************************************************************* * ToolInit starts up all the rest of the tools {memory manager and * tool locator have already been started. ToolInit START Using defaults Using RAM ; Start up quickdraw ;---------------------------------------------------------------- ; First thing, allocate a some storage for the tools to use ; as zero page... ; PushLong #0 Space for new Handle PushLong #$800 8 pages for zero page.. PushWord MyID reserve it for my program PushWord #$C001 Locked, fixed, fixed bank PushLong #0 _NewHandle ErrorDeath ' could not set zero page ' pla get the new handle off the stack sta 0 pla sta 2 lda [0] Now dereference the handle sta 4 and store pointer in ZP PushWord 4 Give quickdraw its zero page PushWord #Mode push the res on the stack PushWord #160 Max Size of each scan line.... PushWord MyID Application ID _QDStartup and start quickdraw ErrorDeath ' couldn t start Quickdraw' ; start up event manager lda 4 clc adc #$300 pha event mgr's own zero page PEA 20 event queue size pea 0 Min X for cursor pea MAXX Max X for cursor pea 0 MIN y for cursor pea 200 max y for cursor lda MyID application ID number pha _EMStartup start the event manager ErrorDeath 'Couldn t startup Event Manager...' _ShowCursor now that we have the bounds.... ; Start the window manager PushWord MyID _WindStartup PushLong #0 _Refresh ; Start the menu manager PushWord MyID lda 4 clc adc #$0400 calculate Menu mgr ZP.. pha Menu manager zero page _MenuStartup ; and the control manager PushWord MyID lda 4 clc adc #$0500 pha Control manager zero page _InitCtrlMgr _IntStartUp Integer math tools lda 4 clc adc #$0600 pha _SoundStartup ; Sound tool startup jsr LoadSound ; create and load the sound wave jsr NoteStartUp lda #$60 jsr Beep rts END ************************************************************ * * This would be your subroutine * ************************************************************ Beep start pha ; save note ; jsr NoteStartup ; these need to be HERE cli ; this seems to be necessary pla and #$7F jsr PlaySound ; pass ascii to note synth ; jsr NoteShutDown rts END **************************************************************** * * Load Sound * This creates a waveform and loads it into the DOC * **************************************************************** LoadSound START * first you need a waveform. This bit creates a one page triangle wave. * Remember that the samples have the hi bit flipped compared to two's * complement numbers. (zero level is $80). Also $00 halts the oscillator! ldx #0 lda #$40 SetMode8 ; 8 bit accumulator uphill sta waveform,x inc a ; ramp from $40 up to $C0 inx cpx #128 bne uphill downhill sta waveform,x ; ramp from $C0 down to $40 dec a inx cpx #256 bne downhill SetMode16 ; 16 bit accumulator ; I think that I woud do it this way -kaar ; SetMode8 ; ldx #127 ; ldy #128 ; lda #$C0 ;loop sta waveform,x ; sta waveform,y ; iny ; dex ; bpl loop ; S******************************************************************* * COLOR : a sample program for trying things with color tables * * * * * January 6, 1987 v1.0 * * * * (c) Copyright 1986, 1987 Apple Computer, Inc. * *  !"#$%&'()*+,-./0123456789:;<=>?@ABC * * All rights reserved. * * * * This program and its derivatives are licensed only for * * use on Apple computers. * * * * Works based on this program must contain and * * conspicuously display this notice. * * * * This software is provided for your evaluation and to * * assist you in developing software for the Apple IIGS * * computer. * * * * This is not a distribution license. Distribution of * * this and other Apple software requires a separate * * license. Contact the Software Licensing Department of * * Apple Computer, Inc. for details. * * * * DISCLAIMER OF WARRANTY * * * * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT * * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, * * WITH RESPECT TO ITS MERCHANTABILITY OR ITS FITNESS * * FOR ANY PARTICULAR PURPOSE. THE ENTIRE RISK AS TO * * THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH * * YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND * * NOT APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE) * * ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, * * REPAIR OR CORRECTION. * * * * Apple does not warrant that the functions * * contained in the Software will meet your requirements * * or that the operation of the Software will be * * uninterrupted or error free or that defects in the * * Software will be corrected. * * * * SOME STATES DO NOT ALLOW THE EXCLUSION * * OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY * * NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC * * LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS * * WHICH VARY FROM STATE TO STATE. * * * ******************************************************************* * This program uses only QuickDraw II and the event Manager. * Its intent is to be a non-desktop environment test program * for checking out special color effects on pictures * * The routine which does the effect is called "DIDDLE" * * The setting of features within the effect is done by mouse downs * and key presses controlled by the Main Event Loop. * * Other routines are support routines for the effect or features. * * Current Features are: * * Mouse Click ==> selects a screen color to * perform the effect on (toggles on/off) * * keys R, G, B ==> holds Red, Green, or Blue constant * while working effect changing intensity * of other two * * Keys F or S ==> do Fade effect or Scroll Effect * note: Fade effect goes to Black or White * depending on U or D switch * * *Key X + 2 clicks ==> exchange two colors on the screen - both * the pallette entries and the actual bits * on the screen. the two clicks are one for * each of the two colors to swap * * Key I ==> do Fade - IN from a faded picture * * keys U or D ==> causes effect to scroll Up or Down * * *Keys H or V ==> flips image vert. (top/bot) or Horiz. (L/R) * * Key M (capital) ==> folds image horiz. (left->Right) * Key m (lower ) ==> folds image Vert. (top ->Bottom) * * Key Z ==> ? * * Key O ==> Turns off effect over entire picture * * space bar ==> 3-way speed change loop for effect * * 0 to 9 ==> reads in Picture COLOR0.PIC through COLOR9.PIC * note: COLOR0.PIC supplied - you can add others * * escape ==> exits the program * * * *note: the star'd items above change the actual bit image, so the "O" * option cannot reset image - to reset, just type the number of * the picture, causing it to be re-read * *** * * Change History: * * 10-AUG-86 Initial Version completed (EIB) * *********************************************************** absaddr on instime on GEN on SYMBOL off KEEP dabbler mcopy dabbler.macros list off color START bra DoIt * * Global equates (in case we try 640 mode) * ScreenMode gequ $00 ; 320 MaxX gequ 320 END DoIt start using GlobalData * * initialization stuff below courtesy of Steve Glass * ;---------------------------------------------------- ; ; Set the data bank to code bank so I can use absolute ; addressing. ; phk plb ;------------------------------------------------------ ; ; Save address of D for use later ; tdc sta MyZP ;----------------------------------------------- ; ; Now we initialize all the tools we are going ; use. ; _TLStartup ; Tool locator ;------------------------------------------------- ; ; Initialize the memory manager. There should be ; no error here. ; PushWord #0 _MMStartup pla sta MyID ;------------------------------------------------- ; ; Initialize misc tools. ; _MTStartup ;------------------------------------------------------- ; ; Load the tools i need ; ; Extra stuff to set and restore bank reg is for bug ; in loader. Will go away soon. ; PushLong #ToolTable _LoadTools ;------------------------------------------------- ; ; Tools are loaded, initialize them. ; jsr InitStuff ;---------------------------------------------------- ; ; go do it! ; jsr PlayWithIt ;-------------------------------------------------- ; ; All is done, let's shut down. ; _GrafOff _SFShutdown _DialogShutDown _WindShutDown _CtlShutDown _EMShutDown _QDShutDown _MTShutdown PushWord MyID _MMShutdown _TLShutdown _Quit QuitParams ; Do a ProDOS Quit call brk $F0 END **************************************************************** * * InitStuff * * Gets space in bank zero for use as zero page by tools and * then initializes QuickDraw and EventManager * * **************************************************************** InitStuff START using GlobalData using KaarData ;------------------------------------------------------ ; ; First get some memory for the zero page we need! ; PushLong #0 ; space for handle PushLong #$600 ;\kaar - five pages PushWord MyID PushWord #$C001 ; locked, fixed, fixed bank PushLong #0 _NewHandle pla sta 0 pla sta 2 lda [0] sta 4 sta QDZPPointer ; for use with FastDraw -kaar PushWord 4 ; zp to use PushWord #ScreenMode PushWord #160 ; max size of scan line PushWord MyID ; my id for memory _QDStartup lda 4 ; zp to use = qd zp +$300 clc adc #$300 pha PushWord #20 ; queue size PushWord #0 ; x clamp low PushWord #MaxX ; x clamp high PushWord #0 ; y clamp low PushWord #200 ; y clamp high PushWord MyID ; id for mem _EMStartup PushWord MyID lda 4 clc adc #$400 pha _CtlStartup PushWord MyID _WindStartup PushWord MyID _DialogStartup PushWord MyID lda 4 clc adc #$500 pha _SFStartup rts END **************************************************************** * * PlayWithIt * * This contains the main event loop. * **************************************************************** PlayWithIt START using GlobalData stz FX ; some initializations stz UPDWN STZ Xcha lda #1 sta MaskIDX lda #3 sta Speed ldx #0 ilp stz select,x inx inx cpx #32 bne ilp jsr loadPic ; load the first pic (COLOR0.PIC) _SHOWCURSOR PushWord #0 ; save off pictures color table PushLong #colorSave _GetColorTable redo JSR TABINIT ; init my color tables & scb's JSR TABSET JSR SCBSET Again jsr Diddle ; diddle moves the color tables PushWord #0 ; here's the traditional MAINEVENTLOOP PushWord #$FFFF PushLong #EventRecord _GetNextEvent pla lda EventWhat cmp #3 ; (keydown) beq key cmp #1 ; (MouseDown) beq mouse bra again mouse jsr mousedown jmp redo key jsr keydown bcc redo rts END ***************************************************** * * Handle KEYDOWN events * ***************************************************** KEYDOWN START using GlobalData lda eventmessage cmp #27 ;(escape) bne checkkeys sec yes, set "quit" flag rts * * we may want to get a bit more efficent at handling keys, but for * now, while building up step by step, this can suffice: * CheckKeys anop stz xcha ; xchange resets on any key-down cmp #'R' beq dored cmp #'r' beq dored cmp #'G' beq dogreen cmp #'g' beq dogreen cmp #'B' beq doblue cmp #'b' beq doblue bra chkO dored lda #1 bra doRGB dogreen lda #2 bra doRGB doblue lda #3 DoRGB sta maskIdx resetCT PushWord #0 PushLong #colorSave _SetColorTable bra doneJ chkO cmp #'O' beq doOff cmp #'o' beq doOff bra chkUD doOFF stz FX offsel ldx #30 lda #0 doOlp sta select,x dex dex bpl doOlp bra resetCT chkUD cmp #'U' beq doUP cmp #'u' beq doUP cmp #'D' beq doDOWN cmp #'d' beq doDOWN bra chkspace doUP lda #1 sta UPDWN bra resetCT doDOWN stz UPDWN bra resetCT chkspace cmp #' ' beq dospeed bra chkFSIZ dospeed inc speed lda speed cmp #4 bne doneJ lda #1 sta speed doneJ JMP done chkFSIZ cmp #'F' beq doFade cmp #'f' beq doFade cmp #'I' beq DoUnFade cmp #'i' beq DoUnFade cmp #'S' beq doScroll cmp #'s' beq doScroll cmp #'Z' beq doRand cmp #'z' beq doRand bra ChkHV doRand lda #2 sta FX jmp offsel DoFade lda #1 sta FX stz unswitch ;(for un-fade) jmp offsel DoUnFade lda FX ; must be in fade to do this cmp #1 bne doneJ sta unswitch jmp done DoScroll stz FX jmp resetCT chkHV cmp #'V' beq DoV cmp #'v' beq DoV cmp #'H' beq DoH cmp #'h' bne ChkM DoH jsr Horizontal jmp done DoV jsr vertical jmp done chkM cmp #'M' beq DoM cmp #'m' bne ChkX jsr FoldVert jmp done DoM jsr FoldHoriz jmp done chkX cmp #'X' beq DoX cmp #'x' bne chkHelp doX inc xcha ; set xcha to one jmp done chkHelp cmp #'?' beq callHelp cmp #'/' bne chkNum callHelp jsr Help jmp done chkNum cmp #'l' beq DoPic cmp #'L' bne chkTog DoPic anop jsr GetPicName Reload _HIDECURSOR Jsr LoadPic _SHOWCURSOR PushWord #0 PushLong #colorSave _GetColorTable jmp DoOFF chkTog cmp #'t' beq DoToggle cmp #'T' bne done DoToggle anop dec InstrMode beq Reload bpl showInstr lda #2 sta InstrMode showInstr jsr PrintInstructions jmp done done clc rts END *********************************************************** * * Handle MOUSEDOWN events * *********************************************************** MOUSEDOWN START using GlobalData _HIDECURSOR ;must hide cursor to avoid reading it PUSHWORD #0 ; where? PUSHLONG EventWhere _GETPIXEL ;the color of it is pixel index PLA AND #$000F ; just in case ASL a ;(now have new color selection index) TAX lda xcha ;we in exchange mode? beq DoSelSw cmp #2 ;if 2, ready to head off and do exch. beq DoExch inc xcha ; else, we're lookin for next color txa lsr a ; (want true index) sta xcha1 ; so save this one for now bra showit ; and get out of here DoSelSw LDA SELECT,x BEQ itsOFF lda #0 ;its on - turn off bra stpx itsOFF lda #1 ; its off - turn on stpx sta SELECT,x bra showit ; done for this stuff DoExch txa lsr a sta xcha2 ; exchange, 1st save off sec. color stz xcha ; may as well reset this now jsr Exchange showit _SHOWCURSOR PushWord #0 PushLong #colorSave _SetColorTable rts END **************************************************************** * * LoadPic * * This loads the picture to display on super hi-res screen * **************************************************************** LoadPic START using GlobalData _OPEN OpenParams bcc cont1 jmp Error cont1 anop lda OpenID sta ReadID sta CloseID _READ ReadParams bcs Error cont2 anop _Close CloseParams jsr PrintInstructions clc rts Error anop jsr PrintInstructions sec rts end PrintInstructions start using GlobalData pea 0 pea 8 _MoveTo pea 0 _SetForeColor pea $f _SetBackColor lda InstrMode beq NoInstr cmp #2 beq PrInstr2 PushLong #Instr1 bra DrawStr PrInstr2 anop PushLong #Instr2 DrawStr _DrawString NoInstr rts Instr1 str ' FSZUDIORGBXHVMLT ' Instr2 str ' Press ''?'' for instructions ' END ********************************************************** * * Diddle : diddles the color tables (move's 'em) * ********************************************************** Diddle START using GlobalData SLP JSR EFFECT LDX speedDel LPS DEX BNE LPS RTS END ********************************************************** * * EFFECT: determine which effect to perform * ********************************************************** EFFECT START Using GlobalData Lda FX beq scroll cmp #1 beq fade cmp #2 beq rand rts scroll lda UPDWN beq sup jsr TABDEC rts sup jsr TABINC rts fade jsr TABFADE rts rand jsr TABRAND rts END ********************************************************** * * TABINIT: sets up color table values & determines SCB's to set * ********************************************************** TABINIT START using GlobalData lda maskidx dec a asl a tax lda fmasks,x sta fmask lda emasks,x sta emask lda tmasks,x sta tmask lda omasks,x sta omask lda mmasks,x sta mmask lda speed cmp #3 bne spdst2 lda #$FFFF bra spdout spdst2 cmp #2 bne spdout lda #$3FFF spdout sta speedDel PushWord #0 PushLong #ColorTable _GetColorTable LDX #0 tablp lda COLORTABLE,X JSR BUMPZ ;(try this, to see what we get!) sta colortable+$20,x JSR BUMP sta colortable+$40,x JSR BUMP sta colortable+$60,x JSR BUMP sta colortable+$80,x JSR BUMP sta colortable+$A0,x JSR BUMP sta colortable+$C0,x JSR BUMP sta colortable+$E0,x JSR BUMP sta colortable+$100,x JSR BUMP sta colortable+$120,x JSR BUMP sta colortable+$140,x JSR BUMP sta colortable+$160,x JSR BUMP sta colortable+$180,x JSR BUMP sta colortable+$1A0,x JSR BUMP sta colortable+$1C0,x JSR BUMP sta colortable+$1E0,x INX INX CPX #32 BNE TABLP RTS BUMP TAY LDA select,x BEQ DBST LDA FLAG CMP #2 Beq dbd TYA AND fmask CMP emask BEQ dbd2 CMP fmask Bne DBA dbd2 inc flag TYA RTS DBD TYA SEC SBC tmask AND fmask ORA t2 RTS DBA TYA CLC ADC tmask AND fmask CMP omask BNE DBq LDA #0 DBQ ORA t2 DB RTS DBST TYA RTS BUMPZ TAY STZ FLAG LDA select,x beq db4 TYA AND mmask STA t2 STA COLORTABLE,X DB3 RTS DB4 TYA STA COLORTABLE,X RTS END ********************************************************** * * TABSET moves my colortables into the system's set * * note: we could work with actual loc's for the * tables, but I choose to do it all via * QUICKDRAW II calls * ********************************************************** TABSET START using GlobalData LDA #0 TABLP2 STA COUNT PHA ASL A ASL A ASL A ASL A ASL A CLC ADC #COLORTABLE TAX LDA #0 ADC #^COLORTABLE PHA PHX _SETCOLORTABLE LDA COUNT INC A CMP #16 BNE TABLP2 RTS END ********************************************************** * * TABINC: ripples forward (backward?)the color tables * ********************************************************** TABINC START using GlobalData LDX #0 TABLP LDA COLORTABLE+$1E0,X STA COLORTABLE+$200,X LDA COLORTABLE+$1C0,X STA COLORTABLE+$1E0,X LDA COLORTABLE+$1A0,X STA COLORTABLE+$1C0,X LDA COLORTABLE+$180,X STA COLORTABLE+$1A0,X LDA COLORTABLE+$160,X STA COLORTABLE+$180,X LDA COLORTABLE+$140,X STA COLORTABLE+$160,X LDA COLORTABLE+$120,X STA COLORTABLE+$140,X LDA COLORTABLE+$100,X STA COLORTABLE+$120,X LDA COLORTABLE+$E0,X STA COLORTABLE+$100,X LDA COLORTABLE+$C0,X STA COLORTABLE+$E0,X LDA COLORTABLE+$A0,X STA COLORTABLE+$C0,X LDA COLORTABLE+$80,X STA COLORTABLE+$A0,X LDA COLORTABLE+$60,X STA COLORTABLE+$80,X LDA COLORTABLE+$40,X STA COLORTABLE+$60,X LDA COLORTABLE+$20,X STA COLORTABLE+$40,X LDA COLORTABLE+$00,X STA COLORTABLE+$20,X LDA COLORTABLE+$200,X STA COLORTABLE+$00,X INX INX CPX #32 BNE TABLP jsr tabset rts END ********************************************************** * * TABDEC: ripples backward (forward?)the color tables * ********************************************************** TABDEC START using GlobalData LDX #0 TABLP LDA COLORTABLE+$0,X STA COLORTABLE-$20,X LDA COLORTABLE+$20,X STA COLORTABLE+$0,X LDA COLORTABLE+$40,X STA COLORTABLE+$20,X LDA COLORTABLE+$60,X STA COLORTABLE+$40,X LDA COLORTABLE+$80,X STA COLORTABLE+$60,X LDA COLORTABLE+$A0,X STA COLORTABLE+$80,X LDA COLORTABLE+$C0,X STA COLORTABLE+$A0,X LDA COLORTABLE+$E0,X STA COLORTABLE+$C0,X LDA COLORTABLE+$100,X STA COLORTABLE+$E0,X LDA COLORTABLE+$120,X STA COLORTABLE+$100,X LDA COLORTABLE+$140,X STA COLORTABLE+$120,X LDA COLORTABLE+$160,X STA COLORTABLE+$140,X LDA COLORTABLE+********************************************************** * * TABRAND * ********************************************************** TABRAND START using GlobalData ldx #0 tablp anop jsr rd sta colortable,x sta colortable+$20,x sta colortable+$40,x sta colortable+$60,x sta colortable+$80,x sta colortable+$A0,x sta colortable+$C0,x sta colortable+$E0,x sta colortable+$100,xDFGHIJKLMNOPQRSTUVWXYZ[\]^_` sta colortable+$120,x sta colortable+$140,x sta colortable+$160,x sta colortable+$180,x sta colortable+$1A0,x sta colortable+$1C0,x sta colortable+$1E0,x nomo inx inx cpx #32 bne tablp jsr tabset ldy #1 wt0 ldx #0 wt dex bne wt dey bne wt0 rts rd PHX PUSHWORD #0 _RANDOM PLA PLX rts END tabfdin START using GlobalData lda UPDWN bne UnfadeBlack jmp UnfadeWhite UnfadeWhite anop ldx #0 tablp anop * blue lda colortable,x tay ;save in y AND #$000F sta local lda colorsave,x and #$000F cmp local beq cg tya DEC a jsr storit jmp nomo * green cg tya and #$00F0 sta local lda colorsave,x and #$00F0 cmp local beq cr tya sec sbc #$0010 jsr storit jmp nomo * red cr tya and #$0F00 sta local lda colorsave,x and #$0F00 cmp local beq nomo tya sec sbc #$0100 jsr storit nomo inx inx cpx #32 bne tablp jsr tabset rts UnfadeBlack anop ldx #0 tablp2 anop * blue lda colortable,x tay ;save in y AND #$000F sta local lda colorsave,x and #$000F cmp local beq cg2 tya INC a jsr storit jmp nomo2 * green cg2 tya and #$00F0 sta local lda colorsave,x and #$00F0 cmp local beq cr2 tya clc adc #$0010 jsr storit jmp nomo2 * red cr2 tya and #$0F00 sta local lda colorsave,x and #$0F00 cmp local beq nomo2 tya clc adc #$0100 jsr storit nomo2 inx inx cpx #32 bne tablp2 jsr tabset rts storit sta colortable,x sta colortable+$20,x sta colortable+$40,x sta colortable+$60,x sta colortable+$80,x sta colortable+$A0,x sta colortable+$C0,x sta colortable+$E0,x sta colortable+$100,x sta colortable+$120,x sta colortable+$140,x sta colortable+$160,x sta colortable+$180,x sta colortable+$1A0,x sta colortable+$1C0,x sta colortable+$1E0,x rts END ********************************************************** * * SCBSET: uses QuickDraw II SCB routine to set up my color tables * ********************************************************** SCBSET START using GlobalData LDA #0 STA SCLIN PEA 0 _GETSTANDARDSCB PLA STA MYSCB LDA SCLIN SCBLP PHA AND #$000F ORA MYSCB PHA _SETSCB INC SCLIN LDA SCLIN CMP #200 BNE SCBLP RTS END **************************************************************** * * EXCHANGE : exchange colors xcha1 and xcha2 in pallette * and in picture image * *************************************************************** EXCHANGE START using GlobalDATA lda xcha1+0 ;$000x xba sta xcha1+4 ;$0x00 asl a asl a asl a asl a sta xcha1+6 ;$x000 xba sta xcha1+2 ;$00x0 lda xcha2+0 ;$000x xba sta xcha2+4 ;$0x00 asl a asl a asl a asl a sta xcha2+6 ;$x000 xba sta xcha2+2 ;$00x0 ldx #$7CFF ; x counts through screen exloop anop lda $e12000,x and #$000F cmp xcha1 beq e11 cmp xcha2 beq e12 back2 lda $e12000,x and #$00F0 cmp xcha1+2 beq e21 cmp xcha2+2 beq e22 back3 lda $e12000,x and #$0F00 cmp xcha1+4 beq e31 cmp xcha2+4 beq e32 back4 lda $e12000,x and #$F000 cmp xcha1+6 beq e41 cmp xcha2+6 beq e42 jmp nextWord e11 lda $e12000,x and #$FFF0 ora xcha1 sta $e12000,x jmp back2 e12 lda $e12000,x and #$FFF0 ora xcha2 sta $e12000,x jmp back2 e21 lda $e12000,x and #$FF0F ora xcha1+2 sta $e12000,x jmp back3 e22 lda $e12000,x and #$FF0F ora xcha2+2 sta $e12000,x jmp back3 e31 lda $e12000,x and #$F0FF ora xcha1+4 sta $e12000,x jmp back4 e32 lda $e12000,x and #$F0FF ora xcha2+4 sta $e12000,x jmp back4 e41 lda $e12000,x and #$0FFF ora xcha1+6 sta $e12000,x jmp NextWord e42 lda $e12000,x and #$0FFF ora xcha2+6 sta $e12000,x * jmp NextWord ;(falls through) nextWord dex dex bmi done Jmp Exloop done lda xcha1 ;now fix color table asl a tax lda colorsave,x pha lda xcha2 asl a tax lda colorsave,x tay pla sta colorsave,x lda xcha1 asl a tax tya sta colorsave,x rts END **************************************************************** * * Vertical: flip picture upside down * **************************************************************** VERTICAL START using GlobalData _HIDECURSOR ldx #0 ldy #$7c60 lda #100 sta temp loop1 lda #80 sta temp2 loop2 lda $e12000,x pha phx tyx lda $e12000,x plx sta $e12000,x pla phx tyx sta $e12000,x plx inx inx iny iny dec temp2 bne loop2 tya sec sbc #320 tay dec temp bne loop1 _SHOWCURSOR rts END **************************************************************** * * Horizontal : reverse picture left to right * **************************************************************** HORIZONTAL START using GlobalData _HIDECURSOR ldx #0 ldy #$9e lda #200 sta temp loop1 lda #40 sta temp2 loop2 lda $e12000,x pha phx tyx lda $e12000,x asl a asl a asl a asl a xba and #$FFF0 sta revd lda $e12000,x lsr a lsr a lsr a lsr a xba and #$0FFF ora revd plx sta $e12000,x pla phx pha asl a asl a asl a asl a xba and #$FFF0 sta revd pla lsr a lsr a lsr a lsr a xba and #$0FFF ora revd tyx sta $e12000,x plx inx inx dey dey dec temp2 bne loop2 tya clc adc #240 tay txa clc adc #80 tax dec temp bne loop1 _SHOWCURSOR rts END **************************************************************** * * FoldHoriz : Fold picture: left to right * **************************************************************** FOLDHORIZ START using GlobalData _HIDECURSOR ldx #0 ldy #$9e lda #200 sta temp loop1 lda #40 sta temp2 loop2 lda $e12000,x asl a asl a asl a asl a xba and #$FFF0 sta revd lda $e12000,x lsr a lsr a lsr a lsr a xba and #$0FFF ora revd phx tyx sta $e12000,x plx inx inx dey dey dec temp2 bne loop2 tya clc adc #240 tay txa clc adc #80 tax dec temp bne loop1 _SHOWCURSOR rts END **************************************************************** * * FoldVert: fold top to bottom * **************************************************************** FOLDVERT START using GlobalData _HIDECURSOR ldx #0 ldy #$7c60 lda #100 sta temp loop1 lda #80 sta temp2 loop2 lda $e12000,x phx tyx tyx sta $e12000,x plx inx inx iny iny dec temp2 bne loop2 tya sec sbc #320 tay dec temp bne loop1 _SHOWCURSOR rts END **************************************************************** * * GlobalDATA * **************************************************************** GlobalData DATA ***** GENERAL STUFF MyID ds 2 InstrMode dc i2'2' ToolTable dc i'6' dc i'4,$0100' ; quickdraw dc i'6,$0100' ; event manager dc i'14,$0100' ; Window Manager dc i'16,$0100' ; Control Manager dc i'21,$0100' ; Dialog Manager dc i'23,$0100' ; Standard File EventRecord anop EventWhat ds 2 EventMessage ds 4 EventWhen ds 4 EventWhere ds 4 EventModifiers ds 2 TaskData ds 4 TaskMask dc i4'$00000f86' ; Event Types EvtNull equ 0 EvtMouseDown equ 1 EvtMouseUp equ 2 EvtKeyDown equ 3 ; equ 4 EvtAutoKey equ 5 EvtUpdate equ 6 ; equ 7 EvtActivate equ 8 EvtSwitch equ 9 EvtDeskAcc equ 10 EvtDriver equ 11 MyZP ds 2 ***** I/O STUFF OpenParams anop OpenID ds 2 NamePtr dc i4'current_name' ds 4 ; record for SFGetFile Prompt str 'Load which Picture:' typelist dc i1'1,$06' ; just one type, and it's binary reply anop r_good dc i'0' r_type dc i'0' r_auxtyp dc i'0' r_fname ds 16 ; file name r_fullpn ds 129 ; full pathname current_name dc i1'10' ; working copy of r_fullpn dc c'color0.pic' ; initial picture to load ds 118 ; filler for a full pathname ReadParams anop ReadID ds 2 PicDest dc i4'$00E12000' dc i4'$00008000' ; this many bytes ds 4 ; how many xfered CloseParams anop CloseID ds 2 QuitParams dc i4'0' dc i2'$0000' ;not restartable from memory dc i2'0' ******** COLOR STUFF ANOTHERSAVE DS $20 COLORSAVE DS $20 Count ds 2 flag ds 2 t2 ds 2 Sclin ds 2 MySCB ds 2 temp ds 2 temp2 ds 2 local ds 2 *MASKS========> R G B fmasks dc i2'$00FF,$0F0F,$0FF0' emasks dc i2'$00EE,$0E0E,$0EE0' tmasks dc i2'$0022,$0202,$0220' mmasks dc i2'$0F00,$00F0,$000F' omasks dc i2'$0010,$1010,$1100' revd dc i'0' maskidx dc i2'1' ;(init to red) FX dc i2'0' ; special effect: init to 0=scroll UPDWN dc i2'0' ;(init down ) xcha dc i'0' ;xchange flag 0=not in use xcha1 dc i'0,0,0,0' ;1st exch. color * (2nd through 4th word are used as shifted versions of first byte) xcha2 dc i'0,0,0,0' ;other exchange fmask ds 2 emask ds 2 tmask ds 2 mmask ds 2 omask ds 2 speed dc i2'3' ;(slow speed) speedDel ds 2 unSwitch ds 2 select dc i2'0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0' PRETABLE DS $20 COLORTABLE DS $200 ;(32*16) POSTTABLE DS $20 END append dabbler.kaar l8<=>?@ABCDEFGHIJ MACRO &LAB PUSHWORD &WHATTOPUSH LCLC &CHAR &CHAR AMID &WHATTOPUSH,1,1 AIF "&CHAR"="#",.IMMEDIATE &LAB LDA &WHATTOPUSH PHA MEXIT .IMMEDIATE &CHAR AMID &WHATTOPUSH,2,100 &LAB DC I1'$F4' DC I2'&CHAR' MEND MACRO &LAB PUSHLONG &WHATTOPUSH LCLC &CHAR &CHAR AMID &WHATTOPUSH,1,1 AIF "&CHAR"="#",.IMMEDIATE &LAB LDA &WHATTOPUSH+2 PHA LDA &WHATTOPUSH PHA MEXIT .IMMEDIATE &CHAR AMID &WHATTOPUSH,2,100 &LAB DC I1'$F4' DC I2'(&CHAR)|-16' DC I1'$F4' DC I2'&CHAR' MEND MACRO &LAB STR &string &LAB dc i1'l:&bdefghijkstring',c"&string" MEND MACRO &lab _TLStartup &lab ldx #$0201 jsl $E10000 MEND MACRO &lab _TLShutdown &lab ldx #$0301 jsl $E10000 MEND MACRO &lab _GetFuncPtr &lab ldx #$0B01 jsl $E10000 MEND MACRO &lab _LoadTools &lab ldx #$0E01 jsl $E10000 MEND MACRO &lab _MMStartup &lab ldx #$0202 jsl $E10000 MEND MACRO &lab _MMShutDown &lab ldx #$0302 jsl $E10000 MEND MACRO &lab _NewHandle &lab ldx #$0902 jsl $E10000 MEND MACRO &lab _MTStartup &lab ldx #3+256*2 jsl $E10000 MEND MACRO &lab _MTShutDown &lab ldx #3+256*3 jsl $E10000 MEND MACRO &lab _ReadMouse &lab ldx #$1703 jsl $E10000 MEND MACRO &lab _ClampMouse &lab ldx #$1C03 jsl $E10000 MEND MACRO &lab _PosMouse &lab ldx #$1E03 jsl $E10000 MEND MACRO &lab _QDStartup &lab ldx #4+256*2 jsl $E10000 MEND MACRO &lab _QDShutDown &lab ldx #4+256*3 jsl $E10000 MEND MACRO &lab _GrafOff &lab ldx #4+256*11 jsl $E10000 MEND MACRO &lab _GetStandardSCB &lab ldx #4+256*12 jsl $E10000 MEND MACRO &lab _InitColorTable &lab ldx #4+256*13 jsl $E10000 MEND MACRO &lab _SetColorTable &lab ldx #4+256*14 jsl $E10000 MEND MACRO &lab _GetColorTable &lab ldx #4+256*15 jsl $E10000 MEND MACRO &lab _SetSCB &lab ldx #4+256*18 jsl $E10000 MEND MACRO &lab _SetAllSCBs &lab ldx #4+256*20 jsl $E10000 MEND MACRO &lab _SetMasterSCB &lab ldx #4+256*22 jsl $E10000 MEND MACRO &lab _GetMasterSCB &lab ldx #4+256*23 jsl $E10000 MEND MACRO &lab _InitPort &lab ldx #4+256*25 jsl $E10000 MEND MACRO &lab _SetPort &lab ldx #4+256*27 jsl $E10000 MEND MACRO &lab _GetPort &lab ldx #4+256*28 jsl $E10000 MEND MACRO &lab _MoveTo &lab ldx #4+256*58 jsl $E10000 MEND MACRO &lab _Random &lab ldx #4+256*134 jsl $E10000 MEND MACRO &lab _GetPixel &lab ldx #4+256*136 jsl $E10000 MEND MACRO &lab _HideCursor &lab ldx #4+256*144 jsl $E10000 MEND MACRO &lab _ShowCursor &lab ldx #4+256*145 jsl $E10000 MEND MACRO &lab _SetTextMode &lab ldx #4+256*156 jsl $E10000 MEND MACRO &lab _SetSpaceExtra &lab ldx #4+256*158 jsl $E10000 MEND MACRO &lab _GetSpaceExtra &lab ldx #4+256*159 jsl $E10000 MEND MACRO &lab _SetForeColor &lab ldx #4+256*160 jsl $E10000 MEND MACRO &lab _SetBackColor &lab ldx #4+256*162 jsl $E10000 MEND MACRO &lab _DrawChar &lab ldx #4+256*164 jsl $E10000 MEND MACRO &lab _DrawString &lab ldx #4+256*165 jsl $E10000 MEND MACRO &lab _InitCursor &lab ldx #4+256*202 jsl $E10000 MEND MACRO &lab _EMStartUp &lab ldx #6+256*2 jsl $E10000 MEND MACRO &lab _EMShutDown &lab ldx #6+256*3 jsl $E10000 MEND MACRO &lab _GetNextEvent &lab ldx #6+256*10 jsl $E10000 MEND MACRO &lab _FixRatio &lab ldx #$0E0B jsl $E10000 MEND MACRO &lab _WindStartup &lab ldx #14+256*2 jsl $E10000 MEND MACRO &lab _WindShutDown &lab ldx #14+256*3 jsl $E10000 MEND MACRO &lab _NewWindow &lab ldx #14+256*9 jsl $E10000 MEND MACRO &lab _CloseWindow &lab ldx #14+256*11 jsl $E10000 MEND MACRO &lab _TaskMaster &lab ldx #14+256*29 jsl $E10000 MEND MACRO &lab _WNewRes &lab ldx #14+256*37 jsl $E10000 MEND MACRO &lab _Refresh &lab ldx #14+256*57 jsl $E10000 MEND MACRO &lab _GetCOrigin &lab ldx #14+256*62 jsl $E10000 MEND MACRO &lab _CtlStartup &lab ldx #16+256*2 jsl $E10000 MEND MACRO &lab _ctlShutDown &lab ldx #16+256*3 jsl $E10000 MEND MACRO &lab _ctlNewRes &lab ldx #16+256*18 jsl $E10000 MEND MACRO &lab _DialogStartup &lab ldx #21+256*2 jsl $E10000 MEND MACRO &lab _DialogShutDown &lab ldx #21+256*3 jsl $E10000 MEND MACRO &lab _SFStartup &lab ldx #23+256*2 jsl $E10000 MEND MACRO &lab _SFShutdown &lab ldx #23+256*3 jsl $E10000 MEND MACRO &Lab _SFGetFile &Lab ldx #23+256*9 jsl $E10000 MEND MACRO &lab _OPEN ¶ms &lab jsl $E100A8 dc i2"$10" dc i4"¶ms" MEND MACRO &lab _READ ¶ms &lab jsl $E100A8 dc i2"$12" dc i4"¶ms" MEND MACRO &lab _CLOSE ¶ms &lab jsl $E100A8 dc i2"$14" dc i4"¶ms" MEND MACRO &lab _QUIT ¶ms &lab jsl $E100A8 dc i2"$29" dc i4"¶ms" MEND dc i'Line0,Line1,Line2,Line3,Line4' dc i'Line5,Line6,Line7,Line8,Line9' dc i'Line10,Line11,Line12,Line12,Line12' Line0 ds 30 ; max name len is 25 + 1 for length ; ; and 4 for size info Line1 str ' ' Line2 str 'The quick brown fox jumped over the lazy dog.' Line3 str 'She sells sea shells down by the sea shore.' Line4 str ' ' Line5 dc h'20' dc h'00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F' dc********************************************************************** * * All of Keith's SFGetFile stuff... * ********************************************************************** GetPicName start using GlobalData PushLong #0 _GetPort PushWord #20 ; x and PushWord #20 ; y locations of dialog box PushLong #Prompt PushLong #0 ; no filter proc Pusmopqrstuvwxyz{|}~hLong #typelist PushLong #reply _SFGetFile lda r_good beq cancelled ; cancel button hit - use old name ldy #128 loop lda r_fullpn,y sta current_name,y dey dey bpl loop cancelled anop _SetPort ; parms on stack from _GetPort above rts end ********************************************************************** * * All of Keith's Help Menu stuff... * ********************************************************************** Help start jsr NormalizeScreen jsr ShowHelp jsr RestoreScreen rts end NormalizeScreen start Using KaarData PushLong #0 _GetPort pla sta origPort pla sta origPort+2 pea 0 _GetMasterSCB pla ora #$0080 ; set the mode to 640 pha pha _SetMasterSCB _SetAllSCBs ; convert to 640 mode PushLong #NewTable ; now standardize the table _InitColorTable lda #15 ; set all color tables to normal sta counter loop anop PushWord counter PushLong #NewTable _SetColorTable dec counter bpl loop _InitCursor _HideCursor PushWord #0 ; x clamp low PushWord #639 ; x clamp high PushWord #0 ; y clamp low PushWord #199 ; y clamp high _ClampMouse pea 0 ; reposition the mouse pea 0 pea 0 _ReadMouse pla ; chuck this beastie (mode and stuff) plx ; save the y-position pla asl a ; Multiply x by 2 pha phx _PosMouse _CtlNewRes ; tell the managers about it _WNewRes Pea 0 ; redo whole desktop pea 0 _refresh _ShowCursor rts ; that's all I can think of for now counter ds 2 end ShowHelp start Using HelpWindow Using GlobalData Using KaarData PushLong #0 space for result PushLong #HelpWindow _NewWindow pla sta >Window pla sta >Window+2 PushLong >Window _SetPort PushWord #$f _SetForeColor PushWord #$0 _SetBackColor PushWord #$0006 ; FG - XOR _SetTextMode PushLong #0 ; save the old space extra _GetSpaceExtra PushLong #0 ; make a fixed frac 4 PushWord #4 PushWord #1 _FixRatio _SetSpaceExtra ; still on the stack, so use it lda #$8000 ; set this for proper screen updating sta OldWindY ; on the first time around loop anop Pea 0 ; here's the traditional TASKMASTER Pushword #$ffff PushLong #EventRecord _TaskMaster pla cmp #22 wInGoAway bne loop _SetSpaceExtra ; restore the spaceExtra from before PushLong >TaskData _CloseWindow rts end * * Got here from TaskMaster, so we don't have to do Begin/End-Update * WindUpdate start phb ; Gotta reset the DBR back to us! phk plb jsr GetStartHeight ; exit w/ start in Acc, height in Y jsr DrawBlock ; now print the lines plb rtl end GetStartHeight start using HelpWindow using KaarData pea 0 ; Get the window origin so that we pea 0 ; know what lines to update PushLong >Window _GetCOrigin pla ; this is the one we want (vert org) ply ; get rid of this sta NewWindY ; find out how much we scrolled sec sbc OldWindY php bpl ScrolledUp1 eor #$ffff ; take absolute value inc a ScrolledUp1 anop lsr a ; get the height to redraw lsr a lsr a inc a ; and a pinch to grow an inch cmp #24 ; 24 lines at the most! bcc WeHaveHeight lda #24 WeHaveHeight anop tay plp bcs ScrolledUp2 lda NewWindY pha bra ExitThisThing ScrolledUp2 anop lda OldWindY ; for scrolling up, the DrawStart clc ; value is the old Y Origin plus the adc SizPos+4 ; height of the window. sec sbc SizPos cmp NewWindY bcs WeHaveStart lda NewWindY ; limit DrawStart to top of screen WeHaveStart anop pha ExitThisThing anop lda NewWindY sta OldWindY pla ; get back the DrawStart value rts end DrawBlock start using HelpWindow sty counter1 lsr a ; enter with Vert. Org. in Acc. lsr a ; div by 8 to get line number lsr a pha ; save this for a min inc a ; spin it back out to get the asl a ; pixel line number (rounded up asl a ; to the nearest multiple of 8) asl a sta Vpos lda #4 sta Hpos pla ; pull line number back off jsr GetStart ; point to start of right text sta index lda #4 ; 3 segments/line sta counter2 loop anop ldy counter2 lda HTAB,y pha PushWord Vpos _MoveTo PushLong #HelpText pla ; now adjust the low word clc adc index pha _DrawString ldy index ; point to the next line of text lda HelpText,y and #$00ff ; just use the length clc adc index inc a ; now skip over the string length sta index dec counter2 dec counter2 bpl loop lda #4 sta counter2 clc ; now, move down the screen lda #08 adc vpos sta vpos dec counter1 ; have we done 24 lines? bmi done ; yes, we're done lda HelpText,y ; have we reached the end of the text? and #$00ff cmp #$ff bne loop ; no, print some more done anop rts counter1 ds 2 counter2 ds 2 vpos ds 2 Hpos ds 2 index ds 2 htab dc i'250,220,10' end GetStart start using helpwindow sta counter ; Multiply by three, as there are asl a ; effectively 3 data lines for every clc ; one there is on the screen adc counter sta counter lda #0 sta index bra Decr loop anop ldy index ; point to the next line of text lda HelpText,y and #$00ff ; just use the length clc adc index inc a ; now skip over the string length sta index Decr dec counter bpl loop rts ; Acc has index counter ds 2 index ds 2 end RestoreScreen start using KaarData pea 0 _GetMasterSCB pla and #$ff7f ; set the mode to 320 pha pha _SetMasterSCB _SetAllSCBs ; convert to 320 mode PushLong OrigPort _InitPort _InitCursor _HideCursor PushWord #0 ; x clamp low PushWord #639 ; x clamp high PushWord #0 ; y clamp low PushWord #199 ; y clamp high _ClampMouse pea 0 ; reposition the mouse pea 0 pea 0 _ReadMouse pla ; chuck this beastie (mode and stuff) plx ; save the y-position pla lsr a ; divide x by 2 pha phx _PosMouse _CtlNewRes ; tell the managers about it _WNewRes Jsr LoadPic _SHOWCURSOR rts end HelpWindow data WindowParamBlock anop dc i'WindowEnd-WindowParamBlock' dc i2'%1101110000100101' Frame stuff bits make dif types dc i4'HelpTitle' Ptr to title dc i4'0' RefCon dc i2'0,0,0,0' Full Size (0= default) dc i4'0' Color Table Pointer dc i2'0' Vertical origin dc i2'0' Horizontal origin dc i2'8*57+1' Data Area Height dc i2'623' Data Area Width dc i2'186' Max Cont Height dc i2'623' Max Cont Width dc i2'8' Number of pixels to scroll vertically. dc i2'0' Number of pixels to scroll horizontally. dc i2'144' Number of pixels to page vertically. dc i2'0' Number of pixels to page horizontally. dc i4'0' Information bar text string. dc i2'0' Info bar height dc i4'0' DefProc. dc i4'0' Routine to draw info. bar. dc i4'WindUpdate' Routine to draw content. SizPos dc i'13,0,199,623' Size/pos of content dc i4'$FFFFFFFF' Plane to put window up in. dc i4'0' Address for window record (0 to allocate) WindowEnd anop HelpTitle str ' Help Window ' HelpText anop str 'COLOR : a sample program for trying things with color tables' dc i2'0' dc i3'0' str 'by Eagle I. Berns and Keith Rollin - Apple Computer Inc.' dc i2'0' dc i3'0' str 'This is a sample program that shows what can be done by using only' dc i2'0' str 'QuickDraw II and Event Manager routines. Its intent is to be a non-' dc i2'0' str 'desktop environment test program for checking out special color effects' dc i2'0' str 'on pictures. There are currently 3 effects from which to choose: the' dc i2'0' str 'first selectively changes the intensity to create a scrolling efect, the' dc i2'0' str 'second changes the intensity of all of the colors to create a fade in or' dc i2'0' str 'out effect, and the third sets the color palletes to random settings.' dc i2'0' dc i3'0' str 'Current Features are:' dc i2'0' dc i3'0' str ' Keys F, S, or Z' str '==>' str 'do Fade, Scroll, or Random effect' dc i2'0' str 'Note: Fade effect goes to Black or White' dc i2'0' str ' depending on U or D switch' dc i3'0' str ' Key I' str '==>' str 'do Fade - IN from a faded picture' dc i3'0' str ' Keys U or D' str '==>' str 'causes Scroll effect to Up or Down' dc i2'0' str 'causes Fade effect to fade in or out' dc i3'0' str ' Mouse Click' str '==>' str 'selects a screen color on which to' dc i2'0' str 'perform the effect (toggles on/off)' dc i3'0' str ' Key O' str '==>' str 'Turns off effect over entire picture' dc i3'0' str ' space bar' str '==>' str '3-way speed change loop for effect' dc i3'0' str ' Keys R, G, B' str '==>' str 'holds Red, Green, or Blue color component' dc i2'0' str 'constant while working effect by changing' dc i2'0' str 'intensity of other two' dc i3'0' str ' *Key X' str '==>' str 'exchange two colors on the screen - both' dc i2'0' str 'the pallette entries and the actual bits on the' dc i2'0' str 'screen are swapped. To select, click on the two' dc i2'0' str 'colors you want to move.' dc i3'0' str ' Keys H or V' str '==>' str 'flips image vert. (top/bot) or Horiz. (L/R)' dc i3'0' str ' *Key M (capital)' str '==>' str 'folds image horiz. (left->Right)' dc i3'0' str ' *Key m (lower)' str '==>' str 'folds image Vert. (top ->Bottom)' dc i3'0' str ' Key T' str '==>' str 'Toggle the instruction line between any' dc i2'0' str 'of 3 modes: the ''?'' line, a line with all' dc i2'0' str 'valid command keys, and no line at all.' dc i3'0' str ' Key L' str '==>' str 'calls SFGetFile to load a picture' dc i3'0' str ' escape' str '==>' str 'exits the program' dc i3'0' dc i3'0' str ' *note: the starred items above change the actual bit image, so the ''O''' dc i2'0' str ' option cannot reset image - to reset, just type the ''L'' key' dc i2'0' str ' and re-load the picture you want.' dc i2'0' dc h'ff' ; This signifies the end of the text HelpTxtEnd anop Window ds 4 END KaarData data OrigPort ds 4 SaveTable ds $20 NewTable ds $20 QDZPPointer ds 4 OldWindY ds 2 NewWindY ds 2 end MOV.PICTUFFuHUSTON!( '  ''MOVEPIC.C >'STARTUPa b$c%QD.SAMPLERF C PAINTX6 C t down ' _SoundShutdown rts end Flag GEQU $12 ; ItemTemplate - [Integer] oItemColor GEQU $14 ; ItemTemplate - [Longint] oDefProcParm GEQU $00 ; UserCtlItemPB - [Longint] oTitleParm GEQU $04 ; UserCtlItemPB - [Ptr] oParam2 GEQU $08 ; UserCtlItemPB - [Word] oParamLong GEQU $08 ; UserCtlItemPB - [Longint] oParam1 GEQU $0A ; UserCtlItemPB - [Word] ******************************************************************* * * * File: E16.WINDOW * * * * Version: 1.0 * * * * (c) Copyright 1986, 1987 Apple Computer, Inc. * *  * * All rights reserved. * * * * This program and its derivatives are licensed only for * * use on Apple computers. * * * * Works based on this program must contain and * * conspicuously display this notice. * * * * This software is provided for your evaluation and to * * assist you in developing software for the Apple IIGS * * computer. * * * * This is not a distribution license. Distribution of * * this and other Apple software requires a separate * * license. Contact the Software Licensing Department of * * Apple Computer, Inc. for details. * * * * DISCLAIMER OF WARRANTY * * * * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT * * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, * * WITH RESPECT TO ITS MERCHANTABILITY OR ITS FITNESS * * FOR ANY PARTICULAR PURPOSE. THE ENTIRE RISK AS TO * * THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH * * YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND * * NOT APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE) * * ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, * * REPAIR OR CORRECTION. * * * * Apple does not warrant that the functions * * contained in the Software will meet your requirements * * or that the operation of the Software will be * * uninterrupted or error free or that defects in the * * Software will be corrected. * * * * SOME STATES DO NOT ALLOW THE EXCLUSION * * OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY * * NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC * * LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS * * WHICH VARY FROM STATE TO STATE. * * * ******************************************************************* WNoConstraint GEQU $00 ; Axis parameter - No constraint on movement. WHAxisOnly GEQU $01 ; Axis parameter - Horizontal axis only. WVAxisOnly GEQU $02 ; Axis parameter - Vertical axis only. WNoHit GEQU $00 ; DefProc Hit Test Code - WInDesk GEQU $10 ; DefProc Hit Test Code - WInMenuBar GEQU $11 ; DefProc Hit Test Code - WInContent GEQU $13 ; DefProc Hit Test Code - WInDrag GEQU $14 ; DefProc Hit Test Code - WInGrow GEQU $15 ; DefProc Hit Test Code - WInGoAway GEQU $16 ; DefProc Hit Test Code - WInZoom GEQU $17 ; DefProc Hit Test Code - WInInfo GEQU $18 ; DefProc Hit Test Code - WInFrame GEQU $1B ; DefProc Hit Test Code - WInSysWindow GEQU $8000 ; DefProc Hit Test Code - ToBottom GEQU -2 ; SendBehind value - To send window to bottom. TopMost GEQU -1 ; SendBehind value - To make window top. BottomMost GEQU $00 ; SendBehind value - To make window bottom. WDraw GEQU $00 ; VarCode - Draw window frame command. WHit MACRO &lab _MMStartup &lab ldx #$0202 jsl $E10000 MEND MACRO &lab _NewHandle &lab ldx #$0902 jsl $E10000 MEND MACRO &lab _MTStartUp &lab ldx #$0203 jsl $E10000 MEND MACRO &lab _SoundStartUp &lab ldx #$0208 jsl $E10000 MEND MACRO &lab _SoundShutDown &lab ldx #$0308 jsl $E10000 MEND MACRO &lab _WriteRamBlock &lab ldx #$0908 jsl $E10000 MEND MACRO &lab _ReadChar &lab ldx #$220C jsl $E10000 MEND MACRO &lab Println &text &lab pea x&syscnt|-16 pea x&syscnt ldx #$1A0C jsl $E10000 bra end&syscnt x&syscnt dc i1"L:&text" dc c"&text" end&syscnt anop mend MACRO &LAB PUSHWORD &WHATTOPUSH LCLC &CHAR &CHAR AMID &WHATTOPUSH,1,1 AIF "&CHAR"="#",.IMMEDIATE &LAB LDA &WHATTOPUSH PHA MEXIT .IMMEDIATE &CHAR AMID &WHATTOPUSH,2,100 &LAB DC I1'$F4' DC I2'&CHAR' MEND MACRO &LAB PUSHLONG &WHATTOPUSH LCLC &CHAR &CHAR AMID &WHATTOPUSH,1,1 AIF "&CHAR"="#",.IMMEDIATE &LAB LDA &WHATTOPUSH+2 PHA LDA &WHATTOPUSH PHA MEXIT .IMMEDIATE &CHAR AMID &WHATTOPUSH,2,100 &LAB DC I1'$F4' DC I2'(&CHAR)|-16' DC I1'$F4' DC I2'&CHAR' MEND MACRO &lab setmode8 &lab sep #$30 longa off longi off MEND MACRO &lab setmode16 &lab rep #$30 longa on longi on mend MACRO &lab ErrorDeath &text &lab bcc end&syscnt pea 0 pea 0 pha ldx #$2A0B jsl $E10000 pla sta >y&syscnt pla sta >y&syscnt+2 pea x&syscnt|-16 pea x&syscnt ldx #$200C jsl $E10000 brk $F0 x&syscnt dc c"&text" dc c' Error was $' y&syscnt ds 4 dc i1'13,10,0' end&syscnt anop mend MACRO &lab _NSStartup &lab ldx #$0219 jsl $E10000 MEND MACRO &lab _NSShutdown &lab ldx #$0319 jsl $E10000 MEND MACRO &lab _AllocGen &lab ldx #$0919 jsl $E10000 MEND MACRO &lab _NoteOn &lab ldx #$0B19 jsl $E10000 MEND MACRO &lab _NoteOff &lab ldx #$0C19 jsl $E10000 MEND MACRO &lab _TLStartUp &lab ldx #$0201 jsl $E10000 MEND MACRO &lab _LoadTools &lab ldx #$0E01 jsl $E10000 MEND MACRO &lab _QUIT ¶ms &lab jsl $E100A8 dc i2"$29" dc i4"¶ms" MEND  ,@ GLK  GX "&% hit keys to play notes; esc to quit S "+* key codes become semitones. try shift... ""h)  ")""RH *"h h  " Memory Manager Mess up Error was $ h"MH *"hdhfE " Misc Tools touchy Error was $ z " loading note synth tool "TH *"hh " error loading note tools Error was $ H "GH *"hYh[@ " no memory ! Error was $ hhH"RH *"hh " bad sound tool startup Error was $ `@0GG:0G "HH *"h?hA% " writing wave Error was $ `=F"TH *"hh " Note synth startup error Error was $ `@ "GH *"hh " Alloc error Error was $ hHHp "LH *"hjhlL " Note on rejected Error was $ HH "EH *"hh " NoteOff ? Error was $ `@ KU"LH *"hFhH( " shutdown failed? Error was $ \ "  note synth has been shut down "`  GESHS  .d3f7E:Elzoz)Y.[2@5@GGGG?A%%inru  5j:l>LALrvFH((N\Q\ GEQU $01 ; VarCode - Hit test command. WCalcRgns GEQU $02 ; VarCode - Compute regions command. WNew GEQU $03 ; VarCode - Initialization command. WDispose GEQU $04 ; VarCode - Dispose command. FHilited GEQU $0001 ; WFrame - Window is highlighted. FZoomed GEQU $0002 ; WFrame - Window is zoomed. FAllocated GEQU $0004 ; WFrame - Window record was allocated. FCtrlTie GEQU $0008 ; WFrame - Window state tied to controls. FInfo GEQU $0010 ; WFrame - Window has an information bar. FVis GEQU $0020 ; WFrame - Window is visible. FQContent GEQU $0040 ; WFrame - FMove GEQU $0080 ; WFrame - Window is movable. FZoom GEQU $0100 ; WFrame - Window is zoomable. FFlex GEQU $0200 ; WFrame - FGrow GEQU $0400 ; WFrame - Window has grow box. FBScroll GEQU $0800 ; WFrame - Window has horizontal scroll bar. FRScroll GEQU $1000 ; WFrame - Window has vertical scroll bar. FAlert GEQU $2000 ; WFrame - FClose GEQU $4000 ; WFrame - Window has a close box. FTitle GEQU $8000 ; WFrame - Window has a title bar. WindSize GEQU $145 ; WindRec - Size of WindRec. WmTaskRecSize GEQU $16 ; WmTaskRec - Size of WmTaskRec. oParamLength GEQU $00 ; ParamList - Parameter to NewWindow. [Integer] oWFrameBits GEQU $02 ; ParamList - Parameter to NewWindow. [Word] oWTitle GEQU $04 ; ParamList - Parameter to NewWindow. [Ptr] oWRefCon GEQU $08 ; ParamList - Parameter to NewWindow. [DblWord] oWZoom GEQU $0C ; ParamList - Parameter to NewWindow. [Rect] oWColor GEQU $14 ; ParamList - Parameter to NewWindow. [Ptr] oWYOrigin GEQU $18 ; ParamList - Parameter to NewWindow. [Integer] oWXOrigin GEQU $1A ; ParamList - Parameter to NewWindow. [Integer] oWDataH GEQU $1C ; ParamList - Parameter to NewWindow. [Integer] oWDataW GEQU $1E ; ParamList - Parameter to NewWindow. [Integer] oWMaxH GEQU $20 ; ParamList - Parameter to NewWindow. [Integer] oWMaxW GEQU $22 ; ParamList - Parameter to NewWindow. [Integer] oWScrollVer GEQU $24 ; ParamList - Parameter to NewWindow. [Integer] oWScrollHor GEQU $26 ; ParamList - Parameter to NewWindow. [Integer] oWPageVer GEQU $28 ; ParamList - Parameter to NewWindow. [Integer] oWPageHor GEQU $2A ; ParamList - Parameter to NewWindow. [Integer] oWInfoRefCon GEQU $2C ; ParamList - Parameter to NewWindow. [DblWord] oWInfoHeight GEQU $30 ; ParamList - height of information bar [Integer] oWFrameDefProc GEQU $32 ; ParamList - Parameter to NewWindow. [Ptr] oWInfoDefProc GEQU $36 ; ParamList - Parameter to NewWindow. [Ptr] oWContDefProc GEQU $3A ; ParamList - Parameter to NewWindow. [Ptr] oWPosition GEQU $3E ; ParamList - Parameter to NewWindow. [Rect] oWPlane GEQU $46 ; ParamList - Parameter to NewWindow. [Longint] oWStorage GEQU $4A ; ParamList - Parameter to NewWindow. [Ptr] oFrameColor GEQU $00 ; WindColor - Color of window frame. [Word] oTitleColor GEQU $02 ; WindColor - Color of title and bar. [Word] oTBarColor GEQU $04 ; WindColor - Color/pattern of title bar. [Word] oGrowColor GEQU $06 ; WindColor - Color of grow box. [Word] oInfoColor GEQU $08 ; WindColor - Color of information bar. [Word] oWNext GEQU $00 ; WindRec - Pointer to next window Record. [WindRecPtr] oWPort GEQU $04 ; WindRec - Window's port. [GrafPortPtr] oWStrucRgn GEQU $BE ; WindRec - Region of frame plus content. [RgnHandle] oWContRgn GEQU $C2 ; WindRec - Content region. [RgnHandle] oWUpdateRgn GEQU $C6 ; WindRec - Update region. [RgnHandle] oWControls GEQU $CA ; WindRec - Window's control list. [Handle] oWFrameCtrls GEQU $CE ; WindRec - Window frame's control list. [Handle] oWFrame GEQU $D2 ; WindRec - Bit flags. [Integer] oWmWhat GEQU $00 ; WmTaskRec - [Word] oWmMessage GEQU $02 ; WmTaskRec - [DblWord] oWmWhen GEQU $06 ; WmTaskRec - [DblWord] oWmWhere GEQU $0A ; WmTaskRec - [Point] oWmModifiers GEQU $0E ; WmTaskRec - [Word] oWmTaskData GEQU $10 ; WmTaskRec - TaskMaster return value. [DblWord] oWmTaskMask GEQU $14 ; WmTaskRec - TaskMaster feature mask. [DblWord] $180,X STA COLORTABLE+$160,X LDA COLORTABLE+$1A0,X STA COLORTABLE+$180,X LDA COLORTABLE+$1C0,X STA COLORTABLE+$1A0,X LDA COLORTABLE+$1E0,X STA COLORTABLE+$1C0,X LDA COLORTABLE-$20,X STA COLORTABLE+$1E0,X INX INX CPX #32 BNE TABLP jsr tabset rts END ********************************************************** * * TABFADE: does a fade in or fade out of picture slowly * (used UPDWN switch also) * ********************************************************** TABFADE START using GlobalData lda unswitch ;fade in or out beq tout jmp tabfdin tout jmp tabfdout END tabfdout START using GlobalData lda UPDWN bne fadeBlack jmp fadeWhite fadeBlack anop ldx #0 tablp anop * blue lda colortable,x tay ;save in y AND #$000F beq cg tya DEC a jsr storit JMP noMo * green cg tya and #$00F0 beq cr tya sec sbc #$0010 jsr storit jmp nomo * red cr tya and #$0F00 beq nomo tya sec sbc #$0100 jsr storit nomo inx inx cpx #32 bne tablp jsr tabset rts fadeWhite anop ldx #0 tablp2 anop * blue lda colortable,x tay ;save in y AND #$000F CMP #$000F beq cg2 tya INC a jsr storit jmp nomo2 * green cg2 tya and #$00F0 CMP #$00F0 beq cr2 tya clc adc #$0010 jsr storit jmp nomo2 * red cr2 tya and #$0F00 cmp #$0F00 beq nomo2 tya clc adc #$0100 jsr storit nomo2 inx inx cpx #32 bne tablp2 jsr tabset rts storit sta colortable,x sta colortable+$20,x sta colortable+$40,x sta colortable+$60,x sta colortable+$80,x sta colortable+$A0,x sta colortable+$C0,x sta colortable+$E0,x sta colortable+$100,x sta colortable+$120,x sta colortable+$140,x sta colortable+$160,x sta colortable+$180,x sta colortable+$1A0,x sta colortable+$1C0,x sta colortable+$1E0,x rts END append dabbler2.src dc i'1024,1024' Scroll bar scaleing dc i'0,0' Max height and width {default} dc i'0,0' Scroll bar arrow offsets dc i'0,0' Scroll bar arrow offsets dc i4'0' InfoBar RefCon dc i'0' InfoBar Height dc i4'0' Def Proc {default} dc i4'0' No info bar routines dc i4'ReDrawB' Update routines Win1Rect dc i'25,8,187,310' dc i4'$FFFFFFFF' In front of everyone.. dc i4'0' memory pointer {mgr allocate} Wind1End Anop WindowRecF dc i'WindFEnd-WindowRecF' dc i'%0000000000000000' Frame type dc i4'WindowTitF' pointer to the title.. dc i4'$FFFFFFFF' RefCon dc i'00,00,00,00' zoomed rect dc i4'0' Color Table dc i'0,0' Verticle and horiz offsets dc i'1024,1024' Scroll bar scaleing dc i'0,0' Max height and width {default} dc i'0,0' Scroll bar arrow offsets dc i'0,0' Scroll bar arrow offsets dc i4'0' InfoBar RefCon dc i'0' InfoBar Height dc i4'0' Def Proc {default} dc i4'0' No info bar routines dc i4'0' Update routines dc i'40,05,110,300' dc i4'$FFFFFFFF' In front of everyone.. dc i4'0' memory pointer {mgr allocate} WindFEnd ANop MyString1 dc c'Brick Out Game By Jim Mensch',i1'0' MyString2 dc c'(c) 1986 Jim Mensch/ProSoft Software',i1'0' MyString3 dc c' ',i1'0' MyString4 dc c'Copyright Apple Computer, Inc.,',i1'0' MyString5 dc c'1986-87, All Rights Reserved',i1'0' MyString6 dc c'January 6, 1987 v1.0',i1'0' MyMess1 dc c'Balls Left:' MyMess11 dc c'0000',i1'0' MyMess2 dc c'Game Over!',i1'0' MyMess3 dc c'Your Score:' MyMess31 dc c'0000',i1'0' ; Menu data structure. This is the text format of the menu mgr MyMenuList ANOP Return equ 13 Ascii return char AplMenu dc c'> @\XN1',i1'Return' dc c' About This Game\N256',i1'Return' GameMenu dc c'> Game \N2',i1'Return' dc c' New Game\N257',i1'return' dc c' Computer Play\N258V',i1'return' dc c' Quit\N259*Qq',i1'Return' dc c'.' Mark the end of the menu END etMode16 * then you have to pump it over to the DOC, using the sound tools. pushlong #waveform ; arg1: src ptr pushword #0 ; doc start address pushword #$100 ; byte count _WriteRamBlock rts waveform ds 256 END **************************************************************** * * NoteStartup and NoteShutDown * **************************************************************** NoteStartup START pushword #150 ; 60 hz updates pushlong #0 ; no IRQ routine for me _NSStartup rts end NoteShutDown start _NSShutdown rts end **************************************************************** * * PlaySound * * Inputs: contents of a register used as pitch of note * * Outputs: sound * **************************************************************** PlaySound START using instdef sta semitone pushword #0 space for result pushword #64 middle of the road priority _AllocGen pla sta gennum pushword gennum pushword semitone pushword #112 ( med volume ) pushlong #instrum ; long ptr to instrument def _NoteOn * normally, you would wait before issuing a note off. Since this * instrument has a fast attack and a long release, it really isn't * necessary... pushword gennum pushword semitone _NoteOff rts semitone ds 2 gennum ds 2 END **************************************************************** instdef DATA * futz with bytes 4 and 5 (the $6340) for the decay instrum dc i1'$7f,0,$7F' ; env: ramp $7F00 to level $7F dc i1'$00,$40,20' ; decay at a slow rate of $0040 dc i1'0,0,0' ; to zero; use this stage for dc i1'0,0,0' ; release also. dc i1'0,0,0' dc i1'0,0,0' dc i1'0,0,0' dc i1'0,0,0' ; fill out 8 stages with 0's dc i1'1' ; release segment - 1 dc i1'32' ; priority inc dc i1'2' ; pitch bend range dc i1'20000' ; slight vibrato dc i1'200' ; vibrato speed dc i1'0' ; spare dc i1'1' ; number of waveptrs for osc A dc i1'1' ; number of waveptrs for osc B AWavelist dc i1'127,0,0,0,0,0' ; topkey,addr,size,ctrl,pitch BWavelist dc i1'127,0,0,0,16,0' ; detune b by 16/256 semitone END APPEND game.MAIN program must contain and * * conspicuously display this notice. * * * * This software is provided for your evaluation and to * * assist you in developing software for the Apple IIGS * * computer. * * * * This is not a distribution license. Distribution of * * this and other Apple software requires a separate * * license. Contact the Software Licensing Department of * * Apple Computer, Inc. for details. * * * * DISCLAIMER OF WARRANTY * * * * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT * * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, * * WITH RESPECT TO ITS MERCHANTABILITY OR ITS FITNESS * * FOR ANY PARTICULAR PURPOSE. THE ENTIRE RISK AS TO * * THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH * * YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND * * NOT APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE) * * ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, * * REPAIR OR CORRECTION. * * * * Apple does not warrant that the functions * * contained in the Software will meet your requirements * * or that the operation of the Software will be * * uninterrupted or error free or that defects in the * * Software will be corrected. * * * * SOME STATES DO NOT ALLOW THE EXCLUSION * * OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY * * NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC * * LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS * * WHICH VARY FROM STATE TO STATE. * * * ******************************************************************* * ******************************************************************* copy daleks.src1 copy daleks.src2 MountBootDisk START _SetPrefix SetPrefixParams _GetPrefix GetPrefixParams PushWord #0 ; space for result PushWord #195 ; x pos PushWord #30 ; y pos PushLong #PromptStr ; prompt string PushLong #VolStr ; vol string PushLong #OKStr PushLong #CancelStr _TLMountVolume pla rts PromptStr str 'Please insert the disk' VolStr ds 16 OKStr str 'OK' CancelStr str 'Shutdown' GetPrefixParams dc i'7' dc i4'VolStr' SetPrefixParams dc i'7' dc i4'BootStr' BootStr str '*/' END h'10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F' Line6 dc h'20' dc h'20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F' dc h'30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F' Line7 dc h'20' dc h'40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F' dc h'50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F' Line8 dc h'20' dc h'60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F' dc h'70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F' Line9 dc h'20' dc h'80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F' dcy dey lda [0],y tax lda [0] rts END **************************************************************** * * Unlock * * Unlocks the handle passed in x and a. 0 is trashed on zp. * **************************************************************** Unlock START sta 0 stx 2 ldy #4 lda [0],y and #$7FFF sta [0],y rts END h'90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F' Line10 dc h'20' dc h'A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF' dc h'B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF' Line11 dc h'20' dc h'C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF' dc h'D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF' Line12 dc h'20' dc h'E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF' dc h'F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF' END **************************************************************** * * DoChooseFont * **************************************************************** DoChooseFont START using GlobalDATA using FontDATA PushLong #0 _GetPort PushLong #TempPort _OpenPort PushLong #0 ; space for result PushLong DesiredFont PushWord #0 _ChooseFont lda 1,s ora 3,s bne ItChanged pla ; ChooseFont returned a 0000, so the pla ; font hasn't changed PushLong #TempPort _ClosePort _SetPort sec ; bad return rts ItChanged anop pla sta DesiredFont pla sta DesiredFont+2 pushword #0 ;space for result PushWord DesiredFont PushLong #R_Fname _GetFamInfo pla ;ignore result lda DesiredFont+3 ; get font size in a reg and #$00FF pha lda #^R_FName ; high word of pointer to name pha lda R_FName and #$00FF inc a adc #R_FName pha ; low word of pointer PushWord #4 ; output length PushWord #0 ; not signed _Int2Dec lda R_FName ; bump the length inc a inc a inc a inc a sta R_FName PushLong #TempPort _ClosePort _SetPort clc ;good return rts TempPort ds $AA ; size of graph port END **************************************************************** * * DispFontWindow * **************************************************************** DispFontWindow START using FontDATA using GlobalData ********** * * get my own zero page * ********** phb phk plb phd lda MyZP tcd ********** * * get the correct window port (got here from within taskmaster) * ********** pushlong #0 _GetPort plx ply ;get result for pushing in a sec. PUSHLONG #0 ;space for result phy phx ; saved the port here _GetWRefCon pla sta Temphandle plx stx TempHandle+2 jsr Deref ; de reference sta 0 stx 2 ldy #oFontID+2 ; get the font ID lda [0],y tax dey dey lda [0],y jsl ShowFont lda TempHandle ldx TempHandle+2 jsr Unlock pld plb rtl END **************************************************************** * * ShowFont * * Common routine to actually draw the contents of the window. * This routine is called with the font to install in the * in the A & X registers. * **************************************************************** ShowFont START using GlobalData using FontData phx ; save copy on stack pha phx ; install the font pha PushWord #0 _InstallFont PushLong #CurFontInfo ; Get its size infot _GetFontInfo stz LineCounter ; zero the line counter lda CFAscent ; calculate the line separation clc adc CFDescent sta CurHeight PushWord #0 ; start the pen position at 0,0 PushWord #0 _MoveTo plx ; get fontid off stack pushword #0 ; space for result phx ; family number was in x PushLong #Line0 _GetFamInfo pla ; ignore result pla ; high word of font id xba ; size in high byte and #$00FF pha lda #^Line0 ; high word of pointer to name pha lda Line0 and #$00FF inc a adc #Line0 pha ; low word of pointer PushWord #4 ; output length PushWord #0 ; not signed _Int2Dec lda Line0 ; bump the length inc a inc a inc a inc a sta Line0 PushWord #0 ; save prev set mono/pro flag _GetFontFlags ldy #oFlag ; keep the result on the stack while lda [0],y ; we set it to what we want (as lsr a ; defined by its window type set up and #$0001 ; when we opened this window) pha _SetFontFlags LineLoop anop PushLong #CurPos ; get the current position _GetPen PushWord #5 ; reset x position lda CurPos clc adc CurHeight pha ; and y position _MoveTo lda LineCounter ; draw current line asl a tax phk phk lda 1,s and #$00FF sta 1,s lda LineTable,x pha _DrawString inc LineCounter ; bump current line lda LineCounter cmp #NumLines bcc LineLoop _SetFontFlags ; restore from saved position rtl END **************************************************************** * * doSetMono * **************************************************************** doSetMono start using FontData using MenuData lda MonoFlag eor #$02 sta MonoFlag beq ChangeToMono ; change message to show effect of PushLong #ProMsg ; NEXT selection of this menu item bra PushID ChangeToMono PushLong #MonoMsg PushID PushWord #MonoID _SetItem rts ProMsg dc c' LDisplay Font as Proportional',i1'RETURN' MonoMsg dc c' LDisplay Font as Mono-spaced',i1'RETURN' end **************************************************************** * * InitStuff * * Gets space in bank zero for use as zero page by tools and * then initializes the tools we use. * * First I initialize the primary tools: * * Tool Locator, Memory Manager, Misc Tools * QuickDraw, Event Manager * * When these are intialized I put up the One moment please * string and call load tools. QuickDraw and the event manager * are initialized first because if the load tools call * fails because of the Boot VolWYZ[\]^_`abcdefghijume not being on line, I need * to have the volume mounted. The mount volume call * requires these tools to be already started. * * Next I start up * * Window Manager, Control Manager, * Menu Manager, LineEdit, Dialog Manager * * After these are initialized, I setup and draw the * menu bar and display a message to the user before I * initialize the Standard File and the Font Manager. * **************************************************************** InitStuff START using GlobalData using MenuData ;----------------------------------------------- ; ; Now we initialize all the tools we are going ; use. ; _TLStartup ; Tool locator ;------------------------------------------------- ; ; Initialize the memory manager. ; PushWord #0 _MMStartup ldx #1 jsr PrepareToDie pla sta MyID ;------------------------------------------------- ; ; Initialize misc tools. ; _MTStartup ldx #2 jsr PrepareToDie ;------------------------------------------------------ ; ; First get some memory for the zero page we need! ; PushLong #0 ; space for handle PushLong #$A00 ; ten pages PushWord MyID PushWord #$C005 ; locked, fixed, fixed bank, pg algned PushLong #0 _NewHandle ldx #3 jsr PrepareToDie pla sta 0 sta ZPHandle pla sta 2 sta ZPHandle+2 lda [0] sta 4 lda 4 ; zp to use pha PushWord ThisMode PushWord #160 ; max size of scan line PushWord MyID _QDStartup ldx #4 jsr PrepareToDie ldy #640 lda ThisMode cmp #$80 beq okmode ldy #320 okmode anop sty MaxX lda 4 ; zp to use = qd zp +$300 clc adc #$300 pha PushWord #20 ; queue size PushWord #0 ; x clamp low PushWord MaxX ; x clamp high PushWord #0 ; y clamp low PushWord #200 ; y clamp high PushWord MyID _EMStartup ldx #5 jsr PrepareToDie PushWord #20 PushWord #20 _MoveTo PushWord #0 _SetBackColor PushWord #$F _SetForeColor PushLong #MomentStr _DrawString _ShowCursor ;------------------------------------------------------- ; ; Load the tools i need ; LoadAgain PushLong #ToolTable _LoadTools bcc ToolsLoaded cmp #VolNotFound beq DoMount sec ldx #6 jsr PrepareToDie DoMount anop jsr MountBootDisk cmp #1 beq LoadAgain sec rts ToolsLoaded anop PushWord MyID _WindStartup ldx #7 jsr PrepareToDie PushLong #$0000 _RefreshDeskTop PushWord MyID lda 4 ; zp to use = qd zp +$400 clc adc #$400 pha _CtlStartup ldx #8 jsr PrepareToDie PushWord MyID lda 4 clc adc #$500 ; zp to use = qd zp +$500 pha _LEStartup ldx #8 jsr PrepareToDie PushWord MyID _DialogStartup ldx #9 jsr PrepareToDie PushWord MyID lda 4 ; zp to use = qd zp +$600 clc adc #$600 pha _MenuStartup ldx #10 jsr PrepareToDie ;------------------------------------------------------ ; ; Initialize the desk manager after all the tools required ; by desk accessories are started up. ; _DeskStartup ldx #11 jsr PrepareToDie jsr ShowMsg PushWord MyID lda 4 ; zp to use = qd zp +$700 clc adc #$700 pha _SFStartup ldx #12 jsr PrepareToDie jsr SetupMenus ;------------------------------------------------------- ; ; Now try to load the QDAux Tool Set and the ; Printing Manager. If it fails then we disable ; printing. ; PushWord #18 ; QDAux PushWord #$0000 _LoadOneTool bcs ToolLoadError PushWord #19 ; Printing Manager PushWord #$0000 _LoadOneTool bcs ToolLoadError _QDAuxStartup ; does not need id or zp _WaitCursor PushWord MyID lda 4 ; zp to use = qd zp +$900 clc adc #$900 pha _PMStartup ldx #14 jsr PrepareToDie JoinAgain anop ;------------------------------------------------------- ; ; Init the font manager down here, so that we can have ; the benefit of the watch from QDAux while we count ; up the fonts available to us. ; PushWord MyID lda 4 ; zp to use = qd zp +$800 clc adc #$800 pha _FMStartup ldx #13 jsr PrepareToDie jsr HideMsg _InitCursor clc rts ToolLoadError anop jsr WarningDialog PushWord #ChooseId _DisableMItem PushWord #SetupID _DisableMItem PushWord #PrintID _DisableMItem bra JoinAgain MomentStr str 'One moment please...' MaxX ds 2 END **************************************************************** * * ShutDownStuff * * Shuts down every thing started up in InitStuff * **************************************************************** ShutDownStuff START using GlobalData _DeskShutdown ; shut this first so that other tools ! ; are still around jsr HideAllWindows _FMShutDown _PMShutdown _SFShutDown _CtlShutdown _DialogShutdown _EMShutDown _LEShutdown _MenuShutDown _WindShutDown _QDAuxShutdown _QDShutDown _MTShutdown PushLong ZPHandle _DisposeHandle PushWord MyID _MMShutdown _TLShutdown rts END **************************************************************** * * PrepareToDie * * Dies if carry is set. * * Number to display as death number is in x register. * Error code to make part of string is in a register. * **************************************************************** PrepareToDie START bcs RealDeath rts RealDeath anop phx pea 0 pea 0 pha _Hexit pla sta codes pla sta codes+2 pla ora #$FF00 pha PushLong #DeathMsg _SysDeath DeathMsg anop dc i1'EndMsg-StartMsg' StartMsg dc c'Could not handle error ' Codes ds 4 dc c' ' EndMsg anop END **************************************************************** * * LoadOne * * Loads the picture whose path name is passed in * * NamePtr * * to address passed in * * PicDestIN * **************************************************************** LoadOne START using IOData _OPEN OpenParams bcc cont1 jmp Error1 cont1 anop lda OpenID sta ReadID sta CloseID _READ ReakmnodParams bcc cont2 jmp Error1 cont2 anop _Close CloseParams clc rts end **************************************************************** * * SaveOne * * Saves the picture whose path name is passed in * * NamePtr * * from address passed in * * PicDestOUT * **************************************************************** SaveOne START using IOData lda NamePtr sta NameC sta NameD lda NamePtr+2 sta NameC+2 sta NameD+2 _Destroy DestParams lda #$c1 ; SuperHires picture type sta CType lda #0 ; standard type = 0 sta CAux _Create CreateParms bcc cont0 jmp Error1 Cont0 _OPEN OpenParams bcc cont1 jmp Error1 cont1 anop lda OpenID sta WriteID sta CloseID _WRITE WriteParams bcc cont2 jmp Error1 cont2 anop _Close CloseParams clc rts end ******************************************************************* * Menu item ID's * ******************************************************************* MenuIDs start AppleMenuID gequ 1 FileMenuID gequ 2 EditMenuID gequ 3 ModeMenuID gequ 4 WindowsMenuID gequ 5 FontsMenuID gequ 6 UndoID gequ 250 ; These next 6 are standard and CutID gequ 251 ; required for DA support under CopyID prstuvwxyz{|}~ gequ 252 ; TaskMaster. PasteID gequ 253 ClearID gequ 254 CloseWID gequ 255 AboutID gequ 256 ; These are our own responsibility QuitID gequ 257 OpenWID gequ 258 SaveID gequ 259 ChooseID gequ 260 SetupID gequ 261 PrintID gequ 262 ModeID gequ 263 ShowFontID gequ 264 MonoID gequ 265 ShowVersID gequ 266 end **************************************************************** * * DoMenu * * Called when task master tells me that a menu item has * been selected. * **************************************************************** DoMenu START using GlobalDATA lda TaskDATA cmp #299 ; 299 is dummy do nothing - ignore beq Unhilite ; do nothing bge DoWItem ; 300 and up are added windows sec sbc #UndoID asl a tax jsr (MenuTable,x) Unhilite anop PushWord #False ; draw normal PushWord TaskDATA+2 ; which menu _HiliteMenu rts MenuTable anop dc i'ignore' ; Edit items dc i'ignore' dc i'ignore' dc i'ignore' dc i'ignore' dc i'doCloseItem' dc i'doAboutItem' dc i'doQuitItem' dc i'doOpenItem' dc i'doSaveItem' dc i'doChooserItem' dc i'doSetupItem' dc i'doPrintItem' dc i'doChangeRes' dc i'doOpenItem' dc i'doSetMono' dc i'doShowVers' DoWitem anop sec sbc #300 ProcessW anop ; In A is window number asl a asl a ; times 4 to index window list tax lda windowlist,x sta WhichWindow lda windowlist+2,x sta whichwindow+2 jsr dowindow jmp unhilite ; done with it END **************************************************************** * * SetupMenus * * Now build the menu bar by inserting the six menus * (back to front). * **************************************************************** SetupMenus START using MenuDATA PushLong #0 ; space for return PushLong #FontsMenu _NewMenu PushWord #0 _InsertMenu PushLong #0 ; space for return PushLong #WindowsMenu _NewMenu PushWord #0 _InsertMenu PushLong #0 ; space for return PushLong #ModeMenu _NewMenu PushWord #0 _InsertMenu PushLong #0 ; space for return PushLong #EditMenu _NewMenu PushWord #0 _InsertMenu PushLong #0 ; space for return PushLong #FileMenu _NewMenu PushWord #0 _InsertMenu PushLong #0 ; space for return PushLong #AppleMenu _NewMenu PushWord #0 _InsertMenu ;------------------------------------------------------ ; ; Call the desk accessory manager to install the ; list of NDAs in the system. ; PushWord #1 _FixAppleMenu ;------------------------------------------------------ ; ; Finish off getting the menu bar ready. ; PushWord #0 _FixMenuBar pla ; discard menu bar height _DrawMenuBar rts END **************************************************************** * * AddToMenu: * * Use the fact that the last SFGTEFILE returned in REPLY record * the name of the file and the state of the request * **************************************************************** AddToMenu START using GlobalDATA pushlong #0 ;it's the front window we're adding in _FrontWindow pla sta whichwindow plx stx whichwindow+2 ;get result for pushing in a sec. PUSHLONG #0 ;space for result PUSHLONG whichwindow _GetWrefCon ;refcon has handle to data pla sta Temphandle plx stx TempHandle+2 jsr Deref ; de reference sta 0 stx 2 PushWord Windex ;font's size PushLong #Iddgt ;ptr to string PushWord #2 ;length of string PushWord #0 ;unsigned integer _Int2Dec ;convert size into an ASCII string lda iddgt ora #'00' sta iddgt ldy #oLength ;get names length lda [0],y ;find end of string to slide stuff and #$FF clc adc #6 tay ; y index off ids is where we store ldx #0 ; x index off idn is where we load cpyidlp lda idn,x sta [0],y iny iny inx inx cpx #6 ; do 6 bytes bne cpyidlp lda 0 ;now pt. to itemlist loc. for insert clc adc #4 tax lda 2 adc #0 pha phx PUSHWORD #$FFFF PUSHWORD #WindowsMenuID _InsertMItem lda windex ; if first time, omit dummy 299 bne goon PushWord #299 ; 299 is dummy item to delete _DeleteMItem ; it's gone, now add next one goon lda #0 ; re-calc size pha pha PushWord #WindowsMenuID _CalcMenuSize lda Windex ; save off window Pointer for menu stuff asl a asl a tax ;*4 for WINDOWLIST index lda whichwindow sta WindowList,x tay lda whichwindow+2 sta WindowList+2,x inc windex ; bump counter for next add on lda temphandle ldx temphandle+2 jsr unlock ; ok, let this loose again rts idn dc c'\N3' ; "\N3nn" will slide in behind it iddgt dc c'00' ;00->15 slides into nn idcr dc i1'13' ;and finally a carriage return iddmy dc i1'0' ;a dummy so we slide exactly 8 END **************************************************************** * * Menu Data * **************************************************************** MenuData DATA Return equ 13 AppleMenu dc c'>L@\XH',i'AppleMenuID',i1'RETURN' dc c' LAbout HodgePodge...\H',i'AboutID',i1'RETURN' dc c' LAbout Tools...\VH',i'ShowVersID',i1'RETURN' dc c'.' EditMenu dc c'>L Edit \H',i'EditMenuID',i1'RETURN' dc c' LUndo\V*ZzH',i'UndoID',i1'RETURN' dc c' LCut\*XxH',i'CutID',i1'RETURN' dc c' LCopy\*CcH',i'CopyID',i1'RETURN' dc c' LPaste\V*VvH',i'PasteID',i1'RETURN' dc c' LClear\H',i'ClearID',i1'RETURN' FileMenu dc c'>L File \H',i'FileMenuID',i1'RETURN' dc c' LOpen\*OoH',i'OpenWID',i1'RETURN' dc c' LClose\H',i'CloseWID',i1'RETURN' dc c' LSave as...\VH',i'SaveID',i1'RETURN' dc c' LChoose Printer...\H',i'ChooseID',i1'RETURN' dc c' LPage Setup...\H',i'SetupID',i1'RETURN' dc c' LPrint...\V*PpH',i'PrintID',i1'RETURN' dc c' LQuit\*QqH',i'QuitID',i1'RETURN' dc c'.' ModeMenu dc c'>L Mode \H',i'ModeMenuID',i1'RETURN' dc c' LSwitch Graphics Mode\H',i'ModeID',i1'RETURN' dc c'.' WindowsMenu dc c'>L Windows \H',i'WindowsMenuID',i1'RETURN' dc c' LNo Windows allocated\N299',i1'RETURN' dc c'.' FontsMenu dc c'>L Fonts \H',i'FontsMenuID',i1'RETURN' dc c' LDisplay font...\*FfH',i'ShowFontID',i1'RETURN' dc c' LDisplay font as mono-spaced\H',i'MonoID',i1'RETURN' dc c'.' ******NOTE: 300 is starting number for a building list - used in AddToMenu ****** 299 is the dummy one that is deleted when we get a real one END ****************************************************************** * * DoChangeRes * * Changes the resolution from 320 to 640 or vice versa * **************************************************************** DoChangeRes START using GlobalData BoundsRect equ 8 PortRect equ 16 ThisWindow equ 0 ;zero page temp for window ptr. LclIdx equ 4 ;one more for counter _WaitCursor ;-------------------------------------------------------- ; ; First I close all the NDAs since these may have to ; be re-initialized to run in the other mode. ; _CloseAllNDAs ;-------------------------------------------------------- ; ; Hide all the windows because it looks mighty strange ; with the windows open. ; jsr HideAllWindows ;-------------------------------------------------------- ; ; Now figure out what mode we are in and change it to the ; other mode. ; PushWord #0 _GetMasterSCB pla eor #$0080 pha pha and #$0080 sta ThisMode _SetMasterSCB _SetAllSCBs PushLong #$E19E00 ; re init the primary color table _InitColorTable _InitCursor _WaitCursor PushLong OrigPort _InitPort _HideCursor PushWord #0 lda ThisMode and #$0080 beq M320 PushWord #640 bra MaxXDone M320 PushWord #320 MaxXDone PushWord #0 PushWord #200 _ClampMouse _HomeMouse _ShowCursor _WindNewRes _MenuNewRes _CtlNewRes PushLong #0 _RefreshDeskTop lda Windex ;now modify all windows in WindowList sta LclIdx ;use this var for local storage DoLoop lda LclIdx bne dodem ;any more? if not, go re-show hid ones jmp almostDone DoDem dec a sta LclIdx asl a asl a tax lda WindowList,x sta ThisWindow lda Windowlist+2,x sta ThisWindow+2 ldy #BoundsRect+2 lda [ThisWindow],y eor #$FFFF inc a asl a ldx ThisMode bne Store1 lsr a lsr a Store1 pha ldy #BoundsRect lda [ThisWindow],y eor #$FFFF inc a pha PushLong ThisWindow _MoveWindow ldy #PortRect+6 lda [ThisWindow],y asl a ldx ThisMode bne Store2 lsr a lsr a Store2 pha ldy #PortRect+4 lda [ThisWindow],y pha PushLong ThisWindow _SizeWindow pea nullRect|-16 ; fix the zoom rect pea nullRect PushLong ThisWindow _SetzoomRect PushLong #0 ; fix the max grow size. PushLong ThisWindow _SetMaxGrow jmp DoLoop almostdone anop adlop ldx Vindex ;bring back what was hidden beq done dex dex dex dex stx Vindex lda Vtable+2,x ; get a convenient pointer to the window sta WhichWindow+2 lda Vtable,x sta WhichWindow PUSHLONG WhichWindow ; put it up front _SelectWindow PUSHLONG WhichWindow ; and show it _ShowWindow PUSHLONG #0 ; Determine whether or not to halve the PUSHLONG whichwindow ; data area width (yes for pics, no for _GetWrefCon ; fonts) pla ; This is handle a to our personal plx ; window data structure. jsr deref sta 0 stx 2 ldy #oFlag ; check if picture lda [0],y bne DontHalve ; 0 = pictures, 1 or 3 = fonts jsr HalveWidth DontHalve anop bra adlop done anop _InitCursor rts HalveWidth anop PushWord #0 ;space for width pushWord #0 ;space for height PushLong WhichWindow _GetDataSize lda 3,s ;width of data area asl a ldx ThisMode bne Store0 lsr a lsr a Store0 sta 3,s PushLong WhichWindow _SetDataSize rts LoclWindow ds 4 lclcnt ds 2 END **************************************************************** * * UnPackOne * * UnPacks the picture whose path name is passed in * * NamePtr * * to address passed in * * PicDestIN * **************************************************************** UNPackOne START using IOData using GlobalData using PackData _OPEN OpenParams bcc *+5 jmp Error1 lda OpenID ; open the file and read in the sta PReadID ; first 4 bytes in order to find out sta CloseID ; how large the first part of the sta MarkID ; file is lda #HeaderBuff sta PReadLoc lda #^HeaderBuff sta PReadLoc+2 lda #4 sta PReadSize stz PReadSize+2 _READ PReadParams bcc *+5 jmp Error1 lda HeaderBuff ; read in the number of bytes in the sta PReadSize ; first section lda HeaderBuff+2 sta PreadSize+2 ; now get some memory for the packed file PushLong #0 ; space for result PushLong PReadSize ; size PushWord MyID ; id PushWord #$0000 ; no restrictions PushLong #0 ; loc not important _NewHandle pla sta TempHndl plx stx TempHndl+2 jsr DeRef sta 4 sta PReadLoc stx 6 stx PReadLoc+2 stz mark ; reset to the start of the file stz mark+2 _SetMark markparams _Read PReadparams ; now read in the first part bcc *+5 jmp Error _Close CloseParams jsr GetPallets bcs unpackError jsr GetSCBs bcs unpackError jsr GetScanLines bcs unpackError PushLong TempHndl _DisposeHandle clc exit rts unpackError anop lda #$80 jsr Error sec rts HeaderBuff ds 4 END **************************************************************** * * GetPallets - This routine will get the pallet array and * move it to its final destination, as indicated by * PicDestIN. * **************************************************************** GetPallets start using IOData using PackData ldy #$0d ; get the number of pallets lda [4],y sta NumPallets iny ; point it to the pallets array iny sty WBPointer clc ; now make a pointer to where it goes lda PicDestIN adc #$7e00 sta 0 lda PicDestIN+2 adc #0 sta 2 sec lda 0 sbc WBPointer sta 0 lda 2 sbc #0 sta 2 loop1 ldx #16 loop2 anop ; move the pallet lda [4],y sta [0],y iny iny dex bne loop2 dec NumPallets ; have we moved all of the pallets? bne loop1 ; no, move the next one sty WBPointer clc rts NumPallets ds 2 end **************************************************************** * * GetSCBs - This routine will get the SCBs from the ScanLine * Directory and mvoe them to their final destinations, * as indicated by PicDestIN. * **************************************************************** GetSCBs start using IOData using PackData ldy WBPointer ; get the number of Scanlines lda [4],y sta NumEntries sta ScanCounter iny iny sty WBPointer sty CTPointer ; keep a pointer to the DirEntry array clc ; now make a pointer to where it goes lda PicDestIN adc #$7d00 sta 0 lda PicDestIN+2 adc #0 sta 2 ldx #0 loop anop ; move the pallet iny ; point to SCB part of dir entry iny lda [4],y phy txy sep #$20 ; store in 8-bit mode sta [0],y rep #$20 ply iny ; point to next directory entry iny inx ; point to next SCB location dec NumEntries ; have we moved all of the SCBs? bne loop ; no, move the next one sty WBPointer ; now pointing to start of packed array clc rts NumEntries ds 2 end **************************************************************** * * GetScanLines * * This routine is not as general as it could have been. It trys to * handle any size scan line but only keeps 160 bytes worth of data. * Additionally, it only keeps 200 scan lines worth of data. * **************************************************************** GetScanLines start using PackData using IOData ldy #9 ; get the Master SCB mode lda [4],y sta Mode iny iny lda [4],y ; get the number of pixels/line sta PixelsPerLine lsr a ; now find the number of bytes per line sta BytesPerLine ; by dividing PixelsPerLine by 2 if we lda Mode ; are in 640 mode, and 4 if in 320 mode. and #$0080 beq mode320 lsr BytesPerLine mode320 anop ; Clip to 200 scan lines. ; lda ScanCounter cmp #200 bcc OKNSL ; = "OK Number of Scan Lines" lda #200 ; limit number of scanlines to 200 sta ScanCounter OKNSL anop loop anop ; lda BytesPerLine ; put this back in for real unpacking lda #160 ; unpack 160 bytes max right now sta LineSize pushword #0 ; space for result clc ; push pointer to packed data lda 4 adc WBPointer tay lda 6 adc #0 pha phy ldy CTPointer ; push packed data length lda [4],y pha pushlong #picDestIN ; These get adjusted by UnPackBytes pushlong #LineSize _UnPackBytes ; UnPack the rest of the file pla ; get rid of this ldy CTPointer ; point to next set of packed bytes lda [4],y clc adc WBPointer sta WBPointer iny ; point to next directory entry so that iny ; we know how long the next string of iny ; packed bytes is. iny sty CTPointer dec ScanCounter ; have we done all lines? bne loop ; no - keep going clc rts LineSize ds 4 Mode ds 2 PixelsPerLine ds 2 BytesPerLine ds 2 end **************************************************************** * * PackOne * * Packs the picture whose path name is passed in * * NamePtr * * from address passed in * * PicDestOUT * **************************************************************** PackOne START using IOData using PackData jsr PackThePicture lda NamePtr sta NameC sta NameD lda NamePtr+2 sta NameC+2 sta NameD+2 _Destroy DestParams lda #$c0 ; packed picture type sta CType lda #2 ; Apple preferred sta CAux _Create CreateParms bcc cont0 jmp Error Cont0 _OPEN OpenParams bcc cont1 jmp Error cont1 anop lda OpenID sta PackWID sta CloseID _WRITE PackWParams bcc *+5 jmp Error _Close CloseParams PushLong TempHndl _DisposeHandle clc rts end **************************************************************** * * PackThePicture - This routine: * - creates a handle to a temporary packing buffer * - stores a pointer to the buffer in PackWDest * - packs the picture pointed to by PicDestOUT and stores * it at the location pointed to by PackWDest * - stores the length of the packed file in HowMany * **************************************************************** PackThePicture start using GlobalData using IOData Using PackData PushLong #0 ; space PushLong #$8000 ; size PushWord MyID ; id PushWord #$0000 ; no restrictions PushLong #0 ; loc not important _NewHandle pla sta TempHndl plx stx TempHndl+2 jsr DeRef sta PackWDest stx PackWDest+2 jsr PackIt sta HowMany ; return with length in Acc stz HowMany+2 rts end **************************************************************** * * PackIt - this routine does tha actual packing. It takes the * data pointed to by PicDestOUT, packs it, and stores * it in the buffer pointed to by PackWDest. Exits with * the block length in the Acc. * **************************************************************** PackIt start Using GlobalData using IOData using PackData stz WBPointer ; master counter through buffer stz CBStart ; pointer to start of current block lda PackWDest ; get a ZP pointer to dest block sta 0 lda PackWDest+2 sta 2 lda #MainStr jsr SetIDString ; Y exits pointing to next byte PushWord #0 ; store the MasterMode _GetMasterSCB pla ldy WBPointer sta [0],y iny iny and #$0080 ; are we in 320 or 640 mode? beq mode320 lda #640 bra cont1 mode320 lda #320 cont1 sta [0],y ; fake PixelsPerScanLine iny iny jsr SaveColorTables jsr SaveScanLines jsr SetBlockLength lda #PatsStr jsr SetIDString ldy WBPointer lda #0 ; signify no patterns lda [0],y iny iny sty WBPointer jsr SetBlockLength lda #ScibStr jsr SetIDString jsr SetBlockLength ; no screen info patterns lda WBPointer rts end * * Puts an ID string in the buffer. Enter with Acc pointer to the * string location, and Y equal to the buffer pointer. This routine * will exit with Y pointer to the next buffer location. * SetIDString start using PackData sta 4 ; store the string pointer here lda CBStart ; calculate position for the string clc adc #4 sta temp ldx #0 ; use x as a byte counter loop anop txy ; get the source byte lda (4),y pha ; save our source byte for a bit txa ; now make a destination pointer clc adc temp tay pla ; get the source byte back sta [0],y ; and store it out inx ; bump the byte count cpx #4 ; copy 4 bytes bcc loop clc ; set WBPointer to point after the lda #9 ; IDString adc CBStart sta WBPointer rts end * * Stores the length of the current block (calculated by subtracting CBStart * from WBPointer) in [CBStart]. Sets CBStart to WBPointer. * SetBlockLength start Using PackData lda WBPointer ; Calculate the length of the block sec ; and store it at (CBStart) sbc CBStart ldy CBStart sta [0],y iny iny lda #0 sta [0],y lda WBPointer sta CBStart rts end SaveColorTables start using IOData lda #16 ; store number of pallets (16) sta [0],y iny ; Now start storing color tables iny ldx #0 ; use X as color table counter loop anop phx ; save these for later phy lda 2 ; make a pointer to the location sta 6 ; within our packing buffer where we clc ; want the color table tya adc 0 sta 4 jsr GetColorTable ; Get the table (now safely stored) pla ; get buffer location back from stack clc ; point to next color table destination adc #$20 tay plx ; get the color table counter back inx ; bump color table counter cpx #16 ; do 16 tables bcc loop rts GetColorTable anop txa asl a ; multiply color table # by 32 asl a ; so we can make a pointer to it asl a asl a asl a * 10 = Acc + #$7E00 + PicDestOut clc adc #$7E00 adc PicDestOut sta 8 lda PicDestOut+2 adc #0 sta 10 ; [8] now points to color pallets ldy #30 ; now copy the table loop2 anop lda [8],y sta [4],y dey dey bpl loop2 rts end SaveScanLines start using PackData using IOData lda #200 ; do 200 scanlines sta ScanCounter sta [0],y iny iny sty CTPointer ; pointer to scanline directory asl a ; calculate length of scanline asl a ; directory by multiplying by 4 clc ; add it to directory length to get adc CTPointer ; relative offset to PackedScanlines sta WBPointer ; array lda WBPointer ; make an absolute pointer to the clc ; place to put the packed bytes adc PackWDest sta Temp lda PackWDest+2 adc #0 sta temp+2 clc lda PicDestOut ; get a pointer to the SCBs adc #$7d00 sta 4 lda PicDestOut+4 adc #0 sta 6 loop anop lda #160 sta TempLength PushWord #0 ; space for result PushLong #PicDestOut ; source location PushLong #TempLength ; source length PushLong Temp ; destination location PushWord #$ffff ; maximum length _PackBytes pla ldy CTPointer ; save length of packed scanline sta [0],y clc ; bump destination location by that adc Temp ; amount sta Temp lda #0 adc Temp+2 sta Temp+2 iny iny phy ; now store its SCB in the directory ldy ScanCounter dey lda [4],y ply sta [0],y iny iny sty CTPointer dec ScanCounter bne loop ; have we done 200 lines? sec ; update WBPointer lda Temp sbc PackWDest sta WBPointer rts end PackData data TempHndl ds 4 WBPointer ds 2 ; master counter through block CBStart ds 2 ; pointer to start of current block CTPointer ds 2 ; pointer to current table TempLength ds 2 ; 160 bytes/scanline Temp ds 4 ScanCounter ds 2 MainStr str 'MAIN' PatsStr str 'PATS' ScibStr str 'SCIB' end **************************************************************** * * Error - called by LoadOne, SaveOne, UnpackOne, and PackOne * **************************************************************** Error start using PackData using ioData PushLong TempHndl _DisposeHandle Error1 entry _Close closeparams jsr FatalError rts END **************************************************************** * * Ignore * * Does not do a whole lot. * **************************************************************** Ignore START rts END **************************************************************** * * Deref * * Derefs and locks the handle passed in a,x. Result passed back * in a,x. Trashes 0 on zp. * **************************************************************** Deref START sta 0  stx 2 ldy #4 lda [0],y ora #$8000 sta [0],y dey dey lda [0],y tax lda [0] rts END **************************************************************** * * Unlock * * Unlocks the handle passed in x and a. 0 is trashed on zp. * **************************************************************** Unlock START sta 0 stx 2 ldy #4 lda [0],y and #$7FFF sta [0],y rts END **************************************************************** * * HideAllWindows: * **************************************************************** HideAllWindows START using GlobalDATA stz VIndex ;index for list of what was vis. HideLoop PushLong #0 ;hide 'em all, looks neater _FrontWindow ldx VIndex pla sta VTable,x pla sta VTable+2,x  cmp #0 bne dohid lda Vtable,x bne dohid rts ;all vis. windows hidden now doHid pha lda Vtable,x pha _HideWindow Lda Vindex clc adc #4 sta Vindex bra HideLoop END **************************************************************** * * DoOpenItem : * * 1) Call OpenAWindow to let the user see it * * 2) Call AddToMenu to add its name into the "windows" menu list * * **************************************************************** DoOpenItem START using GlobalDATA using FontDATA jsr OpenAWindow bcs done ;if we didn't open, don't add it jsr AddToMenu done rts END **************************************************************** * * DoSaveitem : * * **************************************************************** DoSaveItem START using GlobalDATA using IOData pushlong #0 ;it's the front window we're saving _FrontWindow pla sta whichwindow plx stx whichwindow+2 ;get result for pushing in a sec. PUSHLONG #0 ;space for result PUSHLONG whichwindow _GetWrefCon ;refcon has handle to data pla plx jsr deref sta 0 sta Refptr stx 2 stx Refptr+2 ldy #oFlag ;check if picture lda [0],y beq oktosav ;save only type 0 windows rts oktosav PUSHLONG #0 ;space for result PUSHLONG whichwindow _GetWTitle pla sta NamePtr plx stx NamePtr+2 lda #13 ; init to 'Save Normal' sta SaveType PushWord #20 ; x loc PushWord #20 ; y loc. PushLong #Prompt2 ; prompt string pointer PushLong NamePtr ; File name Pushword #15 ; Max file name length PushWord #0 ; Determine which template to use _GetMasterSCB pla and #$0080 bne Save640 PushLong #SFP320Temp bra cont Save640 PushLong #SFP640Temp cont PushLong #SFPDHook ; push on the adress of our Dlg hook PushLong #reply ; reply list result _SFPPutFile lda r_good ; <>0 means OK to load it bne Saveitoff rts Saveitoff anop _WaitCursor lda Refptr sta 0 lda Refptr+2 sta 2 ldy #oHandle lda [0],y sta PicHandle iny iny lda [0],y sta PicHandle+2 ; this de-refd, is the data to write oute pichandle (we'll de-allocate) lda PicHandle ldx PicHandle+2 jsr DeRef sta PicDestOUT stx PicDestOUT+2 ; now pointing to what we write lda #R_fullPN ; put pointer to name in i/o param block sta NamePtr lda #^R_FullPN sta NamePtr+2 lda SaveType ; check for pack, no? fix name cmp #13 beq fixnm jsr Packone ;go Pack the file lda PicHandle ldx PicHandle+2 jsr Unlock _InitCursor rts fixnm lda refptr ; now fix up name clc adc #oLength ; where the name will go sta 0 ; save in 0,2 also for later indirect sta refptr lda refptr+2 adc #0 sta 2 sta refptr+2 lda r_Fname and #$00FF tay sep #%00100000 longa off cpynm lda r_Fname,y sta [0],y dey bpl cpynm rep #%00100000 longa on jsr saveone pushlong refptr ;(it points to string now, remember?) pushlong whichwindow _SetWTitle lda PicHandle ldx PicHandle+2 jsr Unlock lda #0 ; re-calc size pha pha PushWord #4 _CalcMenuSize _InitCursor rts refptr ds 4 END **************************************************************** * * OpenAWindow: * * 1) Call SFGETFILE to get name of file to display in window * (or the dialog to select font if Display Font call) * * 2) Gets memory for, and loads the picture/font data into memory * * 3) Allocates a new window * a) puts handle to MyWindowInfo in WrefCon * b) note that routine to draw picture contents is set to "PAINT" * c) note for font draw contents is "DISPFONTWINDOW" * * The definition of MyWindowInfo is contained in global data * * If the menu manager is being used to add itemlist items with the file * name, it will squeeze the \N etc. together (see AddToMenu). In any * case, the file name string for the window title can still be found * starting at this area+5 * * returns: carry set - didn't open it (user cancelled SFGETFILE) * carry clear - window opened * **************************************************************** OpenAWindow START using GlobalDATA using IOData using FontDATA using WindowData lda TaskData cmp #ShowFontID ; is it open for font window? bne AskUser jsr DoChooseFont bcs stp jmp DoTheOpen stp rts ;cancelled choose font ******** * * call SFGETFILE to request the file name * ******** AskUser lda #20 pha ; x loc. lda #20 pha ; y loc. PushLong #Prompt ; prompt string pointer PushLong #OpenFilter ; allow only auxtype = 2 PushLong #typeList ; list of types to include PushLong #reply ; reply list result _SFGetFile lda r_good ; <>0 means OK to load it bne loaditup sec ; carry set return: didn't open HandleError rts ********* * * Get space for the picture file * ******** LoadItUp anop _WaitCursor PushLong #0 ; space PushLong #$8000 ; size PushWord MyID ; id PushWord #$0000 ; no restrictions PushLong #0 ; loc not important _NewHandle pla sta PicHandle plx stx PicHandle+2 bcs HandleError ; if error occured from no handle jsr Deref ; derefence handle (in a,x) sta PicDestIN ; put pointer in i/o param block stx PicDestIN+2 DoTheOpen PushLong #0 ; space PushLong #MyWinfoSize ; size PushWord MyID ; id PushWord #$C000 ; fixed and locked PushLong #0 ; loc not important _NewHandle pla sta refcon plx stx refcon+2 bcs HandleError jsr deref ;de ref. for storing stuff into sta refptr sta 0 stx refptr+2 stx 2 ********* * * Start by assuming this will be a picture window (not a font window). * We set the address of the drawing routine to PAINT and set the flag * in MyWindowInfo record to 0 indicating picture. * ********* lda #Paint ; first the address of the Paint sta DrawRtn ; routine lda #^Paint sta DrawRtn+2 ldy #oFlag ; Now set the flag field lda #0 sta [0],y ;------------------------------------------------------------ ; ; Now we see if that silly assumption above was correct. ; lda TaskData ; look at the menu item that cmp #ShowFontID ; brought us here. bne setIO ; not the font one so go on lda #1 ; fix the flag field ora MonoFlag ; set bit 1 if monospaced font sta [0],y ; (y still set) lda DesiredFont ; put the chosen fontid where sta PicHandle ; we will later put it in lda DesiredFont+2 ; the MyWindowInfo record sta PicHandle+2 lda #DispFontWindow ; finally, fix the pointer to the sta DrawRtn ; drawing routine lda #^DispFontWindow sta DrawRtn+2 jmp DoMovNam SetIO lda #R_fullPN ; put pointer to name in i/o param block sta NamePtr lda #^R_FullPN sta NamePtr+2 ********* * * load picture in "NamePtr" into "PicDest" * ********* * check for packed or unpacked file load lda r_type ; if the file type is $C0 then do cmp #$C0 ; open packed. beq OpPack ; else, just read in the right num ; ; of bytes. jsr LoadOne ; load it bcc DoMovNam IOError anop ; There was an error loading the file PushLong RefCon ; so dispose of the memory that we _DisposeHandle ; allocated while trying to create PushLong PicHandle ; this window _DisposeHandle sec rts OpPack jsr UnPackOne ; UnpackIt bcs IOError ********** * * Move the files name into the param block * ********** DoMovNam lda refptr ;use zero page for indirect stores sta 0 lda refptr+2 sta 2 lda pichandle ;into the recfon area (refptr) ldy #oHandle sta [0],y iny iny lda pichandle+2 sta [0],y ldy #oBlank ; Put blank in record at blank field lda #' ' ; (note this 16 bit store will over- sta [0],y ; write the length field but we don't ; ; care since we fix it below. lda refptr clc adc #oLength ; where the name will go sta windaddr sta 0 ; save in 0,2 also for later indirect lda refptr+2 adc #0 sta windaddr+2 sta 2 lda r_Fname and #$00FF cmp #MaxNameSize bmi NameLenOK lda #MaxNameSize sep #%00100000 sta r_Fname rep #%00100000 NameLenOK tay sep #%00100000 longa off cpynm lda r_Fname,y sta [0],y dey bpl cpynm rep #%00100000 longa on ********** * * Convert any parms that should be diff. for 320 and 640 mode * ********** ldy #350 ;adjust max siz ldx #640 ;adjust pixel count lda ThisMode and #$0080 bne Do640 ldy #190 ldx #320 do640 stx DataWidth stx mcw sty IsizPos+6 ;------------------------------------------------------------ ; ; Set up the DataHeight based on the type of window it is. ; lda #200 ; assume picture and make 200 the max sta DataHeight ; height lda RefPtr ; now see what it really is sta 0 lda RefPtr+2 sta 2 lda TaskData cmp #OpenWID beq IsPicture PushLong #0 ; save this on the stack _GetFontID ldy #oFontID+2 ; now install the font that will lda [0],y ; be used in the current port pha dey dey lda [0],y pha PushWord #0 _InstallFont PushLong #FIRecord ; get the font info so can get _GetFontInfo ; ascent and descent. PushLong #0 ; space for result lda ascent ; now multiply sum of ascent & clc ; descent by num lines to draw adc Descent pha PushWord #NumLines+1 _Multiply pla ; put result in DataHeight sta DataHeight pla ; strip off high word of nothing jsr FindMaxWidth PushWord #0 ; using saved fontid on stack _InstallFont ; re-install the orig font IsPicture anop ********* * * offset upperleft corner for opening of window * ********* ldx #0 MovOff lda ISizPos,x clc adc Wyoffset sta SizPos,x lda ISizPos+2,x clc adc Wxoffset sta SizPos+2,x inx inx inx inx cpx #8 bne MovOff lda WxOffSet ;adjust offsets clc adc #20 sta WxOffset lda WyOffset clc adc #12 cmp #120 ;if we get too low, start at top bne DoYset lda #12 doYset sta WyOffset ********** * * Now, Finally, create the new window * ********** Finally PushLong #0 ; space for result pushlong #WindowParamBlock _NewWindow pla sta whichwindow pla sta whichwindow+2 PushLong WhichWindow ; set port to new top window _SetPort lda PicHandle ; unlock handle ldx PicHandle+2 jsr Unlock ********** * * force origin boundarys (see Manual definition of _SetOrgnMask) * ********** PushWord #$FFFE PushLong whichwindow _SetOrgnMask _InitCursor clc ; carry clear return: we opened it rts end **************************************************************** * * WindowData * **************************************************************** WindowData data WindowParamBlock anop dc i2'WindowEnd-WindowParamBlock' dc i2'FTitle+FClose+FRScroll+FBScroll+FGrow+FZoom+FMove+FVis' windaddr dc i4'0' Ptr to title refcon dc i4'0' RefCon dc i2'0,0,0,0' Full Size (0= default) dc i4'0' Color Table Pointer dc i2'0' Vertical origin dc i2'0' Horizontal origin DataHeight dc i2'200' Data Area Height DataWidth dc i2'640' Data Area Width dc i2'200' Max Cont Height McW dc i2'640' Max Cont Width dc i2'4' Number of pixels to scroll vertically. dc i2'16' Number of pixels to scroll horizontally. dc i2'40' Number of pixels to page vertically. dc i2'160' Number of pixels to page horizontally. dc i4'0' Infomation bar text string. dc i2'0' Info bar height dc i4'0' DefProc. dc i4'0' Routine to draw info. bar. DrawRtn dc i4'Paint' Routine to draw content. SizPos dc i2'0,0,0,0' Size/pos of content dc i4'$FFFFFFFF' Plane to put window up in. dc i4'0' Address for window record (0 to allocate) WindowEnd anop Refptr ds 4 ;refcon pointer to 20 bytes ISizPos dc i'20,10,80,350' ;Size/pos of content FiRecord anop Ascent ds 2 Descent ds 2 Leading ds 2 WidMax ds 2 END **************************************************************** * * OpenFilter * * This routine is passed to SFGetFile to filter out packed * out files of the types we want to load but with sub-types * we do not know about. We can handle any binary file, any * $C1 file and $C2 files if the aux type is 0002. * * On entry, the stack looks like this: * * | previous contents | * |------------------------------| * | space for result | word * |------------------------------| * | pointer to directory entry | long * |------------------------------| * | return address | 3 bytes * |------------------------------| * | | <- SP * **************************************************************** OpenFilter start using GlobalData phb ; save DBR (and even out RTL addr) phk ; set DBR back to this bank plb pla ; save the return address sta RtnAddr pla sta RtnAddr+2 tdc ; save the ROM's ZP sta DPSave lda MyZP ; and swap in ours tcd pla ; now get the pointer to the sta 0 ; directory entry pla sta 2 ldx #2 ; assume visible and selectable ldy #$10 ; first of all, look only at packed lda [0],y ; file types (type=$C0) and #$00ff cmp #$C0 bne exit ; pass on all others as OK ldy #$1F ; look at the aux_type field lda [0],y cmp #2 beq exit ldx #1 ; show it as a dimmed entry exit anop txa sta 1,s ; pass it back on the stack lda DPSave ; point back to the old DP tcd lda RtnAddr+2 ; and put the return address back pha lda RtnAddr pha plb ; restore old DBR rtl DPSave ds 2 RtnAddr ds 4 end **************************************************************** * * FindMaxWidth - this routine finds out how wide the window * should be for the currently installed font. * **************************************************************** FindMaxWidth start using WindowData using FontData using GlobalData PushWord #0 ; save prev set mono/pro flag _GetFontFlags ldy #oFlag ; keep the result on the stack while lda [0],y ; we set it to what we want (as lsr a ; defined by its window type set up and #$0001 ; when we open this window) pha _SetFontFlags stz MaxSoFar lda #1 sta LineCounter LineLoop anop PushWord #0 ; space for width result. phk ; Get a pointer to the current line. phk ; The upper word is the same as the pla ; program bank. and #$00FF pha lda LineCounter ; The lower word is stored in a table. asl a tax lda LineTable,x pha _StringWidth pla ; How does this line compare with the cmp MaxSoFar ; previous longest line? bcc LessThan sta MaxSoFar ; > or =, so save it as record holder. LessThan anop inc LineCounter ; bump current line lda LineCounter cmp #NumLines bcc LineLoop lda MaxSoFar ; Get the width of longest line. clc ; Add in room for left and right margins adc #10 sta DataWidth _SetFontFlags ; restore old settings rts LineCounter ds 2 MaxSoFar ds 2 end **************************************************************** * * DoCloseItem * * Close a window, and dispose of extra data (in WrefCom) * and remove it from window list * **************************************************************** DoCloseItem START using GlobalDATA pushlong #0 ;it's the front window we're adding in _FrontWindow pla sta whichwindow pla sta whichwindow+2 ; get result for pushing in a sec. ora WhichWindow ; was there one? bne ThereIsOne GotIt rts ; quit now ThereIsOne PushLong WhichWindow ; if it is a system window, this will _CloseNDAByWinPtr ; close it bcc GotIt ; no error so done ; Must be one of mine. dothecls PUSHLONG #0 ;space for result PUSHLONG whichwindow _GetWrefCon ;refcon has handle to data pla sta temp2Handle plx stx Temp2Handle ;the refcon to de-allocate jsr deref sta 0 stx 2 ldy #oHandle lda [0],y sta PicHandle iny iny lda [0],y sta PicHandle+2 ; the pichandle (we'll de-allocate) ldy #oFlag ; check if picture or font lda [0],y beq itsapic stz PicHandle ; flag so we don't dispose stz PicHandle+2 ItsAPic jsr AdjWind ; goes and pulls window from WindowList clc ; position returned in a-reg. adc #300 ; start at 300 sta IDdelete ; the MenuID to del-allocate lda windex ; if only one, we must be special cmp #1 bne allswell pushlong #origitem pushword #0 pushword #WindowsMenuID _InsertMItem ; add old no windows item. lda #20 ; reset start loc for window sizing sta WxOffset lda #12 sta WyOffSet allswell lda IDdelete pha ;now delete this item from menus _DeleteMItem dec windex lda windex ;now, renumber list beq nomore ; none left, skip sta IdCounter ; counts how many lda #300 ; always the starting no. sta IDstart ; will be first sta IDNew ; and the new one back lda IdStart cmp IdDelete ; is it the one we deleted? bne DoIt ; nope, go re-set ID inc Idstart ; yes, skip over it bra back DoIt pushword IdNew pushword IdStart _SetMItemId ; reset inc IdStart inc IdNew dec IdCounter bne back NoMore lda #0 ; re-calc size pha pha PushWord #WindowsMenuID _CalcMenuSize Pushlong Temp2Handle ;get rid of refcon area _DisposeHandle lda PicHandle ;is it font bne dodisp lda PicHandle+2 beq skipdisp DoDisp Pushlong PicHandle ;get rid of picture area _DisposeHandle SkipDisp PushLong WhichWindow ;get rid of window _CloseWindow skip rts **************************** * * AdjWind finds and deletes a window list item which matches * "WhichWindow" and returns in a-reg. where it's position was * * Note: it's optimized to find things near end of list * (if you'd prefer the other end, you'd need some different logic, * but here, generally, you'll open, look at it, and close it, so * this method seems best) * **************************** AdjWind lda Windex tay ;use this to count thru dec a asl a ; pt. before last for end (a-2)*4 asl a sta IDCounter adjloop dey bmi AdjDone tya asl a asl a tax lda WindowList,x ;get the pointer (uniqueness exists) cmp WhichWindow bne adjloop lda WindowList+2,x cmp WhichWindow+2 beq shoveChk bra Adjloop ShoveIt lda WindowList+4,x ;now shove things up sta WindowList,x lda WindowList+6,x sta WindowList+2,x inx inx inx inx ShoveChk cpx IdCounter bne shoveit AdjDone tya rts IdNew ds 2 IdStart ds 2 IdCounter ds 2 IDdelete ds 2 END **************************************************************** * * Paint * * This draws picture in the window when task master calls. * **************************************************************** Paint START using GlobalData ********** * * get my own zero page * ********** phb phk plb phd lda MyZP tcd ********** * * get the correct window port (got here from within taskmaster) * ********** pushlong #0 _GetPort plx ply ;get result for pushing in a sec. PUSHLONG #0 ;space for result phy phx ; saved the port here _GetWrefCon ;refcon has handle to data pla sta Temphandle plx stx TempHandle+2 jsr Deref ; de reference sta 0 stx 2 ldy #oHandle ; get handle to pic data lda [0],y sta picptr pha iny iny lda [0],y sta picptr+2 tax pla jsl PaintIt lda TempHandle ldx TempHandle+2 jsr Unlock pld plb rtl END **************************************************************** * * PaintIt * * The routine which actually does the painting when passed the * the handle to the picture in the a & x registers. * **************************************************************** PaintIt START using GlobalData phx ; save this on stack pha jsr deref ;deref. picture handle sta picptr sta picptr320 stx picptr+2 stx picptr320+2 lda ThisMode and #$0080 bne Do640 PushLong #SrcInfo320 PushLong #SrcRect320 bra pshmor do640 PushLong #SrcLocInfo PushLong #SrcRect Pshmor PushWord #0 ; x PushWord #0 ; y PushWord #0 ; copy _PPToPort pla plx jsr Unlock rtl END **************************************************************** * * DoGoAway * **************************************************************** DoGoAway START using GlobalDATA PushLong TaskData _HideWindow rts END **************************************************************** * * DoWindow * * Selects and shows window in response to menu selection. * **************************************************************** DoWindow START using GlobalDATA PUSHLONG WHICHWINDOW ; select first so it only redraws _SelectWindow ; once PUSHLONG WHICHWINDOW _ShowWindow rts END **************************************************************** * * GlobalDATA * **************************************************************** GlobalData DATA Prompt dc i1'19',c'Load which Picture:' Prompt2 dc i1'19',c'Save which Picture:' typelist dc i1'2',i1'$c0,$c1' ; packed and unpacked pictures origitem dc c' LNo Windows allocated\N299',i1'13',i1'0' Wxoffset dc i'20' ; offset for upperleft window corner Wyoffset dc i'12' ; offset for upperlef t window corner ThisMode dc i'$0080' ;init mode: 640 nullRect dc i'0,0,0,0' reply anop ;SF GET/PUT FILE record r_good dc i2'0' r_type dc i2'0' r_auxtyp dc i2'0' r_fname ds 16 r_fullpn ds 128 QuitParams dc i4'0' dc i'$4000' ; am restartable in memory ToolTable dc i'11' dc i'4,$0101' ; quickdraw dc i'5,$0100' ; desk manager dc i'6,$0100' ; event manager dc i'14,$0103' ; window manager from disk! dc i'15,$0103' ; menu manager from Disk! dc i'16,$0103' ; control manager form disk! dc i'20,$0100' ; line edit dc i'21,$0100' ; dialog manager from disk! dc i'23,$0100' ; standard files from disk! dc i'27,$0100' ; Font manager dc i'28,$0000' ; List manager SrcLocInfo dc i'$80' ;PPtoPort 640 parms PicPtr ds 4 dc i'160' dc i'0,0,200,640' SrcRect dc i'0,0,200,640' Srcinfo320 dc i'$00' ;PPtoPort 320 parms PicPtr320 ds 4 dc i'160' dc i'0,0,200,320' SrcRect320 dc i'0,0,200,320' EventRecord anop EventWhat ds 2 EventMessage ds 4 EventWhen ds 4 EventWhere ds 4 EventModifiers ds 2 TaskDATA ds 4 TaskMask dc i4'$0FFF' QuitFlag ds 2 DialogPtr ds 4 Windex ds 2 ;index to next avail.window ID MyZP ds 2 ZpHandle ds 4 MyID ds 2 Vindex ds 2 ;index used to list of what WAS visible Vtable ds 16*4 ;list of what WAS vis. when Hiding all WindowList ds 16*4 ;all windows handle go into this list WhichWindow ds 4 ;will contain window pointer, cur. window TempHandle ds 4 ;some temp handles Temp2Handle ds 4 PicHandle ds 4 ; handle to picture data OrigPort ds 4 SaveType ds 2 PrintRecord ds 4 ; handle to print record PrintPort ds 4 ; pointer to printing GrafPort. VolNotFound gequ $45 ; prodos error ;------------------------------------------------------------ ; ; MyWindowInfo ; ; This is the data structure used for the windows we ; allocate. ; MaxNameSize equ 29 ; largest name we allow oHandle equ 0 oBlank equ oHandle+4 oLength equ oBlank+1 oName equ oLength+1 oMMStuff equ oName+MaxNameSize oFlag equ oMMStuff+6 oExtra equ oFlag+1 ; oFontID equ oHandle ; if the type is for font, ; ; the first field is a FontID ; ; rather than the handle to picture ; ; data. MyWinfoSize equ oExtra+4 END **************************************************************** * * IOData * **************************************************************** IOData DATA CreateParms anop NameC dc i4'0' dc i2'$00C3' ; DRNWR CType dc i2'$0006' ; BIN CAux dc i4'$00000000' ; Aux. dc i2'$0001' ; type dc i2'$0000' ; create date dc i2'$0000' ; create time DestParams anop NameD dc i4'0' OpenParams anop OpenID ds 2 NamePtr ds 4 ds 4 ReadParams anop ReadID ds 2 PicDestIN ds 4 dc i4'$8000' ; this many bytes ds 4 ; how many xfered PReadParams anop ; for reading a packed file PReadID ds 2 PReadLoc ds 4 PReadSize ds 4 ; this many bytes ds 4 ; how many xfered MarkParams anop MarkID ds 2 Mark ds 4 WriteParams anop WriteID ds 2 PicDestOUT ds 4 dc i4'$8000' ; this many bytes ds 4 ; how many xfered PackWParams anop PackWID ds 2 PackWDest ds 4 HowMany ds 4 ; this many bytes ds 4 ; how many xfered CloseParams anop CloseID ds 2 END **************************************************************** * * DoChooserItem * * This is the routine that handles the Choose Printer * menu item. * **************************************************************** DoChooserItem START using GlobalData PushWord #0 _PrChooser pla rts END **************************************************************** * * DoSetupItem * * This is the routine that handles the pa ge setup item. * **************************************************************** DoSetupItem START using GlobalData lda PrintRecord ora PrintRecord+2 bne AlreadyThere jsr SetupDefault AlreadyThere anop Pushword #0 Pushlong PrintRecord _prStlDialog pla rts END **************************************************************** * * SetupDefault * * This routine creates the default PrintRecord. Puts handle * in PrintRecord. * **************************************************************** SetupDefault START using GlobalDATA PushLong #0 PushLong #140 Pushword MyID PushWord #$8010 PushLong #0 _newHandle pla sta PrintRecord pla sta PrintRecord+2 AlreadyThere anop PushLong PrintRecord _prdefault rts END **************************************************************** * * DoPrintItem * * This is the routine that handles the print item in the * file menu. * **************************************************************** DoPrintItem START using GlobalData pha ; first see if there is a window pha ; to print. _FrontWindow ; and save pointer to it now pla ; before any dialogs are displayed! sta WindowToPrint pla sta WindowToPrint+2 ora WindowToPrint bne ThereIsOne rts ThereIsOne anop lda PrintRecord ora PrintRecord+2 bne AlreadySet jsr SetupDefault AlreadySet anop PushWord #0 PushLong PrintRecord _PrJobDialog pla bne continue brl skipit continue anop _WaitCursor PushLong #0 PushLong PrintRecord PushLong #0 _PrOpenDoc pla sta PrintPort pla sta PrintPort+2 PushLong PrintPort PushLong #0 _PrOpenPage jsr DrawTopWindow PushLong PrintPort _PrClosePage PushLong PrintPort _PrCloseDoc PushLong PrintRecord PushLong #0 PushLong #0 _PrPicFile _InitCursor SkipIt anop rts END **************************************************************** * * DrawTopWindow * * * **************************************************************** DrawTopWindow START using GlobalDATA pha ; space for result of GetWRefCon call pha PushLong WindowToPrint _GetWRefCon pla sta TheRefCon plx stx TheRefCon+2 jsr Deref sta 0 stx 2 ldy #oFlag lda [0],y beq UsePaint ldy #oFontID+2 lda [0],y tax dey dey lda [0],y jsl ShowFont bra AllDone UsePaint anop ldy #oHandle+2 ; get handle to pic data lda [0],y tax dey dey lda [0],y jsl PaintIt AllDone lda TheRefCon ldx TheRefCon+2 jsr Unlock rts theRefCon ds 4 WindowToPrint ENTRY ds 4 END **************************************************************** * * PlayWithIt * * This contains the main event loop. * **************************************************************** PlayWithIt START using GlobalData Again anop lda QuitFlag bne AllDone PushWord #0 PushWord #$FFFF PushLong #EventRecord _TaskMaster pla beq Again asl a  tax jsr (TaskTable,x) bra Again AllDone rts TaskTable anop ;---------------------------------------------------- ; ; Event manager events ; dc i'ignore' ; 0 null dc i'ignore' ; 1 mouse down dc i'ignore' ; 2 mouse up dc i'ignore' ; 3 key down dc i'ignore' ; 4 undefined dc i'ignore' ; 5 auto-key down dc i'ignore' ; 6 update event dc i'ignore' ; 7 undefined dc i'ignore' ; 8 activate dc i'ignore' ; 9 switch dc i'ignore' ; 10 desk acc dc i'ignore' ; 11 device driver dc i'ignore' ; 12 ap dc i'ignore' ; 13 ap dc i'ignore' ; 14 ap dc i'ignore' ; 15 ap ;---------------------------------------------------- ; ; Task master events dc i'ignore' ; 0 in desk dc i'DoMenu' ; 1 in MenuBar dc i'ignore' ; 2 in system window dc i'ignore' ; 3 in content of window dc i'ignore' ; 4 in drag dc i'ignore' ; 5 in grow dc i'DoGoAway' ; 6 in goaway dc i'ignore' ; 7 in zoom dc i'ignore' ; 8 in info bar dc i'DoMenu' ; 9 in special menu item dc i'ignore' ; 10 in OpenNDA dc i'ignore' ; 11 in frame dc i'ignore' ; in drop END **************************************************************** * * doQuitItem * * Sets quit flag. * **************************************************************** doQuitItem START using GlobalDATA lda #$8000 sta QuitFlag rts END MACRO &lab _CautionAlert &lab ldx #21+256*26 jsl $E10000 MEND MACRO &lab _CtlStartUp &lab ldx #$0210 jsl $E10000 MEND MACRO &lab _CtlShutDown &lab ldx #$0310 jsl $E10000 MEND MACRO &lab _CtlNewRes &lab ldx #$1210 jsl $E10000 MEND MACRO &lab _DeskStartUp &lab ldx #$0205 jsl $E10000 MEND MACRO &lab _DeskShutDown &lab ldx #$0305 jsl $E10000 MEND MACRO &lab _FixAppleMenu &lab ldx #$1E05 jsl $E10000 MEND MACRO &lab _DialogStartUp &lab ldx #$0215 jsl $E10000 MEND MACRO &lab _DialogShutDow !"#$%&'()*+,-./01n &lab ldx #$0315 jsl $E10000 MEND MACRO &lab _NewModalDialog &lab ldx #$0A15 jsl $E10000 MEND MACRO &lab _CloseDialog &lab ldx #$0C15 jsl $E10000 MEND MACRO &lab _NewDItem &lab ldx #$0D15 jsl $E10000 MEND MACRO &lab _ModalDialog &lab ldx #$0F15 jsl $E10000 MEND MACRO &lab _EMStartUp &lab ldx #$0206 jsl $E10000 MEND MACRO &lab _EMShutDown &lab ldx #$0306 jsl $E10000 MEND MACRO &lab _FMStartUp &lab ldx #$021B jsl $E10000 MEND MACRO &lab _FMShutDown &lab ldx #$031B jsl $E10000 MEND MACRO &lab _GetFamInfo &lab ldx #$0B1B jsl $E10000 MEND MACRO &lab _InstallFont &lab ldx #$0E1B jsl $E10000 MEND MACRO &lab _ChooseFont &lab ldx #$161B jsl $E10000 MEND MACRO &lab _Int2Dec &lab ldx #$260B jsl $E10000 MEND MACRO &lab _HexIt &lab ldx #$2A0B jsl $E10000 MEND MACRO &lab _LEStartUp &lab ldx #$0214 jsl $E10000 MEND MACRO &lab _LEShutDown &lab ldx #$0314 jsl $E10000 MEND MACRO &lab _TLStartUp &lab ldx #$0201 jsl $E10000 MEND MACRO &lab _TLShutDown &lab ldx #$0301 jsl $E10000 MEND MACRO &lab _LoadTools &lab ldx #$0E01 jsl $E10000 MEND MACRO &lab _TLMountVolume &lab ldx #$1101 jsl $E10000 MEND MACRO &lab _MMStartUp &lab ldx #$0202 jsl $E10000 MEND MACRO &lab _MMShutDown &lab ldx #$0302 jsl $E10000 MEND MACRO &lab _NewHandle &lab ldx #$0902 jsl $E10000 MEND MACRO &lab _DisposeHandle &lab ldx #$1002 jsl $E10000 MEND MACRO &lab _MenuStartUp &lab ldx #$020F jsl $E10000 MEND MACRO &lab _MenuShutDown &lab ldx #$030F jsl $E10000 MEND MACRO &lab _InsertMenu &lab ldx #$0D0F jsl $E10000 MEND MACRO &lab _InsertMItem &lab ldx #$0F0F jsl $E10000 MEND MACRO &lab _DeleteMItem &lab ldx #$100F jsl $E10000 MEND MACRO &lab _FixMenuBar &lab ldx #$130F jsl $E10000 MEND MACRO &lab _CalcMenuSize &lab ldx #$1C0F jsl $E10000 MEND MACRO &lab _MenuNewRes &lab ldx #$290F jsl $E10000 MEND MACRO &lab _DrawMenuBar &lab ldx #$2A0F jsl $E10000 MEND MACRO &lab _HiliteMenu &lab ldx #$2C0F jsl $E10000 MEND MACRO &lab _NewMenu &lab ldx #$2D0F jsl $E10000 MEND MACRO &lab _SetMItemID &lab ldx #$380F jsl $E10000 MEND MACRO &lab _MTStartUp &lab ldx #$0203 jsl $E10000 MEND MACRO &lab _MTShutDown &lab ldx #$0303 jsl $E10000 MEND MACRO &lab _HomeMouse &lab ldx #$1A03 jsl $E10000 MEND MACRO &lab _ClampMouse &lab ldx #$1C03 jsl $E10000 MEND MACRO &lab _PackBytes &lab ldx #$2603 jsl $E10000 MEND MACRO &lab _UnPackBytes &lab ldx #$2703 jsl $E10000 MEND MACRO &lab _CREATE ¶ms &lab jsl $E100A8 dc i2"1" dc i4"¶ms" MEND MACRO &lab _DESTROY ¶ms &lab jsl $E100A8 dc i2"2" dc i4"¶ms" MEND MACRO &lab _SETPREFIX ¶ms &lab jsl $E100A8 dc i2"9" dc i4"¶ms" MEND MACRO &lab _GETPREFIX ¶ms &lab jsl $E100A8 dc i2"$0A" dc i4"¶ms" MEND MACRO &lab _OPEN ¶ms &lab jsl $E100A8 dc i2"$10" dc i4"¶ms" MEND MACRO &lab _READ ¶ms &lab jsl $E100A8 dc i2"$12" dc i4"¶ms" MEND MACRO &lab _WRITE ¶ms &lab jsl $E100A8 dc i2"$13" dc i4"¶ms" MEND MACRO &lab _CLOSE ¶ms &lab jsl $E100A8 dc i2"$14" dc i4"¶ms" MEND MACRO &lab _SETMARK ¶ms &lab jsl $E100A8 dc i2"$16" dc i4"¶ms" MEND MACRO &lab _QUIT ¶ms &lab jsl $E100A8 dc i2"$29" dc i4"¶ms" MEND MACRO &lab _QDStartUp &lab ldx #$0204 jsl $E10000 MEND MACRO &lab _QDShutDown &lab ldx #$0304 jsl $E10000 MEND MACRO &lab _InitColorTable &lab ldx #$0D04 jsl $E10000 MEND MACRO &lab _SetAllSCBs &lab ldx #$1404 jsl $E10000 MEND MACRO &lab _SetMasterSCB &lab ldx #$1604 jsl $E10000 MEND MACRO &lab _GetMasterSCB &lab ldx #$1704 jsl $E10000 MEND MACRO &lab _OpenPort &lab ldx #$1804 jsl $E10000 MEND MACRO &lab _InitPort &lab ldx #$1904 jsl $E10000 MEND MACRO &lab _ClosePort &lab ldx #$1A04 jsl $E10000 MEND MACRO &lab _SetPort &lab ldx #$1B04 jsl $E10000 MEND MACRO &lab _GetPort &lab ldx #$1C04 jsl $E10000 MEND MACRO &lab _GetPen &lab ldx #$2904 jsl $E10000 MEND MACRO &lab _MoveTo &lab ldx #$3A04 jsl $E10000 MEND MACRO &lab _HideCursor &lab ldx #$9004 jsl $E10000 MEND MACRO &lab _ShowCursor &lab ldx #$9104 jsl $E10000 MEND MACRO &lab _GetFontInfo &lab ldx #$9604 jsl $E10000 MEND MACRO &lab _SetForeColor &lab ldx #$A004 jsl $E10000 MEND MACRO &lab _SetBackColor &lab ldx #$A204 jsl $E10000 MEND MACRO &lab _DrawString &lab ldx #$A504 jsl $E10000 MEND MACRO &lab _InitCursor &lab ldx #$CA04 jsl $E10000 MEND MACRO &lab _PPToPort &lab ldx #$D604 jsl $E10000 MEND MACRO &lab _SFStartUp &lab ldx #$0217 jsl $E10000 MEND MACRO &lab _SFShutDown &lab ldx #$0317 jsl $E10000 MEND MACRO &lab _SFGetFile &lab ldx #$0917 jsl $E10000 MEND MACRO &lab _WindStartUp &lab ldx #$020E jsl $E10000 MEND MACRO &lab _WindShutDown &lab ldx #$030E jsl $E10000 MEND MACRO &lab _NewWindow &lab ldx #$090E jsl $E10000 MEND MACRO &lab _CloseWindow &lab ldx #$0B0E jsl $E10000 MEND MACRO &lab _SetWTitle &lab ldx #$0D0E jsl $E10000 MEND MACRO &lab _GetWTitle &lab ldx #$0E0E jsl $E10000 MEND MACRO &lab _SelectWindow &lab ldx #$110E jsl $E10000 MEND MACRO &lab _HideWindow &lab ldx #$120E jsl $E10000 MEND MACRO &lab _ShowWindow &lab ldx #$130E jsl $E10000 MEND MACRO &lab _FrontWindow &lab ldx #$150E jsl $E10000 MEND MACRO &lab _MoveWindow &lab ldx #$190E jsl $E10000 MEND MACRO &lab _SizeWindow &lab ldx #$1C0E jsl $E10000 MEND MACRO &lab _TaskMaster &lab ldx #$1D0E jsl $E10000 MEND MACRO &lab _BeginUpdate &lab ldx #$1E0E jsl $E10000 MEND MACRO &lab _EndUpdate &lab ldx #$1F0E jsl $E10000 MEND MACRO &lab _WindNewRes &lab ldx #$250E jsl $E10000 MEND MACRO &lab _GetWRefCon &lab ldx #$290E jsl $E10000 MEND MACRO &lab _SetOrgnMask &lab ldx #$340E jsl $E10000 MEND MACRO &lab _SetZoomRect &lab ldx #$380E jsl $E10000 MEND MACRO &lab _RefreshDesktop &lab ldx #$390E jsl $E10000 MEND MACRO &lab _GetDataSize &lab ldx #$400E jsl $E10000 MEND MACRO &lab _SetDataSize &lab ldx #$410E jsl $E10000 MEND MACRO &lab _SetMaxGrow &lab ldx #$430E jsl $E10000 MEND MACRO &lab pushlong &addr,&offset &lab ANOP LCLC &C LCLC &REST &C AMID &addr,1,1 AIF "&C"="#",.immediate AIF "&C"="[",.zeropage AIF C:&offset=0,.nooffset AIF "&offset"="s",.stack pushword &addr+2,&offset pushword &addr,&offset MEXIT .nooffset pushword &addr+2 pushword &addr MEXIT .immediate &REST AMID &addr,2,L:&addr-1 dc I1'$F4',I2'(&REST)|-16' dc I1'$F4',I2'&REST' MEXIT .stack pushword &addr+2,s pushword &addr+2,s MEXIT .zeropage ldy #&offset+2 pushword &addr,y ldy #&offset pushword &addr,y MEND MACRO &lab pushword &sysopr &lab ANOP AIF c:&sysopr=0,.b LCLC &C LCLC &REST LCLA &BL &C AMID "&sysopr",1,1 &BL ASEARCH "&sysopr"," ",1 AIF &BL>0,.a &BL SETA L:&sysopr+1 .a &REST AMID "&sysopr",2,&BL-2 AIF ("&C"="#").AND.(S:LONGA),.immediate lda &sysopr pha MEXIT .b pha MEXIT .immediate dc I1'$F4',I2'&REST' MEND MACRO &lab str &string &lab dc i1'l:&string',c'&string' MEND MACRO &lab _SysDeath &lab ldx #$1503 jsl $E10000 MEND MACRO &lab _Multiply &lab ldx #$090B jsl $E10000 MEND MACRO &lab _GetFontID &lab ldx #$D104 jsl $E10000 MEND MACRO &lab _CloseNDAbyWinPtr &lab ldx #$1C05 jsl $E10000 MEND MACRO &lab _QDAuxStartup &lab ldx #18+256*2 jsl $E10000 MEND MACRO &lab _QDAuxShutdown &lab ldx #18+256*3 jsl $E10000 MEND MACRO &lab _WaitCursor &lab ldx #18+256*10 jsl $E10000 MEND MACRO &lab _PrDefault &lab ldx #19+256*9 jsl $E10000 MEND MACRO &lab _PrStlDialog &lab ldx #19+256*11 jsl $E10000 MEND MACRO &lab _PrJobDialog &lab ldx #19+256*12 jsl $E10000 MEND MACRO &lab _PrOpenDoc &lab ldx #19+256*14 jsl $E10000 MEND MACRO &lab _PrCloseDoc &lab ldx #19+256*15 jsl $E10000 MEND MACRO &lab _PrOpenPage &lab ldx #19+256*16 jsl $E10000 MEND MACRO &lab _Prclosepage &lab ldx #19+256*17 jsl $E10000 MEND MACRO &lab _PrPicfile &lab ldx #19+256*18 jsl $E10000 MEND MACRO &lab _PrChooser &lab ldx #19+256*22 jsl $E10000 MEND MACRO &lab _PMStartup &lab ldx #19+256*2 jsl $E10000 MEND MACRO &lab _PMShutdown &lab ldx #19+256*3 jsl $E10000 MEND MACRO &lab _LoadOneTool &lab ldx #$0F01 jsl $E10000 MEND MACRO &lab _DisableMItem &lab ldx #$310F jsl $E10000 MEND MACRO &lab _CloseAllNDAs &lab ldx #$1D05 jsl $E10000 MEND MACRO &lab _SetFontFlags &lab ldx #4+256*152 jsl $E10000 MEND MACRO &lab _GetFontFlags &lab ldx #4+256*153 jsl $E10000 MEND MACRO &lab _SetItem &lab ldx #15+256*36 jsl $E10000 MEND MACRO &lab _DrawDialog &lab ldx #$1615 jsl $E10000 MEND MACRO &lab _GetNewModalDialog &lab ldx #$3215 jsl $E10000 MEND MACRO &lab _StopAlert &lab ldx #$1815 jsl $E10000 MEND MACRO &lab _Int2Hex &lab ldx #$220B jsl $E10000 MEND MACRO &lab long &lab ANOP rep #%00110000 longa on longi on MEND MACRO &lab short &lab ANOP sep #%00110000 longa off longi off MEND MACRO &lab _SetItemValue &lab ldx #21+256*47 jsl $E10000 MEND MACRO &Lab _SFPPutFile &Lab ldx #23+256*12 jsl $E10000 MEND MACRO &lab _StringWidth &lab ldx #$A904 jsl $E10000 MEND MACRO &lab _DisposeControl &lab ldx #$0A10 jsl $E10000 MEND MACRO &lab _FindControl &lab ldx #$1310 jsl $E10000 MEND MACRO &lab _TrackControl &lab ldx #$1510 jsl $E10000 MEND MACRO &lab _SetCtlRefCon &lab ldx #$2210 jsl $E10000 MEND MACRO &lab _GetCtlRefCon &lab ldx #$2310 jsl $E10000 MEND MACRO &lab _UnloadOneTool &lab ldx #$1001 jsl $E10000 MEND MACRO &lab _CreateList &lab ldx #$091c jsl $E10000 MEND **************************************************************** * * DoShowVers * **************************************************************** DoShowVers START using GlobalData Handle equ 40 Pointer equ 44 _WaitCursor pha pha PushLong #Template _GetNewModalDialog ; leave pointer on stack pla sta VDialogPtr pla sta VDialogPtr+2 jsr GetVersions pha ; space for result pha PushLong VDialogPtr PushLong #ListRec ; list record _CreateList pla sta ListControl pla sta ListControl+2 jsr SaveAndZeroRefCons _InitCursor pha PushLong #VersionFilter+$80000000 _ModalDialog ; call modal dialog pla PushLong ListControl _DisposeControl PushLong VDialogPtr _CloseDialog ; close the dialog rts SaveAndZeroRefCons anop pha ; Get the ref con of the list pha ; control and save it PushLong ListControl _GetCtlRefCon pla sta ListRefCon pla sta ListRefCon+2 lda ListControl ; now find the handle to the sta handle ; scroll bar control lda ListControl+2 ; (its at the end of the record sta Handle+2 ; used by the list control) lda [Handle] sta Pointer ldy #2 lda [Handle],y sta Pointer+2 ldy #52 lda [Pointer],y sta ScrollControl iny iny lda [Pointer],y sta ScrollControl+2 pha ; use this to save and zero pha ; ref con of the Scroll bar control PushLong ScrollControl _GetCtlRefCon pla sta ScrollRefCon pla sta ScrollRefCon+2 ZeroRefCons ENTRY PushLong #0 ; zero the ref con of the list PushLong ListControl ; control _SetCtlRefCon PushLong #0 PushLong ScrollControl _SetCtlRefCon rts RestoreRefCons ENTRY PushLong ListRefCon ; zero the ref con of the list PushLong ListControl ; control _SetCtlRefCon PushLong ScrollRefCon PushLong ScrollControl _SetCtlRefCon rts VDialogPtr ENTRY ds 4 ListControl ds 4 ListRefCon ds 4 ScrollControl ds 4 ScrollRefCon ds 4 Template dc i'20,30,185,350' ; bounds rect dc i'TRUE' ; visible dc i4'0' ; ref con dc i4'item1' dc i4'item2' dc i4'0000' item1 dc i2'1' ; id dc i2'145,250,00,00' ; bounds rect for button dc i2'ButtonItem' ; type dc i4'But1' ; item descreptor dc i2'00' ; item value dc i2'0' ; item flag dc i4'0' ; item color item2 dc i2'2' ; id dc i2'05,10,15,280' ; bounds rect dc i2'StatText' ; type dc i4'Msg' ; item descreptor dc i2'00' ; item value dc i2'0' ; item flag dc i4'0' ; item color ListRec dc i2'27,10,109,280' ; lists enclosing rect dc i2'28' ; number of members in the list dc i2'08' ; number seen at once dc i2'$01' ; list type (c strings) dc i2'1' ; list start (first seen) dc i4'0' ; space for control dc i4'MyDraw' ; list draw (pointer to draw routine) dc i2'10' ; height of single item dc i2'6' ; size of list record dc i4'MyList' ; pointer to the list itself dc i4'0' ; ref con dc i4'0' ; adr of color table for control MyList ENTRY dc i4'Tool1',i1'0,1' ; pointer to string and memflag byte dc i4'Tool2',i1'0,2' dc i4'Tool3',i1'0,3' dc i4'Tool4',i1'0,4' dc i4'Tool5',i1'0,5' dc i4'Tool6',i1'0,6' dc i4'Tool7',i1'0,7' dc i4'Tool8',i1'0,8' dc i4'Tool9',i1'0,9' dc i4'Tool10',i1'0,10' dc i4'Tool11',i1'0,11' dc i4'Tool12',i1'0,12' dc i4'Tool13',i1'0,13' dc i4'Tool14',i1'0,14' dc i4'Tool15',i1'0,15' dc i4'Tool16',i1'0,16' dc i4'Tool17',i1'0,17' dc i4'Tool18',i1'0,18' dc i4'Tool19',i1'0,19' dc i4'Tool20',i1'0,20' dc i4'Tool21',i1'0,21' dc i4'Tool22',i1'0,22' dc i4'Tool23',i1'0,23' dc i4'Tool24',i1'0,24' dc i4'Tool25',i1'0,25' dc i4'Tool26',i1'0,26' dc i4'Tool27',i1'0,27' dc i4'Tool28',i1'0,28' But1 str 'OK' Msg str 'Version Reporter' Tool1 str '1. Tool Locator' Tool2 str '2. Memory Manager' Tool3 str '3. Miscellaneous Tools' Tool4 str '4. QuickDraw II' Tool5 str '5. Desk Manager' Tool6 str '6. Event Manager' Tool7 str '7. Scheduler' Tool8 str '8. Sound Manager' Tool9 str '9. ADB Tool' Tool10 str '10. SANE' Tool11 str '11. Integer Math' Tool12 str '12. Text Tools' Tool13 str '13. Used Internally' Tool14 str '14. Window Manager' Tool15 str '15. Menu Manager' Tool16 str '16. Control Manager' Tool17 str '17. Loader' Tool18 str '18. QuickDraw Auxilary' Tool19 str '19. Print Manager' Tool20 str '20. Line Edit' Tool21 str '21. Dialog Manager' Tool22 str '22. Scrap Manager' Tool23 str '23. Standard File' Tool24 str '24. Disk Utilities' Tool25 str '25. Note Synthesizer' Tool26 str '26. Note Sequencer' Tool27 str '27. Font Manager' Tool28 str '28. List Manager' end ***************************************************************** * * MyDraw * * This routine draws the list item when asked by the list mgr * * Ptr to Bounding Rect * Ptr to member record * Handle to list Control record * * ***************************************************************** MyDraw START OrigD equ 1 RTLAdr equ OrigD+2 CHandle equ RTLAdr+3 MemberPtr equ CHandle+4 RectPtr equ MemberPtr+4 phd tsc tcd phb phk plb ldy #2 lda [RectPtr],y clc adc #10 pha ldy #4 lda [RectPtr],y dec a dec a pha _MoveTo ldy #2 lda [MemberPtr],y pha lda [MemberPtr] pha _DrawString ldy #6 lda [RectPtr],y sec sbc #42 pha ldy #4 lda [RectPtr],y dec a dec a pha _MoveTo ldy #5 lda [MemberPtr],y and #$00FF asl a tax lda VerTable,x jsr DrawVerString plb pld lda 1,s sta 13,s lda 2,s sta 14,s tsc clc adc #12 tcs rtl END ***************************************************************** * * VersionFilter * * ***************************************************************** VersionFilter START using GlobalDATA oWhere equ 10 ; offset in event record OrigD equ 1 OrigB equ OrigD+2 RTLAdr equ OrigB+1 ItemHitPtr equ RTLAdr+3 EventPtr equ ItemHitPtr+4 DialogPtr equ EventPtr+4 ReturnFlag equ DialogPtr+4 phd ; save d phb ; save b phk ; set b to our bank plb tsc ; turn stack into zp tcd stz ReturnFlag ; we always return false lda [EventPtr] cmp #1 ; only care about mouse down bne AllDone pha PushLong #FoundControl ldy #oWhere+2 lda [EventPtr],y pha dey dey lda [EventPtr],y pha PushLong VDialogPtr _FindControl pla beq AllDone cmp #5 ; if less than a up arrow then skip it bcc AllDone cmp #10 ; if less than grow then take it bcc DoIt cmp #$81 bne AllDone DoIt anop jsr RestoreRefCons pha ldy #oWhere+2 lda [EventPtr],y pha dey dey lda [EventPtr],y pha PushLong #$FFFFFFFF PushLong FoundControl _TrackControl pla jsr ZeroRefCons AllDone anop plb ; restore b pld ; restore d phb ; put extra byte on stack pla ; pull long into x,a plx ply ; strip 6 words ply ply ply ply ply phx pha plb ; pull extra byte rtl ; done FoundControl ds 4 END ***************************************************************** * * GetVersions * * Fills the version table with the right version numbers. * ***************************************************************** GetVersions START PushWord #$041C ; start with list mgr version Loop anop lda 1,s tax pea 0000 jsl $E10000 pla bcc VerOK lda 1,s ; lets try loading the tool from and #$00FF ; disk--get ts num in low byte of a pha ; push it PushWord #$0000 ; no min version _LoadOneTool ; load it lda #$FFFF ; assume fail bcs VerOK ; oh-well we failed. lda 1,s ; it loaded! tax ; get the version call number again pea 0000 ; and make the call jsl $E10000 lda 3,s ; get tool number again so I can and #$00FF ; unload the tool pha ; twice for good luck pha _UnloadOneTool pla ; get rid of second pla ; now get version result off stack VerOK tay lda 1,s and #$00FF asl a tax tya sta VerTable,x pla dec a pha and #$00FF bne Loop pla rts END ***************************************************************** * * VerTable * ***************************************************************** VerTable START ds 2*30 END ***************************************************************** * * DrawVerString * * Called when pen is already in position. Version number is in * a-reg. * ***************************************************************** DrawVerString START cmp #$FFFF bne continue PushLong #NAStr _DrawString rts NAStr str ' N/A' continue anop pha ; save version on stack lda #4 sta StrLen lda 1,s xba and #$007F pha PushLong #Chars PushWord #2 PushWord #0 ; not signed _Int2Dec lda #'.' sta Chars+2 lda 1,s and #$00FF pha PushLong #Chars+3 cmp #10 bcs Not1 PushWord #1 bra SizePushed Not1 cmp #100 bcs Not2 PushWord #2 inc StrLen ; length is one more bra SizePushed Not2 PushWord #3 inc StrLen ; length is two more inc StrLen SizePushed PushWord #0 ; not signed _Int2Dec PushLong #Str _DrawString pla ; take version off the stack bpl NotProto PushLong #P _DrawString NotProto anop rts Str anop StrLen ds 1 Chars ds 5 Point str '.' P str 'P' END