home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
develop
/
beermon
/
bmsourcecode.lha
/
BMPE.S
< prev
next >
Wrap
Text File
|
1993-08-14
|
23KB
|
1,114 lines
;
; BeerMon Preferences Editor
;
_SysBase=4
incdir "DH0:Include"
CloseLibrary = -414
Forbid = -132
GetMsg = -372
OldOpenLibrary = -408
ReplyMsg = -378
WaitPort = -384
Close = -36
Open = -30
Output = -60
Read = -42
Seek = -66
Write = -48
DisplayBeep = -96
GT_GetIMsg = -72
GT_ReplyIMsg = -78
GT_SetGadgetAttrsA = -42
bmmaxlen = $30000
preflen = 4+4+4+4+(10*20)+30
patchoff= 4
patchlen= 4+4+4+(10*20)
bmpid = "BMP"<<8+0
run: move.l 4.w,a6
move.l $114(a6),a3
moveq #0,d0
tst.l $ac(a3) ;pr_cli
bne.b fromcli
lea $5c(a3),a0
jsr WaitPort(a6)
lea $5c(a3),a0
jsr GetMsg(a6)
fromcli:move.l d0,wbmsg
move.w $14(a6),d2
lea dosname(pc),a1
jsr OldOpenLibrary(a6)
move.l d0,dosbase
beq.w nodos
cmp.w #36,d2
bhi.b kickok
move.l d0,a5
exg a5,a6
jsr Output(a6)
move.l d0,d1
beq.b nohd
move.l #kickmsg,d2
move.l #kicklen,d3
jsr Write(a6)
nohd: exg a5,a6
bra.w nogad
kickok: lea gadname(pc),a1
jsr OldOpenLibrary(a6)
move.l d0,_GadToolsBase
beq.w nogad
lea intname(pc),a1
jsr OldOpenLibrary(a6)
move.l d0,_IntuitionBase
beq.w noint
jsr SetupScreen
bne.w initfail
jsr OpenProject0Window
bne.w initfail
move.l Project0Wnd,a4
bsr.w ldpref
moveq #0,d7
gadepty:tst.l d7
bne.w leave
move.l 4.w,a6
move.l $56(a4),a0
jsr WaitPort(a6)
move.l _GadToolsBase(pc),a6
move.l $56(a4),a0
jsr GT_GetIMsg(a6)
tst.l d0
beq.b gadepty
move.l d0,a1
movem.l a1/a6,-(a7)
cmp.l #$40,$14(a1) ;class_gadgetup
bne.w gadlp0
move.w $18(a1),d2 ;code
move.l $1c(a1),a0 ;iadress
move.w $26(a0),d0 ;gadgetid
cmp.w #GD_Gadget180,d0
bne.b nocanc
moveq #-1,d7
nocanc: cmp.w #GD_Gadget100,d0
bne.b nomodeg
move.b d2,prefbuf+8+1
nomodeg:cmp.w #GD_Gadget110,d0
bne.b nokeymg
and.b #$f0,prefbuf+8+2
or.b d2,prefbuf+8+2
nokeymg:cmp.w #GD_Gadget120,d0
bne.b noreptg
move.b d2,prefbuf+8+3
noreptg:cmp.w #GD_Gadget210,d0
bne.b nocpug
move.b d2,prefbuf+8+0
nocpug:
cmp.w #GD_Gadget190,d0
bne.w nodoit
bsr.w update
move.l dosbase(pc),a6
lea Project0Gadgets+(GD_Gadget200*4),a0
bsr.w getadr
move.l a1,d1 ;name
move.l #1005,d2 ;load
jsr Open(a6)
move.l d0,d4
beq.w noop3
move.l d4,d1
move.l #bmbuf,d2
move.l #bmmaxlen,d3
jsr Read(a6)
move.l d0,bmlen
move.l d0,-(a7)
beq.b bmemp
lea bmbuf,a0
move.l #bmmaxlen,a1
add.l a0,a1
move.l #"PTCH",d0
ptcnf: cmp.l (a0)+,d0
beq.b ptcfnd
subq.w #2,a0
cmp.l a0,a1
bne.b ptcnf
clr.l (a7) ;set error flag
bra.w bmemp ;patch not found
ptcfnd: sub.l #bmbuf,a0
move.l a0,d2 ;offset
move.l d4,d1
moveq #-1,d3 ;offset beg
jsr Seek(a6)
move.l d4,d1
move.l #prefbuf+patchoff,d2
move.l #patchlen,d3
jsr Write(a6)
cmp.l d3,d0
seq d0
ext.w d0
ext.l d0
move.l d0,(a7) ;clr error flag
bmemp: move.l d4,d1
jsr Close(a6)
tst.l (a7)+
beq.b noop3
moveq #1,d7
bra.b opok3
noop3: bsr.w beep
opok3:
nodoit: cmp.w #GD_Gadget130,d0
bne.b nogad13
lea Project0Gadgets+(GD_Gadget130*4),a0
bsr.w getadr
bsr.w cvrgb
bmi.b nogad13
bsr.w beep
move.l Project0Gadgets+(GD_Gadget130*4),a0
lea GadGet130Tags,a3
bsr.w setgad
nogad13:cmp.w #GD_Gadget140,d0
bne.b nogad14
lea Project0Gadgets+(GD_Gadget140*4),a0
bsr.w getadr
bsr.w cvrgb
bmi.b nogad14
bsr.w beep
move.l Project0Gadgets+(GD_Gadget140*4),a0
lea GadGet140Tags,a3
bsr.w setgad
nogad14:
cmp.w #GD_Gadget150,d0
bne.w nogad15
bsr.w ldpref
nogad15:cmp.w #GD_Gadget160,d0
bne.w nogad16
bsr.w update
move.l dosbase(pc),a6
lea Project0Gadgets+(GD_Gadget170*4),a0
bsr.w getadr
move.l a1,d1 ;name
move.l #1006,d2 ;save
jsr Open(a6)
move.l d0,d4
beq.b noop2
move.l d4,d1
move.l #prefbuf,d2
move.l #preflen,d3
jsr Write(a6)
move.l d0,-(a7)
move.l d4,d1
jsr Close(a6)
cmp.l (a7)+,d3
bne.b noop2
bra.b opok2
noop2: bsr.w beep
opok2:
nogad16:cmp.w #GD_Gadget220,d0
bne.w nogad22
bchg #4,prefbuf+8+2
nogad22:
gadlp0: movem.l (a7)+,a1/a6
jsr GT_ReplyIMsg(a6)
bra.w gadepty
leave:
initfail:
jsr CloseProject0Window
jsr CloseDownScreen
move.l 4.w,a6
move.l _IntuitionBase(pc),a1
jsr CloseLibrary(a6)
noint: move.l _GadToolsBase(pc),a1
jsr CloseLibrary(a6)
nogad: move.l dosbase(pc),a1
jsr CloseLibrary(a6)
nodos: move.l wbmsg(pc),d7
beq.b noreply
jsr Forbid(a6)
move.l d7,a1
jsr ReplyMsg(a6)
noreply:moveq #0,d0
rts
copystr:move.l (a0)+,a1
move.l $22(a1),a1 ;strinfo
move $0a(a1),d1
subq.w #2,d1 ;size-1
move.l (a1),a1 ;buffer
cpfgd: move.b (a1)+,(a2)+
dbf d1,cpfgd
dbf d0,copystr
rts
getadr: move.l (a0)+,a1
move.l $22(a1),a1 ;strinfo
move.l (a1),a1 ;buffer
rts
update: lea prefbuf(pc),a2
move.l #bmpid,(a2)+
move.l #$deaddead,(a2)+ ;reserved
tst.l (a2)+ ;cpu,mode,keymap,repeat
lea Project0Gadgets+(GD_Gadget130*4),a0
bsr.b getadr
bsr.b cvrgb
move.w d2,(a2)+ ;even
bsr.b getadr
bsr.b cvrgb
move.w d2,(a2)+
lea Project0Gadgets+(GD_Gadget00*4),a0 ;f1-f10
moveq #10-1,d0
bsr.w copystr
lea Project0Gadgets+(GD_Gadget200*4),a0 ;path
moveq #1-1,d0
bra.w copystr
cvrgb: moveq #0,d2
moveq #3-1,d0
cvrgb0: lsl.w #4,d2
move.b (a1)+,d1
sub.b #"0",d1
bcs.b cverr
cmp.b #9,d1
bls.b cvok
bclr #5,d1
sub.b #"A"-"0"-10,d1
bcs.b cverr
cmp.b #15,d1
bhi.b cverr
cvok: or.b d1,d2
dbf d0,cvrgb0
cverr: tst.w d0
rts
beep: move.l _IntuitionBase(pc),a6
move.l Scr,a0
jmp DisplayBeep(a6)
ldpref: move.l dosbase(pc),a6
lea Project0Gadgets+(GD_Gadget170*4),a0
bsr.w getadr
move.l a1,d1 ;name
move.l #1005,d2 ;load
jsr Open(a6)
move.l d0,d4
beq.w noop
move.l d4,d1
move.l #prefbuf,d2
move.l #preflen,d3
jsr Read(a6)
move.l d0,-(a7)
move.l d4,d1
jsr Close(a6)
cmp.l (a7)+,d3
bne.w noop
lea prefbuf(pc),a2
cmp.l #bmpid,(a2)+
bne.w noop
addq.w #4,a2 ;reserved
lea Project0Gadgets+(GD_Gadget210*4),a0
bsr.w setcyc
lea Project0Gadgets+(GD_Gadget100*4),a0
bsr.w setcyc
lea Project0Gadgets+(GD_Gadget110*4),a0
moveq #%1111,d0 ;bit0-3:language
and.b (a2),d0
move.b d0,cyctags+4+3
bsr.w setcyc2
move.l Project0Gadgets+(GD_Gadget220*4),a0
lea chktags,a3
btst #4,(a2)+ ;bit4:verify
sne d0
addq.b #1,d0
move.b d0,4+3(a3)
bsr.w setgad
lea Project0Gadgets+(GD_Gadget120*4),a0
bsr.w setcyc
lea Project0Gadgets+(GD_Gadget130*4),a0
move.w (a2)+,d0 ;col0
lea strstr(pc),a3
bsr.w rgbcnv
exg a3,a2
bsr.w setstr
exg a3,a2
move.w (a2)+,d0 ;col1
lea strstr(pc),a3
bsr.w rgbcnv
exg a3,a2
bsr.w setstr
exg a3,a2
lea Project0Gadgets+(GD_Gadget00*4),a0
moveq #10-1,d0 ;f1-f10
setstr0:bsr.w setstr
dbf d0,setstr0
lea Project0Gadgets+(GD_Gadget200*4),a0 ;path
bra.w setstr
noop: bra.w beep
rgbcnv: moveq #3-1,d2
rol.w #8,d0
hexcnv: moveq #$0f,d1
and.w d0,d1
rol.w #4,d0
move.b hextab(pc,d1.w),(a3)+
dbf d2,hexcnv
subq.w #3,a3
rts
hextab: dc.b "0123456789ABCDEF"
setgad: movem.l d0-d1/a0-a2/a6,-(a7)
move.l _GadToolsBase(pc),a6
move.l Project0Wnd,a1
sub.l a2,a2
jsr GT_SetGadgetAttrsA(a6)
movem.l (a7)+,d0-d1/a0-a2/a6
rts
chktags:dc.l $80080004,1
dc.l 0
setcyc: move.b (a2)+,cyctags+4+3
setcyc2:movem.l d0-d1/a0-a3/a6,-(a7)
move.l (a0),a0 ;gadget
move.l _GadToolsBase(pc),a6
move.l Project0Wnd,a1
sub.l a2,a2
lea cyctags(pc),a3
jsr GT_SetGadgetAttrsA(a6)
movem.l (a7)+,d0-d1/a0-a3/a6
addq.w #4,a0
rts
cyctags:dc.l $8008000f,0 ;number
dc.l 0
setstr: movem.l d0-d1/a0-a1/a3/a6,-(a7)
move.l (a0),a0 ;gadget
move.l $22(a0),a1 ;strinfo
move.w $0a(a1),d0 ;size+1
subq.b #2,d0
lea strstr(pc),a1
setatr0:move.b (a2)+,(a1)+
dbf d0,setatr0
sf (a1)+
move.l a2,-(a7)
move.l _GadToolsBase(pc),a6
move.l Project0Wnd,a1
sub.l a2,a2
lea strtags(pc),a3
jsr GT_SetGadgetAttrsA(a6)
move.l (a7)+,a2
movem.l (a7)+,d0-d1/a0-a1/a3/a6
addq.w #4,a0
rts
strtags:dc.l $8008002d,strstr ;string
dc.l 0
strstr: dcb.b 30,0
dc.b 0
even
prefbuf:dcb.b preflen,0 ;even!
gadname:dc.b "gadtools.library",0
intname:dc.b "intuition.library",0
dosname:dc.b "dos.library",0
kickmsg:dc.b "This tool needs Kickstart V37 or higher!",10
kicklen=*-kickmsg
dc.b "$VER: BeerMon Preferences Editor V0.14",0
even
wbmsg: dc.l 0
dosbase:dc.l 0
_IntuitionBase:
dc.l 0
_GadToolsBase:
dc.l 0
bmlen: dc.l 0
section "BeerBuf",bss
bmbuf: ds.b bmmaxlen
section "GadToolsBox",code
Project0_CNT=23
*
* Source machine generated by GadToolsBox V2.0
* which is (c) Copyright 1991-1993 Jaba Development
*
* GUI Designed by : -- Unnamed --
*
include 'exec/types.i'
include 'intuition/intuition.i'
include 'intuition/classes.i'
include 'intuition/classusr.i'
include 'intuition/imageclass.i'
include 'intuition/gadgetclass.i'
include 'libraries/gadtools.i'
include 'graphics/displayinfo.i'
include 'graphics/gfxbase.i'
XREF _GadToolsBase
XREF _IntuitionBase
XREF _GfxBase
XREF _SysBase
OpenScreenTagList EQU -612
OpenWindowTagList EQU -606
CloseScreen EQU -66
CloseWindow EQU -72
PrintIText EQU -216
LockPubScreen EQU -510
UnlockPubScreen EQU -516
SetMenuStrip EQU -264
ClearMenuStrip EQU -54
GetVisualInfoA EQU -126
FreeVisualInfo EQU -132
CreateContext EQU -114
CreateGadgetA EQU -30
GT_RefreshWindow EQU -84
FreeGadgets EQU -36
CreateMenusA EQU -48
LayoutMenusA EQU -66
FreeMenus EQU -54
OpenDiskFont EQU -30
CloseFont EQU -78
DrawBevelBoxA EQU -120
FreeClass EQU -714
NewObjectA EQU -636
DisposeObject EQU -642
TextLength EQU -54
CopyMem EQU -624
FindTagItem EQU -30
IntuiTextLength EQU -330
;Forbid EQU -132
Permit EQU -138
GD_Gadget00 EQU 0
GD_Gadget10 EQU 1
GD_Gadget20 EQU 2
GD_Gadget30 EQU 3
GD_Gadget40 EQU 4
GD_Gadget50 EQU 5
GD_Gadget60 EQU 6
GD_Gadget70 EQU 7
GD_Gadget80 EQU 8
GD_Gadget90 EQU 9
GD_Gadget100 EQU 10
GD_Gadget110 EQU 11
GD_Gadget120 EQU 12
GD_Gadget130 EQU 13
GD_Gadget140 EQU 14
GD_Gadget150 EQU 15
GD_Gadget160 EQU 16
GD_Gadget170 EQU 17
GD_Gadget180 EQU 18
GD_Gadget190 EQU 19
GD_Gadget200 EQU 20
GD_Gadget210 EQU 21
GD_Gadget220 EQU 22
Scr:
DC.L 0
VisualInfo:
DC.L 0
PubScreenName:
DC.L WBName
WBName:
DC.B 'Workbench',0
CNOP 0,2
Project0Wnd:
DC.L 0
Project0GList:
DC.L 0
Project0Gadgets:
DCB.L 23,0
BufNewGad:
DC.W 0,0,0,0
DC.L 0,0
DC.W 0
DC.L 0,0,0
TD:
DC.L TAG_DONE
Project0Left:
DC.W 113
Project0Top:
DC.W 11
Project0Width:
DC.W 419
Project0Height:
DC.W 169
Project0GTypes:
DC.W STRING_KIND
DC.W STRING_KIND
DC.W STRING_KIND
DC.W STRING_KIND
DC.W STRING_KIND
DC.W STRING_KIND
DC.W STRING_KIND
DC.W STRING_KIND
DC.W STRING_KIND
DC.W STRING_KIND
DC.W CYCLE_KIND
DC.W CYCLE_KIND
DC.W CYCLE_KIND
DC.W STRING_KIND
DC.W STRING_KIND
DC.W BUTTON_KIND
DC.W BUTTON_KIND
DC.W STRING_KIND
DC.W BUTTON_KIND
DC.W BUTTON_KIND
DC.W STRING_KIND
DC.W CYCLE_KIND
DC.W CHECKBOX_KIND
Project0NGads:
DC.W 225,3,180,13
DC.L Gadget00Text,0
DC.W GD_Gadget00
DC.L PLACETEXT_LEFT,0,0
DC.W 225,18,180,13
DC.L Gadget10Text,0
DC.W GD_Gadget10
DC.L PLACETEXT_LEFT,0,0
DC.W 225,33,180,13
DC.L Gadget20Text,0
DC.W GD_Gadget20
DC.L PLACETEXT_LEFT,0,0
DC.W 225,48,180,13
DC.L Gadget30Text,0
DC.W GD_Gadget30
DC.L PLACETEXT_LEFT,0,0
DC.W 225,63,180,13
DC.L Gadget40Text,0
DC.W GD_Gadget40
DC.L PLACETEXT_LEFT,0,0
DC.W 225,78,180,13
DC.L Gadget50Text,0
DC.W GD_Gadget50
DC.L PLACETEXT_LEFT,0,0
DC.W 225,93,180,13
DC.L Gadget60Text,0
DC.W GD_Gadget60
DC.L PLACETEXT_LEFT,0,0
DC.W 225,108,180,13
DC.L Gadget70Text,0
DC.W GD_Gadget70
DC.L PLACETEXT_LEFT,0,0
DC.W 225,123,180,13
DC.L Gadget80Text,0
DC.W GD_Gadget80
DC.L PLACETEXT_LEFT,0,0
DC.W 225,138,180,13
DC.L Gadget90Text,0
DC.W GD_Gadget90
DC.L PLACETEXT_LEFT,0,0
DC.W 46,3,142,13
DC.L Gadget100Text,0
DC.W GD_Gadget100
DC.L PLACETEXT_LEFT,0,0
DC.W 62,33,126,13
DC.L Gadget110Text,0
DC.W GD_Gadget110
DC.L PLACETEXT_LEFT,0,0
DC.W 62,48,126,13
DC.L Gadget120Text,0
DC.W GD_Gadget120
DC.L PLACETEXT_LEFT,0,0
DC.W 62,18,44,13
DC.L Gadget130Text,0
DC.W GD_Gadget130
DC.L PLACETEXT_LEFT,0,0
DC.W 144,18,44,13
DC.L Gadget140Text,0
DC.W GD_Gadget140
DC.L PLACETEXT_LEFT,0,0
DC.W 7,93,81,13
DC.L Gadget150Text,0
DC.W GD_Gadget150
DC.L PLACETEXT_IN,0,0
DC.W 107,93,81,13
DC.L Gadget160Text,0
DC.W GD_Gadget160
DC.L PLACETEXT_IN,0,0
DC.W 62,108,126,13
DC.L Gadget170Text,0
DC.W GD_Gadget170
DC.L PLACETEXT_LEFT,0,0
DC.W 7,138,165,13
DC.L Gadget180Text,0
DC.W GD_Gadget180
DC.L PLACETEXT_IN,0,0
DC.W 7,152,165,13
DC.L Gadget190Text,0
DC.W GD_Gadget190
DC.L PLACETEXT_IN,0,0
DC.W 225,153,180,12
DC.L Gadget200Text,0
DC.W GD_Gadget200
DC.L PLACETEXT_LEFT,0,0
DC.W 46,63,142,13
DC.L Gadget210Text,0
DC.W GD_Gadget210
DC.L PLACETEXT_LEFT,0,0
DC.W 151,80,26,11
DC.L Gadget220Text,0
DC.W GD_Gadget220
DC.L PLACETEXT_LEFT,0,0
Project0GTags:
DC.L GTST_String,Gadget00String
DC.L GTST_MaxChars,20
DC.L TAG_DONE
DC.L GTST_String,Gadget10String
DC.L GTST_MaxChars,20
DC.L TAG_DONE
DC.L GTST_String,Gadget20String
DC.L GTST_MaxChars,20
DC.L TAG_DONE
DC.L GTST_String,Gadget30String
DC.L GTST_MaxChars,20
DC.L TAG_DONE
DC.L GTST_String,Gadget40String
DC.L GTST_MaxChars,20
DC.L TAG_DONE
DC.L GTST_MaxChars,20
DC.L TAG_DONE
DC.L GTST_MaxChars,20
DC.L TAG_DONE
DC.L GTST_MaxChars,20
DC.L TAG_DONE
DC.L GTST_MaxChars,20
DC.L TAG_DONE
DC.L GTST_MaxChars,20
DC.L TAG_DONE
DC.L GTCY_Labels,Gadget100Labels
DC.L TAG_DONE
DC.L GTCY_Labels,Gadget110Labels
DC.L TAG_DONE
DC.L GTCY_Labels,Gadget120Labels
DC.L TAG_DONE
GadGet130Tags:
DC.L GTST_String,Gadget130String
DC.L GTST_MaxChars,3
DC.L TAG_DONE
GadGet140Tags:
DC.L GTST_String,Gadget140String
DC.L GTST_MaxChars,3
DC.L TAG_DONE
DC.L TAG_DONE
DC.L TAG_DONE
DC.L GTST_String,Gadget170String
DC.L GTST_MaxChars,30
DC.L TAG_DONE
DC.L TAG_DONE
DC.L TAG_DONE
DC.L GTST_String,Gadget200String
DC.L GTST_MaxChars,30
DC.L TAG_DONE
DC.L GTCY_Labels,Gadget210Labels
DC.L TAG_DONE
DC.L GTCB_Checked,1
DC.L TAG_DONE
Gadget00String:
DC.B 'l 40000 0 2 s|',0
CNOP 0,2
Gadget10String:
DC.B 'a 40000|',0
CNOP 0,2
Gadget20String:
DC.B 'd 40000|',0
CNOP 0,2
Gadget30String:
DC.B 'L oi 40000|',0
CNOP 0,2
Gadget40String:
DC.B 'cd:|dir|',0
CNOP 0,2
Gadget130String:
DC.B 'BBB',0
CNOP 0,2
Gadget140String:
DC.B '222',0
CNOP 0,2
Gadget170String:
DC.B 'S:BM.Prefs',0
CNOP 0,2
Gadget200String:
DC.B ':C/BeerMon',0
CNOP 0,2
Gadget00Text:
DC.B 'F1',0
Gadget10Text:
DC.B 'F2',0
Gadget20Text:
DC.B 'F3',0
Gadget30Text:
DC.B 'F4',0
Gadget40Text:
DC.B 'F5',0
Gadget50Text:
DC.B 'F6',0
Gadget60Text:
DC.B 'F7',0
Gadget70Text:
DC.B 'F8',0
Gadget80Text:
DC.B 'F9',0
Gadget90Text:
DC.B 'F10',0
Gadget100Text:
DC.B 'Mode',0
Gadget110Text:
DC.B 'Keymap',0
Gadget120Text:
DC.B 'Repeat',0
Gadget130Text:
DC.B 'Col0 ',0
Gadget140Text:
DC.B '1',0
Gadget150Text:
DC.B 'Load',0
Gadget160Text:
DC.B 'Save',0
Gadget170Text:
DC.B 'Prefs ',0
Gadget180Text:
DC.B 'Cancel',0
Gadget190Text:
DC.B 'Modify BeerMon',0
Gadget200Text:
DC.B 'Path',0
Gadget210Text:
DC.B 'CPU ',0
Gadget220Text:
DC.B 'Disk Verification',0
CNOP 0,2
Gadget100Labels:
DC.L Gadget100Lab0
DC.L Gadget100Lab1
DC.L Gadget100Lab2
DC.L Gadget100Lab3
DC.L Gadget100Lab4
DC.L 0
Gadget110Labels:
DC.L Gadget110Lab0
DC.L Gadget110Lab1
DC.L 0
Gadget120Labels:
DC.L Gadget120Lab0
DC.L Gadget120Lab1
DC.L Gadget120Lab2
DC.L 0
Gadget210Labels:
DC.L Gadget210Lab0
DC.L Gadget210Lab1
DC.L 0
Gadget100Lab0: DC.B 'PAL [640×256]',0
Gadget100Lab1: DC.B 'PAL [640×512]',0
Gadget100Lab2: DC.B 'NTSC [640×200]',0
Gadget100Lab3: DC.B 'NTSC [640×400]',0
Gadget100Lab4: DC.B 'VGA [640×480]',0
CNOP 0,2
Gadget110Lab0: DC.B 'German',0
Gadget110Lab1: DC.B 'American',0
CNOP 0,2
Gadget120Lab0: DC.B 'Fast',0
Gadget120Lab1: DC.B 'Medium',0
Gadget120Lab2: DC.B 'Slow',0
CNOP 0,2
Gadget210Lab0: DC.B 'Standard',0
Gadget210Lab1: DC.B 'Economy',0
CNOP 0,2
topaz8:
DC.L topazFName8
DC.W 8
DC.B $00,$01
topazFName8:
DC.B 'topaz.font',0
CNOP 0,2
Project0WindowTags:
Project0L:
DC.L WA_Left,0
Project0T:
DC.L WA_Top,0
Project0W:
DC.L WA_Width,0
Project0H:
DC.L WA_Height,0
DC.L WA_IDCMP,STRINGIDCMP!CYCLEIDCMP!BUTTONIDCMP!CHECKBOXIDCMP!IDCMP_REFRESHWINDOW
DC.L WA_Flags,WFLG_DRAGBAR!WFLG_DEPTHGADGET!WFLG_SMART_REFRESH!WFLG_ACTIVATE!WFLG_RMBTRAP
Project0WG:
DC.L WA_Gadgets,0
DC.L WA_Title,Project0WTitle
DC.L WA_ScreenTitle,Project0STitle
DC.L TAG_DONE
Project0WTitle:
DC.B 'BeerMon Preferences Editor V0.14',0
CNOP 0,2
Project0STitle:
DC.B 'Written By Carnivore/BeerMacht',0
CNOP 0,2
SetupScreen
movem.l d1-d3/a0-a2/a6,-(sp)
move.l _IntuitionBase,a6
move.l PubScreenName,a0
jsr LockPubScreen(a6)
move.l d0,Scr
tst.l d0
beq SError
move.l Scr,a0
move.l _GadToolsBase,a6
lea.l TD,a1
jsr GetVisualInfoA(a6)
move.l d0,VisualInfo
tst.l d0
beq VError
moveq #0,d0
SDone:
movem.l (sp)+,d1-d3/a0-a2/a6
rts
SError:
moveq #1,d0
bra.s SDone
VError:
moveq #2,d0
bra.s SDone
CloseDownScreen:
movem.l d0-d1/a0-a1/a6,-(sp)
move.l _GadToolsBase,a6
move.l VisualInfo,a0
cmpa.l #0,a0
beq.s NoVis
jsr FreeVisualInfo(a6)
move.l #0,VisualInfo
NoVis:
move.l _IntuitionBase,a6
suba.l a0,a0
move.l Scr,a1
cmpa.l #0,a1
beq.s NoScr
jsr UnlockPubScreen(a6)
move.l #0,Scr
NoScr:
movem.l (sp)+,d0-d1/a0-a1/a6
rts
XDEF OpenProject0Window
OpenProject0Window:
movem.l d1-d4/a0-a4/a6,-(sp)
move.l Scr,a0
moveq #0,d3
moveq #0,d2
move.b sc_WBorLeft(a0),d2
move.l sc_Font(a0),a1
move.w ta_YSize(a1),d3
addq.w #1,d3
add.b sc_WBorTop(a0),d3
move.l _GadToolsBase,a6
lea.l Project0GList,a0
jsr CreateContext(a6)
move.l d0,a3
tst.l d0
beq Project0CError
movem.w d2-d3,-(sp)
moveq #0,d3
lea.l Project0GTags,a4
Project0GL:
move.l _SysBase,a6
lea.l Project0NGads,a0
move.l d3,d0
mulu #gng_SIZEOF,d0
add.l d0,a0
lea.l BufNewGad,a1
moveq #gng_SIZEOF,d0
jsr CopyMem(a6)
lea.l BufNewGad,a0
move.l VisualInfo,gng_VisualInfo(a0)
move.l #topaz8,gng_TextAttr(a0)
move.w gng_LeftEdge(a0),d0
add.w (sp),d0
move.w d0,gng_LeftEdge(a0)
move.w gng_TopEdge(a0),d0
add.w 2(sp),d0
move.w d0,gng_TopEdge(a0)
move.l _GadToolsBase,a6
lea.l Project0GTypes,a0
moveq #0,d0
move.l d3,d1
asl.l #1,d1
add.l d1,a0
move.w (a0),d0
move.l a3,a0
lea.l BufNewGad,a1
move.l a4,a2
jsr CreateGadgetA(a6)
tst.l d0
bne.s Project0COK
movem.w (sp)+,d2-d3
bra Project0CError
Project0COK:
move.l d0,a3
move.l d3,d0
asl.l #2,d0
lea.l Project0Gadgets,a0
add.l d0,a0
move.l a3,(a0)
Project0TL:
tst.l (a4)
beq.s Project0DN
addq.w #8,a4
bra.s Project0TL
Project0DN:
addq.w #4,a4
addq.w #1,d3
cmp.w #Project0_CNT,d3
bmi Project0GL
movem.w (sp)+,d2-d3
move.l Project0GList,Project0WG+4
moveq #0,d0
move.w Project0Left,d0
move.l d0,Project0L+4
move.w Project0Top,d0
move.l d0,Project0T+4
move.w Project0Width,d0
move.l d0,Project0W+4
move.w Project0Height,d0
add.w d3,d0
move.l d0,Project0H+4
move.l _IntuitionBase,a6
suba.l a0,a0
lea.l Project0WindowTags,a1
jsr OpenWindowTagList(a6)
move.l d0,Project0Wnd
tst.l d0
beq Project0WError
move.l _GadToolsBase,a6
move.l Project0Wnd,a0
suba.l a1,a1
jsr GT_RefreshWindow(a6)
moveq #0,d0
Project0Done:
movem.l (sp)+,d1-d4/a0-a4/a6
rts
Project0CError:
moveq #1,d0
bra.s Project0Done
Project0GError:
moveq #2,d0
bra.s Project0Done
Project0WError:
moveq #4,d0
bra.s Project0Done
CloseProject0Window:
movem.l d0-d1/a0-a2/a6,-(sp)
move.l _IntuitionBase,a6
move.l Project0Wnd,a0
cmpa.l #0,a0
beq Project0NWnd
jsr CloseWindow(a6)
move.l #0,Project0Wnd
Project0NWnd:
move.l _GadToolsBase,a6
move.l Project0GList,a0
cmpa.l #0,a0
beq Project0NGad
jsr FreeGadgets(a6)
move.l #0,Project0GList
Project0NGad:
movem.l (sp)+,d0-d1/a0-a2/a6
rts
end
end