Annotation of uae/src/UAEGUI.rexx, revision 1.1

1.1     ! root        1: /* UAEGUI.rexx - A nice GUI for uae using MUIREXX
        !             2:  *
        !             3:  * How to use it: Open a shell a type "run rx UAEGUI.rexx".
        !             4:  * Then, run UAE. Once uae's window is opened, the GUI will
        !             5:  * popup.
        !             6:  *
        !             7:  * (c) By Samuel Devulder, 01/97.
        !             8:  */
        !             9: 
        !            10: TRUE = 1
        !            11: FALSE = 0
        !            12: MUIA_Application_Title = 0x804281b8
        !            13: MUIA_Application_Version = 0x8042b33f
        !            14: MUIA_Application_Copyright = 0x8042ef4d
        !            15: MUIA_Application_Author = 0x80424842
        !            16: MUIA_Application_Base = 0x8042e07a
        !            17: MUIA_Application_OpenConfigWindow = 0x804299ba
        !            18: MUIA_Application_AboutMUI = 0x8042d21d
        !            19: MUIA_Background = 0x8042545b
        !            20: MUII_BACKGROUND = 128
        !            21: MUII_SHADOWFILL = 133
        !            22: MUIA_Image_FreeHoriz = 0x8042da84
        !            23: MUIA_Image_FontMatchWidth = 0x804239bf
        !            24: MUIA_Image_FontMatchHeight = 0x804239c0
        !            25: MUIA_Width = 0x8042b59c
        !            26: MUIA_Image_FontMatch = 0x8042815d
        !            27: MUIA_Image_FontMatchHeight = 0x80429f26
        !            28: MUIA_FixWidthTxt = 0x8042d044
        !            29: MUIA_Weight = 0x80421d1f
        !            30: MUIA_Pressed = 0x80423535
        !            31: MUIA_ShowMe = 0x80429ba8
        !            32: MUIA_Slider_Horiz = 0x8042fad1
        !            33: MUIA_Slider_Min = 0x8042e404
        !            34: MUIA_Slider_Max = 0x8042d78a
        !            35: MUIA_Slider_Level = 0x8042ae3a
        !            36: MUIA_Frame = 0x8042ac64
        !            37: MUIV_Frame_Text = 3
        !            38: MUIV_Frame_Group = 9
        !            39: 
        !            40: Cycle_Active = 0x80421788
        !            41: Menuitem_Shortcut = 0x80422030
        !            42: Menuitem_Title = 0x804218be
        !            43: Selected = 0x8042654b
        !            44: Disabled = 0x80423661;
        !            45: 
        !            46: BLK = "\033I[2:00000000,00000000,00000000]"
        !            47: RED = "\033I[2:ffffffff,00000000,00000000]"
        !            48: GRN = "\033I[2:00000000,ffffffff,6f000000]"
        !            49: 
        !            50: BLK = BLK||BLK||BLK||BLK
        !            51: RED = RED||RED||RED||RED
        !            52: GRN = GRN||GRN||GRN||GRN
        !            53: 
        !            54: options results
        !            55: 
        !            56: /* Run MUIREXX */
        !            57: if ~show('p','UAEGUI') then do
        !            58:    address command "run >nil: muirexx port UAEGUI"
        !            59:    address command "run >nil: muirexx:muirexx port UAEGUI"
        !            60:    do while ~show('p','UAEGUI')
        !            61:       address command "wait 1"
        !            62:    end
        !            63: end
        !            64: 
        !            65: /* wait for UAE to setup */
        !            66: if ~show('p','UAE') then do
        !            67: /*   address command "run <>con: uae" */
        !            68:    do while ~show('p','UAE')
        !            69:       address command "wait 1"
        !            70:    end 
        !            71: end
        !            72: 
        !            73: address UAEGUI
        !            74: 
        !            75: window ID MAIN COMMAND """QUIT""" PORT UAEGUI TITLE """UAE Gui"""
        !            76: 
        !            77:  menu LABEL '"Project"'
        !            78:   item COMMAND '"method 'MUIA_Application_AboutMUI' 0"',
        !            79:    PORT UAEGUI LABEL '"About MUI"'
        !            80:   menu LABEL '"Settings"'
        !            81:    item COMMAND '"method 'MUIA_Application_OpenConfigWindow'"',
        !            82:     PORT UAEGUI LABEL '"MUI..."'
        !            83:   endmenu
        !            84:   item ATTRS Menuitem_Title '-1'
        !            85:   item COMMAND '"quit"' PORT UAEGUI ATTRS Menuitem_Shortcut 'Q' LABEL '"Quit"'
        !            86:  endmenu
        !            87: 
        !            88:  address UAE VERSION NUM;    NUM     = RESULT
        !            89:  address UAE VERSION AUTHOR; AUTHOR  = RESULT
        !            90:  address UAE VERSION PORT;   PORTAUT = RESULT
        !            91: 
        !            92:  text ATTRS MUIA_Frame MUIV_Frame_Group MUIA_Background MUII_SHADOWFILL LABEL,
        !            93:    "\0338\033c\033bUAE v"||NUM%100||"."||(NUM%10)//10||"."||NUM//10||,
        !            94:    "\033n - Un*x Amiga Emulator\n"||AUTHOR||"\n\n"||PORTAUT 
        !            95: 
        !            96:  group LABELS """Actions""" FRAME HORIZ
        !            97:   button PRESS HELP """This button makes UAE and the GUI exit""",
        !            98:    COMMAND """QUIT""" PORT UAE LABEL "Quit"
        !            99:   button PRESS HELP """This button makes UAE do a hard reset""",
        !           100:    COMMAND """RESET""" PORT UAE LABEL "Reset"
        !           101:   button PRESS HELP """This button makes UAE enter in debug mode""",
        !           102:    COMMAND """Debug""" PORT UAE LABEL "Debug"
        !           103:  endgroup
        !           104: 
        !           105:  group LABELS """Parameters""" FRAME
        !           106:   group HORIZ
        !           107:    label "Display:"
        !           108:    address UAE QUERY DISPLAY
        !           109:    cycle ID DRAW,
        !           110:     HELP """This cycle button enables or disables the display output""",
        !           111:     COMMAND """DISPLAY %s""" PORT UAE labels "OFF,ON",
        !           112:     ATTRS Cycle_Active RESULT
        !           113:    label "Sound:"
        !           114:    address UAE QUERY SOUND
        !           115:    IF RESULT = -1 THEN
        !           116:         cycle id sound ATTRS Disabled TRUE COMMAND """SOUND %s""",
        !           117:          PORT UAE LABELS "OFF,ON,BEST" 
        !           118:    ELSE IF RESULT = 0 THEN
        !           119:         cycle id sound ATTRS Cycle_Active 0,
        !           120:          HELP """This cycle button enables or disables the sound output""",
        !           121:          COMMAND """SOUND %s""" PORT UAE LABELS "OFF,ON,BEST" 
        !           122:    ELSE cycle id sound,
        !           123:          HELP """This cycle button enables or disables the sound output""",
        !           124:          ATTRS Cycle_Active RESULT-1 COMMAND """SOUND %s""",
        !           125:          PORT UAE LABELS "OFF,ON,BEST" 
        !           126:    label "Joystick:"
        !           127:    address UAE QUERY FAKEJOYSTICK
        !           128:    cycle ID JOY,
        !           129:     HELP """This cycle button enables or disables the joystick emulation""",
        !           130:     COMMAND """FAKEJOYSTICK %s""" PORT UAE LABELS "OFF,ON",
        !           131:     ATTRS Cycle_Active RESULT
        !           132:   endgroup
        !           133:   group HORIZ
        !           134:    label "POW:"
        !           135:    address UAE QUERY LED_POW;if RESULT = 1 then COL = RED; else COL = BLK
        !           136:    button ID POW HELP """This image represents the power-led state""",
        !           137:     ATTRS MUIA_FixWidthTxt 1 label COL
        !           138:    label "Frame Rate:"
        !           139:    address UAE QUERY FRAMERATE
        !           140:    slider ID SLDR HELP """Use this slider gadget to select the frame rate""",
        !           141:     COMMAND """FRAMERATE %s""" PORT UAE ATTRS MUIA_Slider_Horiz TRUE,
        !           142:     MUIA_Slider_Min 1 MUIA_Slider_Max 20 MUIA_Weight 230,
        !           143:     MUIA_SLIDER_LEVEL RESULT
        !           144:   endgroup
        !           145:  endgroup
        !           146: 
        !           147:  group LABELS """Disk files""" FRAME
        !           148:   call SetDfx(0)
        !           149:   call SetDfx(1)
        !           150:   call SetDfx(2)
        !           151:   call SetDfx(3)
        !           152:  endgroup
        !           153: endwindow
        !           154: 
        !           155: address UAE QUERY NAME_DF0;R0=RESULT
        !           156: address UAE QUERY NAME_DF1;R1=RESULT
        !           157: address UAE QUERY NAME_DF2;R2=RESULT
        !           158: address UAE QUERY NAME_DF3;R3=RESULT
        !           159: popasl ID NDF0 CONTENT R0
        !           160: popasl ID NDF1 CONTENT R1
        !           161: popasl ID NDF2 CONTENT R2
        !           162: popasl ID NDF3 CONTENT R3
        !           163: 
        !           164: address UAE feedback LED_POW PORT UAEGUI,
        !           165:  CMD_ON  """button ID POW LABEL "RED"""",
        !           166:  CMD_OFF """button ID POW LABEL "BLK""""
        !           167: 
        !           168: address UAE feedback LED_DF0 PORT UAEGUI,
        !           169:  CMD_ON  """button ID DF0 LABEL "GRN"""",
        !           170:  CMD_OFF """button ID DF0 LABEL "BLK""""
        !           171: 
        !           172: address UAE feedback LED_DF1 PORT UAEGUI,
        !           173:  CMD_ON  """button ID DF1 LABEL "GRN"""",
        !           174:  CMD_OFF """button ID DF1 LABEL "BLK""""
        !           175: 
        !           176: address UAE feedback LED_DF2 PORT UAEGUI,
        !           177:  CMD_ON  """button ID DF2 LABEL "GRN"""",
        !           178:  CMD_OFF """button ID DF2 LABEL "BLK""""
        !           179: 
        !           180: address UAE feedback LED_DF3 PORT UAEGUI,
        !           181:  CMD_ON  """button ID DF3 LABEL "GRN"""",
        !           182:  CMD_OFF """button ID DF3 LABEL "BLK""""
        !           183: 
        !           184: address UAE feedback NAME_DF0 PORT UAEGUI,
        !           185:  CMD """popasl ID NDF0 CONTENT %s"""
        !           186: 
        !           187: address UAE feedback NAME_DF1 PORT UAEGUI,
        !           188:  CMD """popasl ID NDF1 CONTENT %s"""
        !           189: 
        !           190: address UAE feedback NAME_DF2 PORT UAEGUI,
        !           191:  CMD """popasl ID NDF2 CONTENT %s"""
        !           192: 
        !           193: address UAE feedback NAME_DF3 PORT UAEGUI,
        !           194:  CMD """popasl ID NDF3 CONTENT %s"""
        !           195: 
        !           196: address UAE feedback ON_EXIT PORT UAEGUI,
        !           197:  CMD """quit"""
        !           198: 
        !           199: address UAE QUERY LED_POW;if RESULT = 1 then COL = RED; else COL = BLK
        !           200: button ID POW label COL
        !           201: 
        !           202: exit 0
        !           203: 
        !           204: SetDFx: 
        !           205:    PARSE ARG unit
        !           206:    group ID GDF||unit HORIZ
        !           207:     label LEFT DOUBLE "DF"||unit||":"
        !           208:     address UAE QUERY LED_DF||unit;if RESULT=1 then COL=GRN; else COL=BLK
        !           209:     button ID DF||unit,
        !           210:      HELP """This image represents the state of drive "||unit||"'s led""",
        !           211:      ATTRS MUIA_FixWidthTxt 1 label COL
        !           212:     button PRESS,
        !           213:      HELP """Use this button to eject the diskfile in drive DF"||unit||":""",
        !           214:      COMMAND """EJECT "||unit||"""" PORT UAE ATTRS MUIA_Weight 100,
        !           215:      LABEL "Eject"
        !           216:     popasl ID NDF||unit,
        !           217:      HELP """Select the name of diskfile for drive DF"||unit||":""",
        !           218:      COMMAND """INSERT "||unit||" '%s'""" PORT UAE ATTRS MUIA_Weight 300
        !           219:    endgroup ID GDF||unit
        !           220: return

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.