Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- opt O1+ ;Alarm! short branch
- ;-------------------------------------------------------------------------
- ** ** ** **** **** ***** ***** ****
- **** *** *** ** ** ** ** ** ** ** ** **
- ** ** ** * ** ** ** **** ***** ***** ** **
- ****** ** ** ** ** ** ** **** ** **
- ** ** ** ** ** ** ** ** ** ** ** ** **
- ** ** ** ** **** **** ** ** ** **** Explode Extension
- ;-------------------------------------------------------------------------
- ; Peace of Testaware, GenAm Macro Assembler V2.11D von HiSoft
- ;-------------------------------------------------------------------------
- ; AMOS, AMOSPro and AMOS Compiler V2.00+ (c) Europress Software 1990-2001
- ;-------------------------------------------------------------------------
- ; This V2.01 is public domain, last change ® Tuesday 10-06-02 23:22:48
- ;-------------------------------------------------------------------------
- ExtNb equ 7-1
- *
- Output SYS:APSystem/AMOSPro_Explode.Lib
- Incdir DH1:Asm/DevPac/Include/
- Include devices/trackdisk.i
- Include exec/execbase.i
- Include exec/types.i
- Include exec/memory.i
- Include libraries/dos.i
- Include libraries/diskfont_lib.i
- Include libraries/xpk.i
- Include libraries/ppbase.i
- Include libraries/powerpacker_lib.i
- Include intuition/intuition_lib.i
- Include intuition/intuitionbase.i
- Include graphics/text.i
- Include graphics/rastport.i
- Include graphics/graphics_lib.i
- Include amos/amos.i
- *
- RsReset
- * PowerPacker Data
- my_PpkLibBase rs.l 1
- my_PpkSrc rs.l 1
- my_PpkDst rs.l 1
- my_PpkDstSize rs.l 1
- my_PpkPackMode rs.l 1
- my_PpkCInfo rs.l 1
- my_PpkName equ 0
- my_PpkEffPos equ 4
- my_PpkCodePos equ 8
- my_PpkCode equ 12
- my_PpkCryptPos equ 16
- my_PpkType equ 20
- my_PpkSIZEOF equ 24
- my_PpkKnow equ 10
- my_PpkEffMode equ my_PpkSIZEOF*my_PpkKnow
- * XPK Data
- my_XpkLibBase rs.l 1 ;XpkLibrary
- my_XpkSrc rs.l 1 ;XpkBankToPack
- my_XpkSrcSize rs.l 1 ;XpkBankLength
- my_XpkDst rs.l 1 ;XpkPackBuffer
- my_XpkDstSize rs.l 1 ;XpkBufferLength
- my_XpkOutSize rs.l 1 ;XpkPackedLength
- my_XpkName rs.l 1 ;XpkBriefName
- my_XpkMode rs.l 1 ;XpkPackMethod
- my_XpkPassWord rs.l 1 ;XpkPassWord
- my_XpkErrNum rs.l 1 ;XpkErrorNumber
- my_XpkErrLen rs.w 1 ;XpkErrorMsgLen
- my_XpkErrMsg rs.b XPKERRMSGSIZE ;XpkErrorMessage
- * Decrunch Data
- my_DpkLibBase rs.l 1
- _LVOdlAllocItem equ -30
- _LVOdlFreeItem equ -36
- _LVOdlInitItem equ -42
- _LVOdlDecrunch equ -48
- * Lh Data
- my_LpkLibBase rs.l 1
- my_LpkSrc rs.l 1
- my_LpkSize rs.l 1
- my_LpkDst rs.l 1
- my_LpkBuffer rs.l 1
- my_LpkAux rs.l 1
- my_LpkHeader equ 8
- lh_Src equ 0
- lh_SrcSize equ 4
- lh_Dst equ 8
- lh_DstSize equ 12
- lh_Aux equ 16
- lh_AuxSize equ 20
- lh_Reserved equ 24
- _LVOCreateBuffer equ -30
- _LVODeleteBuffer equ -36
- _LVOLhEncode equ -42
- _LVOLhDecode equ -48
- * Rs Structure Data
- my_RsStart equ 0
- my_RsLength equ 4
- my_RsPosition equ 8
- my_RsSIZEOF equ 12
- my_RsMax equ 8
- my_RsStruc rs.b my_RsSIZEOF*my_RsMax
- * Amcaf Data
- my_AmcafCrack rs.l 1
- * FontList Data
- my_FntMax equ 8
- my_FntStruc rs.l my_FntMax
- * Iff Data
- my_IFFNORM equ 0
- my_IFFCMPR equ 1
- my_IFFACBM equ 2
- * File Data
- my_FileName rs.l 1
- my_FileSize rs.l 1
- my_FileBlocks rs.l 1
- my_FileType rs.l 1
- my_FileProtect rs.l 1
- my_FileBnk rs.l 1
- my_FileMsk rs.l 1
- * Current Dir Data
- my_CdLength equ 256
- my_CdPath rs.b my_CdLength
- * AMOS Bank Data
- my_BkDefault equ 8
- my_BkHeader equ 16
- my_BkName equ -8
- my_BkFuture equ -10
- my_BkFlag equ -12
- my_BkNumber equ -16
- my_BkLength equ -20
- my_BkNext equ -24
- ET_SIZEOF rs.w 0
- *
- EXPLODE MACRO
- dc.b "AMOSPro Explode Extension V"
- ENDM
- VERSION MACRO
- dc.b "2.01 © Testaware"
- ENDM
- DLEA MACRO
- move.l ExtAdr+ExtNb*16(a5),\2
- add.w #\1-ET,\2
- ENDM
- XLEA MACRO
- move.l ExtAdr+ExtNb*16(a5),\2
- adda.l #\1,\2
- ENDM
- DLOAD MACRO
- move.l ExtAdr+ExtNb*16(a5),\1
- ENDM
- PUSH MACRO
- move.l \1,-(sp)
- ENDM
- PUSHM MACRO
- movem.l \1,-(sp)
- ENDM
- POP MACRO
- move.l (sp)+,\1
- ENDM
- POPM MACRO
- movem.l (sp)+,\1
- ENDM
- EXE MACRO
- movea.l $4.w,a6
- LIB \1
- ENDM
- DOS MACRO
- movea.l DosBase(a5),a6
- LIB \1
- ENDM
- INT MACRO
- movea.l T_IntBase(a5),a6
- LIB \1
- ENDM
- GFX MACRO
- movea.l T_GfxBase(a5),a6
- LIB \1
- ENDM
- FNT MACRO
- movea.l T_FntBase(a5),a6
- LIB \1
- ENDM
- LIB MACRO
- jsr _LVO\1(a6)
- ENDM
- SYS MACRO
- PUSH a6
- movea.l \1,a6
- jsr _LVO\2(a6)
- POP a6
- ENDM
- *
- Start dc.l C_Tk-C_Off
- dc.l C_Lib-C_Tk
- dc.l C_Title-C_Lib
- dc.l C_End-C_Title
- dc.w 0
- **************************************************************************
- * OFFSETS TO FUNCTIONS
- *-------------------------------------------------------------------------
- C_Off dc.w (L1-L0)/2,(L2-L1)/2,(L3-L2)/2,(L4-L3)/2,(L5-L4)/2
- dc.w (L6-L5)/2,(L7-L6)/2,(L8-L7)/2,(L9-L8)/2,(L10-L9)/2
- dc.w (L11-L10)/2,(L12-L11)/2,(L13-L12)/2,(L14-L13)/2,(L15-L14)/2
- dc.w (L16-L15)/2,(L17-L16)/2,(L18-L17)/2,(L19-L18)/2,(L20-L19)/2
- dc.w (L21-L20)/2,(L22-L21)/2,(L23-L22)/2,(L24-L23)/2,(L25-L24)/2
- dc.w (L26-L25)/2,(L27-L26)/2,(L28-L27)/2,(L29-L28)/2,(L30-L29)/2
- dc.w (L31-L30)/2,(L32-L31)/2,(L33-L32)/2,(L34-L33)/2,(L35-L34)/2
- dc.w (L36-L35)/2,(L37-L36)/2,(L38-L37)/2,(L39-L38)/2,(L40-L39)/2
- dc.w (L41-L40)/2,(L42-L41)/2,(L43-L42)/2,(L44-L43)/2,(L45-L44)/2
- dc.w (L46-L45)/2,(L47-L46)/2,(L48-L47)/2,(L49-L48)/2,(L50-L49)/2
- dc.w (L51-L50)/2,(L52-L51)/2,(L53-L52)/2,(L54-L53)/2,(L55-L54)/2
- dc.w (L56-L55)/2,(L57-L56)/2,(L58-L57)/2,(L59-L58)/2,(L60-L59)/2
- dc.w (L61-L60)/2,(L62-L61)/2,(L63-L62)/2,(L64-L63)/2,(L65-L64)/2
- dc.w (L66-L65)/2,(L67-L66)/2,(L68-L67)/2,(L69-L68)/2,(L70-L69)/2
- dc.w (L71-L70)/2,(L72-L71)/2,(L73-L72)/2,(L74-L73)/2,(L75-L74)/2
- dc.w (L76-L75)/2,(L77-L76)/2,(L78-L77)/2,(L79-L78)/2,(L80-L79)/2
- dc.w (L81-L80)/2,(L82-L81)/2,(L83-L82)/2,(L84-L83)/2,(L85-L84)/2
- dc.w (L86-L85)/2,(L87-L86)/2,(L88-L87)/2,(L89-L88)/2,(L90-L89)/2
- dc.w (L91-L90)/2,(L92-L91)/2,(L93-L92)/2,(L94-L93)/2,(L95-L94)/2
- dc.w (L96-L95)/2,(L97-L96)/2,(L98-L97)/2,(L99-L98)/2,(L100-L99)/2
- dc.w (L101-L100)/2,(L102-L101)/2,(L103-L102)/2,(L104-L103)/2,(L105-L104)/2
- dc.w (L106-L105)/2,(L107-L106)/2,(L108-L107)/2,(L109-L108)/2,(L110-L109)/2
- dc.w (L111-L110)/2,(L112-L111)/2,(L113-L112)/2,(L114-L113)/2,(L115-L114)/2
- dc.w (L116-L115)/2,(L117-L116)/2,(L118-L117)/2,(L119-L118)/2,(L120-L119)/2
- dc.w (L121-L120)/2,(L122-L121)/2,(L123-L122)/2,(L124-L123)/2,(L125-L124)/2
- dc.w (L126-L125)/2,(L127-L126)/2,(L128-L127)/2,(L129-L128)/2,(L130-L129)/2
- dc.w (L131-L130)/2,(L132-L131)/2,(L133-L132)/2,(L134-L133)/2,(L135-L134)/2
- dc.w (L136-L135)/2,(L137-L136)/2,(L138-L137)/2,(L139-L138)/2,(L140-L139)/2
- dc.w (L141-L140)/2,(L142-L141)/2,(L143-L142)/2,(L144-L143)/2,(L145-L144)/2
- dc.w (L146-L145)/2,(L147-L146)/2,(L148-L147)/2,(L149-L148)/2,(L150-L149)/2
- dc.w (L151-L150)/2,(L152-L151)/2,(L153-L152)/2,(L154-L153)/2,(L155-L154)/2
- dc.w (L156-L155)/2,(L157-L156)/2,(L158-L157)/2,(L159-L158)/2,(L160-L159)/2
- dc.w (L161-L160)/2,(L162-L161)/2,(L163-L162)/2,(L164-L163)/2,(L165-L164)/2
- dc.w (L166-L165)/2,(L167-L166)/2,(L168-L167)/2,(L169-L168)/2,(L170-L169)/2
- dc.w (L171-L170)/2,(L172-L171)/2,(L173-L172)/2,(L174-L173)/2,(L175-L174)/2
- dc.w (L176-L175)/2,(L177-L176)/2,(L178-L177)/2,(L179-L178)/2,(L180-L179)/2
- dc.w (L181-L180)/2,(L182-L181)/2,(L183-L182)/2,(L184-L183)/2,(L185-L184)/2
- dc.w (L186-L185)/2,(L187-L186)/2,(L188-L187)/2,(L189-L188)/2,(L190-L189)/2
- dc.w (L191-L190)/2,(L192-L191)/2,(L193-L192)/2,(L194-L193)/2,(L195-L194)/2
- dc.w (L196-L195)/2,(L197-L196)/2,(L198-L197)/2,(L199-L198)/2,(L200-L199)/2
- dc.w (L201-L200)/2,(L202-L201)/2,(L203-L202)/2,(L204-L203)/2,(L205-L204)/2
- dc.w (L206-L205)/2,(L207-L206)/2,(L208-L207)/2
- **************************************************************************
- * EXPLODE TOKENS
- *-------------------------------------------------------------------------
- C_Tk dc.w 1,0
- dc.b $80,-1
- ;ExtensionCmd
- dc.w -1,L_Explode
- dc.b "explode","$"+$80,"2",-1 * =Explode$
- dc.w -1,L_ExpBase
- dc.b "explode bas","e"+$80,"0",-1 * =Explode Base
- dc.w -1,L_Extension
- dc.b "extension","$"+$80,"20",-1 * =Extension$(#)
- dc.w -1,L_ExtBase
- dc.b "extension bas","e"+$80,"00",-1 * =Extension Base(#)
- ;WaitCmd
- dc.w L_ClearMouse,-1
- dc.b "clear mous","e"+$80,"I",-1 * Clear Mouse
- dc.w -1,L_Pause
- dc.b "paus","e"+$80,"00",-1 * =Pause(tme)
- dc.w L_StopLoop,-1
- dc.b "stop loo","p"+$80,"I",-1 * Stop Loop
- dc.w -1,L_WaitLoop
- dc.b "wait loo","p"+$80,"0",-1 * =Wait Loop
- dc.w L_WaitMouse,-1
- dc.b "wait mous","e"+$80,"I",-1 * Wait Mouse
- ;FileCmd
- dc.w -1,L_FilePath
- dc.b "file path","$"+$80,"22",-1 * =File Path$(file)
- dc.w -1,L_FileBlocks
- dc.b "file block","s"+$80,"02",-1 * =File Blocks(file)
- dc.w -1,L_FileSize
- dc.b "file siz","e"+$80,"02",-1 * =File Size(file)
- dc.w -1,L_FileType
- dc.b "file typ","e"+$80,"02",-1 * =File Type(file)
- dc.w -1,L_Hof
- dc.b "ho","f"+$80,"00",-1 * =Hof(fh)
- ;TimeCmd
- dc.w -1,L_HardTime
- dc.b "hard time","$"+$80,"2",-1 * =Hard Time$
- dc.w -1,L_HardDate
- dc.b "hard date","$"+$80,"2",-1 * =Hard Date$
- dc.w L_SetHardTime,-1
- dc.b "set hard tim","e"+$80,"I2",-1 * Set Hard Time "HH:MM:SS"
- dc.w L_SetHardDate,-1
- dc.b "set hard dat","e"+$80,"I2",-1 * Set Hard Date "DD-MM-YY"
- ;BankCmd
- dc.w L_BankLoadA,-1
- dc.b "!bank loa","d"+$80,"I2",-2 * Bank Load name
- dc.w L_BankLoadB,-1
- dc.b $80,"I2,0",-2 * Bank Load name,msk
- dc.w L_BankLoadC,-1
- dc.b $80,"I2t0",-2 * Bank Load name To bk
- dc.w L_BankLoadD,-1
- dc.b $80,"I2t0,0",-1 * Bank Load name To bk,msk
- dc.w L_BankSave,-1
- dc.b "bank sav","e"+$80,"I2,0",-1 * Bank Save name,bk
- dc.w L_BankAsWork,-1
- dc.b "bank as wor","k"+$80,"I0",-1 * Bank As Work bk
- dc.w L_BankAsData,-1
- dc.b "bank as dat","a"+$80,"I0",-1 * Bank As Data bk
- dc.w -1,L_BankFree
- dc.b "bank fre","e"+$80,"00",-1 * =Bank Free(minbk)
- dc.w L_BankClone,-1
- dc.b "bank clon","e"+$80,"I0t0",-1 * Bank Clone bk to bk
- dc.w -1,L_Number
- dc.b "numbe","r"+$80,"00",-1 * =Number(bk)
- dc.w -1,L_Finish
- dc.b "finis","h"+$80,"00",-1 * =Finish(bk)
- dc.w L_ImageSwap,-1
- dc.b "image swa","p"+$80,"I0,0,0",-1 * Image Swap bk,img1,img2
- dc.w -1,L_ImageWidth
- dc.b "image widt","h"+$80,"00,0",-1 * =Image Width(bk,img)
- dc.w -1,L_ImageHeight
- dc.b "image heigh","t"+$80,"00,0",-1 * =Image Height(bk,img)
- ;TextCmd
- dc.w -1,L_Pinv
- dc.b "pinv","$"+$80,"20",-1 * =Pinv$()
- dc.w -1,L_Psad
- dc.b "psad","$"+$80,"20",-1 * =Psad$()
- dc.w -1,L_Pund
- dc.b "pund","$"+$80,"20",-1 * =Pund$()
- dc.w -1,L_Pcpn
- dc.b "pcpn","$"+$80,"20",-1 * =Pcpn$()
- dc.w -1,L_Pjam
- dc.b "pjam","$"+$80,"20",-1 * =Pjam$()
- dc.w -1,L_Pcsr
- dc.b "pcsr","$"+$80,"20",-1 * =Pcsr$()
- dc.w -1,L_Pdef
- dc.b "pdef","$"+$80,"2",-1 * =Pdef$
- dc.w -1,L_Format
- dc.b "format","$"+$80,"22,0",-1 * =Format$(%$,ptr)
- ;StructureCmd
- dc.w L_RsStructure,-1
- dc.b "rs structur","e"+$80,"I0,0",-1 * Rs Structure n,size
- dc.w -1,L_RsStart
- dc.b "rs star","t"+$80,"00",-1 * =Rs Start(n)
- dc.w -1,L_RsFinish
- dc.b "rs finis","h"+$80,"00",-1 * =Rs Finish(n)
- dc.w -1,L_RsLength
- dc.b "rs lengt","h"+$80,"00",-1 * =Rs Length(n)
- dc.w L_RsClear,-1
- dc.b "rs clea","r"+$80,"I0",-1 * Rs Clear n
- dc.w L_RsFill,-1
- dc.b "rs fil","l"+$80,"I0,0,0",-1 * Rs Fill n,c,#
- dc.w L_RsByte,-1
- dc.b "rs byt","e"+$80,"I0,0",-1 * Rs Byte n,#
- dc.w L_RsWord,-1
- dc.b "rs wor","d"+$80,"I0,0",-1 * Rs Word n,#
- dc.w L_RsLong,-1
- dc.b "rs lon","g"+$80,"I0,0",-1 * Rs Long n,#
- dc.w L_RsAptr,-1
- dc.b "rs apt","r"+$80,"I0,2",-1 * Rs Aptr n,$
- dc.w L_RsChar,-1
- dc.b "rs cha","r"+$80,"I0,2",-1 * Rs Char n,$
- dc.w L_RsSet,-1
- dc.b "rs se","t"+$80,"I0,0",-1 * Rs Set n,#
- dc.w L_RsBset,-1
- dc.b "rs bse","t"+$80,"I0,0",-1 * Rs Bset n,#
- dc.w L_RsWset,-1
- dc.b "rs wse","t"+$80,"I0,0",-1 * Rs Wset n,#
- dc.w L_RsLset,-1
- dc.b "rs lse","t"+$80,"I0,0",-1 * Rs Lset n,#
- dc.w L_RsEraseA,-1
- dc.b "!rs eras","e"+$80,"I",-2 * Rs Erase
- dc.w L_RsEraseB,-1
- dc.b $80,"I0",-1 * Rs Erase n
- dc.w -1,L_Rs
- dc.b "r","s"+$80,"00",-1 * =Rs(n)
- ;VariableCmd
- dc.w -1,L_ByteA
- dc.b "byt","e"+$80,"02",-1 * =Byte($)
- dc.w -1,L_ByteB
- dc.b "byte","$"+$80,"20",-1 * =Byte$(#)
- dc.w -1,L_WordA
- dc.b "wor","d"+$80,"02",-1 * =Word($)
- dc.w -1,L_WordB
- dc.b "word","$"+$80,"20",-1 * =Word$(#)
- dc.w -1,L_LongA
- dc.b "lon","g"+$80,"02",-1 * =Long($)
- dc.w -1,L_LongB
- dc.b "long","$"+$80,"20",-1 * =Long$(#)
- dc.w -1,L_LslB
- dc.b "lsl.","b"+$80,"00,0",-1 * =Lsl.b(#,var)
- dc.w -1,L_LslW
- dc.b "lsl.","w"+$80,"00,0",-1 * =Lsl.w(#,var)
- dc.w -1,L_LslL
- dc.b "lsl.","l"+$80,"00,0",-1 * =Lsl.l(#,var)
- dc.w -1,L_LsrB
- dc.b "lsr.","b"+$80,"00,0",-1 * =Lsr.b(#,var)
- dc.w -1,L_LsrW
- dc.b "lsr.","w"+$80,"00,0",-1 * =Lsr.w(#,var)
- dc.w -1,L_LsrL
- dc.b "lsr.","l"+$80,"00,0",-1 * =Lsr.l(#,var)
- dc.w -1,L_Even
- dc.b "eve","n"+$80,"00",-1 * =Even(var)
- dc.w -1,L_Odd
- dc.b "od","d"+$80,"00",-1 * =Odd(var)
- dc.w -1,L_Align
- dc.b "alig","n"+$80,"00,0",-1 * =Align(var,#)
- ;PackerCmd
- dc.w L_BpkUnpack,-1
- dc.b "bpk unpac","k"+$80,"I0",-1 * Bpk Unpack bk
- dc.w -1,L_BpkLength
- dc.b "bpk lengt","h"+$80,"00",-1 * =Bpk Length(bk)
- dc.w L_DpkUnpack,-1
- dc.b "dpk unpac","k"+$80,"I0",-1 * Dpk Unpack bk
- dc.w -1,L_DpkName
- dc.b "dpk name","$"+$80,"20",-1 * =Dpk Name$(bk)
- dc.w -1,L_IpkLength
- dc.b "ipk lengt","h"+$80,"00",-1 * =Ipk Length(bk)
- dc.w L_PpkPackA,-1
- dc.b "!ppk pac","k"+$80,"I0",-2 * Ppk Pack bk
- dc.w L_PpkPackB,-1
- dc.b $80,"I0,0",-1 * Ppk Pack bk,eff
- dc.w L_PpkUnpackA,-1
- dc.b "!ppk unpac","k"+$80,"I0",-2 * Ppk Unpack bk
- dc.w L_PpkUnpackB,-1
- dc.b $80,"I0,2",-1 * Ppk Unpack bk,pwd
- dc.w -1,L_PpkLength
- dc.b "ppk lengt","h"+$80,"00",-1 * =Ppk Length(bk)
- dc.w -1,L_PpkMode
- dc.b "ppk mod","e"+$80,"00",-1 * =Ppk Mode(bk)
- dc.w -1,L_PpkType
- dc.b "ppk typ","e"+$80,"00",-1 * =Ppk Type(bk)
- dc.w -1,L_PpkName
- dc.b "ppk name","$"+$80,"20",-1 * =Ppk Name$(bk)
- dc.w -1,L_PpkPasskey
- dc.b "ppk passke","y"+$80,"00",-1 * =Ppk Passkey(bk)
- dc.w -1,L_PpkPassword
- dc.b "ppk passwor","d"+$80,"00,2",-1 * =Ppk Password(bk,pwd)
- dc.w L_PpkDataA,-1
- dc.b "!ppk dat","a"+$80,"I0",-2 * Ppk Data bk
- dc.w L_PpkDataB,-1
- dc.b $80,"I0,2",-1 * Ppk Data bk,pwd
- dc.w -1,L_XpkLength
- dc.b "xpk lengt","h"+$80,"00",-1 * =Xpk Length(bk)
- dc.w -1,L_XpkName
- dc.b "xpk name","$"+$80,"20",-1 * =Xpk Name$(bk)
- dc.w L_XpkUnpackA,-1
- dc.b "!xpk unpac","k"+$80,"I0",-2 * Xpk Unpack bk
- dc.w L_XpkUnpackB,-1
- dc.b $80,"I0,2",-1 * Xpk Unpack bk,password
- dc.w -1,L_XpkErrn
- dc.b "xpk err","n"+$80,"0",-1 * =Xpk Errn
- dc.w -1,L_XpkErrs
- dc.b "xpk err","$"+$80,"2",-1 * =Xpk Err$
- ;GfxCmd
- dc.w -1,L_RastPort
- dc.b "rastpor","t"+$80,"0",-1 * =Rastport
- dc.w L_PlaneMask,-1
- dc.b "plane mas","k"+$80,"I0,0",-1 * Plane Mask pln,msk
- dc.w L_PlaneClear,-1
- dc.b "plane clea","r"+$80,"I0",-1 * Plane Clear pln
- dc.w L_PlaneGet,-1
- dc.b "plane ge","t"+$80,"I0t0",-1 * Plane Get pln To bk
- dc.w L_PlanePut,-1
- dc.b "plane pu","t"+$80,"I0t0",-1 * Plane Put pln To bk
- dc.w -1,L_PlaneLength
- dc.b "plane lengt","h"+$80,"0",-1 * =Plane Length
- dc.w L_PlaneCopy,-1
- dc.b "plane cop","y"+$80,"I0t0",-1 * Plane Copy pln To pln
- dc.w L_PlaneSwap,-1
- dc.b "plane swa","p"+$80,"I0,0",-1 * Plane Swap pln,pln
- dc.w L_PlaneNegative,-1
- dc.b "plane negativ","e"+$80,"I0",-1 * Plane Negative pln
- dc.w L_PlaneMerge,-1
- dc.b "plane merg","e"+$80,"I0t0",-1 * Plane Merge pln To pln
- dc.w L_PlaneCloseA,-1
- dc.b "!plane clos","e"+$80,"I0",-2 * Plane Close pln
- dc.w L_PlaneCloseB,-1
- dc.b $80,"I0t0",-1 * Plane Close pln To pln
- dc.w L_PlaneOpenA,-1
- dc.b "!plane ope","n"+$80,"I0",-2 * Plane Open pln
- dc.w L_PlaneOpenB,-1
- dc.b $80,"I0t0",-1 * Plane Open pln To pln
- dc.w -1,L_PlaneActive
- dc.b "plane activ","e"+$80,"00",-1 * =Plane Active(pln)
- dc.w L_IffBank,-1
- dc.b "iff ban","k"+$80,"I0t0",-1 * Iff Bank bk To scrn
- ;FontCmd
- dc.w L_FontOpen,-1
- dc.b "font ope","n"+$80,"I0,2,0",-1 * Font Open fnt,name,hi
- dc.w L_FontSet,-1
- dc.b "font se","t"+$80,"I0",-1 * Font Set fnt
- dc.w L_FontCloseA,-1
- dc.b "!font clos","e"+$80,"I",-2 * Font Close
- dc.w L_FontCloseB,-1
- dc.b $80,"I0",-1 * Font Close fnt
- dc.w -1,L_FontName
- dc.b "font name","$"+$80,"20",-1 * =Font Name$(fnt)
- dc.w -1,L_FontHeight
- dc.b "font heigh","t"+$80,"00",-1 * =Font Height(fnt)
- dc.w -1,L_FontBase
- dc.b "font bas","e"+$80,"00",-1 * =Font Base(fnt)
- ;DeviceCmd
- dc.w -1,L_DriveState
- dc.b "drive stat","e"+$80,"00",-1 * =Drive State drv
- dc.w -1,L_DevState
- dc.b "dev stat","e"+$80,"02",-1 * =Dev State("dev")
- dc.w L_DriveBusy,-1
- dc.b "drive bus","y"+$80,"I0,0",-1 * Drive Busy drv,arg
- ;SpecialCmd
- dc.w -1,L_Vectorptr
- dc.b "vectorpt","r"+$80,"0",-1 * =Vectorptr
- dc.w L_Hardreset,-1
- dc.b "hardrese","t"+$80,"I",-1 * Hardreset
- dc.w L_Softreset,-1
- dc.b "softrese","t"+$80,"I",-1 * Softreset
- dc.w L_Flush,-1
- dc.b "flus","h"+$80,"I",-1 * Flush
- dc.w -1,L_AvailFree
- dc.b "avail fre","e"+$80,"0",-1 * =Avail Free
- dc.w L_OpenWorkbench,-1
- dc.b "open workbenc","h"+$80,"I",-1 * Open Workbench
- dc.w -1,L_Workbench
- dc.b "workbenc","h"+$80,"0",-1 * Workbench
- dc.w -1,L_AmosState
- dc.b "amos stat","e"+$80,"0",-1 * =Amos State
- dc.w L_AmcafCrackOn,-1
- dc.b "amcaf crack o","n"+$80,"I",-1 * Amcaf Crack On
- dc.w L_AmcafCrackOff,-1
- dc.b "amcaf crack of","f"+$80,"I",-1 * Amcaf Crack Off
- dc.w -1,L_CDPath
- dc.b "cd path","$"+$80,"2",-1 * =Cd Path$
- dc.w L_CDSet,-1
- dc.b "cd se","t"+$80,"I2",-1 * Cd Set path
- dc.w L_CDParent,-1
- dc.b "cd paren","t"+$80,"I",-1 * Cd Parent
- ;ExtPackerCmd
- dc.w L_XpkPack,-1
- dc.b "xpk pac","k"+$80,"I0,2,0",-1 * Xpk Pack bk,SLIB,mode
- dc.w L_XpkCrypt,-1
- dc.b "xpk cryp","t"+$80,"I0,2,2",-1 * Xpk Crypt bk,SLIB,pwd
- dc.w -1,L_LpkLength
- dc.b "lpk lengt","h"+$80,"00",-1 * =Lpk Length(bk)
- dc.w L_LpkPack,-1
- dc.b "lpk pac","k"+$80,"I0",-1 * Lpk Pack bk
- dc.w L_LpkUnpack,-1
- dc.b "lpk unpac","k"+$80,"I0",-1 * Lpk Unpack bk
- ;ExtBankCmd
- dc.w L_BankToChip,-1
- dc.b "bank to chi","p"+$80,"I0",-1 * Bank To Chip bk
- ;ExtFileCmd
- dc.w -1,L_FileProtection
- dc.b "file protectio","n"+$80,"02",-1 * =File Protecton(file)
- dc.w 0
- **************************************************************************
- * START OF LIBRARY
- *-------------------------------------------------------------------------
- C_Lib
- **************************************************************************
- * COLD START
- *-------------------------------------------------------------------------
- L0 PUSHM a3-a6
- lea ET(pc),a3
- move.l a3,ExtAdr+ExtNb*16(a5)
- lea ExpDef(pc),a0
- move.l a0,ExtAdr+ExtNb*16+4(a5) ;Default & Run Reset
- lea ExpEnd(pc),a0
- move.l a0,ExtAdr+ExtNb*16+8(a5) ;End Reset
- POPM a3-a6
- moveq #ExtNb,d0
- rts
- *
- ExpDef
- ExpEnd DLOAD a3
- Rbsr L_PpkLibClose
- Rbsr L_XpkLibClose
- Rbsr L_DpkLibClose
- Rbsr L_LpkLibClose
- Rbsr L_FntLibClose
- Rbra L_RsEraseAll
- *
- **************************************************************************
- * GLOBAL EXPLODE TABLE
- *-------------------------------------------------------------------------
- ET ds.b ET_SIZEOF ;NEVER EVER CHANGE THIS LINE!!!
- * AmosBank Names
- my_BkNameData dc.b "Data "
- my_BkNameWork dc.b "Work "
- **************************************************************************
- * EXPLODE$
- * EXPLODE BASE
- * EXTENSION BASE(#ext)
- * EXTENSION$ (#ext)
- *-------------------------------------------------------------------------
- L_Explode equ 1
- L1 lea .1(pc),a0
- move.l a0,d3
- moveq #2,d2
- rts
- .1 dc.w 43
- EXPLODE
- VERSION
- even
- *
- L_ExpBase equ 2
- L2 DLOAD a0
- move.l a0,d3
- moveq #0,d2
- rts
- *
- L_Extension equ 3
- L3 move.l (a3)+,d0 ;Ext
- move.l ChVide(a5),d3 ;Immer Leer-String
- lsl.l #2,d0
- lea AdTokens(a5),a0
- movea.l (a0,d0.l),a0
- move.l -16(a0),d0
- ble.s .Skip ;Ext nicht verfügbar
- movea.l d0,a0
- movea.l d0,a1
- .1 tst.b (a1)+
- bne.s .1
- suba.l d0,a1
- move.l a1,d3
- subq.l #1,d3
- Rbsr L_GetSpace
- .2 move.b (a0)+,(a1)+
- bne.s .2
- .Skip moveq #2,d2 ;Stringmodus
- rts
- *
- L_ExtBase equ 4
- L4 move.l (a3)+,d0
- moveq #0,d3
- subq.l #1,d0
- blt.s .Skip
- lsl.l #4,d0
- lea ExtAdr(a5),a0
- move.l (a0,d0.l),d3
- .Skip moveq #0,d2
- rts
- **************************************************************************
- * CLEAR MOUSE
- * PAUSE (#ticks)
- * STOP LOOP
- * WAIT LOOP
- * WAIT MOUSE
- *-------------------------------------------------------------------------
- L_ClearMouse equ 5
- L5 Rjsr L_Tests
- SyCall MouseKey
- tst.w d1
- Rbne L_ClearMouse
- rts
- *
- L_Pause equ 6
- L6 move.l (a3)+,d7 ;Ticks
- .1 SyCall WaitVbl
- Rjsr L_Tests
- SyCall Inkey
- tst.w d1
- bne.s .2
- SyCall MouseKey
- tst.w d1
- bne.s .2
- dbne d7,.1
- .2 moveq #0,d3
- move.w d1,d3
- moveq #0,d2
- cmpi.w #3,d3
- bgt.s .Skip
- neg.l d3
- .Skip rts
- *
- L_StopLoop equ 7
- L7 Rjsr L_Tests
- SyCall Inkey
- tst.l d1 ;auch AMIGA-Keys gültig
- bne.s .Skip
- SyCall MouseKey
- tst.w d1
- bne.s .Skip
- btst #7,$BFE001 ;Joystick Feuerknopf
- Rbne L_StopLoop
- .Skip rts
- *
- L_WaitLoop equ 8
- L8 Rjsr L_Tests
- SyCall Inkey
- tst.w d1
- bne.s .1
- SyCall MouseKey
- tst.w d1
- Rbeq L_WaitLoop
- .1 moveq #0,d3
- move.w d1,d3 ;keine AMIGA-Keys
- moveq #0,d2
- cmpi.w #3,d3 ;Maustaste ?
- bgt.s .Skip ;nein
- neg.l d3 ;negrieren
- .Skip rts
- *
- L_WaitMouse equ 9
- L9 Rjsr L_Tests
- SyCall MouseKey
- tst.w d1
- Rbeq L_WaitMouse
- rts
- **************************************************************************
- * FILE PATH$ ($file)
- * FILE BLOCKS ($file)
- * FILE SIZE ($file)
- * FILE TYPE ($file)
- * HOF (#channel)
- *-------------------------------------------------------------------------
- L_FilePath equ 10
- L10 movea.l (a3)+,a0 ;File
- move.w (a0)+,d0
- subq.w #1,d0
- cmpi.w #128,d0
- Rbcc L_IFunc
- movea.l Name1(a5),a1
- .1 move.b (a0)+,(a1)+
- dbra d0,.1
- clr.b (a1)
- Rjsr L_Dsk.PathIt
- movea.l Name1(a5),a0
- clr.l d0
- .2 tst.b (a0)+
- beq.s .3
- addq.l #1,d0
- bra.s .2
- .3 move.l d0,d3
- Rbsr L_GetSpace
- movea.l Name1(a5),a0
- .4 move.b (a0)+,(a1)+
- dbra d0,.4
- moveq #2,d2
- rts
- *
- L_FileBlocks equ 11
- L11 DLOAD a2
- move.l (a3)+,my_FileName(a2)
- Rbsr L_GetFileInfo
- move.l my_FileBlocks(a2),d3 ;-1 = Fehler
- moveq #0,d2
- rts
- *
- L_FileSize equ 12
- L12 DLOAD a2
- move.l (a3)+,my_FileName(a2)
- Rbsr L_GetFileInfo
- move.l my_FileSize(a2),d3 ;-1 = Fehler
- moveq #0,d2
- rts
- *
- L_FileType equ 13
- L13 DLOAD a2
- move.l (a3)+,my_FileName(a2)
- Rbsr L_GetFileInfo
- moveq #0,d3 ;0 = Nicht gefunden
- tst.l my_FileType(a2)
- beq.s .Skip
- moveq #-1,d3 ;-1 = Datei
- tst.l my_FileType(a2)
- blt.s .Skip
- moveq #-2,d3 ;-2 = Device
- .Skip moveq #0,d2
- rts
- *
- L_Hof equ 14
- L14 move.l (a3)+,d3 ;Channel
- cmpi.l #10,d3
- Rbcc L_IFunc
- subq.l #1,d3
- Rbmi L_IFunc
- mulu #TFiche,d3
- lea Fichiers(a5),a2
- adda.w d3,a2
- move.l FhA(a2),d3
- Rbeq L_FNopen
- moveq #0,d2
- rts
- **************************************************************************
- * HARD TIME$
- * HARD DATE$
- * SET HARD TIME $hh:mm:ss
- * SET HARD DATE $dd-mm-yy
- *-------------------------------------------------------------------------
- L_HardTime equ 15
- L15 lea $DC0000,a0
- move.b #":",d0
- Rbra L_HardTimeDate
- *
- L_HardDate equ 16
- L16 lea $DC0018,a0
- move.b #"-",d0
- Rbsr L_HardTimeDate
- movea.l d3,a0
- move.w 2(a0),d0
- move.w 8(a0),2(a0)
- move.w d0,8(a0)
- rts
- *
- L_SetHardTime equ 17
- L17 movea.l (a3)+,a0 ;HH:MM:SS
- cmpi.w #8,(a0)+
- Rbne L_IFunc
- lea $DC0017,a1
- Rbra L_SetTimeDate
- *
- L_SetHardDate equ 18
- L18 movea.l (a3)+,a0 ;DD-MM-YY
- cmpi.w #8,(a0)+
- Rbne L_IFunc
- movea.l Name1(a5),a1
- move.l (a0),(a1)
- move.l 4(a0),4(a1)
- move.w (a0),6(a1)
- move.w 6(a0),(a1)
- movea.l a1,a0
- lea $DC002F,a1
- Rbra L_SetTimeDate
- **************************************************************************
- * BANK LOAD $file [TO bk] [,#mask]
- * BANK SAVE $file,bk
- * BANK AS WORK bk
- * BANK AS DATA bk
- * BANK FREE (bkmin)
- * BANK CLONE bk TO bk
- * NUMBER (start(#))
- * FINISH (bk)
- * IMAGE SWAP bk,#image,#image
- * IMAGE WIDTH (bk,#image)
- * IMAGE HEIGHT (bk,#image)
- *-------------------------------------------------------------------------
- L_BankLoadA equ 19
- L19 DLOAD a0
- clr.l my_FileMsk(a0) ;Mask
- move.l #my_BkDefault,my_FileBnk(a0) ;Bank
- move.l (a3)+,my_FileName(a0) ;File
- Rbra L_BankLoad
- L_BankLoadB equ 20
- L20 DLOAD a0
- move.l (a3)+,my_FileMsk(a0)
- move.l (a3)+,my_FileName(a0)
- move.l #my_BkDefault,my_FileBnk(a0)
- Rbra L_BankLoad
- L_BankLoadC equ 21
- L21 DLOAD a0
- clr.l my_FileMsk(a0)
- move.l (a3)+,my_FileBnk(a0)
- move.l (a3)+,my_FileName(a0)
- Rbra L_BankLoad
- L_BankLoadD equ 22
- L22 DLOAD a0
- move.l (a3)+,my_FileMsk(a0)
- move.l (a3)+,my_FileBnk(a0)
- move.l (a3)+,my_FileName(a0)
- Rbra L_BankLoad
- *
- L_BankSave equ 23
- L23 move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- move.w my_BkFlag(a0),d0
- btst #Bnk_BitBob,d0
- Rbne L_IFunc
- btst #Bnk_BitIcon,d0
- Rbne L_IFunc
- move.l my_BkLength(a0),d3
- move.l a0,d6 ;BkAdr -> D6
- movea.l (a3)+,a0 ;File
- move.w (a0)+,d0
- subq.w #1,d0
- cmpi.w #128,d0
- Rbcc L_IFunc
- movea.l Name1(a5),a1
- .1 move.b (a0)+,(a1)+
- dbra d0,.1
- clr.b (a1)
- Rjsr L_Dsk.PathIt
- PUSH a6
- move.l Name1(a5),d1
- move.l #MODE_NEWFILE,d2
- DOS Open
- move.l d0,d7 ;Handle -> d7
- beq.s .2 ;Fehler aufgetreten ?
- move.l d7,d1 ;Handle
- move.l d6,d2 ;BkAdr
- subi.l #my_BkHeader,d3 ;BkLen ohne Header
- move.l d3,d4 ;Überprüfen
- LIB Write
- move.l d0,d3
- move.l d7,d1
- LIB Close
- cmp.l d3,d4
- beq.s .Skip
- .2 POP a6
- Rbra L_IOError
- .Skip POP a6
- rts
- *
- L_BankAsWork equ 24
- L24 move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- move.w my_BkFlag(a0),d0
- bclr #Bnk_BitData,d0
- move.w d0,my_BkFlag(a0)
- cmpi.l #"Data",my_BkName(a0)
- bne.s .Skip
- move.l #"Work",my_BkName(a0)
- .Skip rts
- *
- L_BankAsData equ 25
- L25 move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- move.w my_BkFlag(a0),d0
- bset #Bnk_BitData,d0
- move.w d0,my_BkFlag(a0)
- cmpi.l #"Work",my_BkName(a0)
- bne.s .Skip
- move.l #"Data",my_BkName(a0)
- .Skip rts
- *
- L_BankFree equ 26
- L26 move.l (a3)+,d0 ;BkMin
- Rbsr L_Bnk.GetFree
- move.l d0,d3
- moveq #0,d2
- rts
- *
- L_BankClone equ 27
- L27 move.l (a3)+,d7 ;Bk
- move.l (a3)+,d0 ;Bk to clone
- Rjsr L_Bnk.OrAdr
- move.w my_BkFlag(a0),d0
- btst #Bnk_BitBob,d0
- Rbne L_IFunc
- btst #Bnk_BitIcon,d0
- Rbne L_IFunc
- move.l a0,d6
- move.l d7,d0
- move.w my_BkFlag(a0),d1
- ext.l d1
- move.l my_BkLength(a0),d2
- subi.l #my_BkHeader,d2
- lea my_BkName(a0),a0
- Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- movea.l a0,a1
- movea.l d6,a0
- move.l my_BkLength(a0),d0
- subi.l #my_BkHeader,d0
- SYS $4.w,CopyMem
- rts
- *
- L_Number equ 28
- L28 move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- move.l my_BkNumber(a0),d3
- moveq #0,d2
- rts
- *
- L_Finish equ 29
- L29 move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- move.l a0,d3
- add.l my_BkLength(a0),d3
- subi.l #my_BkHeader,d3
- moveq #0,d2
- rts
- *
- L_ImageSwap equ 30
- L30 move.l (a3)+,d6 ;Image 2
- move.l (a3)+,d7 ;Image 1
- move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- move.w my_BkFlag(a0),d0
- btst #Bnk_BitBob,d0
- bne.s .1
- btst #Bnk_BitIcon,d0
- beq.s .Skip
- .1 cmp.w (a0),d6 ;Image definiert?
- bgt.s .Skip
- cmp.w (a0)+,d7
- bgt.s .Skip
- subq.l #1,d6
- blt.s .Skip ;< 0
- subq.l #1,d7
- blt.s .Skip
- lsl.l #3,d6 ;× 8
- lsl.l #3,d7
- move.l (a0,d6),d0 ;Adr. Image
- move.l 4(a0,d6),d1 ;Msk. Image
- move.l (a0,d7),(a0,d6)
- move.l 4(a0,d7),4(a0,d6)
- move.l d0,(a0,d7)
- move.l d1,4(a0,d7)
- .Skip rts
- *
- L_ImageWidth equ 31
- L31 move.l (a3)+,d7 ;Image
- move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- moveq #0,d3
- move.w my_BkFlag(a0),d0
- btst #Bnk_BitBob,d0
- bne.s .1
- btst #Bnk_BitIcon,d0
- beq.s .Skip
- .1 cmp.w (a0)+,d7 ;Image definiert ?
- bgt.s .Skip
- subq.l #1,d7
- blt.s .Skip ;< 0
- lsl.l #3,d7 ;× 8
- movea.l (a0,d7),a0 ;Adr. v. Image
- move.w (a0),d3 ;Breite / 16
- lsl.l #4,d3 ;Breite × 16
- .Skip moveq #0,d2
- rts
- *
- L_ImageHeight equ 32
- L32 move.l (a3)+,d7 ;Image
- move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- moveq #0,d3
- move.w my_BkFlag(a0),d0
- btst #Bnk_BitBob,d0
- bne.s .1
- btst #Bnk_BitIcon,d0
- beq.s .Skip
- .1 cmp.w (a0)+,d7
- bgt.s .Skip
- subq.l #1,d7
- blt.s .Skip
- lsl.l #3,d7
- movea.l (a0,d7),a0
- move.w 2(a0),d3 ;Höhe
- .Skip moveq #0,d2
- rts
- **************************************************************************
- * PINV$ (#)
- * PSAD$ (#)
- * PUND$ (#)
- * PCPN$ (#)
- * PJAM$ (#)
- * PCSR$ (#)
- * PDEF$
- * FORMAT$ ($fmtstring,#fmtbk)
- *-------------------------------------------------------------------------
- L_Pinv equ 33
- L33 move.b #"I",d0
- Rbra L_PrtSeq
- *
- L_Psad equ 34
- L34 move.b #"S",d0
- Rbra L_PrtSeq
- *
- L_Pund equ 35
- L35 move.b #"U",d0
- Rbra L_PrtSeq
- *
- L_Pcpn equ 36
- L36 move.b #"D",d0
- Rbra L_PrtSeq
- *
- L_Pjam equ 37
- L37 move.b #"W",d0
- Rbra L_PrtSeq
- *
- L_Pcsr equ 38
- L38 move.b #"C",d0
- Rbra L_PrtSeq
- *
- L_Pdef equ 39
- L39 lea .0(pc),a0
- move.l a0,d3
- moveq #2,d2
- rts
- .0 dc.w 24 ;StringLen
- dc.l $1B49301B,$53301B55,$301B5031
- dc.l $1B42301B,$44331B57,$301B4331
- even
- *
- L_Format equ 40
- L40 move.l (a3)+,d0 ;FmtBk
- Rjsr L_Bnk.OrAdr
- movea.l a0,a1
- movea.l (a3)+,a0 ;FmtString
- lea 2(a0),a0 ;^Len() überspringen
- lea .2(pc),a2
- PUSHM a3-a6
- movea.l Name1(a5),a3
- EXE RawDoFmt
- POPM a3-a6
- movea.l Name1(a5),a0
- clr.l d0
- .0 addq.w #1,d0
- tst.b (a0)+
- bne.s .0
- subq.w #1,d0
- move.l d0,d3
- Rbsr L_GetSpace
- movea.l Name1(a5),a0
- .1 move.b (a0)+,(a1)+
- dbra d0,.1
- moveq #2,d2
- rts
- .2 move.b d0,(a3)+
- rts
- **************************************************************************
- * RS STRUCTURE #struc,#size
- * RS START (#struc)
- * RS FINISH (#struc)
- * RS LENGTH (#struc)
- * RS CLEAR #struc
- * RS FILL #struc,#count,#ascii
- * RS BYTE #struc,#byte
- * RS WORD #struc,#word
- * RS LONG #struc,#long
- * RS APTR #struc,$string
- * RS CHAR #struc,$string
- * RS SET #struc,#offset
- * RS BSET #struc,#bytes
- * RS WSET #struc,#words
- * RS LSET #struc,#longs
- * RS ERASE [#struc]
- * RS (#struc)
- *-------------------------------------------------------------------------
- L_RsStructure equ 41
- L41 move.l (a3)+,d6 ;Size
- move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- tst.l my_RsStart(a0)
- beq.s .1
- movea.l my_RsStart(a0),a1
- move.l my_RsLength(a0),d0
- Rjsr L_RamFree
- .1 move.l d6,d0
- Rjsr L_RamFast
- Rbeq L_OOfmem
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l d0,my_RsStart(a0)
- move.l d6,my_RsLength(a0)
- move.l d0,my_RsPosition(a0)
- rts
- *
- L_RsStart equ 42
- L42 move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsStart(a0),d3
- Rbeq L_IFunc
- moveq #0,d2
- rts
- *
- L_RsFinish equ 43
- L43 move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsStart(a0),d3
- Rbeq L_IFunc
- add.l my_RsLength(a0),d3
- moveq #0,d2
- rts
- *
- L_RsLength equ 44
- L44 move.l (a3)+,d7 ;Struc
- moveq.l #0,d3
- cmpi.l #my_RsMax,d7
- bge.s .Skip
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsLength(a0),d3
- .Skip moveq #0,d2
- rts
- *
- L_RsClear equ 45
- L45 move.l (a3)+,d0 ;Struc
- cmpi.l #my_RsMax,d0
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d0
- XLEA my_RsStruc,a0
- adda.l d0,a0
- movea.l my_RsStart(a0),a1
- move.l my_RsLength(a0),d0
- subq.l #1,d0
- .0 clr.b (a1)+
- dbra d0,.0
- rts
- *
- L_RsFill equ 46
- L46 move.l (a3)+,d5 ;AscII
- move.l (a3)+,d6 ;Count
- move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsPosition(a0),d0
- Rbeq L_IFunc
- movea.l d0,a1
- .1 cmp.l my_RsLength(a0),d6
- bge.s .2
- move.b d5,(a1)+
- dbeq d6,.1
- .2 move.l a1,my_RsPosition(a0)
- rts
- *
- L_RsByte equ 47
- L47 move.l (a3)+,d6 ;Byte
- move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsPosition(a0),d0
- Rbeq L_IFunc
- movea.l d0,a1
- move.b d6,(a1)+
- move.l a1,my_RsPosition(a0)
- rts
- *
- L_RsWord equ 48
- L48 movea.l a3,a2 ;Word (Adr)
- lea 4(a3),a3
- move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsPosition(a0),d0
- Rbeq L_IFunc
- movea.l d0,a1
- move.b 2(a2),(a1)+ ;Auch ungerade Adresse
- move.b 3(a2),(a1)+
- move.l a1,my_RsPosition(a0)
- rts
- *
- L_RsLong equ 49
- L49 movea.l a3,a2 ;Long (Adr)
- lea 4(a3),a3
- move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsPosition(a0),d0
- Rbeq L_IFunc
- movea.l d0,a1
- REPT 4
- move.b (a2)+,(a1)+ ;Auch ungerade Adresse
- ENDR
- move.l a1,my_RsPosition(a0)
- rts
- *
- L_RsAptr equ 50
- L50 move.l (a3)+,d6 ;String
- move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- tst.l my_RsPosition(a0)
- Rbeq L_IFunc
- movea.l d6,a2
- move.w (a2)+,d0
- beq.s .Skip
- moveq.l #0,d3
- move.w d0,d3
- addq.w #1,d3 ;+ 1 für NULL
- Rbsr L_GetSpace
- move.l a1,d3 ;Ohne Len()
- .1 move.b (a2)+,(a1)+
- dbeq d0,.1
- clr.b (a1)
- movea.l my_RsPosition(a0),a2
- move.l d3,(a2)+
- move.l a2,my_RsPosition(a0)
- .Skip rts
- *
- L_RsChar equ 51
- L51 move.l (a3)+,d6 ;String
- move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsPosition(a0),d0
- Rbeq L_IFunc
- movea.l d0,a1
- movea.l d6,a2
- move.w (a2)+,d0
- beq.s .Skip
- .1 move.b (a2)+,(a1)+
- dbeq d0,.1
- move.l a1,my_RsPosition(a0)
- .Skip rts
- *
- L_RsSet equ 52
- L52 move.l (a3)+,d6 ;Offset
- move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsStart(a0),d0
- Rbeq L_IFunc
- add.l d6,d0
- move.l d0,my_RsPosition(a0)
- rts
- *
- L_RsBset equ 53
- L53 move.l (a3)+,d6 ;Bytes
- move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsPosition(a0),d0
- Rbeq L_IFunc
- add.l d6,d0
- move.l d0,my_RsPosition(a0)
- rts
- *
- L_RsWset equ 54
- L54 move.l (a3)+,d6 ;Words
- move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsPosition(a0),d0
- Rbeq L_IFunc
- lsl.l #1,d6 ;Words x 2
- add.l d6,d0
- move.l d0,my_RsPosition(a0)
- rts
- *
- L_RsLset equ 55
- L55 move.l (a3)+,d6 ;Longs
- move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsPosition(a0),d0
- Rbeq L_IFunc
- lsl.l #2,d6 ;Longs x 4
- add.l d6,d0
- move.l d0,my_RsPosition(a0)
- rts
- *
- L_RsEraseA equ 56
- L56 Rbra L_RsEraseAll
- L_RsEraseB equ 57
- L57 move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- bge.s .Skip
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- movea.l my_RsStart(a0),a1
- move.l my_RsLength(a0),d0
- beq.s .Skip
- clr.l my_RsStart(a0)
- clr.l my_RsLength(a0)
- clr.l my_RsPosition(a0)
- Rjmp L_RamFree
- .Skip rts
- *
- L_Rs equ 58
- L58 move.l (a3)+,d7 ;Struc
- cmpi.l #my_RsMax,d7
- Rbge L_IFunc
- mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a0
- adda.l d7,a0
- move.l my_RsPosition(a0),d3
- Rbeq L_IFunc
- sub.l my_RsStart(a0),d3
- moveq #0,d2
- rts
- **************************************************************************
- * BYTE ($byte)
- * BYTE$ (#byte)
- * WORD ($word)
- * WORD$ (#word)
- * LONG ($long)
- * LONG$ (#long)
- * LSL.B (#byte,#)
- * LSL.W (#word,#)
- * LSL.L (#long,#)
- * LSR.B (#byte,#)
- * LSR.W (#word,#)
- * LSR.L (#long,#)
- * EVEN (#)
- * ODD (#)
- * ALIGN (#,#align)
- *-------------------------------------------------------------------------
- L_ByteA equ 59
- L59 movea.l (a3)+,a0 ;Byte$
- moveq.l #0,d3
- move.b 2(a0),d3
- moveq #0,d2
- rts
- *
- L_ByteB equ 60
- L60 move.l (a3)+,d0 ;Byte
- moveq #1,d3
- Rbsr L_GetSpace ;D3 = StrPtr
- move.b d0,(a1)
- moveq #2,d2
- rts
- *
- L_WordA equ 61
- L61 movea.l (a3)+,a0 ;Word$
- moveq.l #0,d3
- move.w 2(a0),d3
- moveq #0,d2
- rts
- *
- L_WordB equ 62
- L62 move.l (a3)+,d0 ;Word
- moveq #2,d3
- Rbsr L_GetSpace
- move.w d0,(a1)
- moveq #2,d2
- rts
- *
- L_LongA equ 63
- L63 movea.l (a3)+,a0 ;Long$
- move.l 2(a0),d3
- moveq #0,d2
- rts
- *
- L_LongB equ 64
- L64 moveq #4,d3
- Rbsr L_GetSpace
- move.l (a3)+,(a1) ;Long
- moveq #2,d2
- rts
- *
- L_LslB equ 65
- L65 move.l (a3)+,d3
- move.l (a3)+,d2
- lsl.b d2,d3
- moveq #0,d2
- rts
- *
- L_LslW equ 66
- L66 move.l (a3)+,d3
- move.l (a3)+,d2
- lsl.w d2,d3
- moveq #0,d2
- rts
- *
- L_LslL equ 67
- L67 move.l (a3)+,d3
- move.l (a3)+,d2
- lsl.l d2,d3
- moveq #0,d2
- rts
- *
- L_LsrB equ 68
- L68 move.l (a3)+,d3
- move.l (a3)+,d2
- lsr.b d2,d3
- moveq #0,d2
- rts
- *
- L_LsrW equ 69
- L69 move.l (a3)+,d3
- move.l (a3)+,d2
- lsr.w d2,d3
- moveq #0,d2
- rts
- *
- L_LsrL equ 70
- L70 move.l (a3)+,d3
- move.l (a3)+,d2
- lsr.l d2,d3
- moveq #0,d2
- rts
- *
- L_Even equ 71
- L71 move.l (a3)+,d0
- moveq #0,d3
- btst #0,d0
- bne.s .Skip
- moveq #-1,d3
- .Skip moveq #0,d2
- rts
- *
- L_Odd equ 72
- L72 move.l (a3)+,d0
- moveq #0,d3
- btst #0,d0
- beq.s .Skip
- moveq #-1,d3
- .Skip moveq #0,d2
- rts
- *
- L_Align equ 73
- L73 move.l (a3)+,d0 ;Align
- move.l (a3)+,d1 ;Variabel
- tst.l d0
- Rbeq L_IFunc ;/0 dann Fehler
- move.l d1,d3
- divs d0,d1
- swap d1
- andi.l #$FFFF,d1
- tst.l d1
- beq.s .Skip
- add.l d0,d3
- sub.l d1,d3
- .Skip moveq #0,d2
- rts
- **************************************************************************
- * BPK UNPACK bk
- * BPK LENGTH (bk)
- * DPK UNPACK bk
- * DPK NAME$ (bk)
- * IPK LENGTH (bk)
- * PPK PACK bk [,#efficiency]
- * PPK UNPACK bk [,$password]
- * PPK LENGTH (bk)
- * PPK MODE (bk)
- * PPK TYPE (bk)
- * PPK NAME$ (bk)
- * PPK PASSKEY (bk)
- * PPK PASSWORD (bk,$password)
- * PPK DATA bk [,$password]
- * XPK LENGTH (bk)
- * XPK NAME$ (bk)
- * XPK UNPACK bk [,$password]
- * XPK ERRN
- * XPK ERR$
- *-------------------------------------------------------------------------
- L_BpkUnpack equ 74
- L74 move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- Rbsr L_GetBpkLen
- move.l d0,d2
- beq Bk9 ;Kein ByteKiller Format
- move.l a0,d6
- moveq #0,d1
- DLEA my_BkNameWork,a0
- moveq #1,d0
- Rbsr L_Bnk.GetFree
- Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- movea.l a0,a1 ;DBk -> A1
- movea.l d6,a0 ;SBk -> A0
- PUSHM a0-a6/d0-d7
- cmpi.l #$61766532,$4C(a0) ;Ausführbar?
- bne.s .1 ;Nein!
- lea 234(a0),a0 ;ExecHeader überspringen
- .1 move.l (a0)+,d0
- move.l (a0)+,d1
- move.l (a0)+,d5
- movea.l a1,a2
- adda.l d0,a0
- adda.l d1,a2
- move.l -(a0),d0
- eor.l d0,d5
- Bk1 lsr.l #1,d0
- bne.s .1
- bsr.s Bk7
- .1 bcs.s Bk4
- moveq #8,d1
- moveq #1,d3
- lsr.l #1,d0
- bne.s .2
- bsr.s Bk7
- .2 bcs.s Bk5
- moveq #3,d1
- clr.w d4
- Bk2 bsr.s Bk8
- move.w d2,d3
- add.w d4,d3
- .1 moveq #7,d1
- .2 lsr.l #1,d0
- bne.s .3
- bsr.s Bk7
- .3 roxl.l #1,d2
- dbra d1,.2
- move.b d2,-(a2)
- dbra d3,.1
- bra.s Bk6
- Bk3 moveq #8,d1
- moveq #8,d4
- bra.s Bk2
- Bk4 moveq #2,d1
- bsr.s Bk8
- cmpi.b #2,d2
- blt.s .1
- cmpi.b #3,d2
- beq.s Bk3
- moveq #8,d1
- bsr.s Bk8
- move.w d2,d3
- move.w #$C,d1
- bra.s Bk5
- .1 move.w #9,d1
- add.w d2,d1
- addq.w #2,d2
- move.w d2,d3
- Bk5 bsr.s Bk8
- .1 subq.w #1,a2
- move.b (a2,d2.w),(a2)
- dbra d3,.1
- Bk6 cmpa.l a2,a1
- blt.s Bk1
- POPM a0-a6/d0-d7
- Rbra L_Bnk.HeadClone
- Bk7 move.l -(a0),d0
- eor.l d0,d5
- move.w #$10,CCR
- roxr.l #1,d0
- rts
- Bk8 subq.w #1,d1
- clr.w d2
- .1 lsr.l #1,d0
- bne.s .2
- move.l -(a0),d0
- eor.l d0,d5
- move.w #$10,CCR
- roxr.l #1,d0
- .2 roxl.l #1,d2
- dbra d1,.1
- Bk9 rts
- *
- L_BpkLength equ 75
- L75 move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- Rbsr L_GetBpkLen
- move.l d0,d3
- moveq #0,d2
- rts
- *
- L_DpkUnpack equ 76
- L76 move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- move.l a0,d6 ;BkSAdr
- move.l my_BkLength(a0),d7 ;BkSLen
- subi.l #my_BkHeader,d7
- Rbsr L_DpkLibOpen
- PUSHM a3/a6
- DLOAD a2
- movea.l my_DpkLibBase(a2),a6
- LIB dlAllocItem
- movea.l d0,a3 ;DcTagItem -> A3
- move.l d6,(a3) ;BkSAdr
- move.l d7,22(a3) ;BkSLen
- movea.l a3,a0
- LIB dlInitItem
- tst.l d0
- beq.s .Skip
- movea.l a3,a0
- LIB dlDecrunch
- tst.l d0
- beq.s .Skip
- movea.l d6,a0
- move.l my_BkNumber(a0),d0
- moveq #0,d1 ;Work+Fast
- move.l 12(a3),d2 ;BkLen ungepackt -> D2
- DLEA my_BkNameWork,a0
- Rjsr L_Bnk.Reserve
- beq.s .1
- movea.l a0,a1
- movea.l 8(a3),a0 ;entpackte BereichsAdr.
- move.l 12(a3),d0 ;entpackte Byteanzahl
- SYS $4.w,CopyMem
- .1 movea.l 8(a3),a1 ;Decrunchbuffer
- move.l 16(a3),d0 ;DecrunchbufferLen
- SYS $4.w,FreeMem
- .Skip movea.l a3,a0
- LIB dlFreeItem
- POPM a3/a6
- rts
- *
- L_DpkName equ 77
- L77 move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- move.l a0,d6 ;BkSAdr
- Rbsr L_DpkLibOpen
- PUSHM a3/a6
- DLOAD a2
- movea.l my_DpkLibBase(a2),a6
- LIB dlAllocItem
- movea.l d0,a3 ;DcTagItem -> A3
- move.l d6,(a3) ;BkSAdr
- movea.l a3,a0 ;DcTagItem -> A0
- LIB dlInitItem
- move.l ChVide(a5),d3 ;Leer-String falls ungepackt
- tst.l d0
- beq.s .Skip ;Nicht/unbekannt gepackt
- movea.l 4(a3),a0 ;Adr. v. Packername
- moveq.l #-1,d0
- .1 addq.l #1,d0
- tst.b (a0)+
- bne.s .1
- move.l d0,d3
- Rbsr L_GetSpace
- movea.l 4(a3),a0
- .2 move.b (a0)+,(a1)+
- dbra d0,.2
- .Skip movea.l a3,a0
- LIB dlFreeItem
- POPM a3/a6
- moveq #2,d2
- rts
- *
- L_IpkLength equ 78
- L78 move.l (a3)+,d0
- Rjsr L_Bnk.OrAdr
- moveq #0,d3
- cmpi.l #"IMP!",(a0) ;ID_IMPLODER Bk
- bne.s .Skip ;No imploded data
- move.l 4(a0),d3 ;ExplodedLen
- .Skip moveq #0,d2
- rts
- *
- L_PpkPackA equ 79
- L79 DLOAD a2
- move.l (a3)+,my_PpkSrc(a2)
- move.l #2,my_PpkPackMode(a2) ;Default - Good [2]
- Rbra L_PpkPack
- L_PpkPackB equ 80
- L80 DLOAD a2
- move.l (a3)+,my_PpkPackMode(a2) ;Efficiency
- move.l (a3)+,my_PpkSrc(a2)
- Rbra L_PpkPack
- *
- L_PpkUnpackA equ 81
- L81 DLOAD a2
- move.l (a3)+,my_PpkSrc(a2)
- movea.l Name1(a5),a1
- clr.b (a1) ;Kein Passwort
- Rbra L_PpkUnpack
- L_PpkUnpackB equ 82
- L82 DLOAD a2
- movea.l (a3)+,a0 ;Passwort - Version: Passwort
- move.w (a0)+,d0 ;PasswortLen
- subq.w #1,d0
- cmpi.w #128,d0
- Rbcc L_IFunc
- movea.l Name1(a5),a1
- .1 move.b (a0)+,(a1)+ ;Passwort installieren
- dbra d0,.1
- clr.b (a1)
- move.l (a3)+,my_PpkSrc(a2)
- Rbra L_PpkUnpack
- *
- L_PpkLength equ 83
- L83 DLOAD a2
- move.l (a3)+,my_PpkSrc(a2)
- Rbsr L_GetPpkLen
- move.l d0,d3
- moveq #0,d2
- rts
- *
- L_PpkMode equ 84
- L84 move.l (a3)+,d0
- Rjsr L_Bnk.OrAdr
- Rbsr L_PpkID
- moveq #my_PpkKnow-1,d2
- .1 move.l my_PpkCodePos(a1),d0
- move.l my_PpkCode(a1),d1
- cmp.l (a0,d0.l),d1 ;pp/x.Bk ?
- beq.s .2 ;Ja !
- lea my_PpkSIZEOF(a1),a1
- dbeq d2,.1
- moveq #-1,d3 ;Nicht pp/x.Gepackt
- bra.s .Skip
- .2 move.l my_PpkEffPos(a1),d0
- Rbsr L_PpkID
- lea my_PpkEffMode(a1),a1
- moveq #4,d2
- moveq #0,d3
- .3 move.l (a1)+,d1 ;pp/x.Effizienz Code
- cmp.l (a0,d0.l),d1
- beq.s .Skip
- addq #1,d3
- dbeq d2,.3
- .Skip moveq #0,d2
- rts
- *
- L_PpkType equ 85
- L85 move.l (a3)+,d0
- Rjsr L_Bnk.OrAdr
- Rbsr L_PpkID
- moveq #my_PpkKnow-1,d2
- .1 move.l my_PpkType(a1),d3
- move.l my_PpkCodePos(a1),d0
- move.l my_PpkCode(a1),d1
- cmp.l (a0,d0.l),d1
- beq.s .Skip
- lea my_PpkSIZEOF(a1),a1
- dbeq d2,.1
- moveq #0,d3
- .Skip moveq #0,d2
- rts
- *
- L_PpkName equ 86
- L86 move.l (a3)+,d0
- Rjsr L_Bnk.OrAdr
- Rbsr L_PpkID
- movea.l a1,a2
- moveq #my_PpkKnow-1,d2
- .1 move.l my_PpkCodePos(a2),d0
- move.l my_PpkCode(a2),d1
- cmp.l (a0,d0.l),d1
- beq.s .2
- lea my_PpkSIZEOF(a2),a2
- dbeq d2,.1
- move.l ChVide(a5),d3
- bra.s .Skip
- .2 moveq #4,d3
- Rbsr L_GetSpace
- move.l (a2),(a1)
- .Skip moveq #2,d2
- rts
- *
- L_PpkPasskey equ 87
- L87 move.l (a3)+,d0
- Rjsr L_Bnk.OrAdr
- Rbsr L_PpkID
- moveq #0,d3
- moveq #my_PpkKnow-1,d2
- .1 move.l my_PpkCodePos(a1),d0
- move.l my_PpkCode(a1),d1
- cmp.l (a0,d0.l),d1
- beq.s .2
- lea my_PpkSIZEOF(a1),a1
- dbeq d2,.1
- bra.s .Skip
- .2 move.l my_PpkCryptPos(a1),d0
- beq.s .Skip ;Keine pp.Crypt Bk
- move.w (a0,d0.l),d3 ;px.PassKey
- .Skip moveq #0,d2
- rts
- *
- L_PpkPassword equ 88
- L88 movea.l (a3)+,a0 ;Passwort
- move.w (a0)+,d0 ;PasswortLen
- subq.w #1,d0
- cmpi.w #128,d0
- Rbcc L_IFunc
- movea.l Name1(a5),a1
- .1 move.b (a0)+,(a1)+ ;Passwort installieren
- dbra d0,.1
- clr.b (a1)
- move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- Rbsr L_PxPassKey ;D3 = True oder False
- moveq #0,d2
- rts
- *
- L_PpkDataA equ 89
- L89 DLOAD a2
- move.l (a3)+,my_PpkSrc(a2) ;Bk
- Rbra L_PpkTransform
- L_PpkDataB equ 90
- L90 DLOAD a2
- movea.l (a3)+,a0 ;Passwort
- move.w (a0)+,d0
- subq.w #1,d0
- cmpi.w #128,d0
- Rbcc L_IFunc
- movea.l Name1(a5),a1
- .1 move.b (a0)+,(a1)+
- dbra d0,.1
- clr.b (a1)
- move.l (a3)+,my_PpkSrc(a2) ;Bk
- Rbra L_PpkTransform
- *
- L_XpkLength equ 91
- L91 move.l (a3)+,d0
- Rjsr L_Bnk.OrAdr
- moveq #0,d2
- moveq #0,d3
- cmpi.l #"XPKF",(a0) ;ID_XPK Bk
- bne.s .Skip ;Not compressed
- move.l 12(a0),d3 ;Unpacked len
- .Skip rts
- *
- L_XpkName equ 92
- L92 move.l (a3)+,d0
- Rjsr L_Bnk.OrAdr
- moveq #2,d2
- move.l ChVide(a5),d3
- cmpi.l #"XPKF",(a0)
- bne.s .Skip ;Not compressed
- moveq #4,d3
- Rbsr L_GetSpace
- move.l 8(a0),(a1) ;ID_XPK_COMPRESSOR
- .Skip rts
- *
- L_XpkUnpackA equ 93
- L93 DLOAD a2
- move.l (a3)+,my_XpkSrc(a2)
- clr.l my_XpkPassWord(a2)
- Rbra L_XpkUnpack
- L_XpkUnpackB equ 94
- L94 DLOAD a2
- movea.l (a3)+,a0
- move.w (a0)+,d0
- move.l (a3)+,my_XpkSrc(a2)
- subq.w #1,d0
- cmpi.w #128,d0
- Rbcc L_IFunc
- movea.l Name1(a5),a1
- .0 move.b (a0)+,(a1)+ ;Passwort installieren
- dbra d0,.0
- clr.b (a1)
- move.l Name1(a5),my_XpkPassWord(a2)
- Rbra L_XpkUnpack
- *
- L_XpkErrn equ 95
- L95 DLOAD a2
- move.l my_XpkErrNum(a2),d3
- moveq #0,d2
- rts
- *
- L_XpkErrs equ 96
- L96 XLEA my_XpkErrMsg,a0
- moveq #-1,d0
- .1 addq.w #1,d0
- tst.b (a0)+
- bne.s .1
- XLEA my_XpkErrLen,a0
- move.w d0,(a0) ;APStrLen
- move.l a0,d3
- moveq #2,d2
- rts
- **************************************************************************
- * RASTPORT
- * PLANE MASK #plane,#mask
- * PLANE CLEAR #plane
- * PLANE GET #plane TO bk
- * PLANE PUT bk TO #plane
- * PLANE LENGTH
- * PLANE COPY #plane TO #plane
- * PLANE SWAP #plane,#plane
- * PLANE NEGATIVE#plane
- * PLANE MERGE #plane TO #plane
- * PLANE CLOSE #plane [TO #plane]
- * PLANE OPEN #plane [TO #plane]
- * PLANE ACTIVE (#plane)
- * IFF BANK bk TO #screen
- * ------------------------------------------------------------------------
- L_RastPort equ 97
- L97 move.l T_RastPort(a5),d3
- moveq #0,d2
- rts
- *
- L_PlaneMask equ 98
- L98 move.l (a3)+,d6 ;Mask
- move.l (a3)+,d7 ;Plane
- cmpi.l #EcMaxPlans,d7 ;> 6 ?
- bpl.s .Skip
- tst.l ScOnAd(a5) ;Screen geöffnet
- Rbeq L_SNopen ;Nein
- lsl.l #2,d7 ;PlanePtr × 4
- movea.l T_RastPort(a5),a1
- movea.l rp_BitMap(a1),a1
- move.l bm_Planes(a1,d7.l),d7
- beq.s .Skip ;Nicht vorhanden
- moveq #0,d0
- moveq #0,d1
- move.w bm_BytesPerRow(a1),d0
- move.w bm_Rows(a1),d1
- mulu d1,d0 ;Planegröße = Breite × Linien
- movea.l d7,a0 ;Source
- lsr.l #2,d0 ;/ 4
- subq #1,d0
- .1 or.l d6,(a0)+ ;Maske installieren
- dbra d0,.1
- .Skip rts
- *
- L_PlaneClear equ 99
- L99 move.l (a3)+,d0
- cmpi.l #EcMaxPlans,d0
- bpl.s .Skip
- tst.l ScOnAd(a5) ;Screen geöffnet
- Rbeq L_SNopen ;Nein
- lsl.l #2,d0
- movea.l T_RastPort(a5),a0
- movea.l rp_BitMap(a0),a0
- move.l bm_Planes(a0,d0.l),d1 ;PlanePtr
- beq.s .Skip
- moveq #0,d0
- move.w bm_BytesPerRow(a0),d0
- mulu bm_Rows(a0),d0 ;AnzBytes löschen
- movea.l d1,a1
- moveq #0,d1 ;Flags
- SYS T_GfxBase(a5),BltClear
- .Skip rts
- *
- L_PlaneGet equ 100
- L100 move.l (a3)+,d0 ;Bk
- move.l (a3)+,d7 ;Plane
- cmpi.l #EcMaxPlans,d7
- bpl.s .Skip
- tst.l ScOnAd(a5)
- Rbeq L_SNopen
- lsl.l #2,d7
- movea.l T_RastPort(a5),a0
- movea.l rp_BitMap(a0),a0
- move.l bm_Planes(a0,d7.l),d7
- beq.s .Skip
- moveq #0,d1
- moveq #0,d2
- move.w bm_BytesPerRow(a0),d1
- move.w bm_Rows(a0),d2
- mulu d1,d2
- move.l d2,d6
- moveq #0,d1
- DLEA my_BkNameWork,a0
- Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- movea.l a0,a1
- movea.l d7,a0
- move.l d6,d0
- SYS $4.w,CopyMem
- .Skip rts
- *
- L_PlanePut equ 101
- L101 move.l (a3)+,d7 ;Plane
- move.l (a3)+,d0 ;Bk
- cmpi.l #EcMaxPlans,d7
- bpl.s .Skip
- tst.l ScOnAd(a5)
- Rbeq L_SNopen
- Rjsr L_Bnk.OrAdr
- move.l a0,d6 ;BkAdr
- move.l my_BkLength(a0),d5
- subi.l #my_BkHeader,d5 ;BkLen
- lsl.l #2,d7
- movea.l T_RastPort(a5),a1
- movea.l rp_BitMap(a1),a1
- move.l bm_Planes(a1,d7.l),d7
- beq.s .Skip
- moveq #0,d0
- moveq #0,d1
- move.w bm_BytesPerRow(a1),d0
- move.w bm_Rows(a1),d1
- mulu d1,d0
- cmp.l d0,d5 ;Max. Datentransfer
- ble.s .1 ;Ok
- move.l d0,d5
- .1 movea.l d6,a0 ;Source
- move.l d5,d0 ;Bytes
- movea.l d7,a1 ;Dest
- SYS $4.w,CopyMem
- .Skip rts
- *
- L_PlaneLength equ 102
- L102 moveq #0,d3
- tst.l ScOnAd(a5)
- beq.s .Skip
- movea.l T_RastPort(a5),a0
- movea.l rp_BitMap(a0),a0
- moveq #0,d2
- moveq #0,d3
- move.w bm_BytesPerRow(a0),d2
- move.w bm_Rows(a0),d3
- mulu d2,d3
- .Skip moveq #0,d2
- rts
- *
- L_PlaneCopy equ 103
- L103 move.l (a3)+,d6 ;Destplane
- move.l (a3)+,d7 ;Sourceplane
- cmpi.l #EcMaxPlans,d6
- bpl.s .Skip
- cmpi.l #EcMaxPlans,d7
- bpl.s .Skip
- tst.l ScOnAd(a5)
- Rbeq L_SNopen
- movea.l T_RastPort(a5),a0
- movea.l rp_BitMap(a0),a0
- lsl.l #2,d6
- lsl.l #2,d7
- move.l bm_Planes(a0,d6.l),d6
- beq.s .Skip
- move.l bm_Planes(a0,d7.l),d7
- beq.s .Skip
- cmp.l d6,d7
- beq.s .Skip
- moveq #0,d0
- moveq #0,d1
- move.w bm_BytesPerRow(a0),d0
- move.w bm_Rows(a0),d1
- mulu d1,d0
- movea.l d7,a0
- movea.l d6,a1
- SYS $4.w,CopyMem
- .Skip rts
- *
- L_PlaneSwap equ 104
- L104 move.l (a3)+,d6 ;PlaneA
- move.l (a3)+,d7 ;PlaneB
- cmpi.l #EcMaxPlans,d6
- bpl.s .Skip
- cmpi.l #EcMaxPlans,d7
- bpl.s .Skip
- tst.l ScOnAd(a5) ;Screen geöffnet
- Rbeq L_SNopen ;Nein!
- movea.l T_RastPort(a5),a0
- movea.l rp_BitMap(a0),a0 ;BitMap Struktur
- lsl.l #2,d6
- lsl.l #2,d7
- move.l bm_Planes(a0,d6.l),d6 ;PAdr. PlaneA
- beq.s .Skip
- move.l bm_Planes(a0,d7.l),d7 ;PAdr. PlaneB
- beq.s .Skip
- cmp.l d6,d7
- beq.s .Skip
- moveq #0,d0
- moveq #0,d1
- move.w bm_BytesPerRow(a0),d0 ;Bytes in X (/8)
- move.w bm_Rows(a0),d1 ;Zeilen
- mulu d1,d0 ;Bytegröße
- lsr.l #2,d0
- subq #1,d0
- movea.l d6,a0
- movea.l d7,a1
- .1 move.l (a0),d1
- move.l (a1),(a0)+
- move.l d1,(a1)+
- dbra d0,.1
- .Skip rts
- *
- L_PlaneNegative equ 105
- L105 move.l (a3)+,d7
- cmpi.l #EcMaxPlans,d7
- bpl.s .Skip
- tst.l ScOnAd(a5)
- Rbeq L_SNopen
- lsl.l #2,d7
- movea.l T_RastPort(a5),a1
- movea.l rp_BitMap(a1),a1
- move.l bm_Planes(a1,d7.l),d7
- beq.s .Skip
- moveq #0,d0
- moveq #0,d1
- move.w bm_BytesPerRow(a1),d0
- move.w bm_Rows(a1),d1
- mulu d1,d0
- movea.l d7,a0
- lsr.l #2,d0
- subq #1,d0
- .1 not.l (a0)+ ;Negativ erstellen
- dbra d0,.1
- .Skip rts
- *
- L_PlaneMerge equ 106
- L106 move.l (a3)+,d6 ;Plane für Ausgabe
- move.l (a3)+,d7 ;Plane für Merge
- cmpi.l #EcMaxPlans,d6
- bpl.s .Skip
- cmpi.l #EcMaxPlans,d7
- bpl.s .Skip
- tst.l ScOnAd(a5)
- Rbeq L_SNopen
- movea.l T_RastPort(a5),a0
- movea.l rp_BitMap(a0),a0
- lsl.l #2,d6
- lsl.l #2,d7
- move.l bm_Planes(a0,d6.l),d6
- beq.s .Skip
- move.l bm_Planes(a0,d7.l),d7
- beq.s .Skip
- cmp.l d6,d7
- beq.s .Skip
- moveq #0,d0
- moveq #0,d1
- move.w bm_BytesPerRow(a0),d0
- move.w bm_Rows(a0),d1
- mulu d1,d0
- lsr.l #2,d0
- subq #1,d0
- movea.l d6,a0
- movea.l d7,a1
- .1 move.l (a1)+,d1
- or.l d1,(a0)+ ;Plane mergen
- dbra d0,.1
- .Skip rts
- *
- L_PlaneCloseA equ 107
- L107 move.l (a3)+,d0
- cmpi.l #EcMaxPlans,d0
- bpl.s .Skip
- movea.l T_RastPort(a5),a0
- bclr d0,rp_Mask(a0)
- .Skip rts
- L_PlaneCloseB equ 108
- L108 move.l (a3)+,d0
- move.l (a3)+,d1
- cmpi.l #EcMaxPlans,d0
- bpl.s .Skip
- cmpi.l #EcMaxPlans,d1
- bpl.s .Skip
- movea.l T_RastPort(a5),a0
- cmp.l d1,d0
- bge.s .1
- exg.l d0,d1
- .1 sub.l d1,d0
- .2 bclr d1,rp_Mask(a0)
- addq.l #1,d1
- dbeq d0,.2
- .Skip rts
- *
- L_PlaneOpenA equ 109
- L109 move.l (a3)+,d0
- cmpi.l #EcMaxPlans,d0
- bpl.s .Skip
- movea.l T_RastPort(a5),a0
- bset d0,rp_Mask(a0)
- .Skip rts
- L_PlaneOpenB equ 110
- L110 move.l (a3)+,d0
- move.l (a3)+,d1
- cmpi.l #EcMaxPlans,d0
- bpl.s .Skip
- cmpi.l #EcMaxPlans,d1
- bpl.s .Skip
- movea.l T_RastPort(a5),a0
- cmp.l d1,d0
- bge.s .1
- exg.l d0,d1
- .1 sub.l d1,d0
- .2 bset d1,rp_Mask(a0)
- addq.l #1,d1
- dbeq d0,.2
- .Skip rts
- *
- L_PlaneActive equ 111
- L111 move.l (a3)+,d0
- moveq #0,d3
- cmpi.l #EcMaxPlans,d0
- bpl.s .Skip
- move.l d0,d1
- lsl.l #2,d1
- movea.l T_RastPort(a5),a0
- movea.l rp_BitMap(a0),a1
- tst.l bm_Planes(a1,d1.l) ;Plane vorhanden?
- beq.s .Skip ;Nein
- btst d0,rp_Mask(a0) ;Plane closed?
- beq.s .Skip ;Ja
- moveq #-1,d3
- .Skip moveq #0,d2
- rts
- *
- L_IffBank equ 112
- L112 move.l (a3)+,d1 ;Screen
- cmpi.l #8,d1
- Rbcc L_IFunc
- PUSH d1
- move.l (a3)+,d0 ;Bk
- Rjsr L_Bnk.OrAdr
- POP d1
- movea.l a0,a1
- move.l #1024,d0
- .0 cmpi.l #"BMHD",(a1)
- beq.s Chunk0
- adda.l #2,a1
- dbf d0,.0
- Rbne L_NoIff
- Chunk0 lea 8(a1),a1 ;BitMapHeaDer Daten
- moveq.l #0,d2
- moveq.l #0,d3
- moveq.l #0,d4
- moveq.l #0,d5
- moveq.l #0,d6
- move.w (a1),d2 ;Breite
- move.w 2(a1),d3 ;Höhe
- move.b 8(a1),d4 ;Tiefe
- bset d4,d6 ;Faben
- move.b 10(a1),d7 ;Kompression
- cmpi.w #352,d2
- bls.s .0
- cmpi.w #16,d6 ;Zu viel Farben für Hires?
- bgt.s .0 ;Ja, dann Lowres!
- ori.w #V_HIRES,d5
- .0 cmpi.w #300,d3 ;Zu viele Zeilen?
- bls.s Chunk1
- ori.w #V_LACE,d5 ;Ja, dann Laced!
- Chunk1 cmpi.l #"CMAP",(a0)
- bne.s .1
- lea 8(a0),a0
- PUSHM a0/a1/d0-d2
- movea.l Name1(a5),a1
- moveq #31,d2
- .0 moveq.l #0,d0
- move.b (a0)+,d0 ;R
- andi.b #$F0,d0
- lsl.w #4,d0
- moveq.l #0,d1
- move.b (a0)+,d1 ;G
- andi.b #$F0,d1
- or.w d1,d0
- moveq.l #0,d1
- move.b (a0)+,d1 ;B
- andi.b #$F0,d1
- lsr.b #4,d1
- or.w d1,d0
- move.w d0,(a1)+
- dbra d2,.0
- POPM a0/a1/d0-d2
- .1 cmpi.l #"CAMG",(a0)
- bne.s .2
- move.w 10(a0),d5 ;ViewMode
- .2 cmpi.l #"ABIT",(a0)
- bne.s .3
- move.b #my_IFFACBM,d7
- bra.s .4
- .3 cmpi.l #"BODY",(a0)
- beq.s .4
- adda.l #2,a0 ;Chunks weitersuchen
- bra.s Chunk1
- .4 PUSHM a0-a6/d2/d7
- cmpi.w #64,d6
- bne.s .5
- btst #7,d5 ;EXTRA HALFBRIGHT?
- bne.s .5 ;Ja!
- ori.w #V_HAM,d5
- .5 andi.w #%1000100010000100,d5 ;Nur AMOS-gültige Flags
- movea.l Name1(a5),a1 ;Farb-Palette -> A1
- moveq.l #0,d7
- move.w d2,d7 ;Test ob Breite/16
- ext.l d7
- divs #16,d7
- swap d7 ;Rest ermitteln
- tst.w d7 ;Rest vorhanden?
- Rbne L_IScrn ;Illegaler Parameter
- .6 EcCall Cree
- Rbne L_OOfmem
- move.l a0,ScOnAd(a5)
- move.w EcNumber(a0),ScOn(a5)
- addq.w #1,ScOn(a5)
- lea CsrOff(pc),a1
- WiCall Print ;Cursor ausstellen
- POPM a0-a6/d2/d7
- lsr.w #3,d2 ;Breite/8 (BytesPerRow)
- PUSHM a3-a6
- lea 8(a0),a4 ;Body-Daten -> A4
- movea.l T_RastPort(a5),a3
- movea.l rp_BitMap(a3),a3
- cmpi.b #my_IFFNORM,d7
- beq.s IffRaw
- cmpi.b #my_IFFCMPR,d7
- beq.s IffRle
- cmpi.b #my_IFFACBM,d7
- beq.s IffAcb
- bra IffEnd
- IffRaw move.w d2,d5 ;BytesPerRow
- move.w bm_Rows(a3),d6
- ext.l d5
- moveq.l #0,d3
- .1 moveq.l #bm_Planes,d4
- .2 move.l (a3,d4.l),d0
- beq.s .3
- movea.l a4,a0
- add.l d3,d0
- movea.l d0,a1
- move.l d5,d0
- EXE CopyMem
- adda.l d5,a4
- addq.l #4,d4
- bra.s .2
- .3 subq.w #1,d6
- beq.s IffEnd
- add.l d5,d3
- bra.s .1
- IffRle lea bm_Planes(a3),a0
- movea.l Name1(a5),a1
- .1 move.l (a0)+,(a1)+ ;BitMap Zeiger kopieren
- bne.s .1
- move.w bm_Rows(a3),d6
- .2 move.b bm_Depth(a3),d5
- movea.l Name1(a5),a1
- .3 movea.l (a1),a0
- move.w d2,d1 ;BytesPerRow
- .4 move.b (a4)+,d0
- bmi.s .6
- .5 move.b (a4)+,(a0)+
- subq.w #1,d1
- subq.b #1,d0
- bpl.s .5
- bra.s .8
- .6 neg.b d0
- bmi.s .4
- move.b (a4)+,d3
- .7 move.b d3,(a0)+
- subq.w #1,d1
- subq.b #1,d0
- bpl.s .7
- .8 tst.w d1
- bne.s .4
- move.l a0,(a1)+
- subq.b #1,d5 ;Depth-1
- bne.s .3
- subq.w #1,d6 ;Rows-1
- bne.s .2
- bra.s IffEnd
- IffAcb move.w d2,d7 ;BytesPerRow
- mulu bm_Rows(a3),d7 ;Größe der Planes -> D7
- lea bm_Planes(a3),a2
- .1 movea.l a4,a0 ;Zeiger Grafikdaten
- move.l (a2)+,d0 ;Zeiger BitPlane
- beq.s IffEnd ;Keine weitere Plane
- movea.l d0,a1
- move.l d7,d0
- EXE CopyMem
- adda.l d7,a4
- bra.s .1
- IffEnd POPM a3-a6
- rts
- CsrOff dc.b 27,"C0",0
- even
- **************************************************************************
- * FONT OPEN #fnt,$fontname,#height
- * FONT SET #fnt
- * FONT CLOSE [#fnt]
- * FONT NAME$ (#fnt)
- * FONT HEIGHT (#fnt)
- * FONT BASE (#fnt)
- * ------------------------------------------------------------------------
- L_FontOpen equ 113
- L113 move.l (a3)+,d5 ;Height
- movea.l (a3)+,a0 ;$Fontname
- move.w (a0)+,d0 ;^Len
- move.l (a3)+,d6 ;Fnt
- cmpi.l #my_FntMax,d6 ;Fnt Test
- Rbpl L_IFunc ;Zu hoch
- subq.l #1,d6
- Rbmi L_IFunc ;Zu niedrig
- lsl.l #2,d6 ;x4
- .1 XLEA my_FntStruc,a1 ;A1 <= my_FntStruc
- tst.l (a1,d6.l) ;Fnt schon belegt
- bne.s .Skip ;Ja, my_FntStruc Fnt
- movea.l Name1(a5),a1 ;FontAttr installieren
- move.l a0,ta_Name(a1) ;Fontname
- move.w d5,ta_YSize(a1) ;Fonthöhe
- clr.b ta_Style(a1) ;Stil-Bits
- clr.b ta_Flags(a1) ;Prefs
- movea.l Name1(a5),a0 ;FontAttr
- SYS T_GfxBase(a5),OpenFont ;ROM Font öffnen
- tst.l d0 ;geklappt
- beq.s .2 ;Nein evtl. DiskFont
- XLEA my_FntStruc,a1 ;A1 <= my_FntStruc
- move.l d0,(a1,d6) ;TextFont eintragen
- bra.s .Skip
- .2 Rbsr L_FntLibOpen
- movea.l Name1(a5),a0 ;A0 <= FontAttr
- SYS T_FntBase(a5),OpenDiskFont
- tst.l d0 ;Geklappt?
- beq.s .Skip ;Nein!
- XLEA my_FntStruc,a0 ;A0 <= my_FntStruc
- move.l d0,(a0,d6.l) ;TextFont eintragen
- .Skip rts
- *
- L_FontSet equ 114
- L114 move.l (a3)+,d0 ;Fnt - Nicht SET FONT!
- cmpi.l #my_FntMax,d0
- Rbpl L_IFunc
- subq.l #1,d0
- Rbmi L_IFunc
- lsl.l #2,d0
- XLEA my_FntStruc,a0
- move.l (a0,d0.l),d0 ;Fnt installiert
- beq.s .Skip ;Nein
- movea.l d0,a0 ;A0 <= TextFnt
- movea.l T_RastPort(a5),a1 ;A1 <= RastPort
- SYS T_GfxBase(a5),SetFont ;Fnt aktivieren
- .Skip rts
- *
- L_FontCloseA equ 115
- L115 XLEA my_FntStruc,a0 ;A0 <= FntList
- moveq #my_FntMax-1,d3 ;max. Fnt-1 für dbra
- .1 move.l (a0),d0 ;D0 <= TextFnt
- clr.l (a0)+
- tst.l d0
- beq.s .2 ;Nicht installiert
- movea.l d0,a1 ;A1 <= TextFnt
- SYS T_GfxBase(a5),CloseFont ;Fnt schließen
- .2 dbra d3,.1
- rts
- L_FontCloseB equ 116
- L116 move.l (a3)+,d0 ;Fnt
- cmpi.l #my_FntMax,d0
- Rbpl L_IFunc
- subq.l #1,d0
- Rbmi L_IFunc
- lsl.l #2,d0
- XLEA my_FntStruc,a1
- move.l (a1,d0.l),d1 ;D1 <= TextFnt
- beq.s .Skip ;Nicht installiert
- clr.l (a1,d0.l) ;FntNb austragen
- movea.l d1,a1 ;A1 <= TextFnt
- SYS T_GfxBase(a5),CloseFont ;Fnt schließen
- .Skip rts
- *
- L_FontName equ 117
- L117 move.l (a3)+,d0 ;Fnt
- move.l ChVide(a5),d3 ;Immer Leerstring
- cmpi.l #my_FntMax,d0
- Rbpl L_IFunc
- subq.l #1,d0
- Rbmi L_IFunc
- lsl.l #2,d0
- XLEA my_FntStruc,a0
- move.l (a0,d0.l),d0 ;Fnt installiert
- beq.s .Skip ;Nein
- movea.l d0,a0
- movea.l 10(a0),a0 ;Zeiger auf FntName
- PUSH a0
- moveq #0,d0
- .1 addq.w #1,d0
- tst.b (a0)+
- bne.s .1
- subq.l #1,d0
- move.l d0,d3
- Rbsr L_GetSpace ;A1/D3 <= Varptr
- POP a0
- .2 move.b (a0)+,(a1)+
- dbra d0,.2
- .Skip moveq #2,d2
- rts
- *
- L_FontHeight equ 118
- L118 move.l (a3)+,d0
- moveq #0,d3 ;Def => 0
- cmpi.l #my_FntMax,d0
- Rbpl L_IFunc
- subq.l #1,d0
- Rbmi L_IFunc
- lsl.l #2,d0
- XLEA my_FntStruc,a0
- move.l (a0,d0.l),d0 ;Fnt installiert
- beq.s .Skip ;Nein
- movea.l d0,a0
- move.w 20(a0),d3 ;Fnt Höhe
- .Skip moveq #0,d2
- rts
- *
- L_FontBase equ 119
- L119 move.l (a3)+,d0
- moveq #0,d3
- cmpi.l #my_FntMax,d0
- Rbpl L_IFunc
- subq.l #1,d0
- Rbmi L_IFunc
- lsl.l #2,d0
- XLEA my_FntStruc,a0
- move.l (a0,d0.l),d3 ;FontBase (TextFont Struktur)
- .Skip moveq #0,d2
- rts
- **************************************************************************
- * DRIVE STATE (#drive)
- * DEV STATE ($device)
- * DRIVE BUSY #drive,#argument
- *-------------------------------------------------------------------------
- L_DriveState equ 120
- L120 PUSH a6
- moveq #0,d3
- suba.l a1,a1
- EXE FindTask
- lea DiskRep(pc),a0
- move.l d0,16(a0)
- movea.l Name1(a5),a1 ;StdIOBuffer
- move.l a0,14(a1)
- lea TrackName(pc),a0
- move.l (a3)+,d0 ;Nummer des Laufwerk (0-3)
- moveq #0,d1
- LIB OpenDevice
- tst.l d0
- bne.s .Skip ; 0 = nicht angeschlossen
- moveq #-1,d3 ;-1 = angeschlossen
- move.w #TD_CHANGESTATE,IO_COMMAND(a1)
- LIB DoIO
- tst.l IO_ACTUAL(a1) ;False = eingelegt
- bne.s .1 ;nein
- subq #1,d3 ;-2 = Disk ist eingelegt
- move.w #TD_PROTSTATUS,IO_COMMAND(a1)
- LIB DoIO
- tst.l IO_ACTUAL(a1) ;False = nicht schreibgeschützt
- bne.s .1
- subq #1,d3 ;-3 = nicht schreibgeschützt
- .1 move.w #TD_MOTOR,IO_COMMAND(a1)
- move.l #0,IO_LENGTH(a1)
- LIB DoIO
- LIB CloseDevice
- .Skip moveq #0,d2
- POP a6
- rts
- DiskRep ds.b 32
- TrackName TD_NAME
- *
- L_DevState equ 121
- L121 movea.l (a3)+,a0
- move.w (a0)+,d0
- subq.w #1,d0
- cmpi.w #128,d0
- Rbcc L_IFunc
- movea.l Name1(a5),a1
- .1 move.b (a0)+,(a1)+
- dbra d0,.1
- clr.b (a1)
- Rjsr L_Dsk.PathIt
- PUSH a6
- move.l Name1(a5),d1
- moveq #ACCESS_READ,d2
- DOS Lock
- moveq #0,d3 ;False (0) = default
- move.l d0,d7 ;FileLock -> D7
- beq.s .Skip ;Disk nicht vorhanden (0)
- move.l d7,d1 ;Lock
- move.l Name1(a5),d2
- LIB Info ;Informationen ermitteln
- movea.l Name1(a5),a1 ;InfoBlk -> A1
- moveq #-1,d3 ;Status -1
- cmpi.l #ID_WRITE_PROTECTED,8(a1)
- beq.s .2
- moveq #-2,d3 ;Status -2
- cmpi.l #ID_VALIDATING,8(a1)
- beq.s .2
- moveq #-3,d3 ;Beschreibbar -3
- .2 move.l d7,d1 ;Lock
- LIB UnLock ;freigeben
- .Skip moveq #0,d2 ;Integerwert
- POP a6
- rts
- *
- L_DriveBusy equ 122
- L122 PUSH a6
- move.l (a3)+,d7 ;Argument
- move.l (a3)+,d6 ;Laufwerk
- addi.l #48,d6
- lea DFx(pc),a0
- move.b d6,2(a0)
- move.l a0,d1
- DOS DeviceProc
- move.l d0,d6
- beq.s .Skip
- suba.l a1,a1
- EXE FindTask
- move.l d0,d5
- addi.l #$5C,d5
- movea.l Name1(a5),a0
- movea.l Name1(a5),a1
- lea $14(a0),a0
- move.l a0,10(a1)
- move.l a1,(a0)
- move.l d5,4(a0)
- move.l #$1F,8(a0)
- move.l d7,$14(a0)
- movea.l d6,a0
- LIB PutMsg
- movea.l d5,a0
- LIB WaitPort
- movea.l d5,a0
- LIB GetMsg
- .Skip POP a6
- rts
- DFx dc.b "DFx:",0
- even
- **************************************************************************
- * VECTORPTR
- * HARDRESET
- * SOFTRESET
- * FLUSH
- * AVAIL FREE
- * OPEN WORKBENCH
- * WORKBENCH
- * AMOS STATE
- * AMCAF CRACK ON
- * AMCAF CRACK OFF
- * CD PATH$
- * CD SET $path
- * CD PARENT
- * XPK PACK bk,$lib,mode
- * XPK CRYPT bk,$lib,$password
- * LPK LENGTH bk
- * LPK PACK bk
- * LPK UNPACK bk
- * BANK TO CHIP bk
- *-------------------------------------------------------------------------
- L_Vectorptr equ 123
- L123 movea.l $4.w,a0
- move.l ColdCapture(a0),d3
- bne.s .Skip
- move.l CoolCapture(a0),d3
- bne.s .Skip
- move.l WarmCapture(a0),d3
- bne.s .Skip
- move.l KickMemPtr(a0),d3
- bne.s .Skip
- move.l KickTagPtr(a0),d3
- bne.s .Skip
- move.l KickCheckSum(a0),d3
- .Skip moveq #0,d2
- rts
- *
- L_Hardreset equ 124
- L124 movea.l $4.w,a6
- move.w #$4000,$DFF09A
- move.l #$AAAABBBB,d1
- move.l d1,$24(a6)
- move.l d1,$26(a6)
- move.l d1,$3E(a6)
- move.l d1,$4E(a6)
- move.l d1,$52(a6)
- move.l d1,$22A(a6)
- cmpi.w #$24,$14(a6)
- blt.s .1
- jmp -726(a6)
- .1 lea .2(pc),a5
- jsr -30(a6)
- cnop 0,4
- .2 movea.l #$1000000,a0
- suba.l -$14(a0),a0
- movea.l 4(a0),a0
- lea -2(a0),a0
- reset
- jmp (a0)
- *
- L_Softreset equ 125
- L125 lea .1(pc),a0
- move.w #$4000,$DFF09A
- move.l a0,$B4.w
- trap #13
- .1 move.w #$2700,sr
- jmp $FC0000
- *
- L_Flush equ 126
- L126 Rbsr L_PpkLibClose
- Rbsr L_XpkLibClose
- Rbsr L_DpkLibClose
- Rbsr L_LpkLibClose
- Rbsr L_FntLibClose
- PUSHM a0-a6/d0-d7
- move.l #$7FFFFFFF,d0
- moveq.l #MEMF_PUBLIC|MEMF_CHIP,d1
- EXE AllocMem
- move.l #$7FFFFFFF,d0
- moveq.l #MEMF_PUBLIC|MEMF_FAST,d1
- EXE AllocMem
- POPM a0-a6/d0-d7
- rts
- *
- L_AvailFree equ 127
- L127 moveq #0,d1
- SYS $4.w,AvailMem
- move.l d0,d3
- moveq #0,d2
- rts
- *
- L_OpenWorkbench equ 128
- L128 PUSH a6
- tst.b WB_Closed(a5) ;Workbench geschlossen
- beq.s .Skip ;nein!
- INT OpenWorkBench
- tst.l d0 ;Workbench geöffnet ?
- beq.s .Skip ;nein!
- LIB RemakeDisplay
- clr.b WB_Closed(a5) ;FLAG! Workbench geöffnet
- .Skip POP a6
- rts
- *
- L_Workbench equ 129
- L129 moveq #0,d3
- moveq #0,d2
- tst.b WB_Closed(a5) ;Workbench geschlossen?
- bne.s .Skip ;False = nein
- moveq #-1,d3 ;True = ja
- .Skip rts
- *
- L_AmosState equ 130
- L130 suba.l a1,a1
- SYS $4.w,FindTask
- movea.l d0,a1
- moveq #0,d3
- tst.l $AC(a1) ;pr_CLI von wo gestartet
- beq.s .Skip ;Workbench - False (0)
- moveq #-1,d3 ;CLI - True (-1)
- .Skip moveq #0,d2
- rts
- *
- L_AmcafCrackOn equ 131
- L131 DLOAD a0
- move.w -22(a5),my_AmcafCrack(a0)
- move.w #1,-22(a5)
- rts
- *
- L_AmcafCrackOff equ 132
- L132 DLOAD a0
- move.w my_AmcafCrack(a0),-22(a5)
- rts
- *
- L_CDPath equ 133
- L133 XLEA my_CdPath,a0
- tst.w (a0)
- bne.s .4
- movea.l Name1(a5),a1
- clr.b (a1)
- Rjsr L_Dsk.PathIt
- movea.l Name1(a5),a0
- clr.l d0
- .1 tst.b (a0)+
- beq.s .2
- addq.w #1,d0
- bra.s .1
- .2 XLEA my_CdPath,a0
- movea.l a0,a1
- move.w d0,(a1)+
- movea.l Name1(a5),a0
- .3 move.b (a0)+,(a1)+
- dbra d0,.3
- .4 XLEA my_CdPath,a0
- move.l a0,d3
- moveq #2,d2
- rts
- *
- L_CDSet equ 134
- L134 movea.l (a3)+,a0 ;Path
- move.w (a0)+,d0
- move.w d0,d1
- subq.w #1,d0
- cmpi.w #my_CdLength,d0
- Rbcc L_IFunc
- XLEA my_CdPath,a1
- adda.l #2,a1
- .1 move.b (a0)+,(a1)+
- dbra d0,.1
- cmpi.b #":",-1(a1)
- beq.s .2
- cmpi.b #"/",-1(a1)
- beq.s .2
- move.b #"/",(a1)
- addq.w #1,d1
- .2 XLEA my_CdPath,a0
- move.w d1,(a0)
- rts
- *
- L_CDParent equ 135
- L135 XLEA my_CdPath,a0
- tst.w (a0)
- beq.s .2
- clr.l d0
- move.w (a0)+,d0
- subq.w #1,d0
- cmpi.b #":",(a0,d0.w)
- beq.s .2
- subq.w #1,d0
- .0 move.b (a0,d0.w),d1
- cmpi.b #"/",d1
- beq.s .1
- cmpi.b #":",d1
- beq.s .1
- dbra d0,.0
- bra.s .2
- .1 addq.w #1,d0
- XLEA my_CdPath,a0
- move.w d0,(a0)
- .2 rts
- *
- L_XpkPack equ 136
- L136 DLOAD a2
- move.l (a3)+,my_XpkMode(a2)
- movea.l (a3)+,a0
- adda.l #2,a0
- move.l a0,my_XpkName(a2)
- move.l (a3)+,my_XpkSrc(a2)
- clr.l my_XpkPassWord(a2)
- Rbra L_XpkWork
- *
- L_XpkCrypt equ 137
- L137 DLOAD a2
- movea.l (a3)+,a0 ;Pwd
- move.w (a0)+,d0 ;PwdLen
- movea.l (a3)+,a1 ;SLIB
- adda.l #2,a1
- move.l a1,my_XpkName(a2)
- move.l (a3)+,my_XpkSrc(a2) ;Bk
- subq.w #1,d0
- cmpi.w #128,d0
- Rbcc L_IFunc
- movea.l Name1(a5),a1
- .0 move.b (a0)+,(a1)+ ;Pwd installieren
- dbra d0,.0
- clr.b (a1)
- move.l Name1(a5),my_XpkPassWord(a2)
- Rbra L_XpkWork
- *
- L_XpkWork equ 138
- L138 Rbsr L_XpkLibOpen
- PUSHM a0-a6/d0-d7
- DLOAD a2
- move.l my_XpkSrc(a2),d0
- Rjsr L_Bnk.OrAdr
- move.l a0,my_XpkSrc(a2)
- move.l my_BkLength(a0),d0
- subi.l #my_BkHeader,d0
- move.l d0,my_XpkSrcSize(a2)
- move.l d0,d2
- lsr.l #5,d2
- add.l d2,d0
- add.l #1024,d0
- move.l d0,my_XpkDstSize(a2)
- Rjsr L_RamFast
- Rbeq L_OOfmem ;MemAdr => D0
- move.l d0,my_XpkDst(a2)
- lea .1(pc),a0
- move.l my_XpkSrc(a2),4(a0) ;Xpk_InBuf
- move.l my_XpkSrcSize(a2),12(a0) ;Xpk_InBufLen
- move.l my_XpkDst(a2),20(a0) ;Xpk_OutBuf
- move.l my_XpkDstSize(a2),28(a0) ;Xpk_OutBufLen
- lea my_XpkOutSize(a2),a1
- move.l a1,36(a0) ;Xpk_GetOutLen
- move.l my_XpkName(a2),44(a0) ;Xpk_PackMethod
- move.l my_XpkMode(a2),52(a0) ;Xpk_Mode
- move.l my_XpkPassWord(a2),60(a0) ;Xpk_Password
- lea my_XpkErrMsg(a2),a1
- move.l a1,68(a0) ;Xpk_GetError
- movea.l my_XpkLibBase(a2),a6
- LIB XpkPack
- move.l d0,my_XpkErrNum(a2)
- tst.l d0
- bne.s .0
- moveq #1,d0
- moveq #0,d1
- move.l my_XpkOutSize(a2),d2
- DLEA my_BkNameWork,a0
- Rbsr L_Bnk.GetFree
- Rjsr L_Bnk.Reserve
- beq.s .0
- move.l a0,d6 ;D6 => DBnk
- movea.l a0,a1
- movea.l my_XpkDst(a2),a0
- move.l my_XpkOutSize(a2),d0
- EXE CopyMem
- movea.l my_XpkSrc(a2),a0 ;SBnk
- movea.l d6,a1 ;DBnk
- Rbsr L_Bnk.HeadClone
- .0 movea.l my_XpkDst(a2),a1
- move.l my_XpkDstSize(a2),d0
- Rjsr L_RamFree
- POPM a0-a6/d0-d7
- rts
- .1 dc.l XPK_InBuf,0 ;4
- dc.l XPK_InLen,0 ;12
- dc.l XPK_OutBuf,0 ;20
- dc.l XPK_OutBufLen,0 ;28
- dc.l XPK_GetOutLen,0 ;36
- dc.l XPK_PackMethod,0 ;44
- dc.l XPK_PackMode,0 ;52
- dc.l XPK_Password,0 ;60
- dc.l XPK_GetError,0 ;68
- dc.l XPK_ShortError
- dc.l XPK_PassThru,-1
- dc.l TAG_DONE
- *
- L_LpkLength equ 139
- L139 move.l (a3)+,d0
- Rjsr L_Bnk.OrAdr
- moveq #0,d2
- moveq #0,d3
- cmpi.l #"LH18",(a0) ;ID_LH Bk
- bne.s .Skip ;Not encoded
- move.l 4(a0),d3 ;lhDecoded len
- .Skip rts
- *
- L_LpkPack equ 140
- L140 move.l (a3)+,d0
- Rjsr L_Bnk.OrAdr
- Rbsr L_LpkLibOpen
- PUSHM a0-a6/d0-d7
- DLOAD a2
- move.l a0,my_LpkSrc(a2)
- moveq #0,d0 ;EncodeBuffer[0] (40000 bytes)
- movea.l my_LpkLibBase(a2),a6
- LIB CreateBuffer
- tst.l d0
- beq .Skip
- move.l d0,my_LpkBuffer(a2)
- movea.l my_LpkBuffer(a2),a0
- movea.l my_LpkSrc(a2),a1
- move.l a1,lh_Src(a0)
- move.l my_BkLength(a1),d0
- subi.l #my_BkHeader,d0
- move.l d0,lh_SrcSize(a0)
- move.l d0,d1 ;SrcSize
- lsr.l #3,d1 ;1/8
- add.l d1,d0 ;addieren
- move.l d0,lh_DstSize(a0)
- move.l d0,my_LpkSize(a2)
- Rjsr L_RamFast
- beq.s .1
- move.l d0,lh_Dst(a0)
- movea.l my_LpkBuffer(a2),a0
- LIB LhEncode
- movea.l my_LpkBuffer(a2),a0
- moveq #1,d0
- moveq #0,d1
- move.l lh_DstSize(a0),d2
- addi.l #my_LpkHeader,d2 ;+Header
- DLEA my_BkNameWork,a0
- Rbsr L_Bnk.GetFree
- Rjsr L_Bnk.Reserve
- beq.s .0
- move.l a0,d6 ;D6 => Dst
- movea.l my_LpkBuffer(a2),a2
- movea.l lh_Dst(a2),a0
- move.l lh_DstSize(a2),d0
- movea.l d6,a1
- move.l #"LH18",(a1)+
- move.l lh_SrcSize(a2),(a1)+
- EXE CopyMem
- DLOAD a2
- movea.l my_LpkSrc(a2),a0 ;SBnk
- movea.l d6,a1 ;DBnk
- Rbsr L_Bnk.HeadClone
- .0 movea.l my_LpkBuffer(a2),a0
- movea.l lh_Dst(a0),a1
- move.l my_LpkSize(a2),d0
- Rjsr L_RamFree
- .1 DLOAD a2
- movea.l my_LpkBuffer(a2),a0
- movea.l my_LpkLibBase(a2),a6
- LIB DeleteBuffer
- .Skip POPM a0-a6/d0-d7
- rts
- *
- L_LpkUnpack equ 141
- L141 move.l (a3)+,d0
- Rjsr L_Bnk.OrAdr
- DLOAD a2
- cmpi.l #"LH18",(a0)
- bne .Skip
- move.l a0,my_LpkSrc(a2)
- move.l #4500,d0
- Rjsr L_RamFast
- beq.s .Skip
- move.l d0,my_LpkAux(a2)
- movea.l my_LpkSrc(a2),a0
- moveq #1,d0
- moveq #0,d1
- move.l 4(a0),d2
- DLEA my_BkNameWork,a0
- Rbsr L_Bnk.GetFree
- Rjsr L_Bnk.Reserve
- beq.s .0
- move.l a0,my_LpkDst(a2)
- movea.l my_LpkSrc(a2),a1
- move.l my_BkLength(a1),d0
- subi.l #my_BkHeader+my_LpkHeader,d0
- move.l d0,my_LpkSize(a2)
- movea.l Name1(a5),a0
- movea.l my_LpkSrc(a2),a1
- lea my_LpkHeader(a1),a1
- move.l a1,(a0)+
- move.l my_LpkSize(a2),(a0)+
- move.l my_LpkDst(a2),(a0)+
- clr.l (a0)+
- move.l my_LpkAux(a2),(a0)+
- clr.l (a0)+
- movea.l Name1(a5),a0
- bsr.s .LhD
- movea.l my_LpkSrc(a2),a0 ;SBnk
- movea.l my_LpkDst(a2),a1 ;DBnk
- Rbsr L_Bnk.HeadClone
- .0 movea.l my_LpkAux(a2),a1
- move.l #4500,d0
- Rjsr L_RamFree
- .Skip rts
- .LhD dc.l $48E73F3E,$48506100,$00902009,$205F90A8,$00082140,$000C4CDF
- dc.l $7CFC4E75
- dcb.w 60,$12DA
- dc.l $6000008A,$48502C68,$0010204E,$43EE0C60,$45EE076E,$70FE7600
- dc.l $72017402,$3E3C013C,$30C132C0,$35039042,$D64251CF,$FFF47C00
- dc.l $2E3C0000,$027A204E,$43EE027A,$45EE0EDA,$47EE076E,$78047402
- dc.l $323C013B,$3018D058,$32C034C6,$36C736C7,$DC44DE42,$51C9FFEE
- dc.l $3281426E,$0C5E2A5F,$2055226D,$00082C6D,$00102A4E,$49EE076E
- dc.l $47EE0C60,$78017A0F,$3C186008,$4447E86F,$9E4412C7,$3E2B04F0
- dc.l $DC466400,$00143E33,$70025BCD,$FFF46B00,$00127A0F,$3C1860E8
- dc.l $3E337000,$5BCDFFE2,$6AF051CD,$00063C18,$7A0F0C6D,$800004F0
- dc.l $67000056,$30347000,$45F50000,$3212D244,$34C1B25A,$633CB25A
- dc.l $62FC598A,$240A948D,$3B920000,$34813233,$00006B04,$39821002
- dc.l $39821000,$36332000,$6B043980,$30023781,$20003980,$30003783
- dc.l $00003034,$200066B8,$60063034,$000066B0,$0C47FE00,$6C00FF66
- dc.l $0C47FD86,$6E024E75,$E15E5F45,$641A7600,$36184843,$4445EBBB
- dc.l $32038206,$48433C03,$4445740F,$DA42600E,$72001206,$420651CD
- dc.l $00063C18,$7A0F3601,$D643363B,$30284242,$14034203,$E44BDC46
- dc.l $D34151CD,$00067A0F,$3C1851CA,$FFF20241,$003F8243,$45D194C1
- dc.l $4EFB707E
- dcb.w 32,$0000
- dcb.w 16,$0101
- dcb.w 16,$0201
- dcb.w 16,$0301
- dcb.w 8,$0402
- dcb.w 8,$0502
- dcb.w 8,$0602
- dcb.w 8,$0702
- dcb.w 8,$0802
- dcb.w 8,$0902
- dcb.w 8,$0A02
- dcb.w 8,$0B02
- dcb.w 4,$0C03
- dcb.w 4,$0D03
- dcb.w 4,$0E03
- dcb.w 4,$0F03
- dcb.w 4,$1003
- dcb.w 4,$1103
- dcb.w 4,$1203
- dcb.w 4,$1303
- dcb.w 4,$1403
- dcb.w 4,$1503
- dcb.w 4,$1603
- dcb.w 4,$1703
- dc.l $18041804,$19041904,$1A041A04,$1B041B04,$1C041C04,$1D041D04
- dc.l $1E041E04,$1F041F04,$20042004,$21042104,$22042204,$23042304
- dc.l $24042404,$25042504,$26042604,$27042704,$28042804,$29042904
- dc.l $2A042A04,$2B042B04,$2C042C04,$2D042D04,$2E042E04,$2F042F04
- dc.l $30053105,$32053305,$34053505,$36053705,$38053905,$3A053B05
- dc.l $3C053D05,$3E053F05
- *
- L_BankToChip equ 142
- L142 move.l (a3)+,d0
- Rjsr L_Bnk.OrAdr
- move.w my_BkFlag(a0),d1
- btst #Bnk_BitChip,d1
- bne.s .Skip
- bset #Bnk_BitChip,d1
- move.w d1,my_BkFlag(a0)
- move.l a0,d6
- moveq #1,d0
- move.l my_BkLength(a0),d2
- subi.l #my_BkHeader,d2
- DLEA my_BkNameWork,a0
- Rbsr L_Bnk.GetFree
- Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- movea.l a0,a1 ;a1 => BkChip
- movea.l d6,a0
- move.l my_BkLength(a0),d0
- subi.l #my_BkHeader,d0
- PUSHM a0/a1/a6
- EXE CopyMem
- POPM a0/a1/a6
- Rbsr L_Bnk.HeadClone
- .Skip rts
- *
- L_FileProtection equ 143
- L143 DLOAD a2
- move.l (a3)+,my_FileName(a2)
- Rbsr L_GetFileInfo
- move.l my_FileProtect(a2),d3
- moveq #0,d2
- rts
- **************************************************************************
- ;Reservierte Offsets für neue AMOSPro Instruktionen
- L144
- L145
- L146
- L147
- L148
- L149
- L150
- L151
- L152
- L153
- L154
- L155
- L156
- L157
- **************************************************************************
- ;Entpacken der Xpk! Funktionen Xpk Pack / Xpk Crypt
- L_XpkUnpack equ 158
- L158 Rbsr L_XpkLibOpen
- PUSHM a0-a6/d0-d7
- DLOAD a2
- move.l my_XpkSrc(a2),d0
- Rjsr L_Bnk.OrAdr
- cmpi.l #"XPKF",(a0)
- bne .Skip
- move.l a0,my_XpkSrc(a2)
- move.l my_BkLength(a0),d0
- subi.l #my_BkHeader,d0
- move.l d0,my_XpkSrcSize(a2)
- move.l 12(a0),d0
- addi.l #XPK_MARGIN,d0
- move.l d0,my_XpkDstSize(a2)
- Rjsr L_RamFast
- Rbeq L_OOfmem
- move.l d0,my_XpkDst(a2)
- lea .1(pc),a0
- move.l my_XpkSrc(a2),4(a0)
- move.l my_XpkSrcSize(a2),12(a0)
- move.l my_XpkDst(a2),20(a0)
- move.l my_XpkDstSize(a2),28(a0)
- lea my_XpkOutSize(a2),a1
- move.l a1,36(a0)
- move.l my_XpkPassWord(a2),44(a0)
- lea my_XpkErrMsg(a2),a1
- move.l a1,52(a0)
- movea.l my_XpkLibBase(a2),a6
- LIB XpkUnpack
- move.l d0,my_XpkErrNum(a2)
- tst.l d0
- bne.s .0
- moveq #1,d0
- moveq #0,d1
- move.l my_XpkOutSize(a2),d2
- DLEA my_BkNameWork,a0
- Rbsr L_Bnk.GetFree
- Rjsr L_Bnk.Reserve
- beq.s .0
- move.l a0,d6 ;D6 => DBnk
- movea.l a0,a1
- movea.l my_XpkDst(a2),a0
- move.l my_XpkOutSize(a2),d0
- EXE CopyMem
- movea.l my_XpkSrc(a2),a0 ;SBnk
- movea.l d6,a1 ;DBnk
- Rbsr L_Bnk.HeadClone
- .0 movea.l my_XpkDst(a2),a1
- move.l my_XpkDstSize(a2),d0
- Rjsr L_RamFree
- .Skip POPM a0-a6/d0-d7
- rts
- .1 dc.l XPK_InBuf,0 ;4
- dc.l XPK_InLen,0 ;12
- dc.l XPK_OutBuf,0 ;20
- dc.l XPK_OutBufLen,0 ;28
- dc.l XPK_GetOutLen,0 ;36
- dc.l XPK_Password,0 ;44
- dc.l XPK_GetError,0 ;52
- dc.l XPK_PassThru,-1
- dc.l XPK_ShortError
- dc.l TAG_DONE
- **************************************************************************
- ;Ausführen der Ppk! Funktionen
- L_PpkUnpack equ 159
- L159 DLOAD a2
- move.l my_PpkSrc(a2),d0
- Rjsr L_Bnk.OrAdr
- move.l a0,my_PpkSrc(a2)
- Rbsr L_PpkTransform
- cmpi.l #"PP20",(a0)
- bne.s .Skip
- move.l a0,d7
- Rbsr L_GetPpkLen
- move.l d0,d2
- beq.s .Skip
- moveq #0,d1
- DLEA my_BkNameWork,a0
- moveq #1,d0
- Rbsr L_Bnk.GetFree
- Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- movea.l a0,a1
- movea.l d7,a0
- move.l my_BkLength(a0),d0
- subi.l #my_BkHeader,d0
- PUSHM a0-a3
- bsr.s Pp0 ;ppDeCrunch: A0=SBk / A1=DBk / D0=SBkLen
- POPM a0-a3
- Rbsr L_Bnk.HeadClone
- .Skip rts
- Pp0 lea 4(a0),a3
- adda.l d0,a0
- movea.l a1,a2
- moveq #1,d5
- moveq #3,d6
- moveq #7,d7
- move.l -(a0),d1
- tst.b d1
- beq.s .1
- bsr.s Pp2
- subq.b #1,d1
- lsr.l d1,d5
- .1 lsr.l #8,d1
- adda.l d1,a2
- Pp1 bsr.s Pp2
- bcs.s Pp5
- moveq #0,d2
- .1 moveq #1,d0
- bsr.s Pp4
- add.w d1,d2
- cmp.w d6,d1
- beq.s .1
- .2 moveq #7,d0
- bsr.s Pp4
- move.b d1,-(a2)
- dbra d2,.2
- cmpa.l a2,a1
- bcs.s Pp5
- rts
- Pp2 lsr.l #1,d5
- beq.s .1
- rts
- .1 move.l -(a0),d5
- roxr.l #1,d5
- rts
- Pp3 subq.w #1,d0
- Pp4 moveq #0,d1
- .1 lsr.l #1,d5
- beq.s .3
- .2 roxl.l #1,d1
- dbra d0,.1
- rts
- .3 move.l -(a0),d5
- roxr.l #1,d5
- bra.s .2
- Pp5 moveq #1,d0
- bsr.s Pp4
- moveq #0,d0
- move.b (a3,d1.w),d0
- move.w d1,d2
- cmp.w d6,d2
- bne.s .3
- bsr.s Pp2
- bcs.s .1
- moveq #7,d0
- .1 bsr.s Pp3
- move.w d1,d3
- .2 moveq #2,d0
- bsr.s Pp4
- add.w d1,d2
- cmp.w d7,d1
- beq.s .2
- bra.s .4
- .3 bsr.s Pp3
- move.w d1,d3
- .4 addq.w #1,d2
- .5 move.b (a2,d3.w),-(a2)
- dbra d2,.5
- cmpa.l a2,a1
- bcs.s Pp1
- rts
- **************************************************************************
- ;Bank Header Clonen
- ;A0 <= SBk
- ;A1 <= DBk
- ;A0 => SBk als DBk ge'cloned'
- L_Bnk.HeadClone equ 160
- L160 PUSH a1
- move.l my_BkNumber(a0),my_BkNumber(a1)
- move.w my_BkFlag(a0),my_BkFlag(a1)
- move.w my_BkFuture(a0),my_BkFuture(a1)
- move.l my_BkName(a0),my_BkName(a1)
- move.l my_BkName+4(a0),my_BkName+4(a1)
- Rjsr L_Bnk.EffA0
- POP a0
- rts
- **************************************************************************
- ;Entpackte Bytelänge einer PP - Bank (Data/Executable)
- ;D0 => Entpackte Bytelänge der Bk - NULL => Kein PP Format
- L_GetPpkLen equ 161
- L161 PUSHM a0/a1/d1-d3
- DLOAD a0
- move.l my_PpkSrc(a0),d0
- Rjsr L_Bnk.OrAdr
- moveq #my_PpkKnow-1,d2
- Rbsr L_PpkID
- .1 move.l my_PpkCodePos(a1),d0
- move.l my_PpkCode(a1),d1
- cmp.l (a0,d0.l),d1
- beq.s .2
- lea my_PpkSIZEOF(a1),a1
- dbeq d2,.1
- moveq #0,d0
- bra.s .Skip
- .2 move.b (a0),d0
- adda.l my_BkLength(a0),a0
- cmpi.b #"P",d0
- beq.s .3
- move.l -24(a0),d0
- bra.s .4
- .3 move.l -20(a0),d0
- .4 lsr.l #8,d0
- .Skip POPM a0/a1/d1-d3
- rts
- **************************************************************************
- ;Typ & Bytelänge einer Datei bestimmen
- L_GetFileInfo equ 162
- L162 PUSHM a0-a2/a6/d0-d6
- DLOAD a2
- clr.l my_FileType(a2)
- clr.l my_FileProtect(a2)
- move.l #-1,my_FileSize(a2)
- move.l #-1,my_FileBlocks(a2)
- movea.l my_FileName(a2),a0
- move.w (a0)+,d0
- subq.w #1,d0
- cmpi.w #128,d0
- Rbcc L_IFunc
- movea.l Name1(a5),a1
- .1 move.b (a0)+,(a1)+
- dbra d0,.1
- clr.b (a1)
- Rjsr L_Dsk.PathIt
- move.l Name1(a5),d1
- moveq #ACCESS_READ,d2
- DOS Lock
- move.l d0,d4 ;D4 = Lock
- beq.s .Skip ;Fehler
- move.l #fib_SIZEOF,d0 ;Speicher für InfoBlk
- Rjsr L_RamChip ;bereitstellen (Chip weil align 4)
- Rbeq L_OOfmem
- move.l d0,d6 ;InfoBlk in D6 sichern
- move.l d4,d1 ;Lock
- move.l d6,d2 ;InfoBlk
- LIB Examine ;FileInfo ermitteln
- movea.l d6,a1 ;InfoBlk in A1
- move.l fib_DirEntryType(a1),my_FileType(a2)
- move.l fib_Protection(a1),my_FileProtect(a2)
- move.l fib_Size(a1),my_FileSize(a2)
- move.l fib_NumBlocks(a1),my_FileBlocks(a2)
- move.l #fib_SIZEOF,d0
- Rjsr L_RamFree
- move.l d4,d1 ;Lock
- LIB UnLock
- .Skip POPM a0-a2/a6/d0-d6
- rts
- **************************************************************************
- ;AMOSPro spezifische Print Sequence erzeugen
- ;D0 <= Sequencecode
- L_PrtSeq equ 163
- L163 move.l (a3)+,d1
- moveq #3,d3
- Rbsr L_GetSpace
- addi.b #"0",d1
- move.b #27,(a1)+ ;Escape
- move.b d0,(a1)+ ;I, S, U, D, W, C
- move.b d1,(a1)+ ;0, 1, ...
- moveq #2,d2 ;Stringmodus
- rts
- **************************************************************************
- ;Freie AMOS Banknummer bestimmen
- ;D0 <= Minimale BkNb
- ;D0 => Freie BkNb
- L_Bnk.GetFree equ 164
- L164 PUSHM a0-a2/d1-d2
- move.l d0,d2
- Rble L_IFunc
- subq.l #1,d2
- .1 addq.l #1,d2
- cmpi.l #$10000,d2
- Rbge L_IFunc
- move.l d2,d0
- Rjsr L_Bnk.GetAdr
- bne.s .1
- POPM a0-a2/d1-d2
- rts
- **************************************************************************
- ;Stringkette reservieren
- ;D3 <= Bytelänge des String
- ;A1 => StrPtr
- ;D3 => Len+StrPtr
- L_GetSpace equ 165
- L165 PUSHM a0/d0
- move.w d3,d0
- andi.w #$FFFE,d3
- addq.w #2,d3
- Rjsr L_Demande
- lea 2(a0,d3.w),a0
- move.l a0,HiChaine(a5)
- move.l a1,d3
- move.w d0,(a1)+
- POPM a0/d0
- rts
- **************************************************************************
- ;Hardware-Uhrzeit/Datum in String wandeln
- ;A0 <= Hardware-Adresse
- ;D0 <= Trennzeichen
- ;D3 => Stringadresse
- L_HardTimeDate equ 166
- L166 movea.l Name1(a5),a1
- lea 16(a1),a1
- moveq.l #5,d1
- .1 move.l (a0)+,d2
- andi.w #15,d2
- addi.w #"0",d2
- move.b d2,-(a1)
- dbra d1,.1
- movea.l Name1(a5),a0
- move.l a0,d3
- move.w #8,(a0)+
- moveq #2,d2
- .2 move.b (a1)+,(a0)+
- move.b (a1)+,(a0)+
- move.b d0,(a0)+
- dbra d2,.2
- moveq #2,d2
- rts
- **************************************************************************
- ;Datei in Bank einlesen
- L_BankLoad equ 167
- L167 PUSH a6
- DLOAD a2
- move.l my_FileBnk(a2),d0
- move.l my_FileMsk(a2),d1
- andi.l #%11,d1
- cmpi.l #$10000,d0
- Rbge L_IFunc
- Rbsr L_GetFileInfo
- move.l my_FileSize(a2),d2 ;ByteLen -> D2
- tst.l d2
- Rblt L_IOError ;-1 = IO Fehler
- btst #Bnk_BitData,d1
- beq.s .1
- DLEA my_BkNameData,a0
- bra.s .2
- .1 DLEA my_BkNameWork,a0
- .2 Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- move.l a0,d5 ;BkDAdr -> D5
- move.l Name1(a5),d1
- move.l #MODE_OLDFILE,d2
- DOS Open
- move.l d0,d4 ;Handle -> D4
- Rbeq L_IOError
- move.l d4,d1 ;Handle
- move.l d5,d2 ;Adresse
- move.l my_FileSize(a2),d3 ;Länge
- LIB Read
- move.l d0,d5
- move.l d4,d1
- LIB Close
- POP a6
- cmp.l my_FileSize(a2),d5 ;Lesefehler?
- Rbne L_IOError ;Ja!
- rts
- **************************************************************************
- ;Bank in PowerPacker-Datenformat packen (powerpacker.library!)
- L_PpkPack equ 168
- L168 Rbsr L_PpkLibOpen
- PUSH a6
- DLOAD a2
- move.l my_PpkSrc(a2),d0 ;Bk
- Rjsr L_Bnk.OrAdr
- move.l a0,my_PpkSrc(a2) ;Start()
- Rbsr L_GetPpkLen ;Bereits pp.Format
- tst.l d0
- bne .Skip ;Ja!
- movea.l my_PpkLibBase(a2),a6
- moveq.l #SPEEDUP_BUFFLARGE,d4 ;pp.Speedup default
- .1 move.l d4,d1 ;pp.Speedup in D1
- cmpi.l #SPEEDUP_BUFFSMALL,d1
- Rbpl L_OOfmem
- move.l my_PpkPackMode(a2),d0 ;ppEffizienz (0-4)
- suba.l a0,a0
- suba.l a1,a1
- LIB ppAllocCrunchInfo
- addq.l #1,d4 ;pp.Speedup
- move.l d4,d1 ;Falls BuffOver
- move.l d0,my_PpkCInfo(a2) ;pp.Info
- beq.s .1
- movea.l d0,a0
- movea.l my_PpkSrc(a2),a1 ;BkAdr -> A1
- move.l my_BkLength(a1),d0
- subi.l #my_BkHeader,d0 ;-16
- LIB ppCrunchBuffer
- move.l d0,my_PpkDstSize(a2)
- movea.l my_PpkCInfo(a2),a0
- LIB ppFreeCrunchInfo
- move.l my_PpkDstSize(a2),d2 ;pp.CrunchedLen
- Rble L_OOfmem
- movea.l my_PpkSrc(a2),a0 ;BkAdr -> A0
- move.w my_BkFlag(a0),d1
- moveq #1,d0 ;BkMin = 1
- Rbsr L_Bnk.GetFree ;BkNb -> D0
- addq.l #8,d2 ;pp.Len + 8 (pp.Header)
- DLEA my_BkNameWork,a0
- Rjsr L_Bnk.Reserve
- Rble L_OOfmem
- move.l a0,my_PpkDst(a2) ;Crunched buffer
- lea 8(a0),a1
- movea.l my_PpkSrc(a2),a0 ;Source Bk
- move.l my_PpkDstSize(a2),d0
- SYS $4.w,CopyMem
- Rbsr L_PpkID
- movea.l my_PpkSrc(a2),a0
- movea.l my_PpkDst(a2),a1
- Rbsr L_Bnk.HeadClone
- move.l #"PP20",(a0)+
- Rbsr L_PpkID
- move.l my_PpkPackMode(a2),d0
- lsl.l #2,d0 ;× 4
- lea my_PpkEffMode(a1),a1
- move.l (a1,d0.l),(a0) ;Effeciency-Code
- .Skip POP a6
- rts
- *
- L_PpkLibOpen equ 169
- L169 PUSHM a0-a2/a6/d0
- DLOAD a2
- tst.l my_PpkLibBase(a2)
- bne.s .Skip
- lea PpkLibName(pc),a1
- moveq #0,d0
- EXE OpenLibrary
- move.l d0,my_PpkLibBase(a2)
- Rbeq L_LibError
- .Skip POPM a0-a2/a6/d0
- rts
- PpkLibName PPNAME
- even
- *
- L_PpkLibClose equ 170
- L170 PUSHM a1/a2/a6/d0
- DLOAD a2
- tst.l my_PpkLibBase(a2)
- beq.s .Skip
- movea.l my_PpkLibBase(a2),a1
- clr.l my_PpkLibBase(a2)
- EXE CloseLibrary
- .Skip POPM a1/a2/a6/d0
- rts
- **************************************************************************
- ;Bereitstellen / schließen der lh.library
- L_LpkLibOpen equ 171
- L171 PUSHM a0-a2/a6/d0
- DLOAD a2
- tst.l my_LpkLibBase(a2)
- bne.s .Skip
- lea LpkLibName(pc),a1
- moveq #0,d0
- EXE OpenLibrary
- tst.l d0
- Rbeq L_LibError
- move.l d0,my_LpkLibBase(a2)
- .Skip POPM a0-a2/a6/d0
- rts
- LpkLibName dc.b "lh.library",0
- even
- *
- L_LpkLibClose equ 172
- L172 PUSHM a1/a2/a6/d0
- DLOAD a2
- tst.l my_LpkLibBase(a2)
- beq.s .Skip
- movea.l my_LpkLibBase(a2),a1
- clr.l my_LpkLibBase(a2)
- EXE CloseLibrary
- .Skip POPM a1/a2/a6/d0
- rts
- **************************************************************************
- ;Entpackte Byte-Größe einer ByteKiller gepackten Bank ermitteln
- ;A0 <= Bk
- ;D0 => Entpackte Byte-Größe oder NULL
- L_GetBpkLen equ 173
- L173 moveq.l #0,d0
- cmpi.l #$61766532,$4C(a0) ;Executable?
- bne.s .1 ;Nein!
- move.l 238(a0),d0 ;Byte-Größe
- bra.s .Skip
- .1 cmpi.l #$3F3,(a0) ;Data-Test
- beq.s .Skip
- tst.b (a0)
- bne.s .Skip
- tst.b 5(a0)
- bne.s .Skip
- tst.l 8(a0)
- beq.s .Skip
- move.l 4(a0),d0 ;Byte-Größe
- .Skip rts
- **************************************************************************
- ;xpkmaster.library öffnen / schließen
- L_XpkLibOpen equ 174
- L174 PUSHM a0-a2/a6/d0/d1
- DLOAD a2
- tst.l my_XpkLibBase(a2)
- bne.s .Skip
- lea XpkLibName(pc),a1
- moveq #0,d0
- EXE OpenLibrary
- move.l d0,my_XpkLibBase(a2)
- Rbeq L_LibError
- .Skip POPM a0-a2/a6/d0/d1
- rts
- XpkLibName XPKNAME
- even
- *
- L_XpkLibClose equ 175
- L175 PUSHM a1/a2/a6/d0
- DLOAD a2
- tst.l my_XpkLibBase(a2)
- beq.s .Skip
- movea.l my_XpkLibBase(a2),a1
- clr.l my_XpkLibBase(a2)
- EXE CloseLibrary
- clr.l my_XpkErrNum(a2)
- clr.l my_XpkErrMsg(a2)
- .Skip POPM a1/a2/a6/d0
- rts
- **************************************************************************
- ;Hardware-Uhrzeit/Datum setzen
- ;A0 <= Zeichenkette
- ;A1 <= Hardware-Adresse der Uhr
- L_SetTimeDate equ 176
- L176 moveq.l #2,d0
- .1 move.b (a0)+,d1
- subi.b #"0",d1
- move.b d1,(a1)
- lea -4(a1),a1
- move.b (a0)+,d1
- subi.b #"0",d1
- move.b d1,(a1)
- lea -4(a1),a1
- tst.b (a0)+
- dbra d0,.1
- rts
- **************************************************************************
- ;Bereitstellen bzw. schließen der decrunch.library
- L_DpkLibOpen equ 177
- L177 PUSHM a0-a2/a6/d0
- DLOAD a2
- tst.l my_DpkLibBase(a2)
- bne.s .Skip
- lea DpkLibName(pc),a1
- moveq #0,d0
- EXE OpenLibrary
- move.l d0,my_DpkLibBase(a2)
- Rbeq L_LibError
- .Skip POPM a0-a2/a6/d0
- rts
- DpkLibName dc.b "decrunch.library",0
- even
- *
- L_DpkLibClose equ 178
- L178 PUSHM a1/a2/a6/d0
- DLOAD a2
- tst.l my_DpkLibBase(a2)
- beq.s .Skip
- movea.l my_DpkLibBase(a2),a1
- clr.l my_DpkLibBase(a2)
- EXE CloseLibrary
- .Skip POPM a1/a2/a6/d0
- rts
- **************************************************************************
- ;Transformieren eines pp/x.Format in PP20.Format
- ;z.Z. transferierbar: PPLS/PPBK/PPLB/PPEX/PX20/PXLB/PXEX
- ;A0 <= Bk pp/x.Format
- ;A0 => Bk PP20.Format
- L_PpkTransform equ 179
- L179 PUSHM a1-a6/d0-d7
- DLOAD a2
- move.l my_PpkSrc(a2),d0
- Rjsr L_Bnk.OrAdr
- move.l a0,my_PpkSrc(a2)
- move.l a0,d7 ;Bk in D7 sichern
- Rbsr L_PpkID
- moveq #my_PpkKnow-1,d2
- .1 move.l my_PpkCodePos(a1),d0
- move.l my_PpkCode(a1),d1
- cmp.l (a0,d0.l),d1
- beq.s .ppok
- lea my_PpkSIZEOF(a1),a1
- dbeq d2,.1
- bra .Skip
- .ppok move.l my_PpkType(a1),d3
- cmpi.l #1,d3
- beq .Skip
- cmpi.l #2,d3
- beq.s .ppls
- cmpi.l #3,d3
- beq.s .ppbk
- cmpi.l #4,d3
- beq .pplb
- cmpi.l #5,d3
- beq .ppex
- movea.l Name1(a5),a1
- tst.b (a1) ;px.Passwort ?
- beq .Skip ;Nein.. kein entpacken !
- move.l d3,d0
- Rbsr L_PxPassKey ;Passwort prüfen
- tst.l d3 ;Stimmt überein ?
- beq .Skip ;Nein !
- cmpi.l #6,d0
- beq .px20
- cmpi.l #7,d0
- beq .pxlb
- cmpi.l #8,d0
- beq .pxex
- .ppls lea 4(a0),a1
- move.l my_BkLength(a0),d0
- subi.l #24,d0
- lea 8(a0),a0
- EXE CopyMem
- movea.l d7,a0
- move.l my_BkLength(a0),d0
- subq #4,d0
- move.l d0,my_BkLength(a0)
- bra .pp20
- .ppbk move.l my_BkLength(a0),d2
- subi.l #my_BkHeader+16,d2 ;-16 pp.AbkInfo
- moveq #1,d0
- Rbsr L_Bnk.GetFree
- moveq #0,d1
- DLEA my_BkNameWork,a0
- Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- movea.l a0,a1
- movea.l d7,a0
- move.l a1,d6
- move.l my_BkLength(a1),d0
- subi.l #my_BkHeader,d0
- lea my_BkHeader(a0),a0
- EXE CopyMem
- movea.l d6,a1
- movea.l d7,a0
- Rbsr L_Bnk.HeadClone
- bra .pp20
- .pplb move.l my_BkLength(a0),d2
- subi.l #my_BkHeader+148,d2 ;-148 pp.ExecChunk
- moveq #1,d0
- Rbsr L_Bnk.GetFree
- moveq #0,d1
- DLEA my_BkNameWork,a0
- Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- movea.l a0,a1
- movea.l d7,a0
- move.l a1,d6
- move.l my_BkLength(a1),d0
- subi.l #my_BkHeader,d0
- lea 144(a0),a0
- EXE CopyMem
- movea.l d6,a1
- movea.l d7,a0
- Rbsr L_Bnk.HeadClone
- bra .pp20
- .ppex cmpi.l #$65804E75,my_PpkCode(a1) ;Pk V4.x?
- beq .ppexv4
- cmpi.l #$6472611A,my_PpkCode(a1) ;Pk V2.x?
- beq.s .ppexv2
- move.l my_BkLength(a0),d2
- subi.l #my_BkHeader+576,d2 ;-576 pp.ExecChunk
- moveq #1,d0
- Rbsr L_Bnk.GetFree
- moveq #0,d1
- DLEA my_BkNameWork,a0
- Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- movea.l a0,a1
- movea.l d7,a0
- move.l a1,d6
- move.l my_BkLength(a1),d0
- subi.l #my_BkHeader,d0
- lea 572(a0),a0
- EXE CopyMem
- movea.l d6,a1
- movea.l d7,a0
- Rbsr L_Bnk.HeadClone
- bra .pp20
- .ppexv2 move.l my_PpkEffPos(a1),d5
- move.l (a0,d5.l),d5 ;D5 => Effizienz-Code
- move.l my_BkLength(a0),d2
- subi.l #my_BkHeader+564,d2 ;-564 pp.ExecChunk 2.x
- moveq #1,d0
- Rbsr L_Bnk.GetFree
- moveq #0,d1
- DLEA my_BkNameWork,a0
- Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- movea.l a0,a1
- movea.l d7,a0
- move.l a1,d6
- move.l my_BkLength(a1),d0
- subi.l #my_BkHeader,d0
- lea 560(a0),a0
- EXE CopyMem
- movea.l d6,a1
- movea.l d7,a0
- Rbsr L_Bnk.HeadClone
- move.l d5,4(a0) ;Effizienz-Code
- bra .pp20
- .ppexv4 move.l my_PpkEffPos(a1),d5
- move.l (a0,d5.l),d5 ;D5 => Effizienz-Code
- move.l my_BkLength(a0),d2
- subi.l #my_BkHeader+$2A4,d2 ;-676 pp.ExecChunk 2.x
- moveq #1,d0
- Rbsr L_Bnk.GetFree
- moveq #0,d1
- DLEA my_BkNameWork,a0
- Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- movea.l a0,a1
- movea.l d7,a0
- move.l a1,d6
- move.l my_BkLength(a1),d0
- subi.l #my_BkHeader,d0
- lea $2A0(a0),a0
- EXE CopyMem
- movea.l d6,a1
- movea.l d7,a0
- Rbsr L_Bnk.HeadClone
- move.l d5,4(a0) ;Effizienz-Code
- bra .pp20
- .px20 Rbsr L_PpkLibOpen
- DLOAD a2
- movea.l my_PpkLibBase(a2),a6
- movea.l Name1(a5),a0
- LIB ppCalcPasskey
- move.l d0,d1 ;px.Passkey
- movea.l d7,a0 ;BkAdr
- move.l my_BkLength(a0),d0 ;BkLen
- subi.l #my_BkHeader+14,d0 ;-14 px.Chunk
- lea 10(a0),a0 ;+10 px.Header
- LIB ppDecrypt
- movea.l d7,a0
- movea.l d7,a1
- lea 4(a1),a1
- move.l my_BkLength(a0),d0
- subi.l #22,d0
- lea 6(a0),a0
- EXE CopyMem
- movea.l d7,a0
- move.l my_BkLength(a0),d0
- subq.l #2,d0 ;-2 px.CryptChunk
- move.l d0,my_BkLength(a0)
- bra .pp20
- .pxlb move.w $4A(a0),d4
- move.l $98(a0),d5
- move.l my_BkLength(a0),d2
- subi.l #$B6,d2
- moveq #1,d0
- Rbsr L_Bnk.GetFree
- moveq #0,d1
- DLEA my_BkNameWork,a0
- Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- movea.l a0,a1
- movea.l d7,a0
- move.l a1,d6
- move.l my_BkLength(a0),d0
- subi.l #$B6,d0
- lea $A2(a0),a0
- EXE CopyMem
- movea.l d6,a1
- movea.l d7,a0
- Rbsr L_Bnk.HeadClone
- move.l a0,d7
- move.w d4,4(a0)
- move.l d5,6(a0)
- bra .px20
- .pxex move.w $8E(a0),d4 ;px.PassKey => D4
- move.l $2FE(a0),d5 ;px.Effizienz => D5
- move.l my_BkLength(a0),d2
- subi.l #my_BkHeader+$30A,d2 ;-$30A px.ExecChunk
- moveq #1,d0
- Rbsr L_Bnk.GetFree
- moveq #0,d1
- DLEA my_BkNameWork,a0
- Rjsr L_Bnk.Reserve
- Rbeq L_OOfmem
- movea.l a0,a1
- movea.l d7,a0
- move.l a1,d6
- move.l my_BkLength(a0),d0
- subi.l #my_BkHeader+$30A,d0
- lea $306(a0),a0
- EXE CopyMem
- movea.l d6,a1
- movea.l d7,a0
- Rbsr L_Bnk.HeadClone
- move.l a0,d7
- move.w d4,4(a0)
- move.l d5,6(a0)
- bra .px20
- .pp20 move.l #"PP20",(a0)
- DLOAD a2
- move.l a0,my_PpkSrc(a2)
- .Skip POPM a1-a6/d0-d7
- rts
- **************************************************************************
- ;PX?? Passwort-Test
- ;A0 <= Bk
- ;D3 => True/False
- L_PxPassKey equ 180
- L180 PUSHM a0-a6/d0-d2/d4
- Rbsr L_PpkID
- moveq #my_PpkKnow-1,d2
- .1 move.l my_PpkCodePos(a1),d0
- move.l my_PpkCode(a1),d1
- cmp.l (a0,d0.l),d1 ;Vergleich mit ppAbk
- beq.s .2
- lea my_PpkSIZEOF(a1),a1
- dbeq d2,.1
- moveq #0,d3
- bra.s .Skip
- .2 move.l my_PpkCryptPos(a1),d0
- move.w (a0,d0.l),d4
- Rbsr L_PpkLibOpen
- DLOAD a2
- movea.l my_PpkLibBase(a2),a6
- movea.l Name1(a5),a0
- LIB ppCalcChecksum ;D0 -> CheckSum 16 Bit
- moveq #0,d3 ;False! für ungleich
- cmp.w d0,d4 ;CheckSum vergleichen (Word)
- bne.s .Skip ;Ungleich!
- moveq #-1,d3 ;True! für gleich
- .Skip POPM a0-a6/d0-d2/d4
- rts
- *************************************************************************
- ;Bereitstellen bzw. schließen der diskfont.library
- L_FntLibOpen equ 181
- L181 PUSHM a0-a2/a6/d0
- tst.l T_FntBase(a5)
- bne.s .Skip
- lea FntLibName(pc),a1
- moveq #0,d0
- EXE OpenLibrary
- move.l d0,T_FntBase(a5)
- Rbeq L_LibError
- .Skip POPM a0-a2/a6/d0
- rts
- FntLibName dc.b "diskfont.library",0
- even
- *
- L_FntLibClose equ 182
- L182 PUSHM a1/a2/a6/d0
- tst.l T_FntBase(a5)
- beq.s .Skip
- movea.l T_FntBase(a5),a1
- clr.l T_FntBase(a5)
- EXE CloseLibrary
- .Skip POPM a1/a2/a6/d0
- rts
- **************************************************************************
- ;Ppk_ID-Strukturdefinition global in A1
- L_PpkID equ 183
- L183 lea .0(pc),a1
- rts
- * Name EffPos CodePos Code CryptPos Type
- .0 dc.l $50503230,$00004,$000000,$50503230,$0000000,$001 ;PP20
- dc.l $50504C53,$00008,$000000,$50504C53,$0000000,$002 ;PPLS
- dc.l $5050424B,$00014,$000000,$5050626B,$0000000,$003 ;PPBK
- dc.l $50504C42,$00094,$000080,$706F7765,$0000000,$004 ;PPLB
- dc.l $50504558,$00290,$00028C,$65804E75,$0000000,$005 ;PPEX V4.x
- dc.l $50504558,$00240,$000054,$504B2E1B,$0000000,$005 ;PPEX V3.x
- dc.l $50504558,$00228,$000118,$6472611A,$0000000,$005 ;PPEX V2.x
- dc.l $50583230,$00006,$000000,$50583230,$0000004,$006 ;PX20
- dc.l $50584C42,$00098,$000084,$706F7765,$000004A,$007 ;PXLB
- dc.l $50584558,$002FE,$0002E2,$50617373,$000008E,$008 ;PXEX
- * Fast Mediocre Good VeryGood Best
- dc.l $09090909,$090A0A0A,$090A0B0B,$090A0C0C,$090A0C0D ;MODE
- **************************************************************************
- ;Speicher aller RS_Strukturen freigeben
- L_RsEraseAll equ 184
- L184 PUSHM a0-a6/d0-d7
- moveq.l #0,d6
- moveq.l #0,d7
- .1 mulu #my_RsSIZEOF,d7
- XLEA my_RsStruc,a2
- adda.l d7,a2
- movea.l my_RsStart(a2),a1
- move.l my_RsLength(a2),d0
- beq.s .2
- Rjsr L_RamFree
- .2 clr.l my_RsStart(a2)
- clr.l my_RsLength(a2)
- clr.l my_RsPosition(a2)
- addq.l #1,d6
- move.l d6,d7
- cmpi.l #my_RsMax,d6
- bne.s .1
- POPM a0-a6/d0-d7
- rts
- **************************************************************************
- ;Reservierte Offsets für Rjumps
- L185
- L186
- L187
- L188
- L189
- L190
- L191
- L192
- L193
- L194
- L195
- L196
- L197
- L198
- L199
- **************************************************************************
- ;Fehlerroutine aktivieren
- L_OOfmem equ 200
- L200 moveq #24,d0 ;Out of memory
- Rjmp L_Error
- L_IFunc equ 201
- L201 moveq #23,d0 ;Illegal function call
- Rjmp L_Error
- L_SNopen equ 202
- L202 moveq #47,d0 ;Screen not open
- Rjmp L_Error
- L_FNopen equ 203
- L203 moveq #97,d0 ;File not open
- Rjmp L_Error
- L_IOError equ 204
- L204 moveq #94,d0 ;I/O Error
- Rjmp L_Error
- L_LibError equ 205
- L205 move.l #170,d0 ;Cannot open library
- Rjmp L_Error
- L_NoIff equ 206
- L206 moveq #31,d0 ;IFF cmpr not recognised
- Rjmp L_Error
- L_IScrn equ 207
- L207 moveq #48,d0 ;Illegal screen params
- Rjmp L_Error
- L208
- **************************************************************************
- ;Welcome message
- C_Title EXPLODE
- VERSION
- dc.b 0,"$VER: "
- VERSION
- dc.b 0
- even
- **************************************************************************
- C_End dc.w 0
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement