+Amiga etc.
authorshort <>
Fri, 3 Oct 2003 20:22:10 +0000 (20:22 +0000)
committershort <>
Fri, 3 Oct 2003 20:22:10 +0000 (20:22 +0000)
27 files changed:
autogen.pl
configure.ac
project/CasioA/Casio-A.asm [new file with mode: 0644]
project/CasioA/Casio-A.lha [new file with mode: 0644]
project/CasioA/Casio-A.png [new file with mode: 0644]
project/CasioA/CasioSchema.png [new file with mode: 0644]
project/CasioA/Index.html.pl [new file with mode: 0755]
project/CasioA/ListItem.pm [new file with mode: 0755]
project/CasioA/Makefile.am [new file with mode: 0644]
project/Islet/Index.html.pl
project/Islet/ListItem.pm
project/LaserGame/Index.html.pl [new file with mode: 0755]
project/LaserGame/LaserComm.png [new file with mode: 0644]
project/LaserGame/ListItem.pm [new file with mode: 0755]
project/LaserGame/Makefile.am [new file with mode: 0644]
project/Makefile.am
project/PortDiag/Index.html.pl [new file with mode: 0755]
project/PortDiag/ListItem.pm [new file with mode: 0755]
project/PortDiag/Makefile.am [new file with mode: 0644]
project/PortDiag/PortDiag.asm [new file with mode: 0644]
project/PortDiag/PortDiag.lha [new file with mode: 0644]
project/PortDiag/PortDiag.png [new file with mode: 0644]
project/ShortRel/Index.html.pl [new file with mode: 0755]
project/ShortRel/ListItem.pm [new file with mode: 0755]
project/ShortRel/Makefile.am [new file with mode: 0644]
project/ShortRel/ShortRel.asm [new file with mode: 0644]
project/ShortRel/ShortRel.lha [new file with mode: 0644]

