home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
400-499
/
ff473.lzh
/
BigBrother
/
bigbrother.asm
< prev
next >
Wrap
Assembly Source File
|
1991-04-17
|
42KB
|
2,392 lines
;====================================================================
;= Big Brother V2.11 by The Orega Programming Group Holland (c)1989 =
;= Programmer: EA van Breemen =
;= Assembler : DevPac 2.14 =
;====================================================================
;====================================================================
;= Modifications: =
;= 24-1-90: fixed ctrl-Help bug =
;= added newcli =
;= optimized coding =
;= 26-1-90: added newcli gadget =
;= modified tekstborder =
;= fixed 'system has been modified' tekst bug =
;= 27-1-90: fixed AlertWarning =
;= adjusted some windowsizes =
;= intuified viewbootblocktekst =
;= regulated bootio errors =
;= added help =
;= added preferences =
;= 21-10-90 fixed the memory clean message update bug =
;= added script options =
;= 23-10-90 make auto detaching =
;= 24-10-90 fixed another clean message box bug =
;= added ReBoot routine =
;= 25-10-90 BigBrother is now using the official reboot =
;= 27-10-90 Fixed the endcli bug =
;= 01-12-90 Fixed multiple selection bug. BB replies to all =
;= messages first before next Wait =
;= Version 2.11 Final release. =
;====================================================================
XLIB macro
xref _LVO\1
endm
MEMORY equ $1
VIEW equ $2
CLEAR equ $3
INSTALL equ $4
DRIVE equ $5
WATCH equ $6
NEWSHELL equ $7
HELP equ $8
REBOOT equ $9
READ equ $2
WRITE equ $3
IECLASS_RAWKEY equ $01
IEQUALIFIER_CONTROL equ $08
HELP_KEY equ $5f
FUNC_F1 equ $50
FUNC_F2 equ $51
FUNC_F3 equ $52
FUNC_F4 equ $53
FUNC_F5 equ $54
FUNC_F6 equ $55
FUNC_F7 equ $56
FUNC_F8 equ $57
FUNC_F9 equ $58
FUNC_F10 equ $59
IND_ADDHANDLER equ $09
NT_MESSAGE equ $05
NT_MSGPORT equ $04
PA_SIGNAL equ $00
io_Message equ $00
io_Data equ $28
io_Command equ $1c
Ln_Type equ $08
Ln_Name equ $0a
Ln_Pri equ $09
mp_Node equ $00
mp_SigBit equ $0f
mp_Flags equ $0e
mp_SigTask equ $10
mn_Node equ $00
mn_Length equ $12
mn_ReplyPort equ $0e
gg_GadgetID equ $26
im_Class equ $14
im_Code equ $18
im_Address equ $1c
wd_UserPort equ $56
wd_RPort equ $32
WindowPtr equ $b8
is_Code equ $12
is_Data equ $0e
is_Node equ $00
GADGETUP equ $40
GADGHNONE equ $03
CLOSEWINDOW equ $200
WINDOWDRAG equ $02
WINDOWDEPTH equ $04
WINDOWCLOSE equ $08
ACTIVATE equ $1000
NOCAREREFRESH equ $20000
WBENCHSCREEN equ $01
RELVERIFY equ $01
BOOLGADGET equ $01
RP_JAM1 equ $00
RP_JAM2 equ $01
TD_CHANGESTATE equ 14
NULL equ $00
MAGIC_ROMEND EQU $01000000 ;End of Kickstart ROM
MAGIC_SIZEOFFSET EQU -$14 ;Offset from end of ROM to Kickstart size
V36_EXEC EQU 36 ;Exec with the ColdReboot() function
TEMP_ColdReboot EQU -726 ;Offset of the V36 ColdReboot function
LIB_VERSION EQU $14
XLIB OpenLibrary
XLIB CloseLibrary
XLIB OpenDevice
XLIB CloseDevice
XLIB OpenWindow
XLIB CloseWindow
XLIB DoIO
XLIB Delay
XLIB GetMsg
XLIB ReplyMsg
XLIB AllocSignal
XLIB FreeSignal
XLIB FindTask
XLIB AddPort
XLIB RemPort
XLIB FindName
XLIB DeviceProc
XLIB RefreshGadgets
XLIB Wait
XLIB Move
XLIB Text
XLIB SetAPen
XLIB AllocMem
XLIB FreeMem
XLIB SetWindowTitles
XLIB FindResident
XLIB RemTask
XLIB DisplayBeep
XLIB Disable
XLIB Enable
XLIB DrawBorder
XLIB PrintIText
XLIB WBenchToFront
XLIB DisplayAlert
XLIB SizeWindow
XLIB WaitPort
XLIB Open
XLIB Close
XLIB Read
XLIB Lock
XLIB UnLock
XLIB Execute
XLIB CreateProc
XLIB WaitPort
XLIB Supervisor
XLIB Write
XLIB Output
_ASyncRun equ -$222
STACK_SIZE equ 4096
;===================================
;= Startup code for auto detaching =
;= BigBrother V2.11 =
;===================================
section "Startup",code
start move.l $4,a6
sub.l a1,a1
jsr _LVOFindTask(a6)
move.l d0,a4
tst.l $ac(a4) ; Are we from the WBench ????
bne.s from_cli
lea.l $5c(a4),a0
jsr _LVOWaitPort(a6)
jsr _LVOGetMsg(a6) ; Get message
from_cli:
move.l $4,a6
lea.l DosName,a1
clr.l d0
jsr _LVOOpenLibrary(a6)
move.l d0,a5
beq uit
move.l a5,a6
jsr _LVOOutput(a6)
move.l d0,d1
move.l #Title,d2
move.l #80,d3
jsr _LVOWrite(a6)
move.l #NIL_NAME,d1
move.l #1006,d2
jsr _LVOOpen(a6)
move.l d0,pcb_Input
move.l d0,pcb_Output
move.l $4,a6
lea.l ArpName,a1
clr.l d0
jsr _LVOOpenLibrary(a6)
move.l d0,ArpBase
bne 1$
bra 2$
1$ move.l ArpBase,a6
move.l #0,a0
move.l #0,a1
lea.l newshell2,a2
jsr _ASyncRun(a6)
move.l $4,a6
move.l ArpBase,a1
jsr _LVOCloseLibrary(a6) ; Close Arp
lea.l start,a0
move.l #0,-4(a0) ; Erase pointer to next segment
2$ move.l $4,a6
move.l a5,a1
jsr _LVOCloseLibrary(a6)
uit rts
data
Title dc.b 'BigBrother V2.11 ',169,'1990 by EA van Breemen',10,13
dc.b 'The Orega Programming Group Holland.',10,13,0
even
NewWindowStructure1:
dc.w 62,30
dc.w 330,126
dc.b 0,1
dc.l GADGETUP+CLOSEWINDOW
dc.l WINDOWDRAG+WINDOWDEPTH+WINDOWCLOSE+ACTIVATE+NOCAREREFRESH
dc.l Gadget1
dc.l NULL
dc.l CopyrightName
dc.l NULL
dc.l NULL
dc.w 5,5
dc.w -1,-1
dc.w WBENCHSCREEN
NewWindowStructure2:
dc.w 0,0
hsize dc.w 550,150
dc.b 0,1
dc.l CLOSEWINDOW
dc.l ACTIVATE+NOCAREREFRESH+WINDOWCLOSE
dc.l NULL
dc.l NULL
title2 dc.l InitTitle
dc.l NULL
dc.l NULL
dc.w 5,5
dc.w -1,-1
dc.w WBENCHSCREEN
CopyrightName:
dc.b 'Big Brother V2.11',0
dc.b ' ',169,'1989/1990',0
cnop 0,2
InitTitle:
dc.b 'BootBlock:',0
even
ViewTitle:
dc.b 'Contents of ExecBase:',0
even
InstallTitle:
dc.b 'Installing BootBlock',0
even
HelpTitle:
dc.b 'Help',0
even
install_message:
dc.b 'Disk has been installed',0
even
install_fail:
dc.b 'Install has failed',0
even
disk_protected:
dc.b 'Disk is write-protected!',0
even
disk_changed:
dc.b 'Disk has been removed!',0
even
StandardBootBlock:
dc.b 'Standard BootBlock by The Orega Programming Group Holland.'
dc.b ' Copyright 1989,1990. Installed by Big Brother V2.11'
Standardend:
even
prefs_file:
dc.b 's:big_prefs',0
even
Gadget1:
dc.l Gadget2
dc.w 29,22
dc.w 80,15
dc.w GADGHNONE
dc.w RELVERIFY
dc.w BOOLGADGET
dc.l Border1
dc.l NULL
dc.l IText1
dc.l NULL
dc.l NULL
dc.w DRIVE
dc.l NULL
Border1:
dc.w 0,0
dc.b 2,0,RP_JAM2
dc.b 5
dc.l BorderVectors1
dc.l Border1a
Border1a:
dc.w -1,-1
dc.b 1,0,RP_JAM1
dc.b 5
dc.l BorderVectors1
dc.l NULL
BorderVectors1:
dc.w 0,0
dc.w 80,0
dc.w 80,15
dc.w 0,15
dc.w 0,0
;======== Custom Drawing =======================
Border2:
dc.w 30,96
dc.b 2,0,RP_JAM2
dc.b 5
dc.l BorderVectors2
dc.l Border3
Border3:
dc.w 28,95
dc.b 1,0,RP_JAM1
dc.b 5
dc.l BorderVectors2
dc.l NULL
BorderVectors2: ; Tekstbox of mainwindow
dc.w 0,0
dc.w 283,0
dc.w 283,26
dc.w 0,26
dc.w 0,0
MyTekst:
dc.b 2,0,RP_JAM2,0
dc.w 45,110
dc.l NULL
Mt1 dc.l NULL
dc.l MyTekst2
MyTekst2:
dc.b 1,0,RP_JAM1,0
dc.w 44,109
dc.l NULL
Mt2 dc.l NULL
dc.l NULL
MyTekst3:
dc.b 2,0,RP_JAM2,0
dc.w 45,100
dc.l NULL
Mt3 dc.l NULL
dc.l MyTekst4
MyTekst4:
dc.b 1,0,RP_JAM1,0
dc.w 44,99
dc.l NULL
Mt4 dc.l NULL
dc.l NULL
;=====================================================
;= IntuiText structures for clearing the message box =
;=====================================================
MyTekst3a:
dc.b 2,0,RP_JAM2,0
dc.w 45,100
dc.l NULL
dc.l L10
dc.l MyTekst4a
MyTekst4a:
dc.b 1,0,RP_JAM2,0
dc.w 44,99
dc.l NULL
dc.l L10
dc.l MyTekst3b
MyTekst3b:
dc.b 2,0,RP_JAM2,0
dc.w 45,110
dc.l NULL
dc.l L10
dc.l MyTekst4b
MyTekst4b:
dc.b 1,0,RP_JAM2,0
dc.w 44,109
dc.l NULL
dc.l L10
dc.l NULL
MyTekst5:
dc.b 2,0,RP_JAM2,0
dc.w 40,25
dc.l NULL
Mt5 dc.l NULL
dc.l MyTekst6
MyTekst6:
dc.b 1,0,RP_JAM1,0
dc.w 39,24
dc.l NULL
Mt6 dc.l NULL
dc.l NULL
;=====================================
IText1:
dc.b 2,0,RP_JAM2,0
dc.w 21,3
dc.l NULL
dc.l DummyTekst
dc.l IText1a
IText1a:
dc.b 2,0,RP_JAM2,0
dc.w 22,4
dc.l NULL
dc.l ITextText1
dc.l IText1b
IText1b:
dc.b 1,0,RP_JAM1,0
dc.w 21,3
dc.l NULL
dc.l ITextText1
dc.l NULL
ITextText1:
dc.b 'DF0:',0
cnop 0,2
DummyTekst:
dc.b ' ',0
cnop 0,2
Gadget2:
dc.l Gadget3
dc.w 128,46
dc.w 80,15
dc.w NULL
dc.w RELVERIFY
dc.w BOOLGADGET
dc.l Border1
dc.l NULL
dc.l IText2
dc.l NULL
dc.l NULL
dc.w MEMORY
dc.l NULL
IText2:
dc.b 2,0,RP_JAM2,0
dc.w 15,4
dc.l NULL
dc.l ITextText2
dc.l IText2b
IText2b:
dc.b 1,0,RP_JAM1,0
dc.w 14,3
dc.l NULL
dc.l ITextText2
dc.l NULL
ITextText2:
dc.b 'Memory',0
cnop 0,2
Gadget3:
dc.l Gadget4
dc.w 229,22
dc.w 80,15
dc.w NULL
dc.w RELVERIFY
dc.w BOOLGADGET
dc.l Border1
dc.l NULL
dc.l IText3
dc.l NULL
dc.l NULL
dc.w INSTALL
dc.l NULL
IText3:
dc.b 2,0,RP_JAM2,0
dc.w 13,4
dc.l NULL
dc.l ITextText3
dc.l IText3b
IText3b:
dc.b 1,0,RP_JAM1,0
dc.w 12,3
dc.l NULL
dc.l ITextText3
dc.l NULL
ITextText3:
dc.b 'Install',0
cnop 0,2
Gadget4:
dc.l Gadget5
dc.w 29,46
dc.w 80,15
dc.w NULL
dc.w RELVERIFY
dc.w BOOLGADGET
dc.l Border1
dc.l NULL
dc.l IText4
dc.l NULL
dc.l NULL
dc.w WATCH
dc.l NULL
IText4:
dc.b 2,0,RP_JAM2,0
dc.w 22,4
dc.l NULL
dc.l ITextText4
dc.l IText4b
IText4b:
dc.b 1,0,RP_JAM1,0
dc.w 21,3
dc.l NULL
dc.l ITextText4
dc.l NULL
ITextText4:
dc.b 'Watch',0
cnop 0,2
Gadget5:
dc.l Gadget6
dc.w 229,46
dc.w 80,15
dc.w NULL
dc.w RELVERIFY
dc.w BOOLGADGET
dc.l Border1
dc.l NULL
dc.l IText5
dc.l NULL
dc.l NULL
dc.w CLEAR
dc.l NULL
IText5:
dc.b 2,0,RP_JAM2,0
dc.w 22,4
dc.l NULL
dc.l ITextText5
dc.l IText5b
IText5b:
dc.b 1,0,RP_JAM1,0
dc.w 21,3
dc.l NULL
dc.l ITextText5
dc.l NULL
ITextText5:
dc.b 'Clear',0
cnop 0,2
Gadget6:
dc.l Gadget7
dc.w 128,22
dc.w 80,15
dc.w NULL
dc.w RELVERIFY
dc.w BOOLGADGET
dc.l Border1
dc.l NULL
dc.l IText6
dc.l NULL
dc.l NULL
dc.w VIEW
dc.l NULL
IText6:
dc.b 2,0,RP_JAM2,0
dc.w 22,4
dc.l NULL
dc.l ITextText6
dc.l IText6b
IText6b:
dc.b 1,0,RP_JAM1,0
dc.w 21,3
dc.l NULL
dc.l ITextText6
dc.l NULL
ITextText6:
dc.b 'View',0
even
Gadget7:
dc.l Gadget8
dc.w 29,70
dc.w 80,15
dc.w NULL
dc.w RELVERIFY
dc.w BOOLGADGET
dc.l Border1
dc.l NULL
dc.l IText7
dc.l NULL
dc.l NULL
dc.w NEWSHELL
dc.l NULL
IText7:
dc.b 2,0,RP_JAM2,0
dc.w 10,4
dc.l NULL
dc.l ITextText7
dc.l IText7b
IText7b:
dc.b 1,0,RP_JAM1,0
dc.w 9,3
dc.l NULL
dc.l ITextText7
dc.l NULL
ITextText7:
dc.b 'NewShell',0
even
Gadget8:
dc.l Gadget9
dc.w 229,70
dc.w 80,15
dc.w NULL
dc.w RELVERIFY
dc.w BOOLGADGET
dc.l Border1
dc.l NULL
dc.l _IText8
dc.l NULL
dc.l NULL
dc.w HELP
dc.l NULL
_IText8:
dc.b 2,0,RP_JAM2,0
dc.w 23,4
dc.l NULL
dc.l _ITextText8
dc.l _IText8b
_IText8b:
dc.b 1,0,RP_JAM1,0
dc.w 22,3
dc.l NULL
dc.l _ITextText8
dc.l NULL
_ITextText8:
dc.b 'Help',0
even
Gadget9:
dc.l NULL
dc.w 128,70
dc.w 80,15
dc.w NULL
dc.w RELVERIFY
dc.w BOOLGADGET
dc.l Border1
dc.l NULL
dc.l _IT9
dc.l NULL
dc.l NULL
dc.w REBOOT
dc.l NULL
_IT9:
dc.b 2,0,RP_JAM2,0
dc.w 15,4
dc.l NULL
dc.l _ITT9
dc.l _IT9b
_IT9b:
dc.b 1,0,RP_JAM1,0
dc.w 14,3
dc.l NULL
dc.l _ITT9
dc.l NULL
_ITT9:
dc.b 'ReBoot',0
even
;======== Tekst structures for viewmemory ============
IText8:
dc.b 2,0,RP_JAM2,0
dc.w 11,26
dc.l NULL
MTE8 dc.l NULL
dc.l IText8b
IText8b:
dc.b 1,0,RP_JAM1,0
dc.w 10,25
dc.l NULL
MTE8b dc.l NULL
dc.l IText9
IText9:
dc.b 2,0,RP_JAM2,0
dc.w 11,36
dc.l NULL
MTE9 dc.l NULL
dc.l IText9b
IText9b:
dc.b 1,0,RP_JAM1,0
dc.w 10,35
dc.l NULL
MTE9b dc.l NULL
dc.l IText10
IText10:
dc.b 2,0,RP_JAM2,0
dc.w 11,46
dc.l NULL
MTE10 dc.l NULL
dc.l IText10b
IText10b:
dc.b 1,0,RP_JAM1,0
dc.w 10,45
dc.l NULL
MTE10b dc.l NULL
dc.l IText11
IText11:
dc.b 2,0,RP_JAM2,0
dc.w 11,56
dc.l NULL
MTE11 dc.l NULL
dc.l IText11b
IText11b:
dc.b 1,0,RP_JAM1,0
dc.w 10,55
dc.l NULL
MTE11b dc.l NULL
dc.l IText12
IText12:
dc.b 2,0,RP_JAM2,0
dc.w 11,66
dc.l NULL
MTE12 dc.l NULL
dc.l IText12b
IText12b:
dc.b 1,0,RP_JAM1,0
dc.w 10,65
dc.l NULL
MTE12b dc.l NULL
dc.l IText13
IText13:
dc.b 2,0,RP_JAM2,0
dc.w 11,81
dc.l NULL
MTE13 dc.l NULL
dc.l IText13b
IText13b:
dc.b 1,0,RP_JAM1,0
dc.w 10,80
dc.l NULL
MTE13b dc.l NULL
dc.l NULL
IText14:
dc.b 2,0,RP_JAM2,0
dc.w 10
y1 dc.w 0
dc.l NULL
MTE14 dc.l dummy
dc.l IText14b
IText14b:
dc.b 1,0,RP_JAM1,0
dc.w 9
y2 dc.w 0
dc.l NULL
MTE14b dc.l dummy
dc.l NULL
;== Help strings =====================================
Text15:
dc.b 2,0,RP_JAM2,0
dc.w 11,21
dc.l NULL
dc.l T15
dc.l Text15b
Text15b:
dc.b 1,0,RP_JAM1,0
dc.w 10,20
dc.l NULL
dc.l T15
dc.l Text16
T15 dc.b 'This program is programmed by EA van Breemen',0
even
Text16:
dc.b 2,0,RP_JAM2,0
dc.w 11,31
dc.l NULL
dc.l T16
dc.l Text16b
Text16b:
dc.b 1,0,RP_JAM1,0
dc.w 10,30
dc.l NULL
dc.l T16
dc.l Text17
T16 dc.b 'Copyright by The Orega Programming Group Holland',0
even
Text17:
dc.b 2,0,RP_JAM2,0
dc.w 11,41
dc.l NULL
dc.l T17
dc.l Text17b
Text17b:
dc.b 1,0,RP_JAM1,0
dc.w 10,40
dc.l NULL
dc.l T17
dc.l Text18
T17 dc.b 169,'1989,1990. Any commercially based reproducing',0
even
Text18:
dc.b 2,0,RP_JAM2,0
dc.w 11,51
dc.l NULL
dc.l T18
dc.l Text18b
Text18b:
dc.b 1,0,RP_JAM1,0
dc.w 10,50
dc.l NULL
dc.l T18
dc.l Text19
T18 dc.b 'by any means of this shareware product is illegal.',0
even
Text19:
dc.b 2,0,RP_JAM2,0
dc.w 11,61
dc.l NULL
dc.l T19
dc.l Text19b
Text19b:
dc.b 1,0,RP_JAM1,0
dc.w 10,60
dc.l NULL
dc.l T19
dc.l Text20
T19 dc.b 'If you find this program usefull please send $10',0
even
Text20:
dc.b 2,0,RP_JAM2,0
dc.w 11,71
dc.l NULL
dc.l T20
dc.l Text20b
Text20b:
dc.b 1,0,RP_JAM1,0
dc.w 10,70
dc.l NULL
dc.l T20
dc.l Text21
T20 dc.b 'to: EA van Breemen, Berliozplein 15, 2651 VG',0
even
Text21:
dc.b 2,0,RP_JAM2,0
dc.w 11,81
dc.l NULL
dc.l T21
dc.l Text21b
Text21b:
dc.b 1,0,RP_JAM1,0
dc.w 10,80
dc.l NULL
dc.l T21
dc.l Text22
T21 dc.b 'Berkel en Rodenrijs, Holland.',0
even
Text22:
dc.b 2,0,RP_JAM2,0
dc.w 11,101
dc.l NULL
dc.l T22
dc.l Text22b
Text22b:
dc.b 1,0,RP_JAM1,0
dc.w 10,100
dc.l NULL
dc.l T22
dc.l Text23
T22 dc.b 'Help: Ctrl-F1 ..... NewShell',0
even
Text23:
dc.b 2,0,RP_JAM2,0
dc.w 11,111
dc.l NULL
dc.l T23
dc.l Text23b
Text23b:
dc.b 1,0,RP_JAM1,0
dc.w 10,110
dc.l NULL
dc.l T23
dc.l NULL
T23 dc.b ' Ctrl-HELP ..... BigBrother',0
even
;=====================================================
expert dc.b 0,1,2,2,3,4,5,6,3,4,7
dc.b 7,3,4,7,7,8,8,0,1,8,8
dc.b 5,5,8,8,7,7,8,8,7,7
even
convtable dc.b '0123456789abcdef',0
even
message dc.b 'This system has been modified.',0
L0 dc.b 'Memory is clean.',0
L1 dc.b 'Sca virus.',0
L2 dc.b 'Unknown virus or not mounted rad.',0
L3 dc.b 'Non reset virus.',0
L4 dc.b 'Sca like virus.',0
L5 dc.b 'Dasa virus.',0
L6 dc.b 'Dasa like virus.',0
L7 dc.b 'ByteBandit or Lamer virus.',0
L8 dc.b 'Unknown system configuration???',0
L9 dc.b 'System has not been modified. ',0
L10 dc.b ' ',0
even
TaskName dc.b 'RAD',0
even
devicename dc.b 'trackdisk.device',0
even
MyPortName dc.b 'BigBrother Port',0
even
errormessage dc.b 'BootBlock Read/Write Error.',0
even
found_rad dc.b 'RadTask has been found.',0
even
no_found_rad dc.b 'RadTask has not been found.',0
even
loginfo dc.b 'Launched by BigBrother V2.11',10,0
even
Alertstring dc.w 170
dc.b 15
dc.b '! ! ! ! ! W A R N I N G ! ! ! ! ! ',0
dc.b 1
dc.w 176
dc.b 27
dc.b 'Are you sure to clear the memory?',0
dc.b 1
dc.w 10
dc.b 39
dc.b 'Press <LEFT MOUSE BUTTON> for OK ---- Press <RIGHT MOUSE BUTTON> for CANCEL',0
dc.b 0
even
Alertstring2 dc.w 170
dc.b 15
dc.b '! ! ! ! ! W A R N I N G ! ! ! ! ! ',0
dc.b 1
dc.w 176
dc.b 27
dc.b 'Are you sure you want to Reboot? ',0
dc.b 1
dc.w 10
dc.b 39
dc.b 'Press <LEFT MOUSE BUTTON> for OK ---- Press <RIGHT MOUSE BUTTON> for CANCEL',0
dc.b 0
even
;================
;= Library data =
;================
DosName dc.b 'dos.library',0
cnop 0,2
IntuitionName dc.b 'intuition.library',0
cnop 0,2
GraphicsName dc.b 'graphics.library',0
cnop 0,2
ArpName dc.b 'arp.library',0
even
coldcapture dc.b 'ColdCapture - Offset 42 :$',0
coolcapture dc.b 'CoolCapture - Offset 46 :$',0
kickmemptr dc.b 'KickMemPtr - Offset 546 :$',0
kicktagptr dc.b 'KickTagPtr - Offset 550 :$',0
doio_vector dc.b 'DoIO Vector - Offset -454 :$',0
number dc.b '00000000',0
even
BIG_NAME dc.b 'BigBrother',0
even
NIL_NAME dc.b 'NIL:',0
even
script2 dc.b 'Execute s:F2',0
script3 dc.b 'Execute s:F3',0
script4 dc.b 'Execute s:F4',0
script5 dc.b 'Execute s:F5',0
script6 dc.b 'Execute s:F6',0
script7 dc.b 'Execute s:F7',0
script8 dc.b 'Execute s:F8',0
script9 dc.b 'Execute s:F9',0
script10 dc.b 'Execute s:F10',0
;=====================
;= Input Device data =
;=====================
InputDeviceName dc.b 'input.device',0
even
df0 dc.l 'DF0:'
df1 dc.l 'DF1:'
df2 dc.l 'DF2:'
df3 dc.l 'DF3:'
dc.b ' DoIO vector:'
even
DoIOVector dc.l $fc06dc ; DoIO Vector for V1.2
;=======================
;= Arp data structures =
;=======================
newshell: ; Process control structure for Arp
nsh_StackSize dc.l 4000 ; Stacksize for new process
nsh_Pri dc.b 0 ; Priority of new process
nsh_Control dc.b 128+8 ; Make a newshell
nsh_LogMsg dc.l loginfo
nsh_Input dc.l 0 ; Optional default input
nsh_Output dc.l 0 ; Optional default output
nsh_Reserved ds.l 5 ; Extra
CONNAME dc.b 'CON:0/0/639/75/The Orega Programming Group Holland',0
even
newshell2: ; Process control structure for Arp
pcb_StackSize dc.l 4000 ; Stacksize for new process
pcb_Pri dc.b 0 ; Priority of new process
pcb_Control dc.b 16 ; Make a background cli
pcb_TrapCode dc.l 0
pcb_Input dc.l 0 ; Optional default input
pcb_Output dc.l 0 ; Optional default output
pcb_Console dc.l CONNAME ; Union
pcb_LoadedCode dc.l mymain
pcb_lastGasp dc.l 0
pcb_WBProcess dc.l 0
even
bss
DOSBase ds.l 1
GfxBase ds.l 1
IntuitionBase ds.l 1
ArpBase ds.l 1
window ds.l 1
window2 ds.l 1
rp ds.l 1
rp2 ds.l 1
buffer ds.l 1
keyfound ds.w 1
commando ds.w 1
Mode ds.b 1
signal ds.b 1
Flag ds.b 1
drive ds.b 1
io_error ds.b 1
even
diskio ds.l 20
readreply ds.l 8
memorymask ds.l 1
filehandle ds.l 1
lock ds.l 1
InputRequestBlock ds.b $30
even
InputDevPort ds.b $22
even
HandlerStuff ds.b $16
even
dummy ds.b 70
even
userport ds.l 1
code
;=======================================
;= Initialisation code for Big Brother =
;=======================================
mymain move.l $4,a6
lea.l DosName,a1
clr.l d0
jsr _LVOOpenLibrary(a6)
move.l d0,DOSBase
beq nodos
bsr loadprefs
move.l $4,a6
clr.l d0
lea.l IntuitionName,a1
jsr _LVOOpenLibrary(a6)
move.l d0,IntuitionBase
beq nointuition
clr.l d0
lea.l GraphicsName,a1
jsr _LVOOpenLibrary(a6)
move.l d0,GfxBase
beq nographics
bsr.s initall ; Open inputdevice etc.
bra check ; Jump to checkroutine
;==================================
;= loadprefs: tries to load prefs =
;==================================
loadprefs:
move.l DOSBase,a6
move.l #prefs_file,d1
move.l #-2,d2
jsr _LVOLock(a6)
move.l d0,lock
beq no_prefs
move.l #prefs_file,d1
move.l #1005,d2
jsr _LVOOpen(a6)
move.l d0,filehandle
move.l d0,d1
move.l #DoIOVector,d2
moveq #4,d3
jsr _LVORead(a6)
move.l filehandle,d1
jsr _LVOClose(a6)
move.l lock,d1
jsr _LVOUnLock(a6)
no_prefs:
rts
;=============================================
;= Routine to install a input device handler =
;=============================================
initall: ; Open inputdevice
move.b #0,signal
move.b #0,Flag
move.b #0,drive ; df0: is default
move.l $4,a6 ; Make a message port
moveq #-1,d0
jsr _LVOAllocSignal(a6)
lea.l InputDevPort,a0
move.b d0,mp_SigBit(a0)
move.b #0,mp_Node+Ln_Pri(a0)
move.b #NT_MSGPORT,mp_Node+Ln_Type(a0)
move.l #MyPortName,mp_Node+Ln_Name(a0)
move.b #PA_SIGNAL,mp_Flags(a0)
sub.l a1,a1
jsr _LVOFindTask(a6)
move.l d0,a3
move.l #-1,WindowPtr(a3) ; I don't want requesters
lea.l InputDevPort,a0
move.l d0,mp_SigTask(a0)
move.l a0,a1
jsr _LVOAddPort(a6)
lea.l InputRequestBlock,a0
move.b #NT_MESSAGE,io_Message+mn_Node+Ln_Type(a0)
move.w #$30,io_Message+mn_Length(a0)
lea.l InputDevPort,a1
move.l a1,io_Message+mn_ReplyPort(a0)
lea.l HandlerStuff,a1
move.l #myhandler,is_Code(a1)
move.b #127,is_Node+Ln_Pri(a1)
move.l #0,is_Data(a1)
lea.l InputRequestBlock,a1
lea.l InputDeviceName,a0
clr.l d0
clr.l d1
jsr _LVOOpenDevice(a6)
lea.l InputRequestBlock,a0
move.w #IND_ADDHANDLER,io_Command(a0)
move.l #HandlerStuff,io_Data(a0)
move.l a0,a1
jsr _LVODoIO(a6) ; Install handler
rts
;====================================
;= Code for checking the Amiga =
;====================================
check bsr checkevents ; Any messages ???
bsr.s chlus ; Check routine
move.l DOSBase,a6
moveq #50,d1
jsr _LVODelay(a6)
bra.s check
chlus move.l $4,a0
move.l a0,a6
clr.l d2
tst.l 42(a0)
beq.s 1$
ori.l #1,d2
1$ tst.l 46(a0)
beq.s 2$
ori.l #1,d2
2$ tst.l 546(a0)
beq.s 3$
ori.l #2,d2
3$ tst.l 550(a0)
beq.s 4$
ori.l #2,d2
4$ lea.l 350(a0),a0
lea.l devicename,a1
move.l $4,a6
jsr _LVOFindName(a6)
move.l d0,a0
move.l -28(a0),d1
cmp.l #$fc0000,d1
bhs.s 5$
ori.l #8,d2
5$ move.l $4,a0
move.l -454(a0),d1
cmp.l DoIOVector,d1
beq.s 6$
ori.l #4,d2
6$ lea.l TaskName,a1
jsr _LVOFindTask(a6)
tst.l d0
beq.s 7$
ori.l #16,d2
7$ andi.l #31,d2
move.l d2,memorymask
moveq #0,d0
lea.l expert,a0
move.b 0(a0,d2),d0
cmp.b #0,d0
beq.s novirus
cmp.b #2,d0
beq.s novirus
move.b d0,signal
novirus
rts
;======================================================
;= The Input Device Handler for checking the Help Key =
;======================================================
myhandler ; The input_handler
cmp.b #IECLASS_RAWKEY,4(a0)
beq.s akey
noop move.l a0,d0 ; Return head of list
rts
akey move.w 8(a0),d0
and.w #IEQUALIFIER_CONTROL,d0 ; Mask Control bit
beq.s noop ; None of my keys
cmp.w #HELP_KEY,6(a0)
bne.s 1$ ; Check next key
move.w #HELP_KEY,keyfound
bra needed
1$ cmp.w #FUNC_F1,6(a0)
bne.s 2$
move.w #FUNC_F1,keyfound
bra needed
2$ cmp.w #FUNC_F2,6(a0)
bne.s 3$
move.w #FUNC_F2,keyfound
bra needed
3$ cmp.w #FUNC_F3,6(a0)
bne.s 4$
move.w #FUNC_F3,keyfound
bra needed
4$ cmp.w #FUNC_F4,6(a0)
bne.s 5$
move.w #FUNC_F4,keyfound
bra needed
5$ cmp.w #FUNC_F5,6(a0)
bne.s 6$
move.w #FUNC_F5,keyfound
bra needed
6$ cmp.w #FUNC_F6,6(a0)
bne.s 7$
move.w #FUNC_F6,keyfound
bra needed
7$ cmp.w #FUNC_F7,6(a0)
bne.s 8$
move.w #FUNC_F7,keyfound
bra needed
8$ cmp.w #FUNC_F8,6(a0)
bne.s 9$
move.w #FUNC_F8,keyfound
bra needed
9$ cmp.w #FUNC_F9,6(a0)
bne.s 10$
move.w #FUNC_F9,keyfound
bra needed
10$ cmp.w #FUNC_F10,6(a0)
bne noop
move.w #FUNC_F10,keyfound
needed move.b #1,Flag ; Big Brother Control Window is needed !
move.l (a0),a0
cmp.l #0,a0
beq.s out
bra myhandler ; Process more events !
out clr.l d0 ; End of chain
rts
;=====================================================
;= Checks if an event has occured and responds to it =
;=====================================================
checkevents
clr.l d0
move.b signal,d0
beq.s no_virus_signal
cmp.b #2,d0
beq.s no_virus_signal
bra.s activate ; Open window etc., a virus !!!
no_virus_signal:
move.b Flag,d0
beq.s 1$ ; No keys has been pressed
move.w keyfound,d0
cmp.w #FUNC_F1,d0
beq newcli ; Spawn a cli
cmp.w #HELP_KEY,d0
beq.s activate
bra do_function_keys
1$ rts
;=========================================================
;= Routine for the window processing in case of an event =
;=========================================================
activate
move.l IntuitionBase,a6
jsr _LVOWBenchToFront(a6)
move.l #NewWindowStructure1,a0
jsr _LVOOpenWindow(a6)
move.l d0,window
move.l d0,a0
move.l wd_RPort(a0),rp
move.l rp,a0
move.l #Border2,a1
moveq #0,d0
moveq #0,d1
jsr _LVODrawBorder(a6)
bsr printstatus
waitloop:
move.l window,a0
move.l wd_UserPort(a0),a0
move.l a0,userport
moveq #0,d1
move.b mp_SigBit(a0),d1
moveq #1,d0
asl.l d1,d0
move.l $4,a6
jsr _LVOWait(a6) ; Wait for an event
look move.l $4,a6
move.l userport,a0 ; Get UserPort
jsr _LVOGetMsg(a6) ; Get Message from IDCMP Port
tst.l d0
beq waitloop ; No more messages left
move.l d0,a1
move.l im_Class(a1),d4
move.l im_Code(a1),d5
move.l im_Address(a1),a2
jsr _LVOReplyMsg(a6) ; Reply the message
cmp.l #CLOSEWINDOW,d4
beq.s watchmode
cmp.l #GADGETUP,d4
bne.s look
bsr.s process_gadgets ; Someone has pressed a gadget
cmp.w #WATCH,d0
bne.s look
watchmode:
move.l IntuitionBase,a6
move.l window,a0
jsr _LVOCloseWindow(a6)
move.b #0,Flag
move.b #0,signal
rts
;==================================
;= Routine for processing Gadgets =
;==================================
process_gadgets:
move.w gg_GadgetID(a2),d0
cmp.w #WATCH,d0
bne.s 1$
rts
1$ cmp.w #DRIVE,d0
beq.s nextdrive
cmp.w #CLEAR,d0
beq clearmemory
cmp.w #VIEW,d0
beq viewbootblock
cmp.w #INSTALL,d0
beq installdisk
cmp.w #MEMORY,d0
beq viewmemory
cmp.w #NEWSHELL,d0
beq newcli
cmp.w #HELP,d0
beq showhelp
cmp.w #REBOOT,d0
beq reboot
clr.l d0 ; Clear d0 if GadgetID <> WATCH
rts
;==============================
;= Finds next available drive =
;==============================
nextdrive:
move.b drive,d0
addq #1,d0
cmp.b #4,d0 ; drive number too high ???
bne.s 1$
moveq #0,d0 ; just select df0:
1$ cmp.b #0,d0
bne.s 2$
move.l df0,ITextText1
2$ cmp.b #1,d0
bne.s 3$
move.l df1,ITextText1
3$ cmp.b #2,d0
bne.s 4$
move.l df2,ITextText1
4$ cmp.b #3,d0
bne.s 5$
move.l df3,ITextText1
5$ move.b d0,drive
move.l #ITextText1,d1
move.l DOSBase,a6
jsr _LVODeviceProc(a6) ; Does drive exists ?
tst.l d0
bne.s 6$ ; Yeah
bra.s nextdrive ; Try next drive
6$ move.l #Gadget1,a0
move.l window,a1
move.l #0,a2
move.l IntuitionBase,a6
jsr _LVORefreshGadgets(a6)
clr.l d0
rts
;================================
;= Clears memory area from viri =
;================================
clearmemory:
bsr yesno ; Are you sure????
tst.l d0
beq clearexit ; Noop
move.l $4,a6
jsr _LVODisable(a6)
lea.l TaskName,a1
jsr _LVOFindTask(a6)
tst.l d0
beq.s 1$ ; No rad
move.l d0,a1
jsr _LVORemTask(a6) ; Kill it!!!
1$ move.l $4,a6
clr.l 42(a6)
clr.l 46(a6)
clr.l 546(a6)
clr.l 550(a6)
clr.l 554(a6)
move.l DoIOVector,-454(a6)
clr.l d1
lea.l 34(a6),a0
move.w #$16,d0
loop add.w (a0)+,d1
dbf d0,loop
not.w d1
move.w d1,82(a6)
jsr _LVOEnable(a6)
move.l IntuitionBase,a6
move.l #0,a0
jsr _LVODisplayBeep(a6)
move.l $4,a6
move.b #0,signal
bsr chlus ; Check memory
bsr printstatus ; Show current memory status
clearexit:
clr.l d0 ; No WATCH Gadget
rts
;====================================
;= Are you sure to clear memory???? =
;====================================
yesno:
move.l IntuitionBase,a6
move.l #0,d0
move.l #Alertstring,a0
move.l #50,d1
jsr _LVODisplayAlert(a6)
rts
;====================================
;= Are you sure to reboot???? =
;====================================
yesno2:
move.l IntuitionBase,a6
move.l #0,d0
move.l #Alertstring2,a0
move.l #50,d1
jsr _LVODisplayAlert(a6)
rts
;==================================================
;= Routine shows a bootblock in ascii in a window =
;==================================================
viewbootblock:
move.w #534,hsize ; Adjust windowwidth
move.w #150,hsize+2 ; Adjust height
lea.l InitTitle,a0
move.l a0,title2
move.l IntuitionBase,a6
move.l #NewWindowStructure2,a0
jsr _LVOOpenWindow(a6)
move.l d0,window2
move.l d0,a0
move.l wd_RPort(a0),rp2
move.l $4,a6
move.l #1024,d0
moveq #2,d1 ; Chip memory needed
jsr _LVOAllocMem(a6) ; Allocate buffer for bootblock
move.l d0,buffer
bsr readbootblock
move.b io_error,d0
cmp.b #29,d0
bne 1$ ; Disk is available
move.l window2,a0
move.l #-234,d0
move.l #-100,d1
move.l IntuitionBase,a6
jsr _LVOSizeWindow(a6) ; Make window smaller
move.l #disk_changed,Mt5
move.l #disk_changed,Mt6
move.l rp2,a0
clr.l d0
clr.l d1
move.l #MyTekst5,a1
jsr _LVOPrintIText(a6) ; No disk !
bra 2$ ; skip printbuffer
1$ bsr printbuffer
2$ move.l buffer,a1
move.l #1024,d0
move.l $4,a6
jsr _LVOFreeMem(a6) ; Free buffer for bootblock
move.l window2,a0
bsr waitforclose ; Wait for closegadget
move.l IntuitionBase,a6
move.l window2,a0
jsr _LVOCloseWindow(a6)
clr.l d0 ; No WATCH Gadget
rts
;====================================
;= Routine for installing your disk =
;====================================
installdisk:
move.w #300,hsize
move.w #50,hsize+2 ; Adjust height
lea.l InstallTitle,a0
move.l a0,title2
move.l IntuitionBase,a6
move.l #NewWindowStructure2,a0
jsr _LVOOpenWindow(a6)
move.l d0,window2
move.l d0,a0
move.l wd_RPort(a0),rp2
move.l $4,a6
move.l #1024,d0
move.l #2+1<<16,d1 ; Cleared Chip memory needed
jsr _LVOAllocMem(a6) ; Allocate buffer for bootblock
move.l d0,buffer
beq skip_install ; Prevent a guru
lea.l bootcode,a0
move.l d0,a1
move.l #bootendcode-bootcode-1,d1
1$ move.b (a0)+,(a1)+ ; Copy bootblock into buffer
dbra d1,1$
move.l #StandardBootBlock,a0
move.l #Standardend-StandardBootBlock-1,d1
2$ move.b (a0)+,(a1)+
dbra d1,2$
bsr sum
bsr writebuffer
move.l buffer,a1
move.l #1024,d0
move.l $4,a6
jsr _LVOFreeMem(a6) ; Free buffer for bootblock
tst.b io_error
bne.s 3$ ; An error has occured
move.l #install_message,Mt5
move.l #install_message,Mt6
bra.s install_m
3$ move.b io_error,d0
cmp.b #28,d0 ; disk protected???
bne 4$
move.l #disk_protected,Mt5
move.l #disk_protected,Mt6
bra install_m
4$ cmp.b #29,d0 ; disk changed ????
bne 5$
move.l #disk_changed,Mt5
move.l #disk_changed,Mt6
bra install_m
5$ move.l #install_fail,Mt5 ; Unknown failure
move.l #install_fail,Mt6
install_m
move.l rp2,a0
clr.l d0
clr.l d1
move.l #MyTekst5,a1
move.l IntuitionBase,a6
jsr _LVOPrintIText(a6)
move.l window2,a0
bsr waitforclose ; Wait for closegadget
skip_install:
move.l IntuitionBase,a6
move.l window2,a0
jsr _LVOCloseWindow(a6)
clr.l d0 ; No WATCH Gadget
rts
;=============================================
;= Routine for displaying a part of ExecBase =
;=============================================
viewmemory:
move.w #318,hsize
move.w #100,hsize+2 ; Adjust height
lea.l ViewTitle,a0
move.l a0,title2
move.l IntuitionBase,a6
move.l #NewWindowStructure2,a0
jsr _LVOOpenWindow(a6)
move.l d0,window2
move.l d0,a0
move.l wd_RPort(a0),rp2
move.l $4,a6
move.l #5*80,d0
move.l #1<<16,d1
jsr _LVOAllocMem(a6) ; Allocate buffer
move.l d0,buffer
move.l d0,-(a7)
move.l d0,MTE8
move.l d0,MTE8b
add.l #80,d0
move.l d0,MTE9
move.l d0,MTE9b
add.l #80,d0
move.l d0,MTE10
move.l d0,MTE10b
add.l #80,d0
move.l d0,MTE11
move.l d0,MTE11b
add.l #80,d0
move.l d0,MTE12
move.l d0,MTE12b
;======== ColdCapture ==============
lea.l coldcapture,a0
move.l buffer,a1
bsr stringcopy
move.l $4,a6
move.l 42(a6),a0
bsr makestring
;======= CoolCapture =============
add.l #80,buffer
lea.l coolcapture,a0
move.l buffer,a1
bsr stringcopy
move.l $4,a6
move.l 46(a6),a0
bsr makestring
;======== KickMemPtr ===============
add.l #80,buffer
lea.l kickmemptr,a0
move.l buffer,a1
bsr stringcopy
move.l $4,a6
move.l 546(a6),a0
bsr makestring
;========== KickTagPtr ================
add.l #80,buffer
lea.l kicktagptr,a0
move.l buffer,a1
bsr stringcopy
move.l $4,a6
move.l 550(a6),a0
bsr makestring
;==== DoIO =========================
add.l #80,buffer
lea.l doio_vector,a0
move.l buffer,a1
bsr stringcopy
move.l $4,a6
move.l -454(a6),a0
bsr makestring
;===== Rad ============================
move.l $4,a6
lea.l TaskName,a1
jsr _LVOFindTask(a6)
tst.l d0
beq.s no_rad ; No rad
move.l #found_rad,MTE13
move.l #found_rad,MTE13b
bra.s rad_cont
no_rad move.l #no_found_rad,MTE13
move.l #no_found_rad,MTE13b
rad_cont:
move.l rp2,a0
clr.l d0
clr.l d1
move.l #IText8,a1
move.l IntuitionBase,a6
jsr _LVOPrintIText(a6)
move.l $4,a6
move.l #5*80,d0
move.l (a7)+,a1
jsr _LVOFreeMem(a6) ; Free buffer
move.l window2,a0
bsr waitforclose
move.l IntuitionBase,a6
move.l window2,a0
jsr _LVOCloseWindow(a6)
clr.l d0 ; No WATCH Gadget
rts
;==============
;= Makestring =
;==============
makestring:
move.l $4,a6
lea.l number,a1
bsr.s convert
lea.l number,a1
move.l buffer,a0
bsr.s stringadd
rts
;========================
;= Copy string a0 -> a1 =
;========================
stringcopy:
1$ move.b (a0)+,d0
move.b d0,(a1)+
bne.s 1$
rts
;==============================
;= Add string a1 to string a0 =
;==============================
stringadd:
move.l a2,-(a7)
1$ cmp.b #0,(a0)+ ; Find end of string a0
bne.s 1$
subq #1,a0
move.l a0,a2
move.l a1,a0
move.l a2,a1
bsr.s stringcopy ; Paste a1 to a0
move.l (a7)+,a2
rts
;==========================================
;= Convert value in a0 to buffer a1 (Hex) =
;==========================================
convert:
movem.l d2-d3/a2,-(a7)
lea.l convtable,a2
move.l a0,d1
moveq #7,d3
1$ move.l d1,d2
and.l #$f,d2
move.l d2,d0
move.b 0(a2,d0),-(a7)
lsr.l #4,d1
dbra d3,1$
moveq #7,d3
2$ move.b (a7)+,(a1)+
dbra d3,2$
movem.l (a7)+,d2-d3/a2
rts
;=========================================
;= Calculates lenght of string in buffer =
;= Returns lenght in d0 =
;=========================================
length:
clr.l d0
move.l a5,-(a7)
move.l buffer,a5
1$ addq #1,d0
cmp.b #0,(a5)+
bne.s 1$
subq #1,d0
move.l (a7)+,a5
rts
;=======================================
;= Waits for closegadget to be pressed =
;=======================================
waitforclose:
move.l $4,a6
move.l a5,-(a7)
move.l a0,a5
1$ move.l a5,a0
move.l wd_UserPort(a0),a0
move.l a0,-(a7)
moveq #0,d1
move.b mp_SigBit(a0),d1
moveq #1,d0
asl.l d1,d0
jsr _LVOWait(a6) ; Wait for an event
move.l (a7)+,a0 ; Get UserPort
jsr _LVOGetMsg(a6) ; Get Message from IDCMP Port
move.l d0,a1
move.l im_Class(a1),d4
jsr _LVOReplyMsg(a6) ; Reply the message
cmp.l #CLOSEWINDOW,d4
bne.s 1$
move.l (a7)+,a5
rts
;========================================
;= Prints current virusstatus in window =
;========================================
printstatus:
move.l window,a0
move.l wd_RPort(a0),a1
move.l a1,rp ; Store RastPort
moveq #0,d1
move.b signal,d1
beq.s 1$ ; No extra message needed (=Clean)
cmp.b #2,d1
beq.s 1$ ; The same...
move.l #message,Mt3 ; System has been modified!
move.l #message,Mt4
bra 12$
1$ move.l rp,a0 ; Clear message box
clr. d0
clr.l d1
move.l #MyTekst3a,a1
move.l IntuitionBase,a6
jsr _LVOPrintIText(a6)
move.l #L9,Mt3 ; Clear previous(?) message!
move.l #L9,Mt4
12$ move.l rp,a0
clr. d0
clr.l d1
move.l #MyTekst3,a1
move.l IntuitionBase,a6
jsr _LVOPrintIText(a6)
move.b signal,d1
cmp.b #0,d1
bne.s 2$
lea.l L0,a0
bra.s 10$
2$ cmp.b #1,d1
bne.s 3$
lea.l L1,a0
bra.s 10$
3$ cmp.b #2,d1
bne.s 4$
lea.l L2,a0
bra.s 10$
4$ cmp.b #3,d1
bne.s 5$
lea.l L3,a0
bra.s 10$
5$ cmp.b #4,d1
bne.s 6$
lea.l L4,a0
bra.s 10$
6$ cmp.b #5,d1
bne.s 7$
lea.l L5,a0
bra.s 10$
7$ cmp.b #6,d1
bne.s 8$
lea.l L6,a0
bra.s 10$
8$ cmp.b #7,d1
bne.s 9$
lea.l L7,a0
bra.s 10$
9$ cmp.b #8,d1
bne.s 11$
lea.l L8,a0
10$ move.l a0,Mt1
move.l a0,Mt2
move.l rp,a0
move.l #MyTekst,a1
clr.l d0
clr.l d1
move.l IntuitionBase,a6
jsr _LVOPrintIText(a6)
11$ rts
;======================================
;= Prints buffer in ascii on a window =
;======================================
printbuffer:
move.l buffer,a3
move.l a3,a4
move.l #1023,d1
clr.l d0
cloop move.b (a3)+,d0
cmp.b #31,d0
bls.s outrange
cmp.b #127,d0
bhs.s outrange
move.b d0,(a4)+
dbra d1,cloop
bra.s printit
outrange:
move.b #'.',(a4)+
dbra d1,cloop
printit:
move.l window2,a0
move.l wd_RPort(a0),rp2
moveq #0,d3
move.l buffer,a3
ploop move.l d3,d1
mulu #8,d1
add.l #20,d1
move.w d1,y1
subq #1,d1
move.w d1,y2
move.l #dummy,a2
move.l d3,d1
mulu #64,d1
move.l a3,a0
add.l d1,a0
moveq #63,d0
1$ move.b (a0)+,(a2)+ ; copy string to dummy
dbra d0,1$
move.b #0,(a2) ; end string with 0
clr.l d0
clr.l d1
move.l rp2,a0
lea.l IText14,a1
move.l IntuitionBase,a6
jsr _LVOPrintIText(a6)
addq #1,d3
cmp.l #15,d3
bls.s ploop
rts
;============================
;= Read bootblock in buffer =
;============================
readbootblock:
move.w #READ,commando
bsr.s bootio
rts
;=============================
;= Write buffer to bootblock =
;=============================
writebuffer:
move.w #WRITE,commando
bsr.s bootio
rts
;==========================================
;= Multi function boot read/write routine =
;= =
;= io_error contains error on exit =
;= =
;==========================================
bootio:
move.l $4,a6
sub.l a1,a1
jsr _LVOFindTask(a6)
move.l d0,readreply+$10
lea.l readreply,a1
jsr _LVOAddPort(a6)
lea.l diskio,a1
moveq #0,d0
move.b drive,d0
clr.l d1
lea.l devicename,a0
jsr _LVOOpenDevice(a6)
tst.l d0
beq.s tskip
lea.l readreply,a1
jsr _LVORemPort(a6)
bra trackerror
tskip lea.l diskio,a1
move.l buffer,40(a1)
move.l #readreply,14(a1)
move.w #TD_CHANGESTATE,28(a1)
jsr _LVODoIO(a6)
move.l diskio+32,d6
beq.s tskip2
move.b #29,io_error
bra terror ; No disk!
tskip2 move.w commando,d5
cmp.w #READ,d5
bne.s 1$ ; Don't CMD_CLEAR for a write
lea.l diskio,a1 ; We will read a bootblock
move.l buffer,40(a1)
move.l #readreply,14(a1) ; so, force a reading
move.w #5,28(a1)
jsr _LVODoIO(a6) ; CMD_Clear (Clear trackbuffer)
1$ lea.l diskio,a1
move.l #readreply,14(a1)
move.w commando,28(a1)
move.l buffer,40(a1)
move.l #1024,36(a1)
move.l #0,44(a1)
move.l $4,a6
jsr _LVODoIO(a6)
move.b diskio+31,io_error ; Error number
move.w commando,d5
cmp.w #WRITE,d5
bne.s 2$
lea.l diskio,a1
move.l buffer,40(a1)
move.l #readreply,14(a1)
move.w #4,28(a1) ; CMD_UPDATE
move.l $4,a6
jsr _LVODoIO(a6) ; Write all buffers out
move.b diskio+31,io_error ; Get error number
2$ tst.b io_error
beq.s tgood
terror lea.l errormessage,a1
move.l window2,a0
move.l #0,a2
move.l IntuitionBase,a6
jsr _LVOSetWindowTitles(a6)
move.l $4,a6
tgood lea.l diskio,a1
move.w #9,28(a1) ; TD_MOTOR
move.l #0,36(a1)
jsr _LVODoIO(a6)
lea.l readreply,a1
jsr _LVORemPort(a6)
lea.l diskio,a1
jsr _LVOCloseDevice(a6)
trackerror:
rts
;================================
;= The maincode of my Bootblock =
;================================
bootcode:
dc.b 'DOS',0
dc.l 0
root dc.l 880
main move.l $4,a6
lea.l Dosname(pc),a1
jsr _LVOFindResident(a6)
move.l d0,a0
move.l 22(a0),a0
clr.l d0
rts
Dosname dc.b 'dos.library',0
bootendcode:
;=========================================================
;= Routine which calculates the checksum of my bootblock =
;=========================================================
even
sum clr.l d0
move.l buffer,a0
move.l #255,d1
sumloop add.l (a0)+,d0
bcc.s sumcont
addq #1,d0
sumcont dbra d1,sumloop
moveq #-1,d1
sub.l d0,d1
move.l buffer,a2
move.l d1,4(a2)
rts
;===============================================
;= This routine will spawn a new cli using arp =
;===============================================
newcli:
move.l $4,a6
lea.l ArpName,a1
clr.l d0
jsr _LVOOpenLibrary(a6)
move.l d0,ArpBase
bne 1$
move.l IntuitionBase,a6 ; Arp is not available
move.l #0,a0
jsr _LVODisplayBeep(a6)
bra 2$
1$ move.l ArpBase,a6
lea.l CONNAME,a0
move.l #0,a1
lea.l newshell,a2
jsr _ASyncRun(a6)
move.l $4,a6
move.l ArpBase,a1
jsr _LVOCloseLibrary(a6) ; Close Arp
2$ move.b #0,Flag ; Clear key signal
move.b #0,keyfound
clr.l d0
rts
do_function_keys:
cmp.w #FUNC_F2,d0
bne 1$
lea.l script2,a0
bra cont
1$ cmp.w #FUNC_F3,d0
bne 2$
lea.l script3,a0
bra cont
2$ cmp.w #FUNC_F4,d0
bne 3$
lea.l script4,a0
bra cont
3$ cmp.w #FUNC_F5,d0
bne 4$
lea.l script5,a0
bra cont
4$ cmp.w #FUNC_F6,d0
bne 5$
lea.l script6,a0
bra cont
5$ cmp.w #FUNC_F7,d0
bne 6$
lea.l script7,a0
bra cont
6$ cmp.w #FUNC_F8,d0
bne 7$
lea.l script8,a0
bra cont
7$ cmp.w #FUNC_F9,d0
bne 8$
lea.l script9,a0
bra cont
8$ cmp.w #FUNC_F10,d0
bne ret
lea.l script10,a0
cont move.l a0,d1
clr.l d2
clr.l d3
move.l DOSBase,a6
jsr _LVOExecute(a6)
ret move.b #0,Flag ; Clear key signal
move.b #0,keyfound
clr.l d0
rts
;====================================
;= Help routine: shows credits+help =
;====================================
showhelp:
move.w #418,hsize
move.w #130,hsize+2 ; Adjust height
move.l #HelpTitle,title2
move.l IntuitionBase,a6
move.l #NewWindowStructure2,a0
jsr _LVOOpenWindow(a6)
move.l d0,window2
move.l d0,a0
move.l wd_RPort(a0),a0
move.l #Text15,a1
clr.l d0
clr.l d1
jsr _LVOPrintIText(a6)
move.l window2,a0
bsr waitforclose
move.l IntuitionBase,a6
move.l window2,a0
jsr _LVOCloseWindow(a6)
clr.l d0
rts
;======================
;= The reboot routine =
;======================
reboot bsr yesno2 ; Want to reboot???
tst.l d0
bne.s 1$ ; noop
rts
1$ move.l $4,a6
move.l #-1,$4
cmp.w #V36_EXEC,LIB_VERSION(a6)
blt.s old_exec
jmp TEMP_ColdReboot(a6) ;Let Exec do it...
;NOTE: Control flow never returns to here
old_exec:
lea.l GoAway(pc),a5 ;address of code to execute
jsr _LVOSupervisor(a6) ;trap to code at (a5)...
;NOTE: Control flow never returns to here
;-------------- MagicResetCode ---------DO NOT CHANGE-----------------------
CNOP 0,4 ;IMPORTANT! Longword align!
GoAway: lea.l MAGIC_ROMEND,a0 ;(end of ROM)
sub.l MAGIC_SIZEOFFSET(a0),a0 ;(end of ROM)-(ROM size)=PC
move.l 4(a0),a0 ;Get Initial Program Counter
subq.l #2,a0 ;now points to second RESET
reset ;first RESET instruction
jmp (a0) ;CPU Prefetch executes this
;NOTE: the RESET and JMP instructions must share a longword!
;---------------------------------------DO NOT CHANGE-----------------------
;=======================
;= The Cleanup Routine =
;=======================
exit move.l $4,a6
move.l GfxBase,a1
jsr _LVOCloseLibrary(a6)
nographics:
move.l IntuitionBase,a1
jsr _LVOCloseLibrary(a6)
nointuition:
move.l DOSBase,a1
jsr _LVOCloseLibrary(a6)
nodos rts
;=========================
;= The end of the source =
;=========================
end