******************************************************************* * Apple IIGS Aplication program demo * * By Jim Mensch Apple computer (c) 1986 October 3 1986 * ******************************************************************* Title 'Apple IIGS Application Demo' ABSADDR ON List On instime on GEN off SYMBOL on MCOPY ALL.MACROS 65816 ON KEEP demo ******************************************************************* * Zero Page usage section starts here * ******************************************************************* ZPage start Window1 GEqu $10 Window2 GEqu Window1+4 WindowE GEqu Window2+4 Dialog GEqu WindowE+4 MyPointer Gequ Dialog+4 MyHandle GEqu MyPointer end ******************************************************************** * Main Program Loop this section is generic to all programs * ******************************************************************** MainProgram START Using RAM phk plb tdc ; save off current ZP sta OZP ; and save it for the moment Jsr ToolInit Jsr EventLoop Jsr ShutDown lda OZP tcd _Quit QuitParms RTS OZP ds 2 END ******************************************************************** *ToolInit * ******************************************************************** ToolInit START Using RAM _TLStartup start the tool locator PushWord #0 and init the memory manager _MMStartup pla sta MyID and store our application ID PushLong #0 now request a memory segment PushLong #$0800 for our tools to use as PushWord MyID direct page PushWord #$C001 PushLong #0 _NewHandle pla sta MyHandle pla Sta MyHandle+2 lda [MyHandle] sta MyPointer _MTStartup start Misc Tools PushLong #ToolTable load in the RAM based tools _LoadTools ; tools are now loaded PushLong #0 now request a memory segment PushLong #$0800 for our tools to use as PushWord MyID direct page PushWord #$C001 PushLong #0 _NewHandle pla sta MyHandle pla Sta MyHandle+2 lda [MyHandle] sta MyPointer lda MyPointer adc #$0100 PHA Now init Quickdraw PushWord #$80 PushWord #160 PushWord MyID _QDStartup lda MyPointer adc #$0400 Pha PushWord #20 PushWord #0 PushWord #640 PushWord #0 PushWord #200 PushWord MyID _EMStartup _ShowCursor PushWord MyID _WindStartup PushLong #0 _Refresh PushWord MyID lda MyPointer clc adc #$0500 pha _MenuStartup PushWord MyID clc lda MyPointer adc #$0600 pha _CtrlStartup lda MyPointer adc #$0700 pha PushWord MyID _LEStartup PushWord MyID ldx #21+256*2 Here is a manual tool call jsl $E10000 Dialog Startup _DeskStartup rts END **************************************************************** *ShutDown * * Is used to shut down all the tools I started up.. * **************************************************************** ShutDown START Using RAM _DeskShutDown _DialogShutDown _LEShutDown _CTRLShutDown _MenuShutDown _WindShutDown _EMShutDown _QDShutDown _MTShutDown PushLong MyHandle _DisposeHandle PushWord MyID _MMShutDown _TLShutDown RTS END APPEND Proj.main