index a7d2204..da0ac40 100755 (executable)
@@ -41,7 +41,6 @@ AutoGen->run(
                                ./dia-w.sh
                                ./project/Nokia61/Nokia61
                                ./project/Nokia61/Nokia61_23.cache
-                               ./project/surprise/surprise-gnome-0.gif
                                ./project/line9k/line9k.png
                                ./project/line9k/line9k.gif
                                ./project/captive/doc/fig/*.png
@@ -49,5 +48,10 @@ AutoGen->run(
                                ./project/captive/doc/dia/*.dia~
                                ./project/captive/doc/*.gif
                                ./project/captive/*.gif
+                               ./project/PortDiag/*.gif
+                               ./project/CasioA/*.gif
+                               ./project/LaserGame/*.gif
+                               ./project/Islet/*.gif
+                               ./project/surprise/*.gif
                                )],
                );
index 9f278b4..9116950 100644 (file)
@@ -32,7 +32,7 @@ Makefile
 ./My/Makefile
 ./project/Makefile
 ./project/step/Makefile
-./project/icp/Makefile
+./project/Islet/Makefile
 ./project/FordFulk/Makefile
 ./project/Heat/Makefile
 ./project/kix/Makefile
@@ -73,6 +73,10 @@ Makefile
 ./project/captive/doc/Makefile
 ./project/captive/doc/fig/Makefile
 ./project/captive/doc/dia/Makefile
+./project/PortDiag/Makefile
+./project/CasioA/Makefile
+./project/LaserGame/Makefile
+./project/ShortRel/Makefile
 ])
 
 echo done.
diff --git a/project/CasioA/Casio-A.asm b/project/CasioA/Casio-A.asm
new file mode 100644 (file)
index 0000000..e18d5ff
--- /dev/null
@@ -0,0 +1,1930 @@
+;DEBUG equ     1
+
+;TODO:
+; TRANSMIT/K/M & AppMessage w/arg>1
+
+       include "ssmac.h"
+
+BaudRateBase   equ     1200
+Def_BaudRateN  equ     3
+Def_BaudRate   equ     BaudRateBase<<Def_BaudRateN
+Def_Micros     equ     0       ;1000
+SerBufSiz      equ     1024
+LineBufSiz     equ     1024
+AppBufSiz      equ     256
+ASCII_ACK      equ     6
+ASCII_EOT      equ     4
+ASCII_CR       equ     13
+ASCII_LF       equ     10
+Char_Term      equ     '^'     ;Termination
+Char_TermRepl  equ     '?'     ;How to replace Char_Term during recv
+Char_CasCR     equ     $E4     ;<-/
+Char_CasSep    equ     $F3     ;/#|
+MUIMaster_MVer equ     14
+MUITags        equ     $80420000
+PackMenuHots   equ     7
+FirstMenuCode  equ     6
+SerErrTabSize  equ     13      ;*4
+
+       start
+
+       dbuf    Buttons,0
+       dv.l    TransmitButton
+       dv.l    ReceiveButton
+       dv.l    SettingsButton
+       dv.l    QuitButton
+       dv.l    AbortButton
+       dv.l    SaveButton
+       dv.l    UseButton
+       dv.l    RestoreButton
+       dv.l    CloseButton
+       dv.l    StatBar0
+       dv.l    StatBarNum0
+       dv.l    StatBar1
+       dv.l    StatBarNum1
+       dv.l    StatBar2
+       dv.l    StatBarNum2
+       dv.l    StatBar3
+       dv.l    StatBarNum3
+       dv.l    StatBar4
+       dv.l    StatBarNum4
+       dv.l    StatBar5
+       dv.l    StatBarNum5
+       dbuf.l  PartCounts,6
+       dbuf    Bitmaps,6*(bm_SIZEOF-7*4)
+       dbuf.l  SerErrMem,SerErrTabSize
+       dv.l    SerialTrk
+       dv.l    SerialIO
+       dv.l    TimerTrk
+       dv.l    CurLine
+       dv.l    TxFileSize
+       dv.l    ErrPtr
+       dv.l    muimasterbase
+       dv.l    MUIWaitMask
+       dv.l    BaudRateSlider
+       dv.l    BaudRateClass
+       dv.l    MenuStrip
+       dv.l    TransmitMItem
+       dv.l    ReceiveMItem
+       dv.l    ConfigMItem
+       dv.l    StatBarText
+       dv.l    StatBarBMap
+       dv.l    TransmitFName
+       dbuf    WOpenHook,h_SIZEOF
+       dbuf    AppObjHook,h_SIZEOF
+       dbuf    SerBuf,SerBufSiz        ;A!
+       dbuf    LineBuf,LineBufSiz      ;A!
+       dbuf    AppDropBuf,AppBufSiz
+       dv.w    GaugeSet
+       dbuf.w  MenusHots,PackMenuHots
+       dv.b    CurPart
+       dv.b    SerByte
+       dv.b    TimerPend
+       dv.b    FallOut
+       dv.b    Inside
+       dv.b    InAbort
+       dv.b    GotCmdArgs
+
+       moveq   #Def_Micros,d1
+       get.l   Arg_MicroWait,d0
+       beq.s   NoMicros
+       move.l  d0,a0
+       move.l  (a0),d1
+NoMicros       put.l   d1,Arg_MicroWait
+       dtl     <serial.device>,a0
+       get.l   Arg_Device,d0
+       beq.s   NoDevice
+       move.l  d0,a0
+       move.l  (a0),a0
+NoDevice       put.l   a0,Arg_Device
+       moveq   #0,d1
+       get.l   Arg_DevUnit,d0
+       beq.s   NoDevUnit
+       move.l  d0,a0
+       move.l  (a0),d1
+NoDevUnit      put.l   d1,Arg_DevUnit
+       move.l  #Def_BaudRate,d1
+       get.l   Arg_Baud,d0
+       beq.s   NoBaud
+       move.l  d0,a0
+       move.l  (a0),d1
+NoBaud put.l   d1,Arg_Baud
+
+       lea     SerErrTab(pc),a0
+       move.l  a0,a2
+       geta    SerErrMem,a1
+LoopSerErr     move.b  -(a0),1(a1)
+       beq.s   DoneSerErr
+       moveq   #0,d0
+       move.b  -(a0),d0
+       move.b  d0,3(a1)
+       addq    #4,a1
+       subq.b  #1,d0
+LoopSerErr2    move.l  a2,(a1)+
+SkipSerErr     tst.b   (a2)+
+       bne.s   SkipSerErr
+       dbra    d0,LoopSerErr2
+       bra.s   LoopSerErr
+
+DoneSerErr     get.l   Arg_To,d0
+       vor.l   Arg_From,d0
+       snev    GotCmdArgs
+       tstv.l  Arg_MUI
+       bne.s   DoMUI
+       tst.l   d0
+       bne     ProcessCmdArgs
+DoMUI  dtl     <muimaster.library>,a0
+       moveq   #MUIMaster_MVer,d0
+       call    TrackLibrary
+       put.l   d0,muimasterbase
+       move.l  d0,a6
+       bset.b  #svfb_errorreq,sv_flags+3(v)
+
+       dtl     <_Transmit>,a2
+       dt      <_Receive>
+       dt      <_Settings>
+       dt      <_Quit>
+       dt      <_Abort>
+       dt      <_Save>
+       dt      <_Use>
+       dt      <_Restore>
+       dt      <_Close>
+       geta    Buttons,a3
+       moveq   #8,d2
+LoopMakeObj    push    a2
+       move.l  sp,a0
+       moveq   #MUIO_Button,d0
+       call    muimaster,MUI_MakeObjectA
+       addq    #4,sp
+       move.l  d0,(a3)+
+       bne.s   GenTButton
+MUIDosError    dtl     <MUI error>,a0
+SSDosError     jump    ss,DosError
+
+GenTButton     tst.b   (a2)+
+       bne.s   GenTButton
+       move.l  d0,a0
+       move.w  #MUIA_CycleChain-MUITags,d0
+       moveq   #TRUE,d1
+       bsr     SetAttr
+       dbra    d2,LoopMakeObj
+
+       move.w  #MUIA_InputMode-MUITags,d0
+       moveq   #MUIV_InputMode_Toggle,d1
+       get.l   SettingsButton,a0
+       bsr     SetAttr
+       move.w  #MUIA_Weight-MUITags,d0
+       moveq   #0,d1
+       get.l   AbortButton,a0
+       bsr     SetAttr
+
+       move.w  #MUIA_Popstring_Toggle-MUITags,d0
+       moveq   #1,d1
+       get.l   TransmitButton,a0
+       bsr     SetAttr
+       move.w  #MUIA_Popstring_Toggle-MUITags,d0
+       moveq   #1,d1
+       get.l   ReceiveButton,a0
+       bsr     SetAttr
+
+       moveq   #(6*32*16/8)>>2,d0
+       rol.l   #2,d0
+       moveq   #MEMF_PUBLIC!MEMF_CHIP,d1       
+       call    ss,TrackAllocMem
+       move.l  d0,a6
+
+       lea     CasioIcons(pc),a2
+       lea     PartTab(pc),a4
+       geta    Bitmaps,a3
+       geta    StatBar0,a1
+       moveq   #5,d7
+SkipZeroPart   tst.b   (a4)+
+       beq.s   SkipZeroPart
+       lea     -1(a4),a0
+       put.l   a0,StatBarText
+       put.l   a3,StatBarBMap
+       move.l  #$00040010,(a3)+        ;bm_BytesPerRow+bm_Rows
+       move.l  #$00010000,(a3)+        ;bm_Flags+bm_Depth+bm_Pad
+       move.l  a6,(a3)+                ;bm_Planes[0]
+       moveq   #15,d0
+GenIconLine    move.w  (a2)+,d1
+       moveq   #15,d2
+GenIconPix     move.w  d1,d4
+       roxr.w  #1,d4
+       roxr.l  #1,d3
+       roxr.w  #1,d1
+       roxr.l  #1,d3
+       dbra    d2,GenIconPix
+       move.l  d3,(a6)+
+       dbra    d0,GenIconLine
+       mpush   a1-a3/a6
+       lea     MUI_StatBar(pc),a3
+       bsr     GenerateMUI
+       mpop    a1-a3/a6
+       move.l  d0,(a1)+        ;StatBar
+       get.l   StatBarNumber,(a1)+     ;StatBarNum
+SkipPartPart   tst.b   (a4)+
+       bne.s   SkipPartPart
+       dbra    d7,SkipZeroPart
+
+       move.l  #gnm_SIZEOF*PackMenuNum+1,d0
+       move.l  d0,d2
+       call    ss,IPAlloc
+       clr.l   -(sp)
+       push    d0
+       move.l  d0,a3
+       add.l   d0,d2
+       subq.l  #1,d2
+       lea     PackMenus(pc),a2
+       geta    MenusHots,a4
+       moveq   #FirstMenuCode,d3
+NextMenuField  addq.b  #NM_ITEM,(a3)
+NextMenuTag    move.b  (a2)+,d0
+       beq.s   GotMenuTitle
+       bpl.s   GotMenuHot
+       addq.b  #1,d0
+       bne.s   NotMenuSepar
+       subq.l  #-NM_BARLABEL,gnm_Label(a3)
+       bra.s   NextMenuRecord
+
+NotMenuSepar   move.w  #CHECKIT!MENUTOGGLE,gnm_Flags(a3)
+       bra.s   NextMenuTag
+
+GotMenuTitle   subq.b  #NM_ITEM-NM_TITLE,(a3)
+GotMenuHot     subq.b  #2,d0
+       bmi.s   NotMenuHot
+       move.b  d0,(a4)
+       move.l  a4,gnm_CommKey(a3)
+       addq    #2,a4
+NotMenuHot     move.l  a2,gnm_Label(a3)
+ToEndLabel     tst.b   (a2)+
+       bne.s   ToEndLabel
+       move.l  d3,gnm_UserData(a3)
+       addq.l  #1,d3
+NextMenuRecord lea     gnm_SIZEOF(a3),a3
+       cmp.l   a3,d2
+       bne.s   NextMenuField
+       move.l  sp,a0
+       moveq   #MUIO_MenustripNM,d0
+       call    muimaster,MUI_MakeObjectA
+       put.l   d0,MenuStrip
+       beq     MUIDosError
+       addq    #8,sp
+       pea     (FirstMenuCode+1).w
+       push    #MUIM_FindUData
+       move.l  d0,a2
+       bsr     DoMethod
+       put.l   d0,TransmitMItem
+       addq.l  #1,4(sp)        ;2
+       bsr     DoMethod
+       put.l   d0,ReceiveMItem
+       beq     MUIDosError
+       addq.l  #6,4(sp)        ;8
+       bsr     DoMethod
+       put.l   d0,ConfigMItem
+       beq     MUIDosError
+       addq    #8,sp
+
+       get.l   sv_thistask,a0
+       move.l  v,TC_Userdata(a0)
+       sub.l   a0,a0
+       gett    STR_Slider,a1
+       sub.l   a2,a2
+       moveq   #6,d0
+       lea     BaudRateFunc(pc),a3
+       call    muimaster,MUI_CreateCustomClass
+       put.l   d0,BaudRateClass
+       beq     MUIDosError
+       move.l  d0,a0
+       move.l  mcc_Class(a0),a0
+       clr.l   -(sp)
+       push    sp      ;TRUE
+       push    #MUIA_CycleChain
+       pea     Def_BaudRateN.w
+       push    #MUIA_Numeric_Max
+       pea     Def_BaudRateN.w
+       push    #MUIA_Numeric_Value
+       pea     3.w
+       push    #MUIA_ExportID
+       sub.l   a1,a1
+       move.l  sp,a2
+       call    intuition,NewObjectA
+       lea     4*8+4(sp),sp
+       put.l   d0,BaudRateSlider
+       beq     MUIDosError
+
+       lea     MUI_Applic(pc),a3
+       bsr     GenerateMUI
+
+       lea     MUI_Notific(pc),a3
+       bsr     SetNotify
+
+       push    TriggerValPtr(pc)       ;28
+       vpush   MainWin                 ;24
+       push    #MUIM_Popstring_Open    ;20
+       pea     1.w                     ;16
+       vpush   TransmitAsl             ;12
+       pea     (FirstMenuCode+1).w     ;8
+       push    #MUIA_Application_MenuAction ;4
+       push    #MUIM_Notify            ;0
+       bsr     DoMethodAppl
+       addq.l  #1,8(sp)        ;2
+       get.l   ReceiveAsl,12(sp)
+       bsr     DoMethod
+       addq.l  #2,8(sp)        ;4
+       get.l   ApplObj,12(sp)
+       addq.l  #1,16(sp)       ;->2
+       move.w  #MUIM_Application_AboutMUI-MUITags,22(sp)
+       bsr     DoMethod
+       addq.l  #5,8(sp)        ;9
+       moveq   #MUIV_Application_Load_ENVARC,d0
+       move.l  d0,24(sp)
+       move.w  #MUIM_Application_Load-MUITags,22(sp)
+       bsr     DoMethod
+       addq.l  #1,8(sp)        ;10
+       move.w  #MUIM_Application_OpenConfigWindow-MUITags,22(sp)
+       clr.l   24(sp)
+       bsr     DoMethod
+       move.w  #MUIA_Window_Open-MUITags,6(sp)
+       move.l  EveryTimePtr(pc),8(sp)
+       move.w  #MUIM_CallHook-MUITags,22(sp)
+       geta    WOpenHook,a0
+       lea     WinOpenHook(pc),a1
+       move.l  a1,h_Entry(a0)
+       move.l  v,h_Data(a0)
+       move.l  a0,24(sp)
+       get.l   MainWin,a2
+       bsr     DoMethod
+       move.w  #MUIA_AppMessage-MUITags,6(sp)
+       move.l  a2,12(sp)
+       addq.l  #1,16(sp)       ;->3
+       geta    AppObjHook,a0
+       lea     AppDropHook(pc),a1
+       move.l  a1,h_Entry(a0)
+       move.l  v,h_Data(a0)
+       move.l  a0,24(sp)
+       bsr     DoMethod
+       lea     8*4(sp),sp
+
+       bsr     ActRestore
+
+       move.w  #MUIA_Window_Open-MUITags,d0
+       moveq   #TRUE,d1
+       get.l   MainWin,a0
+       bsr     SetAttr
+       move.w  #MUIA_Window_Open-MUITags,d0
+       get.l   MainWin,a0
+       bsr     GetAttr
+       beq     MUIDosError
+
+       bsr     ProcessCmdArgs
+       tstv.b  GotCmdArgs
+       bne     Return8
+
+LoopNewInput   bsr.s   DoMUIPoll
+       get.l   MUIWaitMask,d0
+       beq.s   LoopNewInput
+       bsr.s   MUIPollEnd
+       bra.s   LoopNewInput
+
+MUIPollEnd     bset.l  #SIGBREAKB_CTRL_C,d0
+       call    exec,Wait
+       put.l   d0,MUIWaitMask
+       btst.l  #SIGBREAKB_CTRL_C,d0
+       beq     Return8
+BreakOut       moveq   #err_break,d0
+SSReportError  jump    ss,ReportError
+
+DoMUIPoll      call    ss,TestBreak
+       push    a2
+       vpea    MUIWaitMask
+       push    #MUIM_Application_NewInput
+       bsr     DoMethodAppl
+       addq    #8,sp
+       pop     a2
+       addq.l  #1,d0
+       beq     EXIT            ;MUIV_Application_ReturnID_Quit
+       subq.l  #2,d0
+       bmi     Return8
+       moveq   #8,d1
+       cmp.l   d0,d1
+       bcs     Return8
+       cmp.w   #5,d0
+       bcc.s   CallAct
+       tstv.b  Inside
+       bne.s   Return8
+CallAct        add.l   d0,d0
+       lea     ButtonAct(pc),a0
+       add.w   (a0,d0.w),a0
+       jmp     (a0)
+
+ButtonAct      dc.w    ActTransmit-ButtonAct   ;0
+       dc.w    ActReceive-ButtonAct    ;1
+       dc.w    ActSave-ButtonAct       ;2
+       dc.w    ActUse-ButtonAct        ;3
+       dc.w    ActRestore-ButtonAct    ;4
+       dc.w    ActAbort-ButtonAct      ;5
+       dc.w    Return8-ButtonAct       ;6
+       dc.w    Return8-ButtonAct       ;7
+       dc.w    ActAbout-ButtonAct      ;8
+
+ActAbout       moveq   #TRUE,d1
+       bsr.s   ApplicSleep
+       dtl.lc  <Casio-A version 1.0 - The communication>,a0
+       dt.lc   <software for Casio organizers series SF-Ax0>
+       dt.lc   <© 1996 Short Software ',60,'short@k332.feld.cvut.cz',62,'>
+       dt.lc   <This software is FreeWare.>
+       dt.lc   <>
+       dt.lc   <Thanks to Pavouk ',60,'pavouk@k332.feld.cvut.cz',62,'>
+       dt.lc   <for testing, icons and hardware support.>
+       dt.lc   <>
+       dt.lc   <This is a MUI-Application,
+       dt      <see "Project/About MUI..." for more.>
+       push    a2
+       dtl     <Okay>,a2
+       call    ss,SimpleRequest
+       pop     a2
+       moveq   #FALSE,d1
+ApplicSleep    move.w  #MUIA_Application_Sleep-MUITags,d0
+       get.l   ApplObj,a0
+       bra     SetAttr
+
+ActUse push    #MUIV_Application_Save_ENV
+       bra.s   ActUseCont
+
+ActSave        push    #MUIV_Application_Save_ENVARC
+ActUseCont     push    #MUIM_Application_Save
+       bsr     DoMethodAppl
+       addq    #8,sp
+       move.w  #MUIA_Window_Open-MUITags,d0
+       moveq   #FALSE,d1
+       get.l   ConfigWin,a0
+       bra     SetAttr
+
+ActRestore     push    #MUIV_Application_Load_ENV
+       push    #MUIM_Application_Load
+       bsr     DoMethodAppl
+       addq    #8,sp
+Return8        rts
+
+ActTransmit    get.l   Arg_From,d0
+       bne     TrasmitClear
+       get.l   TransmitText,a0
+       bsr     GetAttrStr
+       bra     DoTransmit
+
+ActReceive     get.l   ReceiveText,a0
+       bsr     GetAttrStr
+       bra     DoReceive
+
+ActAbort       stv     InAbort
+Return10       rts
+
+ChangeState0   tstv.l  muimasterbase
+       beq.s   Return10
+       moveq   #0,d2
+;---------------
+ChangeState    clr.l   -(sp)
+       vpush   ConfigGroup
+       vpush   ReceiveButton
+       vpush   TransmitButton
+       push    d2
+       push    #MUIA_Disabled
+       push    #MUIM_MultiSet
+       bsr     DoMethodAppl
+       lea     7*4(sp),sp
+       move.w  #MUIA_Menuitem_Enabled-MUITags,d0
+       bchg.l  #0,d2
+       move.l  d2,d1
+       get.l   TransmitMItem,a0
+       bsr.s   SetAttr
+       move.w  #MUIA_Menuitem_Enabled-MUITags,d0
+       move.l  d2,d1
+       get.l   ReceiveMItem,a0
+       bsr.s   SetAttr
+       move.w  #MUIA_Disabled-MUITags,d0
+       move.l  d2,d1
+       get.l   GaugeGroup,a0
+SetAttr        clr.l   -(sp)
+       push    d1
+       move.w  d0,-(sp)
+       move.w  #MUITags>>16,-(sp)
+       move.l  sp,a1
+       call    intuition,SetAttrsA
+       lea     12(sp),sp
+       rts
+;---------------
+ProcessCmdArgs get.l   Arg_To,d0
+       beq.s   NoArgTo
+       bsr.s   DoReceive
+       clrv.l  Arg_To
+NoArgTo        get.l   Arg_From,d0
+       beq.s   Return13
+TrasmitClear   bsr.s   DoTransmit
+       clrv.l  Arg_From
+Return13       rts
+
+DoTransmit     pea     CallTransmit(pc)
+       moveq   #1,d1
+       bra.s   CallRoutine
+
+DoReceive      pea     CallReceive(pc)
+       moveq   #2,d1
+CallRoutine    put.b   d1,Inside
+       push    d0
+
+       tstv.l  muimasterbase
+       beq.s   SkipPrepCfg
+       moveq   #1,d2
+       bsr     ChangeState
+       get.l   DeviceString,a0
+       bsr     GetAttrStr
+       put.l   d0,Arg_Device
+       move.w  #MUIA_Numeric_Value-MUITags,d0
+       get.l   UnitNumber,a0
+       bsr     GetAttr
+       put.l   d0,Arg_DevUnit
+       move.w  #MUIA_Numeric_Value-MUITags,d0
+       get.l   BaudRateSlider,a0
+       bsr     GetAttr
+       moveq   #1200>>4,d1
+       addq.l  #4,d0
+       lsl.l   d0,d1
+       put.l   d1,Arg_Baud
+       move.w  #MUIA_Numeric_Value-MUITags,d0
+       get.l   MicroSecSlider,a0
+       bsr     GetAttr
+       put.l   d0,Arg_MicroWait
+
+       get.b   Inside,d0
+       subq.b  #1,d0
+       dtl     <Transmitting... %ld%% done>,a0
+       beq.s   SkipRecvInfo
+       dtl     <Receiving... %ld%% done>,a0
+SkipRecvInfo   move.l  a0,d1
+       move.w  #MUIA_Gauge_InfoText-MUITags,d0
+       get.l   ProgressGauge,a0
+       bsr     SetAttr
+       moveq   #0,d0
+       bsr     DoSetGauge
+       moveq   #5,d2
+       vlea    PartCounts+6*4,a2
+       move.l  (v),a6
+ClearCounts    clr.l   -(a2)
+       move.l  a2,a1
+       bsr.s   SetNumber
+       dbra    d2,ClearCounts
+SkipPrepCfg    pop     a1
+       pop     a0
+       push    a1
+       moveq   #0,d0
+       clrv.b  InAbort
+       call    ss,CallBlock
+       get.b   Inside,d0
+       bmi.s   AskDelete
+       subq.b  #2,d0
+       beq.s   DoDelete
+       bra.s   WasTransmit
+
+AskDelete      dtl.lc  <Data file "%s" hasn''t been received correctly.>,a0
+       dt      <Do you want to delete this corrupted file?>
+       move.l  sp,a1
+       dtl     <Yes, I''ll retry.|No, leave it!>,a2
+       call    ss,SimpleRequest
+       tst.l   d0
+       beq.s   WasTransmit
+DoDelete       move.l  (sp),d1
+       call    dos,DeleteFile
+WasTransmit    addq    #4,sp
+       clrv.b  Inside
+       tstv.b  FallOut
+       beq     ChangeState0
+EXIT   stv     FallOut
+SSExitCleanup  jump    ss,ExitCleanup
+
+AddPartCount   moveq   #0,d0
+       get.b   CurPart,d0
+       beq.s   IsZeroPart
+       subq.b  #2,d0
+IsZeroPart     lsl.l   #2,d0
+       lea     PartCounts(v,d0.w),a1
+       addq.l  #1,(a1)
+SetNumber      push    a2
+       lea     -12(sp),sp
+       move.l  sp,a2
+       push    a1
+       dt      PercLUT,<%lu>
+       gett    PercLUT,a0
+       call    ss,FormatStr
+       pop     a1
+       move.l  sp,d1
+       geta    PartCounts,a0
+       sub.l   a0,a1
+       add.l   a1,a1
+       geta    StatBarNum0,a0
+       move.l  (a0,a1),a0
+       move.w  #MUIA_Text_Contents-MUITags,d0
+       bsr     SetAttr
+       lea     12(sp),sp
+       pop     a2
+       move.l  (v),a6
+       rts
+
+CallReceive    move.l  a1,a0
+       moveq   #OPEN_NEW+OPEN_LINEBUF,d0
+       moveq   #0,d1
+       call    TrackOpenBuf
+       move.l  d0,a3
+       stv     CurPart
+       bsr     SerialInit
+       put.b   #ASCII_ACK,SerByte
+WaitSig1       bsr     GetSerByte
+       cmp.b   #ASCII_CR,d0
+       bne.s   WaitSig1
+       bsr     GetSerByte
+       cmp.b   #ASCII_LF,d0
+       bne.s   WaitSig1
+       stv.b   Inside
+NextRcvPacket  tstv.l  muimasterbase
+       beq.s   NotUpdGauge
+       get.b   CurPart,d0
+       bmi.s   NotUpdGauge
+       bne.s   NotZeroPart
+       moveq   #2,d0
+NotZeroPart    subq.l  #1,d0
+       moveq   #100,d1
+       mulu.w  d1,d0
+       moveq   #7,d1
+       divu.w  d1,d0
+       bsr.s   ChkSetGauge
+NotUpdGauge    bsr     SendItNow
+       bsr     GetSerByte
+       cmp.b   #ASCII_EOT,d0
+       bne.s   NotEndTrans
+       put.b   d0,Inside
+FullGaugeRet   moveq   #100,d0
+ChkSetGauge    vcmp.w  GaugeSet,d0
+       bls     Return7
+DoSetGauge     tstv.l  muimasterbase
+       beq     Return7
+       put.w   d0,GaugeSet
+       ext.l   d0
+       move.l  d0,d1
+       move.w  #MUIA_Gauge_Current-MUITags,d0
+       get.l   ProgressGauge,a0
+       bra     SetAttr
+
+NotEndTrans    cmp.b   #2,d0
+       beq.s   GotValidPkt
+       dtl     <Packet type ID: $02/$04 is $%02x>,a0
+       move.w  d0,-(sp)
+ExitErrorA1    move.l  sp,a1
+ExitError      jump    ExitError       
+
+GotValidPkt    bsr     GetSerByte
+       move.b  d0,d7
+       vcmp.b  CurPart,d0
+       beq.s   IsCurPart
+       put.b   d0,CurPart
+       cmp.b   #8,d0
+       bcs.s   SmallPartN
+BadPartN       dtl     <Unknown packet part #: $%02x>,a0
+       moveq   #0,d0
+       get.b   CurPart,d0
+       move.w  d0,-(sp)
+       bra.s   ExitErrorA1
+
+SmallPartN     lea     PartTab(pc),a4
+LoopPart       subq.b  #1,d0
+       bcs.s   DoneParts
+ScanPart       tst.b   (a4)+
+       bne.s   ScanPart
+       bra.s   LoopPart
+       
+DoneParts      tst.b   (a4)
+       beq.s   BadPartN
+       dtl     <',Char_Term,Char_Term,Char_Term,'>,a0
+       call    BPuts
+       move.l  a4,a0
+       call    BPutsNL
+       bra.s   NoFirstRec
+
+IsCurPart      cmp.b   #7,d7
+       beq.s   NoFirstRec
+       dtl     <',Char_Term,Char_Term,'>,a0
+       call    BPutsNL
+NoFirstRec     bsr     GetSerByte
+       add.b   d0,d7
+       move.b  d0,d2
+       bsr     GetSerByte
+       add.b   d0,d7
+       rol.w   #8,d0
+       move.b  d2,d0
+       cmp.w   #SerBufSiz-1,d0
+       bcs.s   OkaySize
+       dtl     <Packet too long: size=%u, max=%u>,a0
+       move.w  #SerBufSiz-1,-(sp)
+ExitErrorD0W   move.w  d0,-(sp)
+       bra.s   ExitErrorA1
+
+OkaySize       geta    SerBuf,a4
+       clr.b   (a4,d0.l)
+       move.w  d0,d2
+       move.w  d0,d3
+       bsr     SerReceiveX
+       bsr     GetSerByte
+       move.l  a4,a0
+NextXSumChar   add.b   d0,d7
+       move.b  (a0)+,d0
+       dbra    d2,NextXSumChar
+       tst.b   d7
+       beq.s   GoodXSum
+       dtl     <Packet checksum bad - sum:$00 is $%02x>,a0
+       move.w  d7,-(sp)
+       clr.b   (sp)
+       bra     ExitErrorA1
+
+GoodXSum       bsr     AddPartCount
+       st      d4
+       get.b   CurPart,d0
+       beq     BefRecScan
+       cmp.b   #7,d0   ;CALENDAR
+       beq.s   DoCalendar
+       cmp.b   #$F8,(a4)+
+       beq.s   AfterF8
+       dtl     <Packet data start magic @4:$F8 is $%02x>,a0
+       moveq   #0,d0
+       move.b  -(a4),d0
+       bra.s   ExitErrorD0W
+
+DoCalendar     cmp.w   #6,d3
+       beq.s   GoodCalLen
+       dtl     <Calendar data length:6 is %u>,a0
+       move.w  d3,-(sp)
+       bra     ExitErrorA1
+
+GoodCalLen     move.w  (a4)+,d0
+       bsr.s   PrintDate
+       moveq   #':',d0
+       call    BPutByte
+       moveq   #3,d0
+ReadLELong     move.b  (a4)+,d2
+       ror.l   #8,d2
+       dbra    d0,ReadLELong
+       clr.w   -(sp)
+NextDate       addq.w  #1,(sp)
+       ror.l   #1,d2
+       bcc.s   NotMarked
+       dtl     < %02u>,a0
+       move.l  sp,a1
+       call    BPrintf
+NotMarked      cmp.w   #31,(sp)
+       bne.s   NextDate
+       addq    #2,sp
+       bra     DoneThisRec
+
+PrintDate      move.w  d0,d1
+       and.w   #$000F,d1
+       move.w  d1,-(sp)
+       lsr.w   #4,d0
+       add.w   #$1900,d0
+       btst.l  #8,d0
+       bne.s   Not2000
+       add.w   #$2000-$1A00,d0
+Not2000        move.w  d0,-(sp)
+       dtl     <%x-%02u>,a0
+       move.l  sp,a1
+       call    BPrintf
+       addq    #4,sp 
+Return7        rts
+
+AfterF8        cmp.b   #5,d0   ;SCHEDULE
+       bne     BefRecScan
+       cmp.b   #12,d3
+       bcc.s   LongSchedDat
+       dtl     <Schedule data too short: size=%u, min=12>,a0
+       move.w  d3,-(sp)
+       bra     ExitErrorA1
+
+LongSchedDat   moveq   #0,d0
+       move.b  10(a4),d0
+       move.w  d0,-(sp)
+       move.b  8(a4),d0
+       move.w  d0,-(sp)
+       move.b  3(a4),d0
+       cmp.b   #$F3,d0
+       bne.s   BadSchDat
+       cmp.l   #$00F30000,(sp)
+       beq.s   GoodSched
+BadSchDat      move.w  d0,-(sp)
+       dtl     <Bad schedule data - @8:$F3 is $%02x, @13:$F3 is $%02x, @15:$00 is $%02x>,a0
+       bra     ExitErrorA1
+
+GoodSched      addq    #4,sp
+       move.w  1(a4),d0
+       rol.w   #8,d0
+       bsr.s   PrintDate
+       moveq   #0,d0
+       move.b  4(a4),d0
+       move.w  d0,-(sp)
+       move.b  5(a4),d0
+       move.w  d0,-(sp)
+       move.b  (a4),d0
+       move.w  d0,-(sp)
+       dtl     <-%02x: %02x:%02x>,a0
+       move.l  sp,a1
+       call    BPrintf
+       addq    #6,sp
+       moveq   #0,d0
+       move.b  7(a4),d0
+       cmp.b   #$30,d0
+       beq.s   NoEndTime
+       moveq   #0,d1
+       move.b  6(a4),d1
+       move.w  d1,-(sp)
+       move.w  d0,-(sp)
+       dtl     <-%02x:%02x>,a0
+       move.l  sp,a1
+       call    BPrintf
+       addq    #4,sp
+       moveq   #0,d0
+NoEndTime      move.b  9(a4),d0
+       beq.s   NoSchedImg
+       move.w  d0,-(sp)
+       dtl.c   < >,a0
+       dt      PercUT,<%u>
+       move.l  sp,a1
+       call    BPrintf
+       addq    #2,sp
+NoSchedImg     moveq   #10,d0
+       call    BPutChar
+       lea     11(a4),a4
+
+BefRecScan     moveq   #0,d2
+MainRecScan    move.b  (a4)+,d0
+       beq.s   DoneThisRec
+       cmp.b   #Char_Term,d0
+       bne.s   NotCharTerm
+       moveq   #Char_TermRepl,d0
+       bra.s   NotCharE4
+
+NotCharTerm    cmp.b   #Char_CasSep,d0
+       bne.s   NotCharF3
+       tst.b   d4
+       bne.s   LoopRecScan
+       bsr.s   FlushRecScan
+       moveq   #Char_Term,d0
+       call    BPutByte
+       bra.s   DoCharNL
+
+NotCharF3      cmp.b   #Char_CasCR,d0
+       bne.s   NotCharE4
+DoCharNL       addq.l  #1,d2
+       bra.s   LoopRecScan
+
+NotCharE4      move.w  d0,-(sp)
+       bsr.s   FlushRecScan
+       move.w  (sp)+,d0
+       call    BPutChar
+LoopRecScan    clr.b   d4
+       bra.s   MainRecScan
+
+DoneThisRec    moveq   #10,d0
+       call    BPutChar
+       bra     NextRcvPacket
+
+FlushRecScan   tst.l   d2
+FlushRecScanX  beq     Return7
+       moveq   #10,d0
+       call    BPutChar
+       subq.l  #1,d2
+       bra.s   FlushRecScanX
+;***************
+CallTransmit   put.l   a1,TransmitFName
+       move.l  a1,a0
+       moveq   #OPEN_OLD,d0
+       moveq   #0,d1
+       call    TrackOpenBuf
+       push    d0
+       tstv.l  muimasterbase
+       beq.s   EmptyFile
+       move.l  d0,a0
+       move.l  bh_handle(a0),d1
+       move.l  d1,d4
+       moveq   #0,d2
+       moveq   #OFFSET_END,d3
+       call    dos,Seek
+       moveq   #OFFSET_BEGINNING,d3
+       move.l  d4,d1
+       call    Seek
+       put.l   d0,TxFileSize
+       bne.s   EmptyFile
+       addqv.l #1,TxFileSize
+EmptyFile      bsr     SerialInit
+       move.l  (sp),a2
+       call    BFlush
+       put.l   sp,ErrPtr
+       moveq   #0,d6
+       stv     CurPart
+       move.w  #ASCII_CR<<8!ASCII_LF,-(sp)
+       move.l  sp,a0
+       moveq   #2,d0
+       bsr     DoSendBuf
+       addq    #2,sp
+       bsr     WaitAck
+NextLine       addqv.l #1,CurLine
+       geta    LineBuf,a3
+       move.l  a3,a0
+       move.l  #LineBufSiz,d0
+       call    BGets
+       subq.l  #1,d0
+       beq.s   StringOK
+       bsr     FlushRec
+       addq    #4,sp
+       moveq   #ASCII_EOT,d0
+       bsr     DoSendByte
+       bra     FullGaugeRet
+
+StringOK       cmp.w   #Char_Term<<8!Char_Term,(a3)
+       bne     NotSpec
+       bsr     FlushRec
+       addq    #2,a3
+       tst.b   (a3)
+       beq.s   NextLine
+       cmp.b   #Char_Term,(a3)+
+       beq.s   ReadPartID
+DoInvUse       dt      InvUseT,<Invalid use of ''',Char_Term,'''%s>
+       tpea    InvUseT
+       bra.s   ErrDesc
+
+ReadPartID     lea     PartTab(pc),a4
+       clrv.b  CurPart
+       moveq   #0,d2
+LoopRdPartN    move.l  a3,a0
+       move.l  a4,a1
+       call    utility,Stricmp
+       move.l  (v),a6
+       beq.s   NextLine
+ScanRdPartN    tst.b   (a4)+
+       bne.s   ScanRdPartN
+       addqv.b #1,CurPart
+       cmpv.b  #8,CurPart
+       bne.s   LoopRdPartN
+DoUnkPID       dt      UnkPIDT,<Unknown part ID%s>,a0
+       tpea    UnkPIDT
+ErrDesc        geta    LineBuf,a0
+       push    a0
+LenLine        tst.b   (a0)+
+       bne.s   LenLine
+       sub.l   (sp),a0
+       vpush   CurLine
+       get.l   TransmitFName,a2
+       push    a2
+LenFName       tst.b   (a2)+
+       bne.s   LenFName
+       sub.l   (sp),a2
+       add.l   a2,a0
+       lea     64(a0),a0
+       move.l  a0,d0
+       call    IPAlloc
+       move.l  d0,a2
+       dtl     < in "%s", line %lu: "%s">,a0
+       move.l  sp,a1
+       call    FormatStr
+       lea     12(sp),sp
+       pop     a0
+       get.l   ErrPtr,a1
+       move.l  a2,(a1)
+       bra     ExitErrorA1
+
+NotSpec        move.l  d6,a0
+       tst.l   d6
+       bne     AlreadyBeginX
+       moveq   #0,d4
+       geta    SerBuf,a0
+       move.b  #2,(a0)+
+       get.b   CurPart,d0
+       bmi.s   DoUnkPID
+       move.b  d0,(a0)+
+       clr.w   (a0)+   ;Length 2 B filled L8R
+       cmp.b   #7,d0
+       beq     WrCalendar
+       tst.b   d0
+       beq     AlreadyBegin
+       move.b  #$F8,(a0)+
+       move.b  #Char_CasSep,(a0)+
+       cmp.b   #5,d0
+       bne     AlreadyBegin
+WrSchedule     moveq   #'-',d3
+       bsr     ParseYear
+       move.w  -(a4),d0
+       rol.w   #8,d0
+       move.w  d0,(a4)+
+       bsr     SchedStrStr
+       cmp.l   #32,d0
+       bcc     BadSched
+       tst.l   d0
+       beq     BadSched
+       bsr     ConvByteBCD
+       move.b  d0,-3(a4)
+       move.w  #Char_CasSep<<8,(a4)+
+       bsr     SchReadHour
+       move.b  d0,(a4)+
+       move.l  a4,a0
+LoopSch2Col    move.b  (a3)+,d0
+       move.b  d0,(a4)+
+       beq.s   TermSch2ColX
+       cmp.b   #' ',d0
+       beq.s   TermSch2Col
+       cmp.b   #'-',d0
+       bne.s   LoopSch2Col
+TermSch2ColX   subq    #1,a3
+TermSch2Col    bsr     StrStrToLA4
+       cmp.l   #60,d0
+       bcc.s   BadSched
+       bsr     ConvByteBCD
+       move.b  d0,-2(a4)
+       clr.b   (a4)+
+       move.l  #$30F30000,(a4)+
+       move.l  a4,a0
+SkipSchSpc     move.b  (a3)+,d0
+       beq.s   DoneSchParse
+       cmp.b   #' ',d0
+       beq.s   SkipSchSpc
+       cmp.b   #'-',d0
+       bne.s   NoEndSchTim
+       bsr.s   SchReadHour
+       move.b  d0,-4(a4)
+       move.l  a4,a0
+LoopSch3Col    move.b  (a3)+,d0
+       move.b  d0,(a4)+
+       beq.s   TermSch3Col
+       cmp.b   #' ',d0
+       bne.s   LoopSch3Col
+TermSch3Col    bsr     StrStrToLA4
+       cmp.l   #60,d0
+       bcc.s   BadSched
+       bsr.s   ConvByteBCD
+       move.b  d0,-5(a4)
+NoEndSchTim    move.l  a4,a0
+LoopSch4Col    move.b  (a3)+,d0
+       move.b  d0,(a4)+
+       beq.s   TermSch4Col
+       cmp.b   #' ',d0
+       bne.s   LoopSch4Col
+TermSch4Col    bsr     StrStrToLA4
+       move.l  d0,d1
+       lsr.l   #8,d1
+       bne.s   BadSched
+       move.b  d0,-2(a4)
+       subq    #1,a3
+LoopSch5Col    move.b  (a3)+,d0
+       beq.s   DoneSchParse
+       cmp.b   #' ',d0
+       beq.s   LoopSch5Col
+BadSched       get.l   ErrPtr,sp
+       dt      BadSchedT,<Schedule format bad - req. "YEAR-MN-DY: HS:MS[-HE:ME] [ICON]"%s>
+       tpea    BadSchedT
+       bra     ErrDesc
+
+DoneSchParse   move.l  a4,d6
+       bra     NextLine
+
+SchReadHour    bsr     SchedStrStr
+       cmp.l   #24,d0
+       bcc.s   BadSched
+ConvByteBCD    divu.w  #10,d0
+       move.w  d0,d1
+       swap    d0
+       rol.b   #4,d1
+       or.b    d1,d0
+       rts
+
+ParseYear      move.l  a0,a4
+LoopYrMin      move.b  (a3)+,d0
+       beq.s   BadYear
+       move.b  d0,(a4)+
+       cmp.b   #'-',d0
+       bne.s   LoopYrMin
+       bsr     StrStrToLA4
+       cmp.l   #2100,d0
+       bcs.s   SmallYrYear
+BadYear        dt      BadYearT,<Year/Month format bad - req. "YEAR-MN"%s>
+       tpea    BadYearT
+       bra     ErrDesc
+
+SmallYrYear    cmp.w   #1901,d0
+       bcs.s   BadYear
+       move.l  d0,d2
+       move.l  a4,a0
+LoopYrCol      move.b  (a3)+,d0
+       beq.s   BadYear
+       move.b  d0,(a4)+
+       cmp.b   d3,d0
+       bne.s   LoopYrCol
+       bsr     StrStrToLA4
+       cmp.l   #13,d0
+       bcc.s   BadYear
+       tst.l   d0
+       beq.s   BadYear
+       sub.w   #1900,d2
+       moveq   #10,d1
+       divu.w  d1,d2
+       swap    d2
+       rol.b   #4,d2
+       or.b    d2,d0
+       move.b  d0,1(a4)
+       clr.w   d2
+       swap    d2
+       divu.w  d1,d2
+       swap    d2
+       move.b  d2,d0
+       swap    d2
+       rol.b   #4,d2
+       or.b    d2,d0
+       move.b  d0,(a4)
+       addq    #2,a4
+Return2        rts
+
+WrCalendar     moveq   #':',d3
+       bsr.s   ParseYear
+       moveq   #0,d2
+NextCalenDay   move.l  a4,a0
+SkipSpcCalen   move.b  (a3)+,d0
+       beq.s   SendCalend
+       cmp.b   #' ',d0
+       beq.s   SkipSpcCalen
+       bra.s   SkipZeroCalI
+
+SkipZeroCal    move.b  (a3)+,d0
+SkipZeroCalI   cmp.b   #'0',d0
+       beq.s   SkipZeroCal
+CopyDayNum     move.b  d0,(a4)+
+       move.b  (a3),d0
+       beq.s   DoneDayNum
+       addq    #1,a3
+       cmp.b   #' ',d0
+       bne.s   CopyDayNum
+DoneDayNum     clr.b   (a4)
+       move.l  a0,a4
+       call    StrToL
+       subq.l  #1,d0
+       bmi.s   BadCalend
+       bset.l  d0,d2
+       cmp.l   #31,d0
+       bcs.s   NextCalenDay
+BadCalend      dt      CalBadT,<Calendar format bad - req. "...: D1 D2 ... Dn"%s>
+       tpea    CalBadT
+       bra     ErrDesc
+
+SchedStrStr    move.l  a4,a0
+LoopSchCol     move.b  (a3)+,d0
+       beq     BadSched
+       move.b  d0,(a4)+
+       cmp.b   #':',d0
+       bne.s   LoopSchCol
+StrStrToLA4    clr.b   -(a4)
+       move.l  a0,a4
+       moveq   #0,d0
+StrStrToL      move.b  (a0)+,d0
+       beq.s   Return2
+       cmp.b   #' ',d0
+       beq.s   StrStrToL
+       cmp.b   #'0',d0
+       beq.s   StrStrToL
+       subq    #1,a0
+       jump    StrToL
+
+SendCalend     moveq   #3,d0
+WrCalenLong    move.b  d2,(a4)+
+       ror.l   #8,d2
+       dbra    d0,WrCalenLong
+       move.l  a4,d6
+       bsr.s   FlushRec
+       bra     NextLine
+
+AlreadyBeginX  moveq   #Char_CasCR-$100,d0
+       bclr.l  #0,d4
+       bne.s   PutToBuf
+AlreadyBegin   move.b  (a3)+,d0
+       bne.s   NotNL
+       addq.l  #1,d4
+       move.l  a0,d6
+       bra     NextLine
+
+NotNL  cmp.b   #Char_Term,d0
+       bne.s   PutToBuf
+       tst.b   (a3)
+       bne     DoInvUse
+       moveq   #-1,d4
+       moveq   #Char_CasSep-$100,d0
+PutToBuf       geta    SerBuf+SerBufSiz-1,a1
+       cmp.l   a1,a0
+       bcs.s   GoodPktLen
+       move.w  #SerBufSiz,-(sp)
+       dt      PktDatLT,<Packet data too long - max=%u%s>
+       tpea    PktDatLT
+       bra     ErrDesc
+
+GoodPktLen     move.b  d0,(a0)+
+       bra.s   AlreadyBegin
+
+FlushRec       tst.l   d6
+       beq.s   Return3
+       tstv.l  muimasterbase
+       beq.s   NoMUITxProg
+       call    BTell
+       moveq   #100,d1
+       call    utility,UMult32
+       get.l   TxFileSize,d1
+       call    utility,UDivMod32
+       bsr     DoSetGauge
+       bsr     AddPartCount
+NoMUITxProg    move.l  d6,d0
+       geta    SerBuf+4,a0
+       sub.l   a0,d0
+       ror.w   #8,d0
+       put.w   d0,SerBuf+2
+       ror.w   #8,d0
+       addq.l  #5,d0
+       move.l  d6,a1
+       subq    #4,a0
+       lea     1(a0),a1
+       move.w  d0,d1
+       subq.w  #4,d1
+       move.b  (a1)+,d2
+TxXSum add.b   (a1)+,d2
+       dbra    d1,TxXSum
+       neg     d2
+       move.b  d2,(a1)
+       moveq   #0,d6
+       pea     WaitAck(pc)
+
+DoSendBuf      subq.w  #1,d0
+       bmi.s   Return3
+LoopSendB      push    d0
+       move.b  (a0)+,d0
+       push    a0
+       bsr.s   DoSendByte
+       pop     a0
+       pop     d0
+       dbra    d0,LoopSendB
+Return3        rts
+
+DoSendByte     put.b   d0,SerByte
+       get.l   TimerTrk,a1
+       move.l  trk_data(a1),a0
+       get.l   Arg_MicroWait,IOTV_TIME+TV_MICRO(a0)
+       beq.s   SendItNow
+       clr.l   IOTV_TIME+TV_SECS(a0)
+       dtl     <TR_ADDREQUEST>,a0
+       call    ss,ChkDoIO
+SendItNow      get.l   SerialIO,a0
+       geta    SerByte,a1
+       move.l  a1,IO_DATA(a0)
+       moveq   #1,d0
+       move.l  d0,IO_LENGTH(a0)
+       move.w  #CMD_WRITE,IO_COMMAND(a0)
+       dtl     <CMD_WRITE>,a0
+       get.l   SerialTrk,a1
+       jump    ss,ChkDoIO
+;***************
+WaitAck        bsr.s   GetSerByte
+       cmp.b   #ASCII_ACK,d0
+       beq.s   Return1
+       addq    #2,sp
+       move.w  d0,(sp)
+       dtl     <Casio memory exhausted - got $%02x (ACK=$06)%s>,a0
+       cmp.b   #5,d0
+       beq.s   MemoryErr
+       dtl     <Casio remote abort - got $%02x (ACK=$06)%s>,a0
+       cmp.b   #ASCII_EOT,d0
+       beq.s   MemoryErr
+       dtl     <Expected ACK - $06, got $%02x%s>,a0
+MemoryErr      push    a0
+       bra     ErrDesc
+
+;---------------
+GetSerByte     moveq   #1,d0
+       subq    #2,sp
+       move.l  sp,a0
+       bsr.s   SerReceive
+       moveq   #0,d0
+       move.b  (sp)+,d0
+Return1        rts
+;---------------
+SerReceiveX    move.l  a4,a0
+SerReceive     get.l   SerialIO,a1
+       move.l  a0,IO_DATA(a1)
+       move.w  #CMD_READ,IO_COMMAND(a1)
+       move.l  d0,IO_LENGTH(a1)
+       move.l  MN_REPLYPORT(a1),a0
+       move.b  MP_SIGBIT(a0),d5
+       call    exec,SendIO
+LoopSerInput   tstv.l  muimasterbase
+       beq.s   SkipAbort
+       bsr     DoMUIPoll
+       tstv.b  InAbort
+       beq.s   SkipAbort
+       pea     SSExitCleanup(pc)
+       put.b   #ASCII_EOT,SerByte
+       bra     SendItNow
+
+SkipAbort      get.l   SerialIO,a1
+       call    exec,CheckIO
+       tst.l   d0
+       bne.s   DoneReadIO
+       tstv.l  muimasterbase
+       beq.s   ForceMUIPoll
+       get.l   MUIWaitMask,d0
+       beq.s   LoopSerInput
+ForceMUIPoll   bset.l  d5,d0
+       bsr     MUIPollEnd
+       bra.s   LoopSerInput
+
+DoneReadIO     get.l   SerialIO,a1
+       call    exec,WaitIO
+       move.l  (v),a6
+ProcSerErr     ext.w   d0
+       beq.s   Return1
+       geta    SerErrMem,a0
+;Stolen from SSLib.asm
+10$    move.w  d0,d1
+       sub.w   (a0)+,d1
+       bcs.s   11$
+       move.w  (a0)+,d2
+       beq.s   0$
+       cmp.w   d2,d1
+       bcc.s   12$
+       lsl.w   #2,d1
+       move.l  0(a0,d1.w),d2
+       moveq   #err_iofail2,d0
+       bra.s   01$
+
+11$    move.w  (a0)+,d2
+12$    lsl.w   #2,d2
+       add.l   d2,a0
+       bra.s   10$
+
+0$     moveq   #err_iofail,d0
+       get.l   Arg_Device,d2
+01$    dtl     <CMD_READ>,a1
+       jump    ReportError
+;---------------
+SerialInit     dt      TimerDev,<timer.device>
+       gett    TimerDev,a0
+       moveq   #IOTV_SIZE,d0
+       move.l  d0,a1
+       moveq   #UNIT_MICROHZ,d0
+       moveq   #0,d1
+       sub.l   a2,a2
+       call    ss,TrackDevice
+       put.l   d1,TimerTrk
+       move.w  #TR_ADDREQUEST,IO_COMMAND(a1)
+
+       get.l   Arg_Device,a0
+       get.l   Arg_DevUnit,d0
+       moveq   #IOEXTSER_SIZE,d1
+       move.l  d1,a1
+       moveq   #0,d1
+       geta    SerErrMem,a2
+       call    TrackDevice
+       put.l   d1,SerialTrk
+       put.l   a1,SerialIO
+       move.w  #SDCMD_SETPARAMS,IO_COMMAND(a1)
+       get.l   Arg_Baud,IO_BAUD(a1)
+       move.l  #$08080100!SERF_XDISABLED!SERF_RAD_BOOGIE,IO_READLEN(a1)
+                       ;io_ReadLen,io_WriteLen,io_StopBits,io_SerFlags
+       dtl     <SDCMD_SETPARAMS>,a0
+       move.l  d1,a1
+       jump    ChkDoIO
+;---------------
+GenerateMUI    gett    __BaseText,a2
+       get.l   muimasterbase,a6
+       moveq   #0,d2
+       bra.s   .loopnext
+
+BuildMUILoop   equ     *
+.loop  push    d2
+.loop2 move.l  #MUITags,d2
+       move.w  (a3)+,d2
+       beq.s   .end
+       moveq   #-1,d0
+       cmp.w   d0,d2
+       bne.s   .loopnext
+       move.l  #ASL_TB,d2
+       move.w  (a3)+,d2
+.loopnext      moveq   #0,d3
+       move.w  (a3)+,d3
+       bmi.s   .subobj
+       bclr    #14,d3
+       bne.s   .numb
+       add.l   a2,d3           ; String
+       push    d3
+       bra.s   .loop
+
+.numb  cmp.w   #$2000,d3       ; Number
+       beq.s   .long
+       bcs.s   .plus
+       or.l    #$FFFFE000,d3
+.plus  push    d3
+       bra.s   .loop
+.long  push    (a3)+
+       bra.s   .loop
+
+.subobj        bclr    #15,d3
+       bclr    #14,d3
+       bne.s   .var
+       add.l   a2,d3
+       link    a4,#0
+       push    d3
+       move.w  (a3)+,-(sp)
+       push    d2
+       clr.l   -(sp)
+       bra.s   .loop2
+
+.var   move.l  (a5,d3.w),-(sp)
+       bra.s   .loop
+
+.end   move.l  -4(a4),a0
+       move.l  sp,a1
+       call    MUI_NewObject
+       tst.l   d0
+       beq     MUIDosError
+
+       move.w  -6(a4),d3
+       move.l  d0,(a5,d3.w)
+       move.l  -10(a4),d2
+       unlk    a4
+       tst.w   d2
+       beq.s   Return6
+       push    d0
+       bra     BuildMUILoop
+;---------------
+DoMethodAppl   get.l   ApplObj,a2
+DoMethod       lea     4(sp),a1
+       move.l  -4(a2),a0
+DoMethodEntry  move.l  h_Entry(a0),a6
+       jmp     (a6)
+;---------------
+GetAttrStr     move.w  #MUIA_String_Contents-MUITags,d0
+GetAttr        move.l  #MUITags,d1
+       move.w  d0,d1
+       move.l  d1,d0
+       clr.l   -(sp)
+       move.l  sp,a1
+       call    intuition,GetAttr
+       pop     d0
+Return6        rts
+;---------------
+;-1=Done,-2=TriggerValue,-3=ReturnID_Quit,-4=ID 1
+SetNotify      move.l  sp,d2
+       move.w  (a3)+,d0
+       bpl.s   FilledLongD0E
+       move.w  d0,d1
+       addq.w  #1,d1
+       beq.s   Return6
+       move.l  #MUIV_TriggerValue,d0
+TriggerValPtr  equ     *-4
+       addq.w  #1,d1
+       beq.s   FilledLongD0
+       push    #MUIV_Application_ReturnID_Quit
+       addq.w  #1,d1
+       beq.s   RetQuitID
+       neg.w   d1
+       ext.l   d1
+       move.l  d1,(sp)
+RetQuitID      push    #MUIM_Application_ReturnID
+       pea     2.w
+       vpush   ApplObj
+       bra.s   DoneRetID
+
+FilledLongD0E  ext.l   d0
+FilledLongD0   push    d0
+       move.w  (a3)+,-(sp)
+       move.w  #MUITags>>16,-(sp)
+       push    #MUIM_Set
+       pea     3.w
+       move.w  (a3)+,d0
+       move.l  (v,d0.w),d0
+       push    d0
+DoneRetID      move.w  (a3)+,d0
+       ext.l   d0
+       push    d0
+       addq.l  #1,d0
+       bne.s   NotEveryTime
+       move.l  #MUIV_EveryTime,(sp)
+EveryTimePtr   equ     *-4
+NotEveryTime   move.w  (a3)+,-(sp)
+       move.w  #MUITags>>16,-(sp)
+       push    #MUIM_Notify
+       move.w  (a3)+,d0
+       move.l  (v,d0.w),a2
+       bsr     DoMethod
+       move.l  d2,sp
+       bra.s   SetNotify
+;---------------
+BaudRateFunc   cmp.l   #MUIM_Numeric_Stringify,(a1)
+       beq.s   GotNumString
+       move.l  cl_Super(a0),a0
+       bra     DoMethodEntry
+
+GotNumString   move.w  cl_InstOffset(a0),d0
+       mpush   a2/a5/a6
+       add.w   d0,a2
+       move.l  4(a1),d0        ;offsetof(struct MUIP_Numeric_Stringify,value)
+       moveq   #1200>>4,d1
+       addq.l  #4,d0
+       lsl.l   d0,d1
+       push    d1
+       move.l  4.w,a0
+       move.l  ThisTask(a0),a0
+       move.l  TC_Userdata(a0),v
+       move.l  sp,a1
+       gett    PercLUT,a0
+       call    ss,FormatStr
+       addq    #4,sp
+       move.l  a2,d0
+       mpop    a2/a5/a6
+       rts
+;---------------
+WinOpenHook    mpush   a5/a6
+       move.l  h_Data(a0),v
+       move.w  #MUIA_Window_Window-MUITags,d0
+       get.l   MainWin,a0
+       bsr     GetAttr
+       get.l   sv_thistask,a0
+       move.l  d0,pr_WindowPtr(a0)
+       mpop    a5/a6
+       rts
+;---------------
+AppDropHook    mpush   d2/d3/a2/a5/a6
+       move.l  h_Data(a0),v
+       move.l  (a1),a1
+       move.l  am_NumArgs(a1),d0
+       beq.s   DoneDropHook
+       subq.l  #1,d0
+       beq.s   OneDropHook
+BeepDropHook   sub.l   a0,a0
+       call    intuition,DisplayBeep
+       bra.s   DoneDropHook
+
+OneDropHook    tstv.b  Inside
+       bne.s   BeepDropHook
+       move.l  am_ArgList(a1),a0
+       move.l  (a0)+,d1        ;wa_Lock
+       push    (a0)    ;wa_Name
+       geta    AppDropBuf,a2
+       move.l  a2,d2
+       move.l  #AppBufSiz,d3
+       call    dos,NameFromLock
+       pop     d2
+       tst.l   d0
+       beq.s   BeepDropHook
+       move.l  a2,d1
+       call    AddPart
+       tst.l   d0
+       beq.s   BeepDropHook
+       put.l   a2,Arg_From
+       moveq   #1,d0
+       push    d0
+       push    #MUIM_Application_ReturnID
+       bsr     DoMethodAppl
+       addq    #8,sp
+       move.w  #MUIA_Application_Iconified-MUITags,d0
+       moveq   #0,d1
+       get.l   ApplObj,a0
+       bsr     SetAttr
+DoneDropHook   mpop    d2/d3/a2/a5/a6
+       rts
+;---------------
+Cleanup        get.l   muimasterbase,a6
+       get.l   ApplObj,d0
+       beq.s   NoApplObj
+       move.l  d0,a0
+       clrv.l  ApplObj
+       call    MUI_DisposeObject
+NoApplObj      get.l   BaudRateClass,d0
+       beq     Return6
+       move.l  d0,a0
+       clrv.l  BaudRateClass
+       jump    MUI_DeleteCustomClass
+;---------------
+       dc.b    0,1,15,3,11,3,4,1,1
+SerErrTab      dc.b    'DevBusy',0
+       dc.b    'BufErr',0
+       dc.b    'InvParam',0
+       dc.b    'LineErr',0
+       dc.b    'TimerErr',0
+       dc.b    'BufOverflow',0
+       dc.b    'NoDSR',0
+       dc.b    'DetectedBreak',0
+;!!! SerErrTabSize on begin - keep fresh
+;---------------
+PackMenus      dc.b    0,'Project',0           ;0
+       dc.b    'T'+2,'Transmit...',0   ;1
+       dc.b    'R'+2,'Receive...',0    ;2
+       dc.b    -1
+       dc.b    '?'+2,'About...',0      ;3
+       dc.b    1,'About MUI...',0      ;4
+       dc.b    -1
+       dc.b    'H'+2,'Hide',0          ;5
+       dc.b    'Q'+2,'Quit',0          ;6
+       dc.b    0,'Configuration',0             ;7
+       dc.b    -2,'C'+2,'Settings',0 ;8
+       dc.b    1,'Restore last saved',0 ;9
+       dc.b    -1
+       dc.b    'M'+2,'MUI...',0        ;10
+PackMenuNum    equ     14
+;!!! PackMenuHots on begin - keep fresh
+;---------------
+PartTab        dc.b    'ProtID',0      ;0
+       dc.b    0               ;1
+       dc.b    0               ;2
+       dc.b    'Phone-B',0     ;3
+       dc.b    'Phone-P',0     ;4
+       dc.b    'Schedule',0    ;5
+       dc.b    'Memo',0        ;6
+       dc.b    'Calendar',0    ;7
+       even
+;---------------
+MTag   macro
+       ifge    \1-MUITags
+       dc.w    \1-MUITags
+       else
+       dc.w    -1,\1-ASL_TB
+       endc
+       endm
+
+MOffs  macro
+       dc.w    \1+\2-__BaseText
+       endm
+
+MObj   macro
+       ifne    \1
+       MTag    \1
+       endc
+       ifnd    STREX_\2
+STREX_\2       set     1
+       dt      STR_\2,<\2.mui>
+       endc
+       MOffs   $8000,STR_\2
+       ifgt    NARG-2
+       dc.w    \3
+       dv.l    \3
+       elseif
+       dc.w    __Trash
+       endc
+       endm
+
+MText  macro
+       MTag    \1
+       dt      STR_\@a,<\2>
+       MOffs   0,STR_\@a
+       endm
+
+MNum   macro
+       MTag    \1
+       ifge    \2-$2000
+       dc.w    $6000
+       dc.l    \2
+       elseif
+       ifle    \2+$2000
+       dc.w    $6000
+       dc.l    \2
+       elseif
+       dc.w    $4000+(\2&$3FFF)
+       endc
+       endc
+       endm
+
+MVar   macro
+       MTag    \1
+       ifd     \2
+       ifge    \2-$4000
+       fail
+       endc
+       endc
+       dc.w    \2+$C000
+       endm
+
+MEnd   macro
+       dc.w    0
+       endm
+
+Notify macro
+       ifeq    NARG-4
+        ifc    'Quit','\4'
+         dc.w  -3
+        else
+         dc.w  -(\4)-4
+        endc
+       else
+        ifc    'TriggerValue','\6'
+         dc.w  -2
+        else
+         dc.w  \6
+        endc
+        dc.w   MUIA_\5-MUITags,\4
+       endc
+       ifc     'EveryTime','\3'
+        dc.w   -1
+       else
+        dc.w   \3
+       endc
+       dc.w    MUIA_\2-MUITags,\1
+       endm
+
+       dv.l    __Trash
+       dt.c    __BaseText,<>
+;---------------
+MUI_Applic
+ MObj  0,Application,ApplObj
+  MText        MUIA_Application_Title,<Casio-A>
+  MText        MUIA_Application_Version,<$VER: Casio-A 1.0 (31.8.96)>
+  MText        MUIA_Application_Copyright,<© 1996 Short Software>
+  MText        MUIA_Application_Author,<Jan Kratochvil>
+  MText        MUIA_Application_Description,<Comm. tool for Casio series A organizers>
+  MText        MUIA_Application_Base,<Casio-A>
+  MVar MUIA_Application_Menustrip,MenuStrip
+  MObj MUIA_Application_Window,Window,MainWin
+   MText       MUIA_Window_Title,<Casio-A Communicator>
+   MNum        MUIA_Window_ID,'MAIN'
+   MNum        MUIA_Window_AppWindow,TRUE
+   MObj        MUIA_Window_RootObject,Group
+    MObj       MUIA_Group_Child,Group,GaugeGroup
+     MNum      MUIA_Group_Horiz,TRUE
+     MNum      MUIA_Frame,MUIV_Frame_Button
+     MNum      MUIA_Disabled,TRUE
+     MVar      MUIA_Group_Child,AbortButton
+     MObj      MUIA_Group_Child,Gauge,ProgressGauge
+      MNum     MUIA_Gauge_Horiz,TRUE
+      MText    MUIA_Gauge_InfoText,<%ld%%>
+      MNum     MUIA_Frame,MUIV_Frame_Gauge
+      MEnd
+     MEnd
+    MObj       MUIA_Group_Child,Rectangle
+     MEnd
+    MObj       MUIA_Group_Child,Group
+     MNum      MUIA_Group_Columns,2
+     MNum      MUIA_Frame,MUIV_Frame_Text
+     MVar      MUIA_Group_Child,QuitButton
+     MVar      MUIA_Group_Child,SettingsButton
+     MObj      MUIA_Group_Child,Popasl,ReceiveAsl
+      MVar     MUIA_Popstring_Button,ReceiveButton
+      MObj     MUIA_Popstring_String,String,ReceiveText
+       MNum    MUIA_ExportID,6
+       MNum    MUIA_ShowMe,FALSE
+       MEnd
+      MText    ASLFR_TitleText,<Receive from Casio to file...>
+      MNum     ASLFR_DoSaveMode,TRUE
+      MNum     ASLFR_RejectIcons,TRUE
+      MEnd
+     MObj      MUIA_Group_Child,Popasl,TransmitAsl
+      MVar     MUIA_Popstring_Button,TransmitButton
+      MObj     MUIA_Popstring_String,String,TransmitText
+       MNum    MUIA_ExportID,5
+       MNum    MUIA_ShowMe,FALSE
+       MEnd
+      MText    ASLFR_TitleText,<Files for transmit to Casio...>
+      MNum     ASLFR_RejectIcons,TRUE
+      MEnd
+     MEnd
+    MObj       MUIA_Group_Child,Rectangle
+     MEnd
+    MObj       MUIA_Group_Child,Group
+     MNum      MUIA_Group_Columns,2
+     MNum      MUIA_Frame,MUIV_Frame_Group
+     MText     MUIA_FrameTitle,<Casio Modes>
+     MVar      MUIA_Group_Child,StatBar5
+     MVar      MUIA_Group_Child,StatBar2
+     MVar      MUIA_Group_Child,StatBar4
+     MVar      MUIA_Group_Child,StatBar1
+     MVar      MUIA_Group_Child,StatBar3
+     MVar      MUIA_Group_Child,StatBar0
+     MEnd
+    MEnd
+   MEnd
+  MVar MUIA_Application_DropObject,MainWin
+  MObj MUIA_Application_Window,Window,ConfigWin
+   MText       MUIA_Window_Title,<Casio-A Settings>
+   MNum        MUIA_Window_ID,'SETT'
+   MObj        MUIA_Window_RootObject,Group,ConfigGroup
+    MObj       MUIA_Group_Child,Group
+     MNum      MUIA_Group_Horiz,TRUE
+     MVar      MUIA_Group_Child,CloseButton
+     MVar      MUIA_Group_Child,RestoreButton
+     MVar      MUIA_Group_Child,UseButton
+     MVar      MUIA_Group_Child,SaveButton
+     MEnd
+    MObj       MUIA_Group_Child,Group,MicroSecSlider
+     MNum      MUIA_Group_Columns,2
+     MNum      MUIA_Frame,MUIV_Frame_Button
+     MObj      MUIA_Group_Child,Slider
+      MNum     MUIA_Numeric_Min,0
+      MNum     MUIA_Numeric_Max,1000
+      MNum     MUIA_Numeric_Value,Def_Micros
+      MNum     MUIA_ExportID,4
+      MNum     MUIA_CycleChain,TRUE
+      MEnd
+     MObj      MUIA_Group_Child,Text
+      MText    MUIA_Text_Contents,<',27,'rDelay [MicroSec]>
+      MNum     MUIA_HorizWeight,0
+      MEnd
+     MVar      MUIA_Group_Child,BaudRateSlider
+     MObj      MUIA_Group_Child,Text
+      MText    MUIA_Text_Contents,<',27,'rBaud rate>
+      MNum     MUIA_HorizWeight,0
+      MEnd
+     MObj      MUIA_Group_Child,String,UnitNumber
+      MText    MUIA_String_Accept,<0123456789>
+      MNum     MUIA_Frame,MUIV_Frame_String
+      MVar     MUIA_String_Integer,Arg_DevUnit
+      MNum     MUIA_ExportID,2
+      MNum     MUIA_CycleChain,TRUE
+      MEnd
+     MObj      MUIA_Group_Child,Text
+      MText    MUIA_Text_Contents,<',27,'rDevice unit>
+      MNum     MUIA_HorizWeight,0
+      MEnd
+     MObj      MUIA_Group_Child,String,DeviceString
+      MNum     MUIA_Frame,MUIV_Frame_String
+      MVar     MUIA_String_Contents,Arg_Device
+      MNum     MUIA_ExportID,1
+      MNum     MUIA_CycleChain,TRUE
+      MEnd
+     MObj      MUIA_Group_Child,Text
+      MText    MUIA_Text_Contents,<',27,'rDevice>
+      MNum     MUIA_HorizWeight,0
+      MEnd
+     MEnd
+    MEnd
+   MEnd
+  MEnd
+
+MUI_StatBar
+ MObj  0,Group
+  MNum MUIA_Group_Horiz,TRUE
+  MNum MUIA_Frame,MUIV_Frame_Text
+  MObj MUIA_Group_Child,Rectangle
+   MNum        MUIA_FixWidth,1
+   MEnd
+  MObj MUIA_Group_Child,Text,StatBarNumber
+   MText       MUIA_Text_Contents,<  0>
+   MText       MUIA_Text_PreParse,<',27,'r',27,'8>
+   MEnd
+  MObj MUIA_Group_Child,Text
+   MVar        MUIA_Text_Contents,StatBarText
+   MNum        MUIA_Text_SetMax,TRUE
+   MEnd
+  MObj MUIA_Group_Child,Rectangle
+   MNum        MUIA_Rectangle_VBar,TRUE
+   MNum        MUIA_FixWidth,1
+   MEnd
+  MObj MUIA_Group_Child,Bitmap
+   MVar        MUIA_Bitmap_Bitmap,StatBarBMap
+   MNum        MUIA_Bitmap_Width,32
+   MNum        MUIA_Bitmap_Height,16
+   MNum        MUIA_Bitmap_Precision,PRECISION_ICON
+   MNum        MUIA_Frame,MUIV_Frame_None
+   MNum        MUIA_FixWidth,32
+   MNum        MUIA_FixHeight,16
+   MEnd
+  MEnd
+
+MUI_Notific
+       Notify  SettingsButton,Selected,EveryTime,ConfigWin,Window_Open,TriggerValue
+       Notify  ConfigWin,Window_Open,EveryTime,SettingsButton,Selected,TriggerValue
+       Notify  ConfigWin,Window_Open,EveryTime,ConfigMItem,Menuitem_Checked,TriggerValue
+       Notify  ConfigWin,Window_CloseRequest,TRUE,ConfigWin,Window_Open,FALSE
+       Notify  CloseButton,Pressed,FALSE,ConfigWin,Window_Open,FALSE
+       Notify  MainWin,Window_CloseRequest,TRUE,Quit
+       Notify  TransmitText,String_Acknowledge,EveryTime,0
+       Notify  ReceiveText,String_Acknowledge,EveryTime,1
+       Notify  QuitButton,Pressed,FALSE,Quit
+       Notify  SaveButton,Pressed,FALSE,2
+       Notify  UseButton,Pressed,FALSE,3
+       Notify  RestoreButton,Pressed,FALSE,4
+       Notify  AbortButton,Pressed,FALSE,5
+       Notify  ApplObj,Application_MenuAction,FirstMenuCode+5,ApplObj,Application_Iconified,TRUE
+       Notify  ApplObj,Application_MenuAction,FirstMenuCode+6,Quit
+       Notify  ConfigMItem,Menuitem_Checked,EveryTime,ConfigWin,Window_Open,TriggerValue
+       dc.w    -1
+;---------------
+CasioIcons     incbin  "Casio-A.gfx"
+;---------------
+       tags
+       template <TO=RECEIVE/K,FROM=TRANSMIT/K,DEVICE/K,DEVUNIT/K/N,BAUD/K/N,MICROWAIT/K/N,MUI/S>
+       dv.l    Arg_To
+       dv.l    Arg_From
+       dv.l    Arg_Device
+       dv.l    Arg_DevUnit
+       dv.l    Arg_Baud
+       dv.l    Arg_MicroWait
+       dv.l    Arg_MUI
+       defvar  <Casio-A>
+       diserr  1<<err_number
+       exitrout Cleanup
+       finish
+
+       end
diff --git a/project/CasioA/Casio-A.lha b/project/CasioA/Casio-A.lha
new file mode 100644 (file)
index 0000000..2c62b28
Binary files /dev/null and b/project/CasioA/Casio-A.lha differ
diff --git a/project/CasioA/Casio-A.png b/project/CasioA/Casio-A.png
new file mode 100644 (file)
index 0000000..500eba4
Binary files /dev/null and b/project/CasioA/Casio-A.png differ
diff --git a/project/CasioA/CasioSchema.png b/project/CasioA/CasioSchema.png
new file mode 100644 (file)
index 0000000..043ebf1
Binary files /dev/null and b/project/CasioA/CasioSchema.png differ
diff --git a/project/CasioA/Index.html.pl b/project/CasioA/Index.html.pl
new file mode 100755 (executable)
index 0000000..297bc76
--- /dev/null
@@ -0,0 +1,43 @@
+#! /usr/bin/perl
+# 
+# $Id$
+# Main page of 'My::Project::CasioA'
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+package project::CasioA::Index;
+require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
+our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
+our $CVS_ID=q$Id$;
+use strict;
+use warnings;
+
+BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
+use My::Web;
+use My::Project;
+use project::CasioA::ListItem;
+
+
+My::Project->init_project(
+               "__PACKAGE__"=>__PACKAGE__,
+               "ListItem"=>\@project::CasioA::ListItem::ListItem,
+               );
+
+print '<table border="0"><tr><td align="center">'.My::Web::img("Casio-A","Casio-A Snapshot").'</td></tr></table>'."\n";
+
+print '<table border="0"><tr><td align="center">'.My::Web::img("CasioSchema","Casio-A Interface Scheme").'</td></tr></table>'."\n";
+
+My::Web->footer();
diff --git a/project/CasioA/ListItem.pm b/project/CasioA/ListItem.pm
new file mode 100755 (executable)
index 0000000..b3f51fb
--- /dev/null
@@ -0,0 +1,49 @@
+#! /usr/bin/perl
+# 
+# $Id$
+# Definition of 'My::Project::CasioA' for list.cgi.pl
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+package project::CasioA::ListItem;
+require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
+our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
+our $CVS_ID=q$Id$;
+use strict;
+use warnings;
+
+use My::Web;
+
+
+our @ListItem=(
+               "name"=>"Casio Diary Backup",
+               "priority"=>3,
+               "download"=>"Casio-A.lha",
+               "link-source file"=>"Casio-A.asm",
+               "summary"=>"Hardware Analysing Utility",
+               "license"=>"PD",
+               "maintenance"=>"obsolete-Casio SF-A10 diary and AmigaOS are no longer being used.",
+               "language"=>"680x0 asm",
+               "description"=><<"HERE",
+<p>Casio-A is a software for backup/restore of Casio SF-A10 personal digital
+diary. Its development involved reverse-engineering the Casio communication
+protocol by sniffing serial communication of the vendor's MS-DOS backup tool.</p>
+<p>Hardware issues, Casio SF-A10, electronic scheme and images by the courtesy of
+@{[ a_href 'http://www.pavouk.org/','Pavel "Pavouk" Ruzicka' ]}.</p>
+HERE
+               );
+
+1;
diff --git a/project/CasioA/Makefile.am b/project/CasioA/Makefile.am
new file mode 100644 (file)
index 0000000..544d810
--- /dev/null
@@ -0,0 +1,24 @@
+# $Id$
+# automake source for the Makefile of project/CasioA/ subdir
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+include $(top_srcdir)/Makefile-head.am
+
+EXTRA_DIST+= \
+       ListItem.pm \
+       Index.html.pl \
+       Casio-A.png
index 136fb10..a97494e 100755 (executable)
@@ -1,7 +1,7 @@
 #! /usr/bin/perl
 # 
 # $Id$
-# Main page of 'My::Project::icp'
+# Main page of 'My::Project::Islet'
 # Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
 # 
 # This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 
-package project::icp::Index;
+package project::Islet::Index;
 require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
 our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
 our $CVS_ID=q$Id$;
@@ -28,12 +28,12 @@ use warnings;
 BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
 use My::Web;
 use My::Project;
-use project::icp::ListItem;
+use project::Islet::ListItem;
 
 
 My::Project->init_project(
                "__PACKAGE__"=>__PACKAGE__,
-               "ListItem"=>\@project::icp::ListItem::ListItem,
+               "ListItem"=>\@project::Islet::ListItem::ListItem,
                );
 
 print <<'HERE';
index 9e29222..4c38652 100755 (executable)
@@ -1,7 +1,7 @@
 #! /usr/bin/perl
 # 
 # $Id$
-# Definition of 'My::Project::icp' for list.cgi.pl
+# Definition of 'My::Project::Islet' for list.cgi.pl
 # Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
 # 
 # This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 
-package project::icp::ListItem;
+package project::Islet::ListItem;
 require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
 our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
 our $CVS_ID=q$Id$;
@@ -29,7 +29,7 @@ use My::Web;
 
 
 our @ListItem=(
-               "name"=>'<a href="http://www.stv.cz/icp/">ICP 1998</a> Competition Software',
+               "name"=>'Islet Simulation',
                "priority"=>5,
                "download"=>"Islet/Islet.zip",
                "summary"=>"Web game applet",
@@ -37,8 +37,7 @@ our @ListItem=(
                "maintenance"=>"ready",
                "language"=>"Java 1.1",
                "description"=><<"HERE",
-<p>Simple game. Written for the purpose of
-a @{[ a_href 'http://www.stv.cz/icp/','programming competition' ]}.</p>
+<p>Simple 'game', Java demostration.</p>
 HERE
                );
 
diff --git a/project/LaserGame/Index.html.pl b/project/LaserGame/Index.html.pl
new file mode 100755 (executable)
index 0000000..d8ffcc8
--- /dev/null
@@ -0,0 +1,41 @@
+#! /usr/bin/perl
+# 
+# $Id$
+# Main page of 'My::Project::LaserGame'
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+package project::LaserGame::Index;
+require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
+our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
+our $CVS_ID=q$Id$;
+use strict;
+use warnings;
+
+BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
+use My::Web;
+use My::Project;
+use project::LaserGame::ListItem;
+
+
+My::Project->init_project(
+               "__PACKAGE__"=>__PACKAGE__,
+               "ListItem"=>\@project::LaserGame::ListItem::ListItem,
+               );
+
+print '<table border="0"><tr><td align="center">'.My::Web::img("LaserComm","LaserComm Utility").'</td></tr></table>'."\n";
+
+My::Web->footer();
diff --git a/project/LaserGame/LaserComm.png b/project/LaserGame/LaserComm.png
new file mode 100644 (file)
index 0000000..a5d88c6
Binary files /dev/null and b/project/LaserGame/LaserComm.png differ
diff --git a/project/LaserGame/ListItem.pm b/project/LaserGame/ListItem.pm
new file mode 100755 (executable)
index 0000000..3d1b2d9
--- /dev/null
@@ -0,0 +1,52 @@
+#! /usr/bin/perl
+# 
+# $Id$
+# Definition of 'My::Project::LaserGame' for list.cgi.pl
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+package project::LaserGame::ListItem;
+require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
+our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
+our $CVS_ID=q$Id$;
+use strict;
+use warnings;
+
+use My::Web;
+
+
+our @ListItem=(
+               "name"=>"LaserGame Shooting Hardware",
+               "priority"=>4,
+               "download"=>"LaserGame.lha",
+               "link-source file"=>"LaserGame.asm",
+               "summary"=>"Embedded firmware and Communication Tool",
+               "license"=>"PD",
+               "maintenance"=>"obsolete-Communication is written for discontinued Amiga platform.",
+               "language"=>"i8051 asm, 680x0 asm",
+               "description"=><<"HERE",
+<p>LaserGame is a clone of commercial shoot'n'run game. Each player has its
+own hardware with multiple infra detecting sensor and one laser/infra gun.
+Shooting is visually targeting by red laser diode while the shooting
+information is being emitted by infrared.</p>
+<p>Its Amiga communication tool will receive shooting statistics while being
+also capable of remote hardware configuration.</p>
+<p>Hardware part done by
+@{[ a_href 'http://www.pavouk.org/','Pavel "Pavouk" Ruzicka' ]}.</p>
+HERE
+               );
+
+1;
diff --git a/project/LaserGame/Makefile.am b/project/LaserGame/Makefile.am
new file mode 100644 (file)
index 0000000..c848438
--- /dev/null
@@ -0,0 +1,24 @@
+# $Id$
+# automake source for the Makefile of project/LaserGame/ subdir
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+include $(top_srcdir)/Makefile-head.am
+
+EXTRA_DIST+= \
+       ListItem.pm \
+       Index.html.pl \
+       LaserGame.png
index 22fa393..9c4769a 100644 (file)
@@ -20,7 +20,7 @@ include $(top_srcdir)/Makefile-head.am
 
 SUBDIRS= \
                step            \
-               icp             \
+               Islet           \
                FordFulk        \
                Heat            \
                kix             \
@@ -56,7 +56,11 @@ SUBDIRS= \
                ppp9k           \
                LaceMail        \
                line9k          \
-               captive
+               captive         \
+               PortDiag        \
+               CasioA          \
+               LaserGame       \
+               ShortRel
 
 EXTRA_DIST+= \
                Index.html.pl \
diff --git a/project/PortDiag/Index.html.pl b/project/PortDiag/Index.html.pl
new file mode 100755 (executable)
index 0000000..b3b6b94
--- /dev/null
@@ -0,0 +1,41 @@
+#! /usr/bin/perl
+# 
+# $Id$
+# Main page of 'My::Project::PortDiag'
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+package project::PortDiag::Index;
+require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
+our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
+our $CVS_ID=q$Id$;
+use strict;
+use warnings;
+
+BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
+use My::Web;
+use My::Project;
+use project::PortDiag::ListItem;
+
+
+My::Project->init_project(
+               "__PACKAGE__"=>__PACKAGE__,
+               "ListItem"=>\@project::PortDiag::ListItem::ListItem,
+               );
+
+print '<table border="0"><tr><td align="center">'.My::Web::img("PortDiag","PortDiag Snapshot").'</td></tr></table>'."\n";
+
+My::Web->footer();
diff --git a/project/PortDiag/ListItem.pm b/project/PortDiag/ListItem.pm
new file mode 100755 (executable)
index 0000000..6f3f35c
--- /dev/null
@@ -0,0 +1,51 @@
+#! /usr/bin/perl
+# 
+# $Id$
+# Definition of 'My::Project::PortDiag' for list.cgi.pl
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+package project::PortDiag::ListItem;
+require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
+our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
+our $CVS_ID=q$Id$;
+use strict;
+use warnings;
+
+use My::Web;
+
+
+our @ListItem=(
+               "name"=>"I/O Port Diagnostics",
+               "priority"=>4,
+               "download"=>"PortDiag.lha",
+               "link-source file"=>"PortDiag.asm",
+               "aminet"=>"hard/hack/PortDiag",
+               "summary"=>"Hardware Analysing Utility",
+               "license"=>"PD",
+               "maintenance"=>"ready",
+               "language"=>"680x0 asm",
+               "description"=><<"HERE",
+<p>PortDiag is generally used for low-level hardware watching and modifying.
+It has support for all the bits of the four CIA ports, digital and analog parts
+of the game ports, serial port TXD and RXD signals and selective system
+allocation of this hardware.</p>
+<p>Hardware issues and images by the courtesy of
+@{[ a_href 'http://www.pavouk.org/','Pavel "Pavouk" Ruzicka' ]}.</p>
+HERE
+               );
+
+1;
diff --git a/project/PortDiag/Makefile.am b/project/PortDiag/Makefile.am
new file mode 100644 (file)
index 0000000..08328cd
--- /dev/null
@@ -0,0 +1,24 @@
+# $Id$
+# automake source for the Makefile of project/PortDiag/ subdir
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+include $(top_srcdir)/Makefile-head.am
+
+EXTRA_DIST+= \
+       ListItem.pm \
+       Index.html.pl \
+       PortDiag.png
diff --git a/project/PortDiag/PortDiag.asm b/project/PortDiag/PortDiag.asm
new file mode 100644 (file)
index 0000000..a6cc02b
--- /dev/null
@@ -0,0 +1,1017 @@
+;###############################################
+;### SPECIAL WARNING FOR NORMAL PROGRAMMERS: ###
+;###############################################
+;###### Please don't read this source !!! ######
+;##### It is completely ALTERNATIVELY made #####
+;### from scratch. Reading such thing may and ##
+;### possibly WILL leave permanent damage to ###
+;################ your _mind_. #################
+;##### Special recommendation for Lemming. #####
+;###############################################
+
+;DEBUG equ     1
+
+       include "ssmac.h"
+
+WARN_DDR_MASK  equ     $FFF800FF
+WARN_PR_MASK   equ     $00000001
+
+ciaa   equ     $bfe001
+ciab   equ     $bfd000
+CIABaseA4      equ     ciab
+BaseA4 equ     $dff000
+TEXT_PEN       equ     1
+BGND_PEN       equ     0
+
+       dv.b    ST_joy0daty
+       dv.b    ST_joy0datx
+       dv.b    ST_joy1daty
+       dv.b    ST_joy1datx
+       dv.b    ST_pot0daty
+       dv.b    ST_pot0datx
+       dv.b    ST_pot1daty
+       dv.b    ST_pot1datx
+       dv.l    DefCIAIO
+       dv.l    SigMask
+       dv.l    MyWindow
+       dv.l    StdFont
+       dv.l    potgobase
+       dv.l    diskbase
+       dv.l    miscbase
+       dv.l    OrigWPtr
+       dv.l    VisualInfo
+       dv.w    GameAlloced
+       dbuf    ScrTitBuf,80
+       dv.b    CleanServ
+       dv.b    Signaled
+       dv.b    InitCounters
+       dv.b    DiskAlloc
+       dv.b    PortAdd
+
+       start
+
+       move.l  4.w,a6
+       addq.b  #1,TDNestCnt(a6)
+       gett    RzPortName,a1
+       call    FindPort
+       tst.l   d0
+       beq.s   NoPortFound
+       move.l  d0,a1
+       move.l  MP_SIGTASK(a1),a1
+       moveq   #1<<6,d0
+       rol.l   #8,d0
+       call    Signal
+       call    Permit
+       dtl     <Already running>,a0
+       bra.s   SSExitError
+       
+NoPortFound    lea     RzPort(pc),a1
+       move.l  ThisTask(a6),MP_SIGTASK(a1)
+       call    AddPort
+       call    Permit
+       stv     PortAdd
+       lea     StdAttr(pc),a0
+       call    gfx,OpenFont
+       put.l   d0,StdFont
+       beq.s   OpenWinFail
+       dtl     <disk.resource>,a1
+       call    exec,OpenResource
+       put.l   d0,diskbase
+       beq.s   OpenWinFail
+       dtl     <misc.resource>,a1
+       call    OpenResource
+       put.l   d0,miscbase
+       beq.s   OpenWinFail
+       sub.l   a0,a0
+       call    intuition,LockPubScreen
+       move.l  d0,ScrLock
+       bne.s   LockScrOK
+OpenWinFail    dtl     <Cannot open window>,a0
+SSExitError    jump    ss,ExitError
+
+LockScrOK      move.l  d0,a0
+       sub.l   a1,a1
+       call    gadtools,GetVisualInfoA
+       put.l   d0,VisualInfo
+       beq.s   OpenWinFail
+       move.l  d0,d5
+       lea     AGamePort(pc),a0
+       call    CreateContext
+       lea     GNGadgets(pc),a3
+       clr.l   -(sp)
+       clr.l   -(sp)
+       push    #GA_Immediate
+GGNG_Loop      tst.l   d0
+       beq.s   OpenWinFail
+       move.l  d0,a0
+       move.l  a3,a1
+       tst.b   gng_GadgetID+1(a1)
+       bmi.s   GGNG_Skip
+       move.l  sp,4(sp)
+GGNG_Skip      lea     gng_VisualInfo(a3),a3
+       move.l  d5,(a3)+
+       moveq   #BUTTON_KIND,d0
+       move.l  sp,a2
+       call    CreateGadgetA
+       tst.w   (a3)
+       bne.s   GGNG_Loop
+       tst.l   d0
+       beq.s   OpenWinFail
+       lea     1*8+4(sp),sp
+       lea     NewMyWindow(pc),a0
+;;;    move.w  #CUSTOMSCREEN,nw_Type(a0)
+       clr.l   -(sp)
+       dt      ScrTitle,<PortDiag - Copyright (c) 1995 Short Software ',60,'short@k332.feld.cvut.cz',62,'>
+       tpea    ScrTitle
+       push    #WA_ScreenTitle
+       push    sp
+       push    #WA_AutoAdjust
+       moveq   #0,d0
+       move.w  NewMyWindow+nw_Width(pc),d0
+       push    d0
+       push    #WA_InnerWidth
+       move.w  NewMyWindow+nw_Height(pc),d0
+       push    d0
+       push    #WA_InnerHeight
+       move.l  sp,a1
+       call    intuition,OpenWindowTagList
+       put.l   d0,MyWindow
+       beq     OpenWinFail
+       get.l   sv_thistask,a0
+       put.l   pr_WindowPtr(a0),OrigWPtr
+       move.l  d0,pr_WindowPtr(a0)
+       lea     4*8+4(sp),sp
+       move.l  d0,a0
+       move.l  wd_UserPort(a0),d6
+       move.l  wd_RPort(a0),d2
+       sub.l   a1,a1
+       call    gadtools,GT_RefreshWindow
+       lea     BorList(pc),a2
+       move.w  (a2)+,d0
+       get.l   intuitionbase,a6
+NextBorder     lea     (a2,d0.w),a1
+       move.l  d2,a0
+       moveq   #0,d0
+       moveq   #0,d1
+       call    DrawBorder
+       move.w  (a2)+,d0
+       bne.s   NextBorder
+       get.l   StdFont,a0
+       move.l  d2,a1
+       call    gfx,SetFont
+       move.l  d2,a0
+       lea     MyWinITexts(pc),a1
+       moveq   #0,d0
+       moveq   #0,d1
+       call    intuition,PrintIText
+       dtl     <potgo.resource>,a1
+       call    exec,OpenResource
+       put.l   d0,potgobase
+       beq     OpenWinFail
+       get.l   intuitionbase,a6
+       bsr     ActivateScreen
+       call    ss,TrackSignal
+       moveq   #0,d2
+       bset    d0,d2
+       put.l   d2,SigMask
+       move.l  CIABaseA4Ptr(pc),a4
+       move.b  ciaa+ciaddra-CIABaseA4(a4),d0
+       rol.w   #8,d0
+       move.b  ciaa+ciaddrb-CIABaseA4(a4),d0
+       rol.l   #8,d0
+       move.b  ciab+ciaddra-CIABaseA4(a4),d0
+       rol.l   #8,d0
+       move.b  ciab+ciaddrb-CIABaseA4(a4),d0
+       put.l   d0,DefCIAIO
+       stv.b   CleanServ
+       moveq   #INTB_VERTB,d0
+       lea     IntStruct(pc),a1
+       move.l  v,IS_DATA(a1)
+       call    exec,AddIntServer
+LoopIDCMP      lea     SetSelected(pc),a1
+       bsr     DoRoutUpdate
+       get.l   MyWindow,a2
+       move.l  wd_RPort(a2),d3
+       move.l  d3,a1
+       moveq   #TEXT_PEN,d0
+       call    gfx,SetAPen
+       move.l  d3,a1
+       moveq   #BGND_PEN,d0
+       call    SetBPen
+       move.l  joy0dat(a4),d2
+       geta    ST_joy0daty,a0
+       moveq   #64,d0
+       moveq   #125,d1
+       lea     G12l+gg_GadgetID(pc),a2
+       lea     G12r+gg_GadgetID(pc),a3
+       bsr     ProcCounterLR   ;joy0daty
+       moveq   #64,d0
+       moveq   #114,d1
+       lea     G11l+gg_GadgetID(pc),a2
+       lea     G11r+gg_GadgetID(pc),a3
+       bsr     ProcCounterLR   ;joy0datx
+       move.w  #216,d0
+       moveq   #125,d1
+       lea     G22l+gg_GadgetID(pc),a2
+       lea     G22r+gg_GadgetID(pc),a3
+       bsr     ProcCounterLR   ;joy1daty
+       move.w  #216,d0
+       moveq   #114,d1
+       lea     G21l+gg_GadgetID(pc),a2
+       lea     G21r+gg_GadgetID(pc),a3
+       bsr     ProcCounterLR   ;joy1datx
+       move.l  pot0dat(a4),d2
+       moveq   #64,d0
+       move.w  #147,d1
+       bsr.s   ProcCounter     ;pot0daty
+       moveq   #64,d0
+       move.w  #136,d1
+       bsr.s   ProcCounter     ;pot0datx
+       move.w  #216,d0
+       move.w  #147,d1
+       bsr.s   ProcCounter     ;pot1daty
+       move.w  #216,d0
+       move.w  #136,d1
+       bsr.s   ProcCounter     ;pot1datx
+       stv.b   InitCounters
+       clrv.b  Signaled
+       get.l   SigMask,d0
+       move.l  d6,a0
+       move.b  MP_SIGBIT(a0),d1
+       bset    d1,d0
+       or.w    #SIGBREAKF_CTRL_C!SIGBREAKF_CTRL_E,d0
+       call    exec,Wait
+       btst    #SIGBREAKB_CTRL_C,d0
+       beq.s   TestFlagE
+SSReportBreak  moveq   #err_break,d0
+SSReportError  jump    ss,ReportError
+
+
+PC_Return      tstv.b  InitCounters
+       beq.s   PC_Cont
+       cmp.l   d0,d0
+       rts
+
+ProcCounter    rol.l   #8,d2
+       cmp.b   (a0)+,d2
+       beq.s   PC_Return
+PC_Cont        move.l  a0,d5
+       move.b  d2,-(a0)
+       move.l  d3,a1
+       call    Move
+       move.l  d3,a1
+       moveq   #RP_JAM2,d0
+       call    SetDrMd
+       moveq   #0,d0
+       move.b  d2,d0
+       move.w  d0,-(sp)
+       move.l  sp,a1
+       subq    #4,sp
+       move.l  a2,d4
+       move.l  sp,a2
+       dtl     <%02x>,a0
+       call    ss,FormatStr
+       move.l  d4,a2
+       move.l  d3,a1
+       move.l  sp,a0
+       moveq   #2,d0
+       call    gfx,Text
+       addq    #6,sp
+       move.l  d5,a0
+       move.l  sp,d0
+Return2        rts
+
+ActivateScreen move.l  ScrLock(pc),a0
+       jump    ScreenToFront
+
+TestFlagE      btst    #SIGBREAKB_CTRL_E,d0
+       beq.s   RetryIDCMP
+       get.l   MyWindow,a0
+       call    intuition,ActivateWindow
+       get.l   MyWindow,a0
+       call    WindowToFront
+       bsr.s   ActivateScreen
+RetryIDCMP     move.l  d6,a0
+       call    gadtools,GT_GetIMsg
+       tst.l   d0
+       beq     LoopIDCMP
+       move.l  d0,a1
+       movem.l im_Class(a1),d2/d3/a3
+       call    GT_ReplyIMsg
+       btst    #9,d2   ;bit(IDCMP_CLOSEWINDOW)
+       bne.s   Return2
+       moveq   #0,d0
+       move.l  CIABaseA4Ptr(pc),a4
+       btst    #6,d2   ;bit(IDCMP_GADGETUP)
+       beq.s   NoGadUp
+       move.b  gg_GadgetID+1(a3),d0
+       addq.b  #4,d0
+       bcc.s   RetryIDCMP
+       move.b  DefCIAIO(v,d0.w),d1
+       add.w   d0,d0
+       add.w   CIAddrTab(pc,d0.w),a4
+       move.b  d1,(a4)
+SafeSetCIA     nop
+       move.b  (a4),(a4)
+       bra.s   RetryIDCMP
+
+CIAprTab       dc.w    ciaa+ciapra-CIABaseA4
+       dc.w    ciaa+ciaprb-CIABaseA4
+       dc.w    ciab+ciapra-CIABaseA4
+       dc.w    ciab+ciaprb-CIABaseA4
+CIAddrTab      dc.w    ciaa+ciaddra-CIABaseA4
+       dc.w    ciaa+ciaddrb-CIABaseA4
+       dc.w    ciab+ciaddra-CIABaseA4
+       dc.w    ciab+ciaddrb-CIABaseA4
+CIAEndTab
+
+NoGadUp        btst    #5,d2   ;bit(IDCMP_GADGETDOWN)
+       beq.s   RetryIDCMP
+       move.b  gg_GadgetID+1(a3),d0
+       beq.s   RetryIDCMP
+       subq.b  #1,d0
+       cmp.b   #64,d0
+       bcc.s   OtherButtonDown
+       move.w  d0,d1
+       lsr.w   #3,d0
+       add.w   d0,d0
+       lea     Warn_DDR_Mask(pc),a0
+       subq.w  #8,d0
+       bcc.s   ItsddrChange
+       addq    #4,a0
+       move.w  CIAEndTab(pc,d0.w),d2
+       btst    d1,(a4,d2.w)
+       bne.s   ItsddrChange
+CallScrBeep    bsr.s   DoScrBeep
+       bra     RetryIDCMP
+
+DoScrBeep      move.l  ScrLock(pc),a0  ;(#66)
+       jump    intuition,DisplayBeep
+
+ItsddrChange   tstv.l  Arg_Force
+       bne.s   NoWarnBit
+       move.l  (a0),d3
+       btst    d1,d3
+       beq.s   NoWarnBit
+       mpush   d0/d1/a0
+       dtl.lc  <WARNING:  You are attempting to change a bit>,a0
+       dt.lc   <which may cause permanent hardware damage or>
+       dt.lc   <unconditional immediate system crash!>
+       dt.lc   <>
+       dt.lc   <This is not a common warning as in many other programs:>
+       dt.lc   <THIS REALLY _MIGHT_ DESTROY YOUR MACHINE!!!>
+       dt.lc   <>
+       dt.lc   <And remember:  The author is not responsible for>
+       dt.l    <any damage caused by this (any ;-) ) software!>
+       dtl     <Change it|Oh no, forget it!>,a2
+       call    ss,SimpleRequest
+       subq.l  #1,d0
+       mpop    d0/d1/a0
+       bne     RetryIDCMP
+       bclr    d1,d3
+       move.l  d3,(a0)
+NoWarnBit      add.w   CIAddrTab(pc,d0.w),a4
+       bchg    d1,(a4)
+       bra     SafeSetCIA
+
+Warn_DDR_Mask  dc.l    WARN_DDR_MASK,WARN_PR_MASK
+
+OtherButtonDown        bne.s   NoWritePotgo
+;+++ Pressed "Start potgo" +++ (#65)
+       moveq   #1,d0   ;START
+       moveq   #1,d1   ;START
+       call    potgo,WritePotgo
+       bra     RetryIDCMP
+
+NoWritePotgo   sub.b   #66,d0
+       bmi.s   CallScrBeep
+       bne.s   NoTXD
+       opt     nochkimm                ;(#67)
+       move.b  adkconr+BaseA4,d0
+       opt     chkimm
+       and.b   #ADKF_UARTBRK>>8,d0
+       bchg    #ADKB_UARTBRK-8,d0
+       lsl.b   #4,d0
+       bset    #ADKB_UARTBRK-8,d0
+       opt     nochkimm
+       move.b  d0,adkcon+BaseA4
+       opt     chkimm
+       bra     RetryIDCMP
+
+NoTXD  subq.b  #1,d0
+       cmp.b   #8,d0
+       bcc.s   NoPotgoBits
+       moveq   #0,d1           ;(#68)..(#75)
+       bset    d0,d1
+       rol.w   #8,d1
+       get.l   potgobase,a6
+       move.w  $28(a6),d0
+       and.w   d1,d0
+       eor.w   d1,d0
+       call    WritePotgo
+       bra     RetryIDCMP
+
+NoPotgoBits    subq.b  #8,d0
+       bne     NoASerial
+       moveq   #MR_SERIALPORT,d2
+       lea     ASerial+gg_GadgetID(pc),a2
+       dtl     <Seria>,a3
+DoAParallel    move.l  a2,d7
+       bsr.s   ClearScrTit
+       geta    ScrTitBuf,a0
+CopySerParName move.b  (a3)+,(a0)+
+       bne.s   CopySerParName
+       lea     6(a0),a4
+       subq    #1,a0
+       dtl     <l port grab error, owned by >,a1
+CopySerParSuff move.b  (a1)+,(a0)+
+       bne.s   CopySerParSuff
+       move.l  d7,a2
+       tst.b   (a2)
+       bne.s   DoFreeSerPar
+       lea     -1(a0),a3
+       bsr.s   SerParHalf
+       addq.l  #1,d2
+       bsr.s   SerParHalf
+       dtl     <allocated.>,a0
+       moveq   #-1,d0
+       move.l  d7,a2
+CopySerParSucc move.b  (a0)+,(a4)+
+       bne.s   CopySerParSucc
+       bsr     SetSelected
+       bra.s   DoScrWinTitle
+
+ClearScrTit    get.l   MyWindow,a0
+       moveq   #-1,d0
+       move.l  d0,a1
+       sub.l   a2,a2
+       jump    intuition,SetWindowTitles
+
+DoFreeSerPar   bsr.s   FreeSerParRout
+       gett    GivenSys,a0
+       moveq   #0,d0
+       bra.s   CopySerParSucc
+
+SerParHalf     move.l  d2,d0
+       lea     IntName(pc),a1
+       move.l  4.w,a0
+       addq.b  #1,TDNestCnt(a0)
+       call    misc,AllocMiscResource
+       tst.l   d0
+       beq.s   JumpExecPermit
+       move.l  d0,a0
+       moveq   #31,d0
+CopyLimName    move.b  (a0)+,(a3)+
+       dbeq    d0,CopyLimName
+       clr.b   (a3)
+       bsr.s   JumpExecPermit
+       move.l  d2,d0
+       and.b   #~1,d0
+       cmp.l   d0,d2
+       beq.s   DontFreeRest
+       bsr.s   JumpMiscFree
+DontFreeRest   addq    #4,sp
+       bsr     DoScrBeep
+DoScrWinTitle  geta    ScrTitBuf,a2
+       bra     DoScrTitle
+
+FreeSerParRout move.l  d2,d0
+       bsr.s   JumpMiscFree
+       move.l  d2,d0
+       addq.l  #1,d0
+JumpMiscFree   jump    misc,FreeMiscResource
+
+JumpExecPermit jump    exec,Permit
+
+NoASerial      moveq   #MR_PARALLELPORT,d2
+       lea     AParallel+gg_GadgetID(pc),a2
+       dtl     <Paralle>,a3
+       subq.b  #2,d0
+       bcs     DoAParallel
+       bne     NoADisk
+       lea     ADisk+gg_GadgetID(pc),a2
+       tst.b   (a2)
+       bne     ADiskDoFree
+       move.l  a2,d7
+       get.l   MyWindow,a0
+       get.l   intuitionbase,a6
+       cmp.w   #39,LIB_VERSION(a6)
+       bcs.s   StupidGfx2
+       move.l  a0,a3
+       clr.l   -(sp)
+       push    sp
+       push    #WA_BusyPointer
+       push    sp
+       push    #WA_PointerDelay
+       move.l  sp,a1
+       call    SetWindowPointerA
+       move.l  a3,a0
+StupidGfx2     moveq   #-1,d4
+       move.l  d4,a1
+       dtl     <Allocating disk...>,a2
+       call    SetWindowTitles
+       get.l   diskbase,a6
+       moveq   #3,d2
+LoopADiskUnit  move.l  d2,d0
+       call    AllocUnit
+       tst.l   d0
+       sne     d1
+       move.b  d1,d0
+       roxr.b  #1,d0
+       roxl.b  #1,d3
+       bsr     PushSw
+       dbra    d2,LoopADiskUnit
+       put.b   d3,DiskAlloc
+       get.l   sv_thistask,a2
+       lea     pr_MsgPort(a2),a2
+RetryGetUnit   lea     DRUnit(pc),a1
+       move.l  a2,a0
+       move.l  a0,MN_REPLYPORT(a1)
+       call    disk,GetUnit
+       tst.l   d0
+       bne.s   GotUnit
+       move.l  4.w,a6
+RetryGiveReply move.l  a2,a0
+       call    WaitPort
+       move.l  a2,a0
+       call    GetMsg
+       tst.l   d0
+       beq.s   RetryGiveReply
+       bra.s   RetryGetUnit
+
+GotUnit        move.l  d7,a2
+       moveq   #-1,d0
+       bsr     SetSelected
+       dtl     <Disk control hardware allocated; Units: 0 - %s, 1 - %s, 2 - %s, 3 - %s>,a0
+       move.l  sp,a1
+       geta    ScrTitBuf,a2
+       call    ss,FormatStr
+       lea     4*4(sp),sp
+       get.l   intuitionbase,a6
+       cmp.w   #39,LIB_VERSION(a6)
+       bcs.s   SetTitnRet
+       clr.l   -(sp)
+       clr.l   -(sp)
+       push    #WA_Pointer
+       move.l  a3,a0
+       move.l  sp,a1
+       call    SetWindowPointerA
+       lea     (1*8+4)+(2*8+4)(sp),sp
+SetTitnRet     get.l   MyWindow,a0
+       move.l  d4,a1
+       call    SetWindowTitles
+       bra     RetryIDCMP
+
+ADiskDoFree    bsr     FreeDiskRes
+       moveq   #0,d0
+       bsr     SetSelected
+       dtl.c   <Disk completely >,a2
+       dt      GivenSys,<given to system.>
+DoScrTitle     get.l   intuitionbase,a6
+       moveq   #-1,d4
+       bra.s   SetTitnRet
+
+NoADisk        subq.b  #1,d0
+       bne     RetryIDCMP
+       lea     AGamePort+gg_GadgetID(pc),a2
+       get.l   potgobase,a6
+       tst.b   (a2)
+       bne.s   ADoFreeGame
+       move.w  #$5501,d0
+       move.w  d0,d2
+       call    AllocPotBits
+       and.w   d2,d0
+       beq.s   AGameFailed
+       put.w   d0,GameAlloced
+       moveq   #4,d2
+       ror.w   #2,d0
+LoopPushRol    bsr.s   PushRolSw
+       dbra    d2,LoopPushRol
+       moveq   #-1,d0
+       bsr     SetSelected
+       bsr     ClearScrTit
+       dtl     <Game Port 1: A - %s, B - %s; Game Port 2: A - %s, B - %s; Start - %s>,a0
+       move.l  sp,a1
+       geta    ScrTitBuf,a2
+       call    ss,FormatStr
+       lea     5*4(sp),sp
+       bra.s   DoScrTitle
+
+PushRolSw      rol.w   #2,d0
+       scs     d1
+PushSw neg.b   d1
+       ext.w   d1
+       lsl.w   #2,d1
+       dt      <Yes>
+       dt      NoMsg,<No>
+       gett    NoMsg,a0
+       sub.w   d1,a0
+       move.l  (sp),a1
+       move.l  a0,(sp)
+       jmp     (a1)
+
+AGameFailed    bsr     DoScrBeep
+       dtl     <Game Ports are fully allocated!>,a2
+       bra.s   DoScrTitle
+
+ADoFreeGame    get.w   GameAlloced,d0
+       clrv.w  GameAlloced
+       call    FreePotBits
+       moveq   #0,d0
+       bsr     SetSelected
+       dtl     <Game Ports given to system.>,a2
+       bra     DoScrTitle
+
+FreeDiskRes    call    disk,GiveUnit
+       get.b   DiskAlloc,d3
+       ror.b   #4,d3
+       moveq   #3,d2
+LoopFreeUnit   rol.b   #1,d3
+       bcc.s   SkipFreeUnit
+       move.l  d2,d0
+       call    FreeUnit
+SkipFreeUnit   dbra    d2,LoopFreeUnit
+       rts
+
+Cleanup        move.l  4.w,a6
+       tstv.b  PortAdd
+       beq.s   NoPortAdd
+       clrv.b  PortAdd
+       lea     RzPort(pc),a1
+       call    RemPort
+NoPortAdd      tstv.b  CleanServ
+       beq.s   NoCleanServ
+       clrv.b  CleanServ
+       lea     IntStruct(pc),a1
+       moveq   #INTB_VERTB,d0
+       call    RemIntServer
+NoCleanServ    lea     ADisk+gg_GadgetID(pc),a2
+       tst.b   (a2)
+       beq.s   NoFreeDisk
+       clr.b   (a2)
+       bsr.s   FreeDiskRes
+NoFreeDisk     lea     ASerial+gg_GadgetID(pc),a2
+       tst.b   (a2)
+       beq.s   NoFreeSerial
+       clr.b   (a2)
+       moveq   #MR_SERIALPORT,d2
+       bsr     FreeSerParRout
+NoFreeSerial   lea     AParallel+gg_GadgetID(pc),a2
+       tst.b   (a2)
+       beq.s   NoFreeParallel
+       clr.b   (a2)
+       moveq   #MR_PARALLELPORT,d2
+       bsr     FreeSerParRout
+NoFreeParallel get.w   GameAlloced,d0
+       beq.s   NoFreeGamePort
+       clrv.w  GameAlloced
+       call    potgo,FreePotBits
+NoFreeGamePort get.l   MyWindow,d0
+       beq.s   NoMyWindow
+       clrv.l  MyWindow
+       get.l   sv_thistask,a0
+       get.l   OrigWPtr,pr_WindowPtr(a0)
+       move.l  d0,a4
+       move.l  4.w,a6
+       addq.b  #1,TDNestCnt(a6)
+ClearWinPort   move.l  wd_UserPort(a4),a0
+       call    GetMsg
+       tst.l   d0
+       beq.s   WinPortCleared
+       move.l  d0,a1
+       call    ReplyMsg
+       bra.s   ClearWinPort
+
+WinPortCleared move.l  a4,a0
+       moveq   #0,d0
+       call    intuition,ModifyIDCMP
+       call    exec,Permit
+       move.l  a4,a0
+       call    intuition,CloseWindow
+NoMyWindow     get.l   StdFont,d0
+       beq.s   NoCloseFont
+       clrv.l  StdFont
+       move.l  d0,a1
+       call    gfx,CloseFont
+NoCloseFont    lea     AGamePort(pc),a1
+       move.l  (a1),a0
+       clr.l   (a1)
+       call    gadtools,FreeGadgets
+       get.l   VisualInfo,a0
+       clrv.l  VisualInfo
+       call    FreeVisualInfo
+       sub.l   a0,a0
+       lea     ScrLock(pc),a0
+       move.l  (a0),a1
+       clr.l   (a0)
+       jump    intuition,UnlockPubScreen
+
+GadTable       dc.w    AA0l+gg_GadgetID-*-2
+       dc.w    AA1l+gg_GadgetID-*-2
+       dc.w    AA2l+gg_GadgetID-*-2
+       dc.w    AA3l+gg_GadgetID-*-2
+       dc.w    AA4l+gg_GadgetID-*-2
+       dc.w    AA5l+gg_GadgetID-*-2
+       dc.w    AA6l+gg_GadgetID-*-2
+       dc.w    AA7l+gg_GadgetID-*-2
+       dc.w    AB0l+gg_GadgetID-*-2
+       dc.w    AB1l+gg_GadgetID-*-2
+       dc.w    AB2l+gg_GadgetID-*-2
+       dc.w    AB3l+gg_GadgetID-*-2
+       dc.w    AB4l+gg_GadgetID-*-2
+       dc.w    AB5l+gg_GadgetID-*-2
+       dc.w    AB6l+gg_GadgetID-*-2
+       dc.w    AB7l+gg_GadgetID-*-2
+       dc.w    BA0l+gg_GadgetID-*-2
+       dc.w    BA1l+gg_GadgetID-*-2
+       dc.w    BA2l+gg_GadgetID-*-2
+       dc.w    BA3l+gg_GadgetID-*-2
+       dc.w    BA4l+gg_GadgetID-*-2
+       dc.w    BA5l+gg_GadgetID-*-2
+       dc.w    BA6l+gg_GadgetID-*-2
+       dc.w    BA7l+gg_GadgetID-*-2
+       dc.w    BB0l+gg_GadgetID-*-2
+       dc.w    BB1l+gg_GadgetID-*-2
+       dc.w    BB2l+gg_GadgetID-*-2
+       dc.w    BB3l+gg_GadgetID-*-2
+       dc.w    BB4l+gg_GadgetID-*-2
+       dc.w    BB5l+gg_GadgetID-*-2
+       dc.w    BB6l+gg_GadgetID-*-2
+       dc.w    BB7l+gg_GadgetID-*-2
+       dc.w    AA0r+gg_GadgetID-*-2
+       dc.w    AA1r+gg_GadgetID-*-2
+       dc.w    AA2r+gg_GadgetID-*-2
+       dc.w    AA3r+gg_GadgetID-*-2
+       dc.w    AA4r+gg_GadgetID-*-2
+       dc.w    AA5r+gg_GadgetID-*-2
+       dc.w    AA6r+gg_GadgetID-*-2
+       dc.w    AA7r+gg_GadgetID-*-2
+       dc.w    AB0r+gg_GadgetID-*-2
+       dc.w    AB1r+gg_GadgetID-*-2
+       dc.w    AB2r+gg_GadgetID-*-2
+       dc.w    AB3r+gg_GadgetID-*-2
+       dc.w    AB4r+gg_GadgetID-*-2
+       dc.w    AB5r+gg_GadgetID-*-2
+       dc.w    AB6r+gg_GadgetID-*-2
+       dc.w    AB7r+gg_GadgetID-*-2
+       dc.w    BA0r+gg_GadgetID-*-2
+       dc.w    BA1r+gg_GadgetID-*-2
+       dc.w    BA2r+gg_GadgetID-*-2
+       dc.w    BA3r+gg_GadgetID-*-2
+       dc.w    BA4r+gg_GadgetID-*-2
+       dc.w    BA5r+gg_GadgetID-*-2
+       dc.w    BA6r+gg_GadgetID-*-2
+       dc.w    BA7r+gg_GadgetID-*-2
+       dc.w    BB0r+gg_GadgetID-*-2
+       dc.w    BB1r+gg_GadgetID-*-2
+       dc.w    BB2r+gg_GadgetID-*-2
+       dc.w    BB3r+gg_GadgetID-*-2
+       dc.w    BB4r+gg_GadgetID-*-2
+       dc.w    BB5r+gg_GadgetID-*-2
+       dc.w    BB6r+gg_GadgetID-*-2
+       dc.w    BB7r+gg_GadgetID-*-2
+       dc.w    G13l+gg_GadgetID-*-2
+       dc.w    G13r+gg_GadgetID-*-2
+       dc.w    G14l+gg_GadgetID-*-2
+       dc.w    G14r+gg_GadgetID-*-2
+       dc.w    G23l+gg_GadgetID-*-2
+       dc.w    G23r+gg_GadgetID-*-2
+       dc.w    G24l+gg_GadgetID-*-2
+       dc.w    G24r+gg_GadgetID-*-2
+       dc.w    S1l+gg_GadgetID-*-2
+       dc.w    S2l+gg_GadgetID-*-2
+       dc.w    G13m+gg_GadgetID-*-2
+       dc.w    G23m+gg_GadgetID-*-2
+       dc.w    G14m+gg_GadgetID-*-2
+       dc.w    G24m+gg_GadgetID-*-2
+
+ProcCounterLR  bsr     ProcCounter
+       beq.s   Return1ShEq
+       ror.b   #2,d2
+       scs     d0
+       bsr.s   ChkSelected
+       rol.b   #1,d2
+       scs     d0
+       rol.b   #1,d2
+       scs     d1
+       eor.b   d1,d0
+       move.l  a3,a2
+ChkSelected    cmp.b   (a2),d0
+Return1ShEq    beq.s   Return1
+SetSelected    mpush   d2/d3/a0/a1/a3
+       move.b  d0,(a2)
+       get.l   MyWindow,a3
+       move.l  wd_RPort(a3),a1
+       cmp.b   #76,1(a2)
+       bcc.s   NoImage
+       move.l  a1,a0
+       lea     ImgZero(pc),a1
+       move.w  -gg_GadgetID+gg_LeftEdge(a2),d0
+       move.w  -gg_GadgetID+gg_TopEdge(a2),d1
+       move.l  -gg_GadgetID+gg_GadgetRender(a2),a3
+       cmp.l   a1,a3
+       bne.s   SS_DoInpOut
+       tst.b   (a2)
+       beq.s   SS_HaveImage
+       lea     ImgOne(pc),a1
+       bra.s   SS_HaveImage
+
+NoImage        moveq   #RP_COMPLEMENT,d0
+       call    gfx,SetDrMd
+       move.l  wd_RPort(a3),a0
+       moveq   #3,d0
+       cmp.w   #39,LIB_VERSION(a6)
+       bcs.s   StupidGfx
+       call    SetWriteMask    ;failures ignored
+StupidGfxJump  move.l  wd_RPort(a3),a1
+       lea     -gg_GadgetID+gg_LeftEdge(a2),a0
+       move.w  (a0)+,d0        ;LeftEdge->xmin
+       move.w  (a0)+,d1        ;TopEdge->ymin
+       move.w  (a0)+,d2
+       add.w   d0,d2
+       subq.w  #1,d2           ;xmax
+       move.w  (a0),d3
+       add.w   d1,d3
+       subq.w  #1,d3           ;ymax
+       call    RectFill
+Ret_SetSelected        mpop    d2/d3/a0/a1/a3
+Return1        rts
+
+SS_DoInpOut    lea     ImgInput(pc),a1
+       tst.b   (a2)
+       beq.s   SS_HaveImage
+       lea     ImgOutput(pc),a1
+SS_HaveImage   call    intuition,DrawImage
+       get.l   gfxbase,a6
+       bra.s   Ret_SetSelected
+
+StupidGfx      move.b  d0,rp_Mask(a0)
+       bra.s   StupidGfxJump
+
+DoRoutUpdate   lea     CIABaseA4,a4
+CIABaseA4Ptr   equ     *-4
+       lea     GadTable(pc),a0
+       lea     CIAprTab(pc),a3
+       moveq   #7,d7
+ChkCIALoop     move.w  (a3)+,d0
+       move.b  (a4,d0.w),d2
+       bsr.s   ChkEight
+       dbra    d7,ChkCIALoop
+       get.l   potgobase,a4
+       move.b  $28(a4),d2      ;$28(potgobase)/W=Contents of POTGO/POTINP
+       bsr.s   ChkEight
+       lea     BaseA4,a4
+BaseA4Ptr      equ     *-4
+       move.b  potinp(a4),d2
+       move.b  d2,d0
+       and.b   #$05,d2
+       and.b   #$50,d0
+       lsr.b   #3,d0
+       or.b    d0,d2
+       btst    #ADKB_UARTBRK-8,adkconr(a4)
+       sne     d0      ;TXD
+       roxr.b  #1,d0
+       roxl.b  #1,d2
+       btst    #11-8,serdatr(a4)
+       sne     d0      ;RXD
+       roxr.b  #1,d0
+       roxl.b  #1,d2
+       moveq   #5,d3
+       bra.s   Chk8Loop
+
+ChkEight       moveq   #7,d3
+Chk8Loop       move.w  (a0)+,d0
+       lea     (a0,d0.w),a2
+       ror.b   d2
+       scs     d0
+       cmp.b   (a2),d0
+       beq.s   Chk8Okay
+       jsr     (a1)
+Chk8Okay       dbra    d3,Chk8Loop
+       rts
+
+IntRoutine     tst.b   Signaled(a1)
+       bne.s   IntReturnQuick
+       move.l  a1,v
+       mpush   d2-d4/d7/a2-a4
+       move.l  sp,d4
+       lea     DoSignal(pc),a1
+       bsr     DoRoutUpdate
+       move.l  joy0dat(a4),d0
+       vcmp.l  ST_joy0daty,d0
+       bne.s   DoSignal
+       move.l  pot0dat(a4),d0
+       vcmp.l  ST_pot0daty,d0
+       bne.s   DoSignal
+       bra.s   IntReturn
+
+DoSignal       get.l   SigMask,d0
+       get.l   sv_thistask,a1
+       stv.b   Signaled
+       call    exec,Signal
+       move.l  d4,sp
+IntReturn      mpop    d2-d4/d7/a2-a4
+IntReturnQuick move.l  BaseA4Ptr(pc),a0
+       cmp.l   d0,d0
+       rts
+
+IntStruct      dc.l    0,0
+       dc.b    NT_INTERRUPT,-128
+       dc.l    IntName
+       dc.l    0               ;IS_DATA
+       dc.l    IntRoutine
+
+IntName        dc.b    'PortDiag',0
+       even
+
+DRUnit dc.l    0,0
+       dc.b    NT_MESSAGE,0
+       dc.l    IntName
+DRReplyPort    dc.l    0
+       dc.w    DRU_SIZE
+
+       dc.l    0,0
+       dc.b    NT_INTERRUPT,-128
+       dc.l    IntName,0,0     ;LN_NAME,IS_DATA,IS_CODE
+
+       dc.l    0,0
+       dc.b    NT_INTERRUPT,-128
+       dc.l    IntName,0,0     ;LN_NAME,IS_DATA,IS_CODE
+
+       dc.l    0,0
+       dc.b    NT_INTERRUPT,-128
+       dc.l    IntName,0,0     ;LN_NAME,IS_DATA,IS_CODE
+
+RzPort dc.l    0,0
+       dc.b    NT_MSGPORT,-128
+       dc.l    RzPortName
+       dc.b    PA_IGNORE,0
+       dc.l    0
+RzPortHead     dc.l    RzPortTail
+RzPortTail     dc.l    0,RzPortHead
+       dc.b    NT_MESSAGE,0
+
+       dt      RzPortName,<PortDiag.rendezvous>
+
+GNGadgets
+GNGDefaultAA   dc.w    44,78,72,13
+       dc.l    DefaultTxt,StdAttr
+       dc.w    252
+       dc.l    PLACETEXT_IN,0
+
+GNGDefaultAB   dc.w    196,78,72,13
+       dc.l    DefaultTxt,StdAttr
+       dc.w    253
+       dc.l    PLACETEXT_IN,0
+
+GNGDefaultBA   dc.w    348,78,72,13
+       dc.l    DefaultTxt,StdAttr
+       dc.w    254
+       dc.l    PLACETEXT_IN,0
+
+GNGDefaultBB   dc.w    500,78,72,13
+       dc.l    DefaultTxt,StdAttr
+       dc.w    255
+       dc.l    PLACETEXT_IN,0
+
+GNGStartPotgo  dc.w    318,106,134,15
+       dc.l    SPotgoTxt,StdAttr
+       dc.w    65
+       dc.l    PLACETEXT_IN,0
+
+       dc.w    0
+
+       dt      DefaultTxt,<Default>
+       dt      SPotgoTxt,<Start potgo>
+
+       include "PortDiagWin.asm"
+
+ScrLock        equ     NewMyWindow+nw_Screen
+
+BorList        dc.w    AABorder-*-2
+       dc.w    ABBorder-*-2
+       dc.w    BABorder-*-2
+       dc.w    BBBorder-*-2
+       dc.w    G1Border-*-2
+       dc.w    G1Border1-*-2
+       dc.w    G1Border2-*-2
+       dc.w    G1Border3-*-2
+       dc.w    G1Border4-*-2
+       dc.w    G2Border-*-2
+       dc.w    G2Border1-*-2
+       dc.w    G2Border2-*-2
+       dc.w    G2Border3-*-2
+       dc.w    G2Border4-*-2
+       dc.w    PotgoBorder-*-2
+       dc.w    SerialBorder-*-2
+       dc.w    AllocBorder-*-2
+       dc.w    0
+
+       dt      <$VER: PortDiag 1.0 (4.10.95)>
+
+       tags
+       template <OMIT_ANY_OF_ALL_THOSE_ANNOYING_WARNING_MESSAGES=FORCE/S>
+       dv.l    Arg_Force
+       exitrout        Cleanup
+       finish
+       end
diff --git a/project/PortDiag/PortDiag.lha b/project/PortDiag/PortDiag.lha
new file mode 100644 (file)
index 0000000..820fc7e
Binary files /dev/null and b/project/PortDiag/PortDiag.lha differ
diff --git a/project/PortDiag/PortDiag.png b/project/PortDiag/PortDiag.png
new file mode 100644 (file)
index 0000000..063c525
Binary files /dev/null and b/project/PortDiag/PortDiag.png differ
diff --git a/project/ShortRel/Index.html.pl b/project/ShortRel/Index.html.pl
new file mode 100755 (executable)
index 0000000..0fb60c9
--- /dev/null
@@ -0,0 +1,39 @@
+#! /usr/bin/perl
+# 
+# $Id$
+# Main page of 'My::Project::ShortRel'
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+package project::ShortRel::Index;
+require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
+our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
+our $CVS_ID=q$Id$;
+use strict;
+use warnings;
+
+BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
+use My::Web;
+use My::Project;
+use project::ShortRel::ListItem;
+
+
+My::Project->init_project(
+               "__PACKAGE__"=>__PACKAGE__,
+               "ListItem"=>\@project::ShortRel::ListItem::ListItem,
+               );
+
+My::Web->footer();
diff --git a/project/ShortRel/ListItem.pm b/project/ShortRel/ListItem.pm
new file mode 100755 (executable)
index 0000000..e464a22
--- /dev/null
@@ -0,0 +1,50 @@
+#! /usr/bin/perl
+# 
+# $Id$
+# Definition of 'My::Project::ShortRel' for list.cgi.pl
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+package project::ShortRel::ListItem;
+require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
+our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
+our $CVS_ID=q$Id$;
+use strict;
+use warnings;
+
+use My::Web;
+
+
+our @ListItem=(
+               "name"=>"Shorten Relocations",
+               "priority"=>4,
+               "download"=>"ShortRel.lha",
+               "link-source file"=>"ShortRel.asm",
+               "aminet"=>"util/cli/ShortRel",
+               "summary"=>"Executable file squeezer",
+               "license"=>"PD",
+               "maintenance"=>"ready",
+               "language"=>"680x0 asm",
+               "description"=><<"HERE",
+<p>ShortRel loads the input file (must be an executable), converts relocations
+(32-bit to 16-bit or vice versa), strips debug informaion (if requested) and
+writes out the result. 16-bit relocations use 2 bytes per each one and 32-bit
+relocations use 4 bytes. So conversion of any executable with many relocations
+from 32-bit to 16-bit relocations saves 2 bytes per each one.</p>
+HERE
+               );
+
+1;
diff --git a/project/ShortRel/Makefile.am b/project/ShortRel/Makefile.am
new file mode 100644 (file)
index 0000000..ec2c257
--- /dev/null
@@ -0,0 +1,25 @@
+# $Id$
+# automake source for the Makefile of project/ShortRel/ subdir
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+include $(top_srcdir)/Makefile-head.am
+
+EXTRA_DIST+= \
+       ListItem.pm \
+       Index.html.pl \
+       ShrotRel.lha \
+       ShortRel.asm
diff --git a/project/ShortRel/ShortRel.asm b/project/ShortRel/ShortRel.asm
new file mode 100644 (file)
index 0000000..dd70b08
--- /dev/null
@@ -0,0 +1,684 @@
+;DEBUG equ     1
+
+       include "SSMac.h"
+
+       dv.l    FileStart
+       dv.l    Hunks
+       dv.l    OldKeepDebug
+       dv.l    RelocPool
+       dv.l    BackupA2
+       dv.l    FirstInsert
+       dv.l    LastInsert
+       dv.b    FlgBufEnd
+       dv.b    Advisory
+
+       start
+
+       get.l   Arg_File,a0
+       call    LoadFile
+       put.l   d0,FileStart
+       move.l  d0,a2
+       add.l   -(a2),d0
+       move.l  d0,d7
+       moveq   #20,d0
+       cmp.l   (a2)+,d0
+       bhi.s   InvalidNE1
+       lea     (a2,d0.l),a3
+       cmp.l   #HUNK_HEADER,(a2)+
+       bne.s   InvalidNE1
+       tst.l   (a2)+
+       bne.s   InvalidNE1
+       move.l  (a2)+,d2
+       beq     Invalid
+       tst.l   (a2)+
+       bne.s   InvalidNE1
+       move.l  (a2)+,d0
+       addq.l  #1,d0
+       cmp.l   d0,d2
+       bne.s   InvalidNE1
+       dtl     <hunk>,a6
+       bsr.s   CheckWordLimit
+       swap    d0
+       put.l   d0,Hunks
+       lsl.l   #3,d0
+       call    ss,TrackAllocPub
+       move.l  d0,a4
+       move.l  d2,d0
+       moveq   #0,d4
+       bsr     CopyLongs
+
+       moveq   #0,d3
+MainHunkLoop
+       ifd     DEBUG
+       push    d4
+       push    d3
+       push    a2
+       dtl     <A2=%08lx, D3=%08lx, D4=%08lx - >,a0
+       move.l  sp,a1
+       call    ss,Printf
+       lea     12(sp),sp
+       endc
+       cmp.l   a2,d7
+       beq.s   FileEnd
+       move.l  (a2)+,d0
+       push    d0
+       ifd     DEBUG
+       dtl.l   <Got %08lx>,a0
+       move.l  sp,a1
+       call    Printf
+       move.l  (sp),d0
+       endc
+       bclr.l  #HUNKB_ADVISORY,d0
+       snev    Advisory
+       sub.w   #HUNK_NAME,d0
+       bcs.s   BadHunk
+       cmp.w   #HUNK_RELRELOC32-HUNK_NAME+1,d0
+       bcc.s   BadHunk
+       lsl.l   #1,d0
+       move.w  HunkTable(pc,d0.w),d1
+       swap    d0
+       lsl.w   #2,d0
+InvalidNE1     bne     Invalid
+       pop     d0
+       jsr     HunkTable(pc,d1.w)
+       bra.s   MainHunkLoop
+
+CheckWordLimit swap    d0
+       tst.w   d0
+       beq     Return5
+       push    a0
+       dtl     <Too many %ss>,a0
+       bra     ErrorSSA1
+
+BadHunk        tstv.b  Advisory
+       beq     Invalid
+       tst.l   d4
+       bne.s   AdviSkip
+       move.l  d0,(a3)+
+AdviSkip       bsr     GetLong
+
+FileEnd        tstv.l  Arg_NoEnd
+       beq.s   PatchNoEnd
+       addq    #4,a3
+PatchNoEnd     geta    Arg_To,a0
+       move.l  (a0),d0
+       bne.s   ArgToSpecified
+       move.l  -4(a0),d0
+       move.l  d0,(a0)
+ArgToSpecified move.l  d0,a0
+       moveq   #OPEN_NEW,d0
+       call    ss,TrackOpen
+       move.l  d1,d2
+       get.l   FileStart,a2
+       move.l  -4(a2),d4
+       get.l   FirstInsert,d3
+       moveq   #0,d5
+
+FlushLoop      tst.l   d3
+       beq.s   FlushNoInsertX
+       move.l  d3,a1
+       move.l  (a1)+,d1        ;Next
+       move.l  (a1)+,d0        ;Point
+       sub.l   a2,d0
+       bne.s   FlushNoInsert
+       move.l  d1,d3
+       move.l  (a1)+,d0        ;Length
+       bra.s   FlushSkip
+
+hunk   macro   ;HUNK_#?[,<routine>]
+       ifne    _hunk-\1
+       fail    Mismatched hunk numbers!
+       endc
+       ifeq    NARG-1
+       dc.w    BadHunk-HunkTable
+       else
+       dc.w    hunk_\2-HunkTable
+       endc
+_hunk  set     _hunk+1
+       endm
+_hunk  set     1000
+HunkTable
+       hunk    HUNK_NAME,skipcnt       ;1000
+       hunk    HUNK_CODE,main          ;1001
+       hunk    HUNK_DATA,main          ;1002
+       hunk    HUNK_BSS,bss            ;1003
+       hunk    HUNK_RELOC32,rel32      ;1004
+       hunk    HUNK_RELOC16            ;1005
+       hunk    HUNK_RELOC8             ;1006
+       hunk    HUNK_EXT                ;1007
+       hunk    HUNK_SYMBOL,symbol      ;1008
+       hunk    HUNK_DEBUG,skipcnt      ;1009
+       hunk    HUNK_END,end            ;1010
+       hunk    HUNK_HEADER             ;1011
+       hunk    1012                    ;????
+       hunk    HUNK_OVERLAY            ;1013
+       hunk    HUNK_BREAK              ;1014
+       hunk    HUNK_DREL32,rel16       ;1015
+       hunk    HUNK_DREL16             ;1016
+       hunk    HUNK_DREL8              ;1017
+       hunk    HUNK_LIB                ;1018
+       hunk    HUNK_INDEX              ;1019
+       hunk    HUNK_RELOC32SHORT,rel16 ;1020
+       hunk    HUNK_RELRELOC32,rrel16  ;1021
+       ifne    _hunk-HUNK_RELRELOC32-1
+       fail    Invalid number of hunks!
+       endc
+
+FlushNoInsertX move.l  a3,d0
+       sub.l   a2,d0
+FlushNoInsert  move.l  a2,a1
+       add.l   d0,a2
+FlushSkip      move.l  d2,a0
+       add.l   d0,d5
+       call    ss,ChkWrite
+       cmp.l   a2,a3
+       bne.s   FlushLoop
+
+       tstv.l  Arg_Quiet
+       bne.s   Return5
+
+       move.l  d5,d0
+       moveq   #100,d1
+       get.l   utilitybase,a0
+       jsr     _LVOUMult32(a0)
+       move.l  d4,d1
+       jsr     _LVOUDivMod32(a0)
+       pop     d1
+       move.w  d0,-(sp)
+       get.l   Arg_To,d3
+       get.l   Arg_File,d2
+       mpush   d1-d5
+       lea     4(sp),a1
+       dtl.l   <%s =',62,' %s: %lu =',62,' %lu (%u%%)>,a0
+       jump    Printf
+
+hunk_rel16     moveq   #-31,d2
+       bra.s   HunkReloc
+
+RelocRead16    moveq   #0,d0
+       move.w  (a2)+,d0
+Return5        rts
+
+hunk_rel32     moveq   #2,d2
+HunkReloc      tst.l   d3
+       beq.s   InvalidEQ1
+RelocLoop      bsr.s   RelocRead
+       beq.s   RelocReturn
+       move.l  d0,d1
+       bsr.s   RelocRead
+       vcmp.l  Hunks,d0
+       bcc     Invalid
+       lsl.l   #2,d0
+       lea     (a4,d0.l),a0
+       move.l  d1,d0
+       tst.l   d4
+       bne.s   RelocScan
+       lsl.l   #2,d0
+       move.l  (a0),a1
+       add.l   d0,(a0)
+       tst.l   d2
+       bmi.s   RelocCopy16
+       move.l  a2,a0
+       add.l   d0,a2
+       call    exec,CopyMemQuick
+       bra.s   RelocLoop
+
+RelocCopy16    subq.l  #1,d1
+RC16Loop       clr.w   (a1)+
+       move.w  (a2)+,(a1)+
+       dbra    d1,RC16Loop
+       bra.s   RelocLoop
+
+RelocScan      add.l   d1,(a0)
+       rol.l   d2,d0
+       bsr     SkipBytes
+       bra.s   RelocLoop
+
+RelocRead      cmp.l   a2,d7
+       beq     InvalidEnd
+       tst.l   d2
+       bmi.s   RelocRead16
+       move.l  (a2)+,d0
+       rts
+
+RelocReturnRR  cmp.l   a3,d7
+       beq.s   InvalidEQ1
+       clr.w   (a3)
+       move.l  a3,d0
+       addq.l  #3,d0
+       and.w   #~3,d0
+       move.l  d0,a3
+RelocReturn    move.l  a2,d0
+       addq.l  #3,d0
+       and.w   #~3,d0
+       move.l  d0,a2
+       rts
+
+hunk_rrel16    tst.l   d3
+InvalidEQ1     beq     Invalid
+       moveq   #-1,d2
+       tst.l   d4
+       bne.s   RRel16Loop
+       move.l  d0,(a3)+
+RRel16Loop     bsr.s   RelocRead
+       tst.l   d4
+       bne.s   SkipCpNum16
+       move.w  d0,(a3)+
+SkipCpNum16    tst.w   d0
+       beq.s   RelocReturnRR
+       addq.l  #1,d0
+       lsl.l   #1,d0
+       bsr.s   CopyBytes       ;or SkipBytes if d4\ne0
+       bra.s   RRel16Loop
+
+hunk_skipcnt   bsr.s   SymInit
+       moveq   #0,d2
+       bsr.s   RelocRead
+       tst.l   d6
+       beq.s   SymbolSkip
+       move.l  d0,(a3)+
+SymbolSkip     push    d4
+       move.l  d6,d4
+       subq.l  #1,d4
+       subx.l  d4,d4
+       bsr.s   CopyLongs
+       pop     d4
+Return1        rts
+
+SymInit        get.l   Arg_KeepDebug,d6
+       beq.s   Return6
+PutnRet        move.l  d0,(a3)+
+Return6        rts
+
+hunk_symbol    moveq   #0,d2
+       bsr.s   SymInit
+SkipSymbol     bsr.s   RelocRead
+       tst.l   d6
+       beq.s   KeepNull
+       move.l  d0,(a3)+
+KeepNull       tst.l   d0
+       beq.s   Return1
+       addq.l  #1,d0
+       bsr.s   SymbolSkip
+       bra.s   SkipSymbol
+
+CopyLongs      lsl.l   #2,d0
+CopyBytes      tst.l   d4
+       bne     SkipBytes
+       move.l  d7,d1
+       sub.l   a2,d1
+       cmp.l   d0,d1
+       bcs     InvalidEnd
+       move.l  a2,a0
+       move.l  a3,a1
+       add.l   d0,a2
+       add.l   d0,a3
+       cmp.l   a0,a1
+       beq.s   Return1
+       cmp.l   a3,a0
+       bcc.s   JumpCopyMem
+       lsr.l   #2,d0
+       bcc.s   CopyQuad
+       move.w  (a0)+,(a1)+
+CopyQuad       move.w  d0,d1
+       swap    d0
+       bra.s   MyCopyInto
+
+MyCopyLoop     move.l  (a0)+,(a1)+
+MyCopyInto     dbra    d1,MyCopyLoop
+       dbra    d0,MyCopyLoop
+       rts
+
+JumpCopyMem    jump    exec,CopyMem
+
+hunk_end       tst.l   d3
+       beq     Invalid
+HunkEndJump    tst.l   d4
+       beq.s   Pass1Done
+       ifd     DEBUG
+       dtl     <HunkEnd - Pass 1>,a0
+       call    ss,PutsNL
+       endc
+       moveq   #64,d0
+       lsl.l   #4,d0
+       moveq   #96,d1
+       lsl.l   #3,d1
+       moveq   #0,d2
+       call    ss,TrackPool
+       put.l   d0,RelocPool
+       push    d3
+       move.l  d0,d3
+       get.l   Hunks,d2
+       move.l  d2,d0
+       lsl.l   #2,d0
+       lea     (a4,d0.l),a2
+       push    a4
+       bra.s   AllocRelocInto
+
+AllocRelocLoop move.l  (a4),d0
+       lsl.l   #2,d0
+       move.l  d0,(a2)+
+       beq.s   NoAllocReloc
+       move.l  d3,a0
+       call    PoolAlloc
+NoAllocReloc   move.l  d0,(a4)+
+AllocRelocInto dbra    d2,AllocRelocLoop
+       pop     a4
+       pop     d3
+       move.l  d4,a2
+       moveq   #0,d4
+       vmovev.l OldKeepDebug,Arg_KeepDebug
+       rts
+
+Pass1Done
+       ifd     DEBUG
+       push    d0
+       dtl     <HunkEnd - Pass 1 done>,a0
+       call    ss,PutsNL
+       pop     d0
+       endc
+       put.l   a2,BackupA2
+       mpush   d0/d7/a4
+       get.l   Hunks,d6
+       move.l  d6,d3
+       lsl.l   #2,d6
+       move.l  (v),a6
+       lea     (a4,d6.l),a2    ;A2=RelLengths, A4=RelEnds
+       moveq   #0,d4           ;define to 16 if at least 1 32bit
+       moveq   #0,d5           ;saved bytes by 16bit header
+       tstv.l  Arg_Reloc32
+       bne.s   Only32Fake
+       get.l   RelocPool,a0
+       move.l  d6,d0
+       call    PoolAlloc
+       push    a3
+       move.l  d0,a3
+       add.l   d6,a3
+       push    a3
+       bra.s   NormalPtrsInto
+
+NormalPtrsLoop move.l  (a2)+,d0
+       sub.l   d0,(a4)
+       move.l  d0,d7
+       move.l  (a4)+,a0
+       beq.s   EmptyHunk
+       move.l  a0,d2
+       lsr.l   #2,d0
+       call    SortLongs
+       moveq   #0,d0
+       move.l  d2,a0
+       move.l  d7,d1
+EdgeLoop       move.l  d0,d2
+       add.l   d1,d2
+       lsr.l   #1,d2
+       and.w   #~3,d2
+       cmp.l   d0,d2
+       beq.s   EdgeFound
+       tst.w   (a0,d2.l)
+       bne.s   EdgeDown
+       move.l  d2,d0
+       move.l  d1,d2
+EdgeDown       move.l  d2,d1
+       bra.s   EdgeLoop
+
+Only32Fake     subq.l  #1,d3
+Only32Loop     move.l  (a4),a0
+       move.l  (a2)+,d0
+       sub.l   d0,a0
+       move.l  a0,(a4)+
+       lsr.l   #2,d0
+       call    SortLongs
+       dbra    d3,Only32Loop
+       bra.s   FromFaked32
+
+EdgeFound      tst.w   (a0,d0.l)
+       bne.s   EdgeFix
+       addq.l  #4,d0
+EdgeFix        add.l   d0,d5
+       addq.l  #8,d5
+EmptyHunk      move.l  d0,-(a3)                ;real # of 16bit relocs
+       beq.s   NormalPtrsInto
+       moveq   #16,d4
+       subq.l  #8,d0
+       bhi.s   MoreThatTwo
+       sub.l   d0,d5
+       subq.l  #8,d5
+       subq.l  #8,d5
+       clr.l   (a3)
+MoreThatTwo    sub.l   d4,d5
+NormalPtrsInto dbra    d3,NormalPtrsLoop       ;A2=TotalEnd, A4=RelLengths
+       mpop    a0/a3
+FromFaked32    move.l  d6,d3
+       lsr.l   #2,d3
+       subq.l  #1,d3
+       sub.l   d6,a2
+       sub.l   d6,a2           ;A2=RelStarts, A4=RelLengths
+       sub.l   d4,d5
+       bmi.s   Hunks32
+       beq.s   Hunks32
+       tst.l   d4
+       beq.s   Hunks32
+       mpush   d3/a0/a2/a4
+       moveq   #8,d0
+H16SizeLoop    move.l  -(a0),d1
+       beq.s   H16SizeSkip
+       lsr.l   #1,d1
+       addq.l  #4,d1
+       add.l   d1,d0
+H16SizeSkip    dbra    d3,H16SizeLoop
+       and.w   #~3,d0
+       bsr     ReserveReloc
+       movem.l 4(sp),d3/a0/a2/a4
+       move.l  #HUNK_DREL32,(a3)+
+       dtl     <reloc>,a6
+H16Loop        move.l  -(a0),d0
+       sub.l   d0,(a4)+
+       lsr.l   #2,d0
+       move.l  (a2),a1
+       beq.s   H16SkipAll
+       move.w  d0,(a3)+
+       subq.w  #1,d0
+       move.w  6(sp),(a3)      ;Desthunk
+       sub.w   d3,(a3)+
+
+H16InLoop      addq    #2,a1
+       move.w  (a1)+,(a3)+
+       dbra    d0,H16InLoop
+       bsr     CheckWordLimit          ;# of relocs>65535 ?!?
+H16SkipAll     move.l  a1,(a2)+
+       dbra    d3,H16Loop
+       clr.w   (a3)+
+       move.w  a3,d0
+       ror.w   #2,d0
+       bcc.s   H16Aligned
+       clr.w   (a3)+
+H16Aligned     pop     a3
+       mpop    d3/a0/a2/a4
+Hunks32        moveq   #0,d0
+       move.l  d3,d2
+       push    a4
+H32SizeLoop    move.l  (a4)+,d1
+       beq.s   H32SizeInto
+       addq.l  #8,d1
+       add.l   d1,d0
+H32SizeInto    dbra    d2,H32SizeLoop
+       pop     a4
+       tst.l   d0
+       beq.s   HunksDone
+       addq.l  #8,d0
+       bsr.s   ReserveReloc
+       move.l  #HUNK_RELOC32,(a3)+
+       move.l  d3,d2
+       moveq   #0,d5           ;Current DestHunk
+H32Loop        move.l  (a2)+,a0
+       move.l  (a4)+,d0
+       beq.s   H32Skip
+       move.l  d0,d1
+       lsr.l   #2,d1
+       move.l  d1,(a3)+
+       move.l  d5,(a3)+
+       move.l  a3,a1
+       add.l   d0,a3
+       call    exec,CopyMemQuick
+H32Skip        addq.l  #1,d5
+       dbra    d2,H32Loop
+       clr.l   (a3)+
+       pop     a3
+HunksDone      get.l   RelocPool,a0
+       call    ss,FreeObject
+       get.l   BackupA2,a2
+       moveq   #0,d3
+       moveq   #0,d4
+       pop     (a3)
+       tstv.l  Arg_NoEnd
+       bne.s   IsNoEnd
+       addq    #4,a3
+IsNoEnd        mpop    d7/a4
+Return4        rts
+
+ReserveReloc   add.l   a3,d0
+       vcmp.l  BackupA2,d0
+       bls.s   ReserveReturn
+       sub.l   a3,d0
+       push    d0
+       addq.l  #8,d0
+       addq.l  #4,d0
+       call    ss,TrackAllocPub
+       geta    FirstInsert,a0
+       get.l   LastInsert,d1
+       beq.s   NoLastInsert
+       move.l  d1,a0
+NoLastInsert   move.l  d0,(a0)
+       put.l   d0,LastInsert
+       move.l  d0,a1
+       clr.l   (a1)+           ;^NextInsert
+       move.l  a3,(a1)+        ;^InsertPoint
+       pop     (a1)+           ;^InsertLength
+       move.l  a3,d0
+       move.l  a1,a3
+ReserveReturn  move.l  (sp),a0
+       move.l  d0,(sp)
+       jmp     (a0)
+
+hunk_main      bsr.s   HunkMainInit
+       push    a3
+       bsr.s   GetLong
+       move.l  d0,d2
+       bsr     CopyLongs
+       move.w  d2,d0
+       swap    d2
+       move.l  a3,d1
+       cmp.l   d0,d0           ;ZF=1
+       bra.s   SqueezeInto
+
+GetLong        cmp.l   a2,d7
+       beq.s   Invalid
+       move.l  (a2)+,d0
+       tst.l   d4
+       bne.s   Return2
+       move.l  d0,(a3)+
+Return2        rts
+
+HunkMainInit   tst.l   d3
+       beq.s   WereFree
+       push    d0
+       move.l  #HUNK_END,d0
+       bsr     HunkEndJump
+       pop     d0
+       tst.l   d3
+       bne.s   HMI_Skip
+WereFree       tst.l   d4
+       beq     PutnRet
+HMI_Skip       addq    #4,sp
+       rts
+
+SqueezeLoop    tst.l   -(a3)
+SqueezeInto    dbne    d0,SqueezeLoop
+       dbne    d2,SqueezeLoop
+       beq.s   TotalSqueeze
+       addq    #4,a3
+TotalSqueeze   sub.l   a3,d1
+       lsr.l   #2,d1
+       pop     a0
+       sub.l   d1,(a0)
+JumpFromBSS    get.l   Hunks,d0
+       move.l  a4,a0
+       bra.s   ClrHunkTabInto
+
+hunk_bss       bsr.s   HunkMainInit
+       bsr.s   GetLong
+       bra.s   JumpFromBSS
+
+ClrHunkTabLoop clr.l   (a0)+
+ClrHunkTabInto dbra    d0,ClrHunkTabLoop
+       move.l  a2,d4
+       vmovev.l Arg_KeepDebug,OldKeepDebug
+       clrv.l  Arg_KeepDebug
+       moveq   #-1,d3
+Return3        rts
+
+SkipBytes      add.l   d0,a2
+       cmp.l   a2,d7
+       bcc.s   Return3
+InvalidEnd     move.l  d7,a2
+Invalid        vsub.l  FileStart,a2
+       push    a2
+       dtl     <Invalid structure of file "%s" near offset $%06lx>,a0
+       vpush   Arg_File
+ErrorSSA1      move.l  sp,a1
+       jump    ss,ExitError
+
+       ifd     DEBUG
+EXIT   jump    ss,ExitCleanup
+       endc
+
+       tags
+       template <FROM/A,TO,KEEPDEBUG/S,RELOC32/S,NOEND/S,QUIET/S>
+       dv.l    Arg_File
+       dv.l    Arg_To
+       dv.l    Arg_KeepDebug
+       dv.l    Arg_Reloc32
+       dv.l    Arg_NoEnd
+       dv.l    Arg_Quiet
+       finish
+       end
+ShortRel dvitype /bin.new.exp/dvitype RELOC32
+ShortRel gftodvi /bin.new.exp/gftodvi RELOC32
+ShortRel gftopk /bin.new.exp/gftopk RELOC32
+ShortRel gftype /bin.new.exp/gftype RELOC32
+ShortRel inimf /bin.new.exp/inimf RELOC32
+ShortRel initex /bin.new.exp/initex RELOC32
+ShortRel mft /bin.new.exp/mft RELOC32
+ShortRel pltotf /bin.new.exp/pltotf RELOC32
+ShortRel tftopl /bin.new.exp/tftopl RELOC32
+ShortRel vftovp /bin.new.exp/vftovp RELOC32
+ShortRel virmf /bin.new.exp/virmf RELOC32
+ShortRel virtex /bin.new.exp/virtex RELOC32
+ShortRel vptovf /bin.new.exp/vptovf RELOC32
+ShortRel MakeInfo /bin.new.exp/MakeInfo RELOC32
+ShortRel tr2tex /bin.new.exp/tr2tex RELOC32
+ShortRel dvi2tty /bin.new.exp/dvi2tty RELOC32
+ShortRel disdvi /bin.new.exp/disdvi RELOC32
+ShortRel DVIprint /bin.new.exp/DVIprint RELOC32
+ShortRel flib /bin.new.exp/flib RELOC32
+ShortRel PToFront /bin.new.exp/PToFront RELOC32
+ShortRel TeXindex /bin.new.exp/TeXindex RELOC32
+ShortRel ShowDVI /bin.new.exp/ShowDVI RELOC32
+ShortRel SpecialHost /bin.new.exp/SpecialHost RELOC32
+ShortRel bm2font /bin.new.exp/bm2font RELOC32
+
+
+A2=000EEE44, D3=00000000, D4=00000000 - Got HUNK_CODE
+A2=00102524, D3=FFFFFFFF, D4=00102524 - Got HUNK_DREL32
+A2=00102E08, D3=FFFFFFFF, D4=00102524 - Got HUNK_RELOC32
+A2=00102E1C, D3=FFFFFFFF, D4=00102524 - Got HUNK_DATA
+A2=00102524, D3=FFFFFFFF, D4=00000000 - Got HUNK_DREL32
+A2=00102E08, D3=FFFFFFFF, D4=00000000 - Got HUNK_RELOC32
+A2=00102E1C, D3=FFFFFFFF, D4=00000000 - Got HUNK_DATA
+A2=00103308, D3=FFFFFFFF, D4=00103308 - Got HUNK_RELOC32
+A2=00103320, D3=FFFFFFFF, D4=00103308 - Got HUNK_BSS
+A2=00103308, D3=FFFFFFFF, D4=00000000 - Got HUNK_RELOC32
+A2=00103320, D3=FFFFFFFF, D4=00000000 - Got HUNK_BSS
+A2=00103328, D3=FFFFFFFF, D4=00103328 - Got HUNK_END
+A2=00103328, D3=FFFFFFFF, D4=00000000 - Got HUNK_END
+A2=0010332C, D3=00000000, D4=00000000 - bm2font => :t/shortrel.res: 83208 => 80888 (97%)
diff --git a/project/ShortRel/ShortRel.lha b/project/ShortRel/ShortRel.lha
new file mode 100644 (file)
index 0000000..417fcc1
Binary files /dev/null and b/project/ShortRel/ShortRel.lha differ