home *** CD-ROM | disk | FTP | other *** search
- ;Programm: BangerMenu bietet eine grafische Oberfläche zum Anwählen von Programmen
- ; die beim Starten in der Startup-Sequence aufgerufen werden sollen.
- ;Autor : Andre´ Trettin
- ;Codename: Banger
- ;Begin : 31-Mai-95 17:08:28
- ;$VER : BangerMenu.Asm 3.05 (19-Feb-96)
-
- ** INCLUDE Struktur Variablen
- * Fehler Codes: 21=kein Speicher
- * 22=konnte Library (oder Libraries) nicht öffnen
- * 23=GetVisualInfo Fehler
- * 24=konnte File S:BangerMenu.Prefs nicht öffnen
- * 25=bei der Gadgeterschaffung trat ein Fehler auf
- * 26=konnte Fenster nicht öffnen oder Task nicht Finden
- * 27=Einstellungen sind Leer
- * 28=kein Speicher für die Einstellungen
- * 29=kein MsgPort
- * 30=konnte kein IORequest create
- * 31=konnte Device nicht öffnen
- * 32=falsche Parameter angabe
- * 33=zu viele Gadget (>2560)
- * 34=konnte MonitorTreiber Datei nicht laden
- * 35=Monitor mit angebenen ID nicht gefunden
- * 36=konnte Screen nicht öffnen
- * 37=Fehler im Einstellungsfile
- * 38=Menu Fehler
- * 10=Return Code für die Startup-Sequence
-
- incdir INCLUDE:
- include exec/exec.i
- include exec/io.i
- include devices/input.i
- include devices/inputevent.i
- include dos/dos.i
- include dos/dosextens.i
- include intuition/intuition.i
- include libraries/gadtools.i
- include lvo/exec_lib.i
- include lvo/dos_lib.i
- include lvo/intuition_lib.i
- include lvo/gadtools_lib.i
- include lvo/graphics_lib.i
- include lvo/input_lib.i
-
- STRUCTURE BangerMenu,0
- APTR BaM_MenuTitleText
- APTR BaM_MenuKey
- STRUCT BaM_SpaltenTitleText,[50*4]
- STRUCT BaM_SpaltenLaenge,[50]
- STRUCT BaM_GadgetLaenge,[50]
- BYTE BaM_SpaltenAnzahl
- BYTE BaM_SeitenAnzahl
- WORD BaM_GadgetAnzahl
- LABEL BaM_SIZEOF
-
- STRUCTURE Internal,0
- APTR INTUIBase
- APTR DOSBase
- APTR GADBase
- APTR GFXBase
- APTR WindowHandle
- APTR OutputHandle
- APTR ScreenHandle
- APTR VisualInfo
- APTR WinRPort
- APTR PrefsFileHandle
- APTR FileSpeicher
- APTR FontAddr
- APTR meinTask
- APTR alterTask
- APTR AnGad
- APTR MsgPortAddr
- APTR MonitorKey
- APTR MoniID
- APTR NOKEYArray
- APTR RDArgs
- APTR MenuPtr
- APTR PrintMarkTab
- STRUCT FIB,[fib_SIZEOF]
- STRUCT TastenIBlock,[IO_SIZE]
- STRUCT MenuData,[BaM_SIZEOF*50]
- STRUCT PrintData,[it_SIZEOF*20]
- STRUCT VirtualMenu,[gnm_SIZEOF*55]
- STRUCT GadgetAddr,[2600*4] ;Alle GadgetsAddressen max 2600
- STRUCT GadgetListe,[11*4] ;Einzelnen GadgetListe (Window)
- STRUCT PageLAddr,[11*4] ;eine Seite zurück
- STRUCT PageRAddr,[11*4] ;eine Seite vor
- STRUCT GadgetPage,[11*4] ;Gadgetanfang einer Seite
- STRUCT PrintPage,[11*4] ;PrintIText Addr
- LONG Filegroesse
- LONG GadUniLang
- WORD HoeheWin
- WORD BreiteWin
- WORD AlteHoeheWin
- WORD AlteBreiteWin
- WORD CAPS
- WORD SCHoehe
- WORD SCBreite
- WORD AnzahlGADs
- WORD MaxZeile
- WORD MaxSeite
- WORD AnPage
- WORD MaxSpaltenZahl
- BYTE JetztigeSeite
- BYTE LetzteSPLaenge
- BYTE ErsteSPLaenge
- BYTE VorigeSeitenLaenge
- BYTE VorigeSPSeiten
- BYTE NaechsteSPSeiten
- BYTE VorigeSPLaenge
- BYTE RelativeGDPos
- BYTE JetztigeSPLaenge
- BYTE NaechsteSPLaenge
- BYTE TextUOFlag
- BYTE SpalteOhneTitle
- BYTE MenuEintragAnzahl
- BYTE ZweitePage
- BYTE ScreenSignal
- BYTE RelativeTopC
- BYTE RelativeLeftC
- BYTE MenuAnGe
- BYTE AnzahlPage
- LABEL Int_SIZEOF
- ;;
- ** Hauptprog
- moveq #0,d7
- move.l 4.w,a6
- move.l #Int_SIZEOF,d0
- move.l #MEMF_PUBLIC!MEMF_CLEAR,d1
- jsr _LVOAllocMem(a6)
- move.l d0,a5
- bne.s LibraryO
- moveq #21,d7 ;21 = kein Speicher
- bra.w Ende
- LibraryO
- bsr.w InitRelative
- bsr.w LibOeffne
- tst.w d7
- bne.w SchliesseLibrary
- bsr.w Parameter
- tst.w d7
- bne.s SchliesseLibrary
- bsr.w WaitOnCaps
- cmp.w #10,d7
- bhi.s ParameterFree
- tst.w d7
- beq.s Menuerscheine
- moveq #0,d7
- bra.s ParameterFree
- Menuerscheine
- bsr.w PubScreenOeffne
- tst.w d7
- bne.s ParameterFree
- bsr.w LadePrefs
- tst.w d7
- bne.s SchliesseScreen
- bsr.w WertePrefsAus
- tst.w d7
- bne.s FreiSPrefs
- bsr.w InitMenu
- tst.b d7
- bne.s MenuRemove
- bsr.w InitGadget
- tst.w d7
- bne.s MenuRemove
- bsr.w FensterOeffne
- tst.w d7
- bne.s RemGad
- bsr.w SetAndLayout
- tst.b d7
- bne.s SchliesseFenster
- move.w #0,d5
- bsr.w PrintIUnter
- bsr.w GadAktivieren
- bsr.w RefreshWin
- bsr.w MessageAbFragen
- bsr.w ClearMenu
- SchliesseFenster
- bsr.w FensterSchliesse
- RemGad
- bsr.w RemoveGadget
- MenuRemove
- bsr.w RemoveMenu
- FreiSPrefs
- bsr.w SpeicherPrefs
- SchliesseScreen
- bsr.w ScreenSchliesse
- ParameterFree
- bsr.w FreePara
- SchliesseLibrary
- bsr.w LibSchliesse
- move.l a5,a1
- move.l #Int_SIZEOF,d0
- jsr _LVOFreeMem(a6)
- Ende
- move.l d7,d0
- ende
- rts
- ;;
- ** InitMenu
- InitMenu
- lea UniGad(pc),a1
- move.b RelativeTopC(a5),d4
- move.b RelativeLeftC(a5),d5
- add.b d4,gng_TopEdge+1(a1)
- add.b d5,gng_LeftEdge+1(a1)
- move.l VisualInfo(a5),gng_VisualInfo(a1)
- move.l FontAddr(a5),gng_TextAttr(a1)
- lea PageGads(pc),a1
- add.b d4,gng_TopEdge+1(a1)
- add.b d5,gng_LeftEdge+1(a1)
- move.l VisualInfo(a5),gng_VisualInfo(a1)
- move.l FontAddr(a5),gng_TextAttr(a1)
- lea PageLeftTxt(pc),a2
- move.l a2,gng_GadgetText(a1)
- lea Page2Gads(pc),a1
- add.b d4,gng_TopEdge+1(a1)
- add.b d5,gng_LeftEdge+1(a1)
- move.l VisualInfo(a5),gng_VisualInfo(a1)
- move.l FontAddr(a5),gng_TextAttr(a1)
- lea PageRightTxt(pc),a2
- move.l a2,gng_GadgetText(a1)
- lea VirtualMenu(a5),a0
- move.b #NM_TITLE,gnm_Type(a0)
- lea ProjektName(pc),a1
- move.l a1,gnm_Label(a0)
- lea gnm_SIZEOF(a0),a0
- move.b #NM_ITEM,gnm_Type(a0)
- lea InfoName(pc),a1
- move.l a1,gnm_Label(a0)
- lea InfoTaste(pc),a1
- move.l a1,gnm_CommKey(a0)
- lea gnm_SIZEOF(a0),a0
- move.b #NM_ITEM,gnm_Type(a0)
- lea QuitName(pc),a1
- move.l a1,gnm_Label(a0)
- lea QuitTaste(pc),a1
- move.l a1,gnm_CommKey(a0)
- move.b MenuEintragAnzahl(a5),d0
- tst.b d0
- beq.s keinGrossesMenu
- lea gnm_SIZEOF(a0),a0
- move.b #NM_TITLE,gnm_Type(a0)
- lea WindowTitle(pc),a1
- move.l a1,gnm_Label(a0)
- subq #1,d0
- lea MenuData(a5),a1
- MenuInitLoop
- lea gnm_SIZEOF(a0),a0
- move.b #NM_ITEM,gnm_Type(a0)
- move.l BaM_MenuTitleText(a1),gnm_Label(a0)
- move.l BaM_MenuKey(a1),gnm_CommKey(a0)
- lea BaM_SIZEOF(a1),a1
- dbra d0,MenuInitLoop
- keinGrossesMenu
- move.l GADBase(a5),a6
- lea VirtualMenu(a5),a0
- lea MenuTags(pc),a1
- jsr _LVOCreateMenusA(a6)
- move.l d0,MenuPtr(a5)
- beq.s MenuError
- move.l d0,a0
- move.l VisualInfo(a5),a1
- suba.l a2,a2
- jsr _LVOLayoutMenusA(a6)
- move.l d0,d1
- bne.s MenuOK
- MenuError
- moveq #38,d7
- MenuOK
- rts
- RemoveMenu
- move.l GADBase(a5),a6
- move.l MenuPtr(a5),a0
- jsr _LVOFreeMenus(a6)
- rts
- ;;
- ** SetAndLayout ClearMenu PrintIUnter
- SetAndLayout
- move.l INTUIBase(a5),a6
- move.l WindowHandle(a5),a0
- move.l MenuPtr(a5),a1
- jsr _LVOSetMenuStrip(a6)
- move.l d0,d1
- bne.s SetLayOK
- moveq #38,d7
- SetLayOK
- rts
- ClearMenu
- move.l INTUIBase(a5),a6
- move.l WindowHandle(a5),a0
- jsr _LVOClearMenuStrip(a6)
- rts
- PrintIUnter
- lea PrintPage(a5),a1
- lea (a1,d5.w),a1
- move.l (a1),a1
- lea it_SIZEOF(a1),a1
- move.l WinRPort(a5),a0
- moveq #0,d0
- moveq #0,d1
- move.b RelativeTopC(a5),d1
- move.b RelativeLeftC(a5),d0
- move.l INTUIBase(a5),a6
- jsr _LVOPrintIText(a6)
- rts
- ;;
- ** WertePrefsAus
- WertePrefsAus
- move.w SCHoehe(a5),d0
- sub.w #20,d0
- moveq #10,d1
- divu.w d1,d0
- move.w d0,MaxSpaltenZahl(a5)
- move.l FileSpeicher(a5),a1 ;PrefsFile anfang
- move.l Filegroesse(a5),d0
- move.l a1,a2
- lea 1(a1),a1 ;erstes Zeichen ein Return !
- add.l d0,a2 ;PrefsFile Ende
- MenuDochNoch
- cmp.l #'MENU',(a1)
- beq.s MenuEintrag
- keinMenuReturn
- cmp.b #10,(a1)+
- bne.s keinMenuReturn
- cmp.l a1,a2
- bne.s MenuDochNoch
- lea MenuData(a5),a3
- move.l FileSpeicher(a5),a1
- lea 1(a1),a1 ;erstes Zeichen ein Return !
- bra.w UnterMenuGefunden
- MenuEintrag
- lea MenuData(a5),a3
- moveq #0,d0
- EintragMenuSLoop
- cmp.b #10,(a1)+
- bne.s EintragMenuSLoop
- EintragMenu2Loop
- move.b #0,-1(a1)
- cmp.l #'ENDM',(a1)
- beq.s AlleMenuEintrage
- cmp.l a1,a2
- beq.w PrefsWerteError
- lea 1(a1),a1
- move.l a1,(a3)
- weiterSuchenMKey
- move.b (a1)+,d1
- cmp.l #'MKEY',(a1)
- beq.s TasteFuerMenu
- cmp.b #10,d1
- bne.s weiterSuchenMKey
- MKeyGefunden
- lea BaM_SIZEOF(a3),a3
- addq #1,d0
- cmp.b #50,d0
- beq.s AlleMenuEintrage
- bra.s EintragMenu2Loop
- TasteFuerMenu
- move.b #0,-1(a1)
- lea 5(a1),a1
- move.l a1,BaM_MenuKey(a3)
- EintragMenu3Loop
- cmp.b #10,(a1)+
- bne.s EintragMenu3Loop
- bra.s MKeyGefunden
- AlleMenuEintrage
- move.b d0,MenuEintragAnzahl(a5)
- lea MenuData(a5),a3
- NaechstesUnterM
- move.l BaM_MenuTitleText(a3),a0
- move.l FileSpeicher(a5),a1
- lea 1(a1),a1 ;erstes Zeichen ein Return !
- move.b (a0),d0
- TestUnterMenuLoop
- cmp.b (a1),d0
- beq.s MenuBezeich
- keinMenuBezReturn
- cmp.b #10,(a1)+
- bne.s keinMenuBezReturn
- cmp.l a1,a2
- bne.s TestUnterMenuLoop
- bra.w PrefsWerteError
- MenuBezeich
- move.l a0,a4
- MenuBezeichLoop
- move.b (a0)+,d1
- tst.b d1
- beq.s UnterErstGefunden
- cmp.b (a1)+,d1
- beq.s MenuBezeichLoop
- move.l a4,a0
- bra.s keinMenuBezReturn
- UnterErstGefunden
- move.b #0,(a1)+
- UnterMenuGefunden
- moveq #0,d5
- moveq #0,d4
- UnterMenu2Loop
- moveq #0,d0
- moveq #0,d2
- moveq #0,d3
- UnterMenuLoop
- moveq #0,d1
- cmp.l a1,a2
- beq.w UnterMenuFertig
- cmp.l #'END ',(a1)
- beq.w UnterMenuFertig
- cmp.l #'COLT',(a1)
- beq.s SpaltenTitle
- lea 1(a1),a1
- keinReturn
- addq #1,d1 ;länge GadgetName aus der Prefs
- cmp.b #10,(a1)+
- bne.s keinReturn
- move.b #0,-1(a1) ;das Return mit NullByte abschliessen
- tst.b d3 ;d3 0/1 entweder Gadgetname oder Programm bzw. Batchdatei
- beq.s BreiteZaehlen
- moveq #0,d3
- bra.s wortkleiner
- BreiteZaehlen
- moveq #1,d3
- addq #1,d0 ;d0=Anzahl der Gadgets
- cmp.b d2,d1 ;d2 enthält den längsten Gadgetnamen
- bls.s wortkleiner
- move.b d1,d2 ;neue länge war größer als alte
- wortkleiner
- bra.s UnterMenuLoop
- SpaltenTitle
- cmp.b #50,d4
- beq.w MenuIstVoll
- lea 9(a1),a1
- tst.b d4
- beq.s keineBaMDaten
- bsr.s Spalteninit
- tst.l d7
- bne.s MenuGadgetzuviel
- bra.s BaMDatenDA
- keineBaMDaten
- lea BaM_SpaltenTitleText(a3),a0
- BaMDatenDA
- move.l a1,(a0)
- SpaltenTitleLoop
- cmp.b #10,(a1)+
- bne.s SpaltenTitleLoop
- move.b #0,-1(a1)
- addq #1,d4 ;d4=SpaltenAnzahl
- bra.s UnterMenu2Loop
- MenuGadgetzuviel
- cmp.l #-1,d7
- bne.s NichtsGadgetAbzieh
- sub.w d0,d5
- NichtsGadgetAbzieh
- moveq #0,d7
- bra.w MenuIstVoll
- Spalteninit
- moveq #-1,d7
- add.w d0,d5
- cmp.w #2560,d5
- bge.s keineSpaltemehrMoeg
- move.w d4,d6
- subq #1,d6
- lea BaM_GadgetLaenge(a3),a6
- lea (a6,d6.w),a6
- lea BaM_SpaltenLaenge(a3),a4
- lea (a4,d6.w),a4
- add.w d6,d6
- add.w d6,d6
- lea BaM_SpaltenTitleText(a3),a0
- lea (a0,d6.w),a0
- move.l (a0),d7
- SpaltenCheck
- cmp.w MaxSpaltenZahl(a5),d0
- bls.s nurnocheineSpalte
- sub.w MaxSpaltenZahl(a5),d0
- move.b MaxSpaltenZahl+1(a5),(a4)+
- move.b d2,(a6)+
- move.l d7,(a0)+
- addq #1,d4
- cmp.b #50,d4
- beq.s keineSpaltemehrMoeg
- bra.s SpaltenCheck
- nurnocheineSpalte
- move.b d0,(a4)
- move.b d2,(a6)
- move.l d7,(a0)+
- moveq #0,d7
- keineSpaltemehrMoeg
- rts
- UnterMenuFertig
- tst.b d4
- bne.s JauEinSpalt
- move.w d4,d6
- addq #1,d4
- move.w d0,d1
- add.w d1,d1
- tst.b d1
- beq.s JauEinSpalt
- move.l a1,a4
- addq #1,d1
- EndeVonMenu
- tst.b -(a4)
- bne.s EndeVonMenu
- subq #1,d1
- bne.s EndeVonMenu
- EinVorRueck
- lea 1(a4),a4
- cmp.b #' ',(a4)
- beq.s EinVorRueck
- add.w d6,d6
- add.w d6,d6
- lea BaM_SpaltenTitleText(a3),a0
- lea (a0,d6.w),a0
- move.l a4,(a0)
- move.b #-1,SpalteOhneTitle(a5)
- JauEinSpalt
- bsr.w Spalteninit
- moveq #0,d7
- tst.b SpalteOhneTitle(a5)
- beq.s MenuIstVoll
- moveq #-1,d4
- move.b #0,SpalteOhneTitle(a5)
- MenuIstVoll
- lea BaM_SpaltenAnzahl(a3),a4
- move.b d4,(a4)
- lea BaM_GadgetAnzahl(a3),a4
- move.w d5,(a4)
- lea BaM_SIZEOF(a3),a3
- tst.l (a3)
- bne.w NaechstesUnterM
- rts
- PrefsWerteError
- moveq #37,d7
- rts
- ;;
- ** Parameter
- Parameter
- move.l DOSBase(a5),a6
- lea ParaTemplate(pc),a1
- move.l a1,d1
- lea MonitorKey(a5),a1
- move.l a1,d2
- moveq #0,d3
- jsr _LVOReadArgs(a6)
- move.l d0,RDArgs(a5)
- bne.s ParaOK
- jsr _LVOIoErr(a6)
- move.l d0,d1
- moveq #0,d2
- jsr _LVOPrintFault(a6)
- moveq #32,d7
- ParaOK
- rts
- FreePara
- move.l RDArgs(a5),d1
- move.l DOSBase(a5),a6
- jsr _LVOFreeArgs(a6)
- rts
- ;;
- ** Warte auf Caps Lock
- WaitOnCaps
- tst.l NOKEYArray(a5)
- bne.s NOKeyJA
- move.l 4.w,a6
- jsr _LVOCreateMsgPort(a6)
- move.l d0,MsgPortAddr(a5)
- bne.s MsgPortOK
- moveq #29,d7 ;29 = kein MsgPort
- addq #4,a7
- pea SchliesseLibrary(pc)
- rts
- MsgPortOK
- move.l d0,a0
- move.l #IOSTD_SIZE,d0
- jsr _LVOCreateIORequest(a6)
- move.l d0,TastenIBlock(a5)
- bne.s OeffneDev
- moveq #30,d7 ;30=konnte kein IORequest create
- bra.s FreiMsgP
- OeffneDev
- lea inputname(pc),a0
- move.l d0,a1
- moveq #0,d0
- move.l #IOF_QUICK,d1
- jsr _LVOOpenDevice(a6)
- tst.l d0
- beq.s DevOK
- moveq #31,d7 ;31=konnte Device nicht öffnen
- bra.s IOReqDel
- DevOK
- move.l TastenIBlock(a5),a0
- move.l IO_DEVICE(a0),a6
- jsr _LVOPeekQualifier(a6)
- and.w #IEQUALIFIER_CAPSLOCK,d0
- cmp.w #IEQUALIFIER_CAPSLOCK,d0
- beq.s CAPSgedrueckt
- moveq #10,d7
- CAPSgedrueckt
- move.l 4.w,a6
- lea TastenIBlock(a5),a1
- jsr _LVOCloseDevice(a6)
- IOReqDel
- move.l TastenIBlock(a5),a0
- jsr _LVODeleteIORequest(a6)
- FreiMsgP
- move.l MsgPortAddr(a5),a0
- jsr _LVODeleteMsgPort(a6)
- NOKeyJA
- rts
- ;;
- ** GadAktivieren
- GadAktivieren
- move.l GadgetAddr(a5),a3
- lea GadgetPage(a5),a4
- lea (a4,d5.w),a4
- move.l (a4),a4
- move.l (a4),a4
- moveq #1,d6
- bsr.w SelGK
- lea GadgetPage(a5),a4
- lea (a4,d5.w),a4
- move.l (a4),a4
- move.l a4,AnGad(a5)
- rts
- ;;
- ** Relative Init
- InitRelative
- lea topazFName8(pc),a0
- lea topaz8(pc),a1
- move.l a0,(a1)
- move.l a1,FontAddr(a5)
- rts
- ;;
- ** MessageAbFragen MsgVerarbeitung Sprung
- MessageAbFragen
- move.l WindowHandle(a5),a0
- move.l wd_UserPort(a0),a0
- move.l 4.w,a6
- jsr _LVOWaitPort(a6)
- nocheine
- move.l GADBase(a5),a6
- move.l WindowHandle(a5),a0
- move.l wd_UserPort(a0),a0
- jsr _LVOGT_GetIMsg(a6)
- move.l d0,a1
- tst.l d0
- beq.s MessageAbFragen
- move.w im_Qualifier(a1),d2
- move.l im_Class(a1),d3
- move.w im_Code(a1),d4
- move.l im_IAddress(a1),a4
- jsr _LVOGT_ReplyIMsg(a6)
- cmpi.l #IDCMP_CLOSEWINDOW,d3
- beq.w ende
- cmpi.l #IDCMP_REFRESHWINDOW,d3
- beq.w RefreWin
- cmpi.l #IDCMP_GADGETUP,d3
- beq.w GadAuswertung
- cmpi.l #IDCMP_VANILLAKEY,d3
- beq.w VanTaste
- cmpi.l #IDCMP_RAWKEY,d3
- beq.w RAWTaste
- cmp.l #IDCMP_MENUPICK,d3
- beq.s MenuAuswertung
- bra.s nocheine
- ** MenuAuswertung
- MenuAuswertung
- cmpi.w #MENUNULL,d4
- beq.w nocheine
- cmp.w #$F800,d4
- beq.w About
- cmp.w #$F820,d4
- beq.w ende
- moveq #0,d6
- sub.w #$F801,d4
- MenuErmittelLoop
- tst.w d4
- beq.s MenuWeiterWert
- sub.w #$20,d4
- addq #1,d6
- bra.s MenuErmittelLoop
- MenuWeiterWert
- cmp.b MenuAnGe(a5),d6
- beq.w nocheine
- bsr.w ReGadList
- bsr.w RemoveGadget
- move.b d6,MenuAnGe(a5)
- move.w HoeheWin(a5),AlteHoeheWin(a5)
- move.w BreiteWin(a5),AlteBreiteWin(a5)
- bsr.w InitGadget
- tst.b d7
- beq.s NeuMenuGadgetOK
- rts
- NeuMenuGadgetOK
- moveq #0,d5
- move.w d5,AnPage(a5)
- move.w AlteHoeheWin(a5),d0
- cmp.w HoeheWin(a5),d0
- bls.s VergroesserWin
- move.w AlteBreiteWin(a5),d0
- cmp.w BreiteWin(a5),d0
- bgt.s keinVergroessern
- VergroesserWin
- move.l WindowHandle(a5),a0
- move.w BreiteWin(a5),d0
- sub.w AlteBreiteWin(a5),d0
- lsr.w #1,d0
- neg.w d0
- move.w HoeheWin(a5),d1
- sub.w AlteHoeheWin(a5),d1
- lsr.w #1,d1
- neg.w d1
- move.l INTUIBase(a5),a6
- jsr _LVOMoveWindow(a6)
- move.l WindowHandle(a5),a0
- move.w BreiteWin(a5),d0
- sub.w AlteBreiteWin(a5),d0
- move.w HoeheWin(a5),d1
- sub.w AlteHoeheWin(a5),d1
- jsr _LVOSizeWindow(a6)
- keinVergroessern
- bsr.w AddGadList
- bsr.w PrintIUnter
- bsr.w GadAktivieren
- bra.w nocheine
- ;;
- ** About
- About
- move.l WindowHandle(a5),a0
- lea AbReqTi(pc),a2
- lea AbReqTxt(pc),a3
- lea AbGadTxt(pc),a4
- lea EndeReq(pc),a1
- move.l a2,8(a1)
- move.l a3,12(a1)
- move.l a4,16(a1)
- suba.l a2,a2
- suba.l a3,a3
- move.l INTUIBase(a5),a6
- jsr _LVOEasyRequestArgs(a6)
- bra.w nocheine
- ;;
- ** RefreWin
- RefreWin
- bsr.w RefreshWin
- bra.w nocheine
- ;;
- ** RAWTaste
- RAWTaste
- move.b d2,d1
- and.b #IEQUALIFIER_CONTROL,d1
- bne.s CtrlTaste
- and.b #IEQUALIFIER_LSHIFT!IEQUALIFIER_RSHIFT,d2
- bne.s ShiftTaste
- cmp.b #$4e,d4 ;rechts
- beq.w rechteBank
- cmp.b #$4f,d4 ;links
- beq.w linkeBank
- cmp.b #$4d,d4 ;Down
- beq.w DownTaste
- cmp.b #$4c,d4 ;Up
- beq.w UpTaste
- bra.w nocheine
- VanTaste
- cmp.b #$0d,d4
- beq.s Auswahl
- cmp.b #$1b,d4
- beq.w ende
- cmp.b #'<',d4
- beq.s PfeilLinks
- cmp.b #'>',d4
- beq.s PfeilRechts
- bclr #5,d4
- cmp.b #'Q',d4
- beq.w ende
- bra.w nocheine
- ShiftTaste
- cmp.b #$4e,d4 ;rechts+shift
- beq.w rechtsShift
- cmp.b #$4f,d4 ;links+shift
- beq.w linkeShift
- cmp.b #$4d,d4 ;Down+shift
- beq.w DownShift
- cmp.b #$4c,d4 ;Up+shift
- beq.w UpShift
- bra.w nocheine
- CtrlTaste
- cmp.b #$4e,d4 ;rechts+shift
- beq.w rechtsCtrl
- cmp.b #$4f,d4 ;links+shift
- beq.w linkeCtrl
- bra.w nocheine
- Auswahl
- move.l AnGad(a5),a4
- move.l (a4),a4
- bra.s GadExe
- PfeilLinks
- tst.w AnPage(a5)
- beq.w nocheine
- bra.w PageLGAn
- PfeilRechts
- bsr.s MenuDataInit
- moveq #0,d0
- move.b BaM_SeitenAnzahl(a4),d0
- cmp.w AnPage(a5),d0
- beq.w nocheine
- bra.w PageRGAn
- MenuDataInit
- lea MenuData(a5),a4
- moveq #0,d0
- moveq #0,d1
- move.b MenuAnGe(a5),d0
- move.w #BaM_SIZEOF,d1
- mulu.w d0,d1
- lea (a4,d1.w),a4
- rts
- ;;
- ** GadAuswertung
- GadAuswertung
- lea PageLAddr(a5),a0
- move.w AnPage(a5),d5
- lea (a0,d5.w),a0
- move.l (a0),a0
- cmp.l a0,a4
- beq.w PageLGAn
- lea PageRAddr(a5),a0
- lea (a0,d5.w),a0
- move.l (a0),a0
- cmp.l a0,a4
- beq.w PageRGAn
- GadExe
- move.l gg_UserData(a4),a1
- SucheAnfangExe
- tst.b (a1)+
- bne.s SucheAnfangExe
- move.l a1,d1
- moveq #0,d2
- moveq #0,d3
- move.l DOSBase(a5),a6
- jsr _LVOExecute(a6)
- moveq #10,d7
- rts
- ;;
- ;;
- ** TastenAuswertung
- UpTaste
- move.l AnGad(a5),a4
- move.w AnPage(a5),d5
- lea GadgetPage(a5),a3
- lea (a3,d5.w),a3
- move.l (a3),a3
- cmp.l a3,a4
- beq.w DownShift
- lea -4(a4),a3
- bra.s GadAnwaehlen
- DownTaste
- move.l AnGad(a5),a4
- move.w AnPage(a5),d5
- lea 4(a4),a3
- cmp.l #0,(a3)
- beq.w UpShift
- GadAnwaehlen
- move.l (a4),a4
- moveq #0,d6
- bsr.w SelGK
- moveq #1,d6
- move.l (a3),a4
- bsr.w SelGK
- move.l (a3),a3
- bsr.w GetGAddr
- bra.w nocheine
- rechteBank
- bsr.w NummerGad
- tst.b NaechsteSPLaenge(a5)
- beq.s letztesGDAnw
- tst.b NaechsteSPSeiten(a5)
- bne.s NeueSeitebeiRechts
- move.b NaechsteSPLaenge(a5),d0
- move.b RelativeGDPos(a5),d1
- cmp.b d0,d1
- bgt.s RechteSpalteLang
- move.b JetztigeSPLaenge(a5),d0
- add.b d4,d0
- bra.s DieSelbigeSeite
- RechteSpalteLang
- add.b d0,d4
- move.b JetztigeSPLaenge(a5),d0
- sub.b d1,d0
- add.b d4,d0
- bra.s DieSelbigeSeite
- NeueSeitebeiRechts
- move.l AnGad(a5),a4
- move.w AnPage(a5),d5
- addq #4,d5
- move.b RelativeGDPos(a5),d0
- move.b NaechsteSPLaenge(a5),d1
- cmp.b d0,d1
- bgt.s SpaltePasst
- move.b d1,d0
- SpaltePasst
- bra.w NeueSeite
- letztesGDAnw
- move.b JetztigeSPLaenge(a5),d0
- DieSelbigeSeite
- subq #1,d0
- DieSelbige2Seite
- add.w d0,d0 ;*4
- add.w d0,d0
- move.w AnPage(a5),d5
- move.l AnGad(a5),a4
- lea GadgetPage(a5),a3
- lea (a3,d5.w),a3
- move.l (a3),a3
- lea (a3,d0.w),a3
- bra.w GadAnwaehlen
- linkeBank
- bsr.w NummerGad
- tst.b VorigeSPLaenge(a5)
- beq.s erstesGDAnw
- tst.b VorigeSPSeiten(a5)
- bne.s NeueSeitebeiLinks
- move.b VorigeSPLaenge(a5),d0
- move.b RelativeGDPos(a5),d1
- cmp.b d0,d1
- bhi.s LinkeSpalteLang
- sub.b d0,d4
- move.b d4,d0
- bra.w DieSelbigeSeite
- LinkeSpalteLang
- move.b d4,d0
- sub.b d1,d0
- bra.w DieSelbigeSeite
- erstesGDAnw
- moveq #1,d0
- bra.w DieSelbigeSeite
- NeueSeitebeiLinks
- move.l AnGad(a5),a4
- move.w AnPage(a5),d5
- subq #4,d5
- move.b VorigeSeitenLaenge(a5),d0
- move.b VorigeSPLaenge(a5),d1
- move.b RelativeGDPos(a5),d2
- cmp.b d1,d2
- bgt.s NeueSeite
- sub.b d1,d0
- add.b d2,d0
- ** NeueSeite
- * d0 = Neues Angewähltes GadgetNr. relative zum Anfang
- * d5 = Neue SeitenNummer
- * a4 = Alte GadgetAddr
- NeueSeite
- subq #1,d0
- NeueSeite2
- cmp.b #36,d5
- bgt.w nocheine
- move.w d0,d7
- move.l (a4),a4
- moveq #0,d6
- bsr.w SelGK
- bsr.w ReGadList
- move.w d5,AnPage(a5)
- bsr.w AddGadList
- add.w d7,d7 ;*4
- add.w d7,d7
- lea GadgetPage(a5),a3
- lea (a3,d5.w),a3
- move.l (a3),a3
- lea (a3,d7.w),a3
- moveq #0,d7
- moveq #1,d6
- move.l (a3),a4
- bsr.w SelGK
- move.l (a3),a3
- bsr.w GetGAddr
- bsr.w PrintIUnter
- bra.w nocheine
- ;;
- ** NummerGad
- NummerGad
- move.l AnGad(a5),a4
- move.l (a4),a3
- move.w gg_GadgetID(a3),d6
- bsr.w MenuDataInit
- lea BaM_SpaltenLaenge(a4),a3
- lea BaM_GadgetLaenge(a4),a2
- moveq #0,d5
- move.b BaM_SpaltenAnzahl(a4),d5
- tst.b d5
- bpl.s keineUnsinnigeSpalte
- moveq #1,d5
- keineUnsinnigeSpalte
- subq #1,d5
- move.b #0,VorigeSPLaenge(a5)
- moveq #0,d0
- moveq #20,d2
- move.b d6,d4
- move.b (a3),d0
- move.b d0,ErsteSPLaenge(a5)
- SpaltenHochZLoop
- bsr.s SCBreiteBestimmen
- cmp.w SCBreite(a5),d2
- bhi.w SeiteNeuBeiSpalte
- move.b #0,VorigeSPSeiten(a5)
- VorigeSeiteKoori
- sub.b d0,d6
- cmp.b #1,d6
- blt.s GadgetSpalteGef
- move.b d0,VorigeSPLaenge(a5)
- add.w #20,d2
- dbra d5,SpaltenHochZLoop
- GadgetSpalteGef
- add.w #20,d2
- move.b d0,JetztigeSPLaenge(a5)
- move.b d6,RelativeGDPos(a5)
- add.b d0,RelativeGDPos(a5)
- tst.b d5
- beq.s keineSpaltenLaengen
- moveq #0,d0
- bsr.s SCBreiteBestimmen
- move.b d0,NaechsteSPLaenge(a5)
- cmp.w SCBreite(a5),d2
- bhi.s SeiteNeuBeiNaechster
- move.b #0,NaechsteSPSeiten(a5)
- NaechsteSeiteKoori
- add.w #20,d2
- sub.b d0,d6
- bsr.s SCBreiteBestimmen
- cmp.w SCBreite(a5),d2
- bhi.s SeiteNeuBei2Naechster
- dbra d5,NaechsteSeiteKoori
- sub.b d0,d6
- KorriKeineSpalten
- neg.b d6
- move.b d6,d0
- add.b d4,d0
- move.b d0,JetztigeSeite(a5)
- move.b -(a3),LetzteSPLaenge(a5)
- SeiteKorriRueck
- rts
- keineSpaltenLaengen
- move.b #0,NaechsteSPSeiten(a5)
- move.b #0,NaechsteSPLaenge(a5)
- bra.s KorriKeineSpalten
- SCBreiteBestimmen
- move.b (a3)+,d0
- moveq #0,d1
- move.b (a2)+,d1
- asl.w #3,d1
- add.w #10,d1
- add.w d1,d2
- rts
- SeiteNeuBeiSpalte
- moveq #0,d2
- sub.b d6,d4
- move.b d4,VorigeSeitenLaenge(a5)
- move.b d6,d4
- move.b #1,VorigeSPSeiten(a5)
- move.b d0,ErsteSPLaenge(a5)
- bra.w VorigeSeiteKoori
- SeiteNeuBeiNaechster
- move.b #1,NaechsteSPSeiten(a5)
- SeiteNeuBei2Naechster
- neg.b d6
- move.b d6,d0
- add.b d4,d0
- move.b d0,JetztigeSeite(a5)
- move.b -2(a3),LetzteSPLaenge(a5)
- bra.s SeiteKorriRueck
- ;;
- ** GetGAddr
- * a3 = Neue GadgetAddr
- GetGAddr
- lea GadgetPage(a5),a4
- lea (a4,d5.w),a4
- move.l (a4),a4
- FindeGAdd
- cmp.l (a4)+,a3
- bne.s FindeGAdd
- lea -4(a4),a4
- move.l a4,AnGad(a5)
- rts
- ;;
- ** Auswertung PageLeft/PageRight Ctrl Shift
- PageLGAn
- moveq #-4,d5
- NeueSeiteLeft
- add.w AnPage(a5),d5
- NeueSeite2Left
- move.l AnGad(a5),a4
- moveq #0,d0
- bra.w NeueSeite2
- PageRGAn
- moveq #4,d5
- bra.s NeueSeiteLeft
- rechtsCtrl
- bsr.w MenuDataInit
- moveq #0,d1
- move.b BaM_SeitenAnzahl(a4),d1
- tst.b d1
- beq.w nocheine
- cmp.w AnPage(a5),d1
- bne.s PageRGAn
- moveq #0,d5
- bra.s NeueSeite2Left
- linkeCtrl
- bsr.w MenuDataInit
- tst.w AnPage(a5)
- bne.s PageLGAn
- moveq #0,d5
- move.b BaM_SeitenAnzahl(a4),d5
- bra.s NeueSeite2Left
- UpShift
- bsr.w NummerGad
- sub.b RelativeGDPos(a5),d4
- move.b d4,d0
- bra.w DieSelbige2Seite
- DownShift
- bsr.w NummerGad
- move.b JetztigeSPLaenge(a5),d0
- sub.b RelativeGDPos(a5),d0
- add.b d4,d0
- bra.w DieSelbigeSeite
- linkeShift
- bsr.w NummerGad
- move.b RelativeGDPos(a5),d0
- move.b ErsteSPLaenge(a5),d1
- cmp.b d0,d1
- bgt.s ShiftLinksPasst
- move.b d1,d0
- ShiftLinksPasst
- bra.w DieSelbigeSeite
- rechtsShift
- bsr.w NummerGad
- move.b JetztigeSeite(a5),d0
- move.b LetzteSPLaenge(a5),d1
- sub.b RelativeGDPos(a5),d1
- bmi.s ShiftRechtsPasst
- sub.b d1,d0
- ShiftRechtsPasst
- bra.w DieSelbigeSeite
- ;;
- **SelGK Selektiert Gadget also ein oder aus
- SelGK
- bsr.b RemoveGSuche
- tst.l d6
- beq.s DisSel
- or.w #GFLG_SELECTED,gg_Flags(a4)
- bra.s NunSel
- DisSel
- eor.w #GFLG_SELECTED,gg_Flags(a4)
- NunSel
- bsr.b AddGSuche
- rts
- RemoveGSuche
- move.l WindowHandle(a5),a0
- move.l a4,a1
- move.l INTUIBase(a5),a6
- jsr _LVORemoveGadget(a6)
- rts
- AddGSuche
- move.l WindowHandle(a5),a0
- move.l a4,a1
- moveq #-1,d0
- jsr _LVOAddGadget(a6)
- move.l a4,a0
- move.l WindowHandle(a5),a1
- suba.l a2,a2
- jsr _LVORefreshGadgets(a6)
- rts
- ReGadList
- move.l WindowHandle(a5),a0
- lea GadgetListe(a5),a1
- move.w AnPage(a5),d4
- lea (a1,d4.w),a1
- move.l (a1),a1
- moveq #-1,d0
- move.l INTUIBase(a5),a6
- jsr _LVORemoveGList(a6)
- move.l WinRPort(a5),a1
- moveq #0,d0
- move.l GFXBase(a5),a6
- jsr _LVOSetAPen(a6)
- move.l WinRPort(a5),a1
- moveq #2,d0
- moveq #2,d1
- add.b RelativeLeftC(a5),d0
- add.b RelativeTopC(a5),d1
- move.w BreiteWin(a5),d2
- subq #5,d2
- move.w HoeheWin(a5),d3
- subq #5,d3
- jsr _LVORectFill(a6)
- rts
- AddGadList
- move.l WindowHandle(a5),a0
- lea GadgetListe(a5),a3
- lea (a3,d5.w),a3
- move.l (a3),a1
- moveq #2,d0
- moveq #-1,d1
- suba.l a2,a2
- move.l INTUIBase(a5),a6
- jsr _LVOAddGList(a6)
- move.l (a3),a0
- move.l WindowHandle(a5),a1
- suba.l a2,a2
- moveq #-1,d0
- jsr _LVORefreshGList(a6)
- bsr.s RefreshWin
- rts
- ;;
- ;;
- ** Refresh Fenster
- RefreshWin
- move.l GADBase(a5),a6
- move.l WindowHandle(a5),a0
- suba.l a1,a1
- jsr _LVOGT_RefreshWindow(a6)
- move.l WindowHandle(a5),a0
- jsr _LVOGT_BeginRefresh(a6)
- move.l WindowHandle(a5),a0
- moveq #DOSTRUE,d0
- jsr _LVOGT_EndRefresh(a6)
- rts
- ;;
- ** Fenster Öffnen
- FensterOeffne
- move.l INTUIBase(a5),a6
- lea Fenster_Tags(pc),a1
- move.l GadgetListe(a5),12(a1)
- move.l ScreenHandle(a5),60(a1)
- lea WindowTitle(pc),a0
- move.l a0,4(a1)
- lea ScreenTitle(pc),a0
- move.l a0,20(a1)
- move.w BreiteWin(a5),d0
- move.w d0,30(a1)
- sub.w SCBreite(a5),d0
- neg.w d0
- asr.w #1,d0
- move.w d0,54(a1)
- move.w HoeheWin(a5),d4
- move.w d4,38(a1)
- move.w SCHoehe(a5),d0
- add.w #50,d0
- sub.w d4,d0
- asr.w #1,d0
- move.w d0,46(a1)
- suba.l a0,a0
- jsr _LVOOpenWindowTagList(a6)
- move.l d0,WindowHandle(a5)
- beq.b ErrorWindow
- move.l d0,a0
- move.l wd_RPort(a0),WinRPort(a5)
- move.l 4.w,a6
- suba.l a1,a1
- jsr _LVOFindTask(a6)
- move.l d0,meinTask(a5)
- beq.s ErrorTask
- move.l d0,a0
- move.l pr_WindowPtr(a0),alterTask(a5)
- move.l WindowHandle(a5),pr_WindowPtr(a0)
- rts
- ErrorTask
- bsr.s keinTask
- ErrorWindow
- moveq #26,d7 ;26 = konnte Fenster nicht öffnen oder Task nicht finden
- rts
- FensterSchliesse
- move.l meinTask(a5),a0
- move.l alterTask(a5),pr_WindowPtr(a0)
- keinTask
- move.l INTUIBase(a5),a6
- move.l WindowHandle(a5),a0
- jsr _LVOCloseWindow(a6)
- rts
- ;;
- ** GadgetListeInit
- * d0=WelcheSeite
- * a0=Pointer für CreateGadget
- GadgetListeInit
- lea PrintPage(a5),a1
- move.l PrintMarkTab(a5),(a1,d0.w)
- lea GadgetPage(a5),a1
- move.l a3,(a1,d0.w)
- lea GadgetListe(a5),a0
- lea (a0,d0.w),a0
- move.l GADBase(a5),a6
- jsr _LVOCreateContext(a6)
- move.l d0,a0
- beq.w ErrorGadget
- rts
- ;;
- ** InitGadget
- InitGadget
- lea PrintData(a5),a1
- move.l a1,PrintMarkTab(a5)
- moveq #it_SIZEOF*5,d0
- LoescheTextData
- move.l #0,(a1)+
- dbra d0,LoescheTextData
- move.b #0,SpalteOhneTitle(a5)
- bsr.w MenuDataInit
- moveq #0,d6
- move.b #0,BaM_SeitenAnzahl(a4)
- move.b BaM_SpaltenAnzahl(a4),d6
- tst.b d6
- bpl.s NormalSpaltenMitTitle
- moveq #1,d6
- move.b #1,SpalteOhneTitle(a5)
- NormalSpaltenMitTitle
- subq #1,d6
- lea GadgetAddr(a5),a3
- moveq #0,d0
- bsr.s GadgetListeInit
- moveq #0,d3
- SpaltenLoop
- * a0=GadgetCreatepointer
- * a3=GadgetAddr essen speicher
- * a4=BangerMenu-Struct (data)
- * d3=GadgetText (später nach Schleife Ende init)
- * d6=Spalten Anzahl
- moveq #0,d0
- move.b BaM_SpaltenAnzahl(a4),d0
- tst.b d0
- bpl.s NormalSpalten2MitTitle
- moveq #1,d0
- NormalSpalten2MitTitle
- sub.w d6,d0
- subq #1,d0
- lea BaM_SpaltenLaenge(a4),a1
- lea (a1,d0.w),a1
- moveq #0,d5
- move.b (a1),d5
- move.w d5,d2
- moveq #10,d1
- mulu.w d1,d2
- add.w #60,d2
- cmp.w HoeheWin(a5),d2
- bls.s WinGroesseBeh
- move.w d2,HoeheWin(a5)
- WinGroesseBeh
- tst.b d5
- beq.w COLOhne
- subq #1,d5
- lea BaM_GadgetLaenge(a4),a1
- lea (a1,d0.w),a1
- moveq #0,d4
- move.b (a1),d4
- asl.w #3,d4
- add.w #10,d4
- lea UniGad(pc),a1
- move.w gng_LeftEdge(a1),d1
- move.w d4,gng_Width(a1)
- add.w d4,d1
- cmp.w SCBreite(a5),d1
- bhi.w NeueSeiteInit
- SeitenRueckkehr
- lea BaM_SpaltenTitleText(a4),a1
- add.w d0,d0
- add.w d0,d0
- lea (a1,d0.w),a1
- move.l (a1),a1
- tst.b SpalteOhneTitle(a5)
- bne.s GSNameRichtig
- bsr.w TextInit
- tst.b d3
- beq.s ErsterGadNameFind
- move.l d3,a2
- cmp.b #$20,-1(a2)
- beq.s TauscheReg
- ErsterGadNameFind
- tst.b (a1)+
- bne.s ErsterGadNameFind
- lea 1(a1),a1
- GSNameRichtig
- move.l a1,d3
- TauscheReg
- exg a4,d3
- InitGadloop
- * a0=GadgetCreatepointer
- * a3=GadgetAddr essen speicher
- * a4=GadgetText (aus der Konfig)
- * d3=BangerMenuStruct
- * d5=GadgetAnzahl pro Spalte
- * d6=Spalten Anzahl
- moveq #BUTTON_KIND,d0
- lea UniGad(pc),a1
- move.l a4,gng_GadgetText(a1)
- add.w #10,gng_TopEdge(a1)
- add.w #1,gng_GadgetID(a1)
- suba.l a2,a2
- move.l GADBase(a5),a6
- jsr _LVOCreateGadgetA(a6)
- move.l d0,(a3)+
- beq.w ErrorGadget
- move.l d0,a0
- move.l a4,gg_UserData(a0)
- bsr.w Return2Find
- dbra d5,InitGadloop
- lea UniGad(pc),a1
- move.w #20,gng_TopEdge(a1)
- move.b RelativeTopC(a5),d0
- add.b d0,gng_TopEdge+1(a1)
- move.w gng_Width(a1),d0
- add.w d0,gng_LeftEdge(a1)
- add.w #20,gng_LeftEdge(a1)
- exg d3,a4
- COLOhne
- dbra d6,SpaltenLoop
- lea UniGad(pc),a1
- move.w gng_LeftEdge(a1),d1
- move.w #20,gng_LeftEdge(a1)
- move.b RelativeLeftC(a5),d0
- add.b d0,gng_LeftEdge+1(a1)
- move.w #0,gng_GadgetID(a1)
- cmp.w BreiteWin(a5),d1
- bls.s WinBreite2Beh
- move.w d1,BreiteWin(a5)
- WinBreite2Beh
- tst.b BaM_SeitenAnzahl(a4)
- beq.s GadgetEndeInit
- bsr.w SeitenGadgetInit
- GadgetEndeInit
- move.b #0,ZweitePage(a5)
- move.l #0,(a3)
- rts
- ;;
- ** TextInit
- * a0=GadgetCreatepointer
- * a1=Zeiger auf Col Title Text
- * a3=GadgetAddr essen speicher
- * a4=BangerMenu-Struct (data)
- * d0=Spalte
- * d3=GadgetText voriges Mal
- * d5=GadgetAnzahl pro Spalte
- * d6=Spalten Anzahl
- TextInit
- movem.l a0-a4/d7,-(sp)
- move.w d0,d4
- lea UniGad(pc),a2
- move.w gng_LeftEdge(a2),d7
- move.w gng_Width(a2),d2
- move.l PrintMarkTab(a5),a2
- lea it_SIZEOF(a2),a3
- move.l a3,it_NextText(a2)
- move.l #$02000100,(a3)
- move.w #19,it_TopEdge(a3)
- move.l FontAddr(a5),it_ITextFont(a3)
- move.l a1,it_IText(a3)
- move.l a1,a0
- TextEndeLoop
- tst.b (a1)+
- bne.s TextEndeLoop
- sub.l a0,a1
- move.l a1,d0
- subq #1,d0
- lsl.w #3,d0
- sub.w d0,d2
- bmi.s TextZuLang
- lsr.w #1,d2
- TextKorritur
- add.w d2,d7
- move.b RelativeLeftC(a5),d2
- sub.w d2,d7
- bpl.s nichtFensterRand
- moveq #0,d7
- nichtFensterRand
- move.w d7,it_LeftEdge(a3)
- move.l a3,PrintMarkTab(a5)
- movem.l (sp)+,a0-a4/d7
- rts
- TextZuLang
- neg.w d2
- lsr.w #1,d2
- neg.w d2
- tst.b d4
- beq.s TextKorritur
- sub.b d4,TextUOFlag(a5)
- beq.s TextKorritur
- addq #1,d4
- move.b d4,TextUOFlag(a5)
- sub.w #10,it_TopEdge(a3)
- bra.s TextKorritur
- ;;
- ** NeueSeiteInit
- * a0=GadgetCreatepointer
- * a3=GadgetAddr essen speicher
- * a4=BangerMenu-Struct (data)
- * d0=Spalte
- * d3=GadgetText (später nach Schleife Ende init)
- * d5=GadgetAnzahl pro Spalte
- * d6=Spalten Anzahl
- NeueSeiteInit
- movem.l d0,-(sp)
- bsr.s SeitenGadgetInit
- tst.b d7
- beq.s SeitenGadgOK
- rts
- SeitenGadgOK
- lea UniGad(pc),a1
- move.w gng_LeftEdge(a1),d0
- cmp.w BreiteWin(a5),d0
- bls.s WinBreiteBeh
- move.w d0,BreiteWin(a5)
- WinBreiteBeh
- move.w #20,gng_LeftEdge(a1)
- move.b RelativeLeftC(a5),d0
- add.b d0,gng_LeftEdge+1(a1)
- move.l #0,(a3)+
- add.b #4,BaM_SeitenAnzahl(a4)
- move.l PrintMarkTab(a5),a1
- move.l #0,it_NextText(a1)
- lea it_SIZEOF(a1),a1
- move.l a1,PrintMarkTab(a5)
- moveq #0,d0
- move.b BaM_SeitenAnzahl(a4),d0
- bsr.w GadgetListeInit
- tst.b d7
- beq.s NeueGadListeOK
- rts
- NeueGadListeOK
- movem.l (sp)+,d0
- bra.w SeitenRueckkehr
- ;;
- ** SeitenGadgetInit
- * a0=GadgetCreatepointer
- * d6=Spalten Anzahl (ob noche eine Seite kommt oder nicht)
- SeitenGadgetInit
- moveq #0,d4
- move.b BaM_SeitenAnzahl(a4),d4
- moveq #BUTTON_KIND,d0
- lea PageGads(pc),a1
- tst.b ZweitePage(a5)
- beq.s kein1Seite
- lea PaGadTags2(pc),a2
- bra.s doch1Seite
- kein1Seite
- lea PaGadTags(pc),a2
- doch1Seite
- jsr _LVOCreateGadgetA(a6)
- tst.l d0
- beq.w ErrorGadget
- move.l d0,a0
- lea PageLAddr(a5),a1
- lea (a1,d4.w),a1
- move.l d0,(a1)
- moveq #BUTTON_KIND,d0
- lea Page2Gads(pc),a1
- tst.b d6
- bmi.s kein2Seite
- cmp.b #36,d4
- beq.s kein2Seite
- lea PaGadTags2(pc),a2
- bra.s doch2Seite
- kein2Seite
- lea PaGadTags(pc),a2
- doch2Seite
- jsr _LVOCreateGadgetA(a6)
- tst.l d0
- beq.w ErrorGadget
- move.l d0,a0
- lea PageRAddr(a5),a1
- lea (a1,d4.w),a1
- move.l d0,(a1)
- move.b #1,ZweitePage(a5)
- rts
- ;;
- ** ErrorGadget
- ErrorGadget
- bsr.s RemoveGadget
- moveq #25,d7 ;25 = Gadget init Fehler
- rts
- RemoveGadget
- move.l GADBase(a5),a6
- bsr.w MenuDataInit
- moveq #0,d4
- move.b BaM_SeitenAnzahl(a4),d4
- GadListeFLoop
- lea GadgetListe(a5),a0
- lea (a0,d4.w),a0
- move.l (a0),a0
- jsr _LVOFreeGadgets(a6)
- subq #4,d4
- bpl.s GadListeFLoop
- rts
- Return2Find
- tst.b (a4)+
- bne.s Return2Find
- Return1Mal
- tst.b (a4)+
- bne.s Return1Mal
- cmp.b #$20,(a4)
- bne.s AltesKonfigFile
- lea 1(a4),a4
- AltesKonfigFile
- rts
- ;;
- ** Speicher freigeben von den Einstellungen
- SpeicherPrefs
- move.l FileSpeicher(a5),a1
- move.l Filegroesse(a5),d0
- move.l 4.w,a6
- jsr _LVOFreeMem(a6)
- rts
- ;;
- ** Lade Einstellungen
- LadePrefs
- lea PrefsFile1(pc),a3
- move.l a3,d1
- move.l #MODE_OLDFILE,d2
- move.l DOSBase(a5),a6
- jsr _LVOOpen(a6)
- move.l d0,PrefsFileHandle(a5)
- bne.s OpenPrefsFile
- lea PrefsFileName(pc),a3
- move.l a3,d1
- move.l #MODE_OLDFILE,d2
- jsr _LVOOpen(a6)
- move.l d0,PrefsFileHandle(a5)
- beq.s OpenFileError
- OpenPrefsFile
- move.l d0,d1
- lea FIB(a5),a3
- move.l a3,d2
- jsr _LVOExamineFH(a6)
- move.l fib_Size(a3),d0
- addq #1,d0
- move.l d0,Filegroesse(a5)
- cmp.l #1,d0
- beq.s nixPrefs
- tst.l d0
- beq.s nixPrefs
- move.l #MEMF_PUBLIC!MEMF_CLEAR,d1
- move.l 4.w,a6
- jsr _LVOAllocMem(a6)
- move.l d0,FileSpeicher(a5)
- beq.s ErrorFiSp
- move.l d0,a0
- move.b #0,(a0)+
- move.l PrefsFileHandle(a5),d1
- move.l a0,d2
- move.l Filegroesse(a5),d3
- move.l DOSBase(a5),a6
- jsr _LVORead(a6)
- SchliesseFile
- move.l PrefsFileHandle(a5),d1
- move.l DOSBase(a5),a6
- jsr _LVOClose(a6)
- rts
- ErrorFiSp
- moveq #28,d7 ;28 = kein Speicher für Prefs
- bra.s SchliesseFile
- OpenFileError
- moveq #24,d7 ;24 = konnte File BangerMenu.prefs nicht öffnen
- rts
- nixPrefs
- moveq #27,d7 ;27 = Prefs vorhanden aber leer
- bra.s SchliesseFile
- ;;
- ** Library Öffnen + Schliessen
- LibOeffne
- move.l a5,a4
- lea intname(pc),a1
- bsr.s OeffneLib
- lea dosname(pc),a1
- bsr.s OeffneLib
- lea gadname(pc),a1
- bsr.s OeffneLib
- lea gfxname(pc),a1
- bsr.s OeffneLib
- rts
- OeffneLib
- moveq #37,d0
- jsr _LVOOpenLibrary(a6)
- move.l d0,(a4)+
- beq.s LibError
- rts
- LibError
- moveq #22,d7 ;22 = konnte Library nicht öffnen
- rts
- LibSchliesse
- move.l 4.w,a6
- moveq #4-1,d2
- lea WindowHandle(a5),a4
- SchliesseLib
- move.l -(a4),a1
- cmp.l #0,a1
- beq.s notOpened
- jsr _LVOCloseLibrary(a6)
- notOpened
- dbra d2,SchliesseLib
- rts
- ;;
- ** PubScreenOeffne
- PubScreenOeffne
- tst.l MonitorKey(a5)
- beq.w StdPal
- tst.l MoniID(a5)
- bne.s IDistDa
- moveq #32,d7
- rts
- IDistDa
- move.l MonitorKey(a5),d1
- moveq #0,d2
- moveq #0,d3
- move.l DOSBase(a5),a6
- jsr _LVOExecute(a6)
- tst.l d0
- bne.s NeuenMonitor
- moveq #34,d7
- rts
- NeuenMonitor
- move.l MoniID(a5),a4
- move.l (a4),d0
- move.l GFXBase(a5),a6
- jsr _LVOFindDisplayInfo(a6)
- tst.l d0
- bne.s MonitorDa
- moveq #35,d7
- rts
- MonitorDa
- move.l 4.w,a6
- keinSignal
- moveq #-1,d0
- jsr _LVOAllocSignal(a6)
- move.b d0,ScreenSignal(a5)
- bmi.b keinSignal
- lea MyScreenTags(pc),a1
- lea PubScTitle(pc),a0
- move.l a0,4(a1)
- move.l MoniID(a5),a4
- move.l (a4),12(a1)
- moveq #0,d0
- move.b ScreenSignal(a5),d0
- move.l d0,20(a1)
- lea PenArray(pc),a0
- move.l a0,28(a1)
- suba.l a0,a0
- move.l INTUIBase(a5),a6
- jsr _LVOOpenScreenTagList(a6)
- move.l d0,ScreenHandle(a5)
- bne.s Pubvorgucken
- moveq #36,d7
- rts
- Pubvorgucken
- move.l d0,a0
- moveq #0,d0
- jsr _LVOPubScreenStatus(a6)
- move.w d0,d1
- beq.w keinPubScreen
- lea PubScTitle(pc),a0
- bra.s Pubgucken
- StdPal
- suba.l a0,a0
- Pubgucken
- move.l INTUIBase(a5),a6
- jsr _LVOLockPubScreen(a6)
- tst.l d0
- beq.s keinPubScreen
- move.l d0,ScreenHandle(a5)
- move.l d0,a0
- move.w sc_Height(a0),SCHoehe(a5)
- move.w sc_Width(a0),SCBreite(a5)
- sub.w #20,SCBreite(a5)
- sub.w #50,SCHoehe(a5)
- move.l sc_Font(a0),a1
- move.w ta_YSize(a1),d2
- add.b sc_WBorTop(a0),d2
- addq #1,d2
- move.b d2,RelativeTopC(a5)
- move.b sc_WBorTop(a0),RelativeLeftC(a5)
- suba.l a1,a1
- move.l GADBase(a5),a6
- jsr _LVOGetVisualInfoA(a6)
- move.l d0,VisualInfo(a5)
- bne.s VisualOK
- keinPubScreen
- moveq #23,d7
- VisualOK
- rts
- ScreenSchliesse
- move.l GADBase(a5),a6
- move.l VisualInfo(a5),a0
- jsr _LVOFreeVisualInfo(a6)
- ScrSchliesse
- move.l INTUIBase(a5),a6
- suba.l a0,a0
- move.l ScreenHandle(a5),a1
- jsr _LVOUnlockPubScreen(a6)
- cmp.b #10,d7
- beq.s ScreenBleibt
- move.l ScreenHandle(a5),a0
- jsr _LVOCloseScreen(a6)
- ScreenBleibt
- rts
- ;;
- ** LONG Daten
- Fenster_Tags
- dc.l WA_Title,0
- dc.l WA_Gadgets,0
- dc.l WA_ScreenTitle,0
- dc.l WA_Width,0
- dc.l WA_Height,0
- dc.l WA_Top,11
- dc.l WA_Left,0
- dc.l WA_PubScreen,0
- dc.l WA_IDCMP,IDCMP_MENUPICK!IDCMP_CLOSEWINDOW!IDCMP_VANILLAKEY!IDCMP_REFRESHWINDOW!BUTTONIDCMP!RAWKEY
- dc.l WA_Flags,WFLG_ACTIVATE!WFLG_SMART_REFRESH!WFLG_DRAGBAR!WFLG_DEPTHGADGET!WFLG_CLOSEGADGET
- dc.l WA_NewLookMenus,-1
- dc.l WA_AutoAdjust,-1
- dc.l TAG_DONE
- MyScreenTags
- dc.l SA_PubName,0
- dc.l SA_DisplayID,0
- dc.l SA_PubSig,0
- dc.l SA_Pens,0
- dc.l SA_Type,WBENCHSCREEN
- dc.l SA_Width,STDSCREENWIDTH
- dc.l SA_Height,STDSCREENHEIGHT
- dc.l SA_Depth,2
- dc.l SA_SysFont,1
- dc.l SA_Overscan,OSCAN_TEXT
- dc.l TAG_DONE
- UniGad
- dc.w 20,20,0,10
- dc.l 0,0
- dc.w 0
- dc.l PLACETEXT_IN,0,0
- PageGads
- dc.w 20,5,14,12
- dc.l 0,0
- dc.w 10000
- dc.l PLACETEXT_IN,0,0
- Page2Gads
- dc.w 40,5,14,12
- dc.l 0,0
- dc.w 10001
- dc.l PLACETEXT_IN,0,0
- PaGadTags
- dc.l GA_Disabled,1
- PaGadTags2
- dc.l GT_Underscore,'_'
- dc.l TAG_DONE
- MenuTags
- dc.l GTMN_NewLookMenus,1
- dc.l TAG_END
- topaz8:
- dc.l 0
- dc.w 8
- dc.b 0,1
- PenArray
- dc.w -1
- EndeReq
- dc.l EasyStruct_SIZEOF
- dc.l 0,0,0,0
- ;;
- ** BYTE Daten
- ParaTemplate dc.b 'MONITORTREIBER,MONITORID/K/N,NOKEY/S',0
- intname INTNAME
- dosname DOSNAME
- gadname GADTOOLSNAME
- gfxname GRAFNAME
- AbReqTi dc.b 'About the program',0
- AbReqTxt dc.b 'BangerMenu is giftware',10
- dc.b 'Autor: Andre´ Trettin',10,10
- dc.b ' Duwockskamp 33',10
- dc.b ' 21029 Hamburg',10
- dc.b ' 040/7246861',10
- dc.b ' Germany',10,10
- dc.b 'EMail: tretti-a@rzbt.fh-hamburg.de',10,10
- dc.b 'Greeting all how sent me a EMail about BangerMenu',10
- dc.b ' and my friends',0
- AbGadTxt dc.b 'OK',0
- ProjektName dc.b 'Project',0
- InfoName dc.b 'About',0
- QuitName dc.b 'Quit',0
- InfoTaste dc.b 'A',0
- QuitTaste dc.b 'Q',0
- PubScTitle dc.b 'Workbench Screen',0
- PageLeftTxt dc.b '_<',0
- PageRightTxt dc.b '_>',0
- inputname dc.b 'input.device',0
- PrefsFileName dc.b 'S:'
- PrefsFile1 dc.b 'BangerMenu.prefs',0
- topazFName8 dc.b 'topaz.font',0
- WindowTitle dc.b 'BangerMenu',0
- dc.b '$VER: '
- ScreenTitle dc.b 'BangerMenu 3.05 (19-Feb-96) © by Andre´ Trettin',0
- ;;
-