dyer@atari.UUCP (02/22/87)
This is a disk activity "LED" for the Atari ST. It presents a blinking bar on the bottom right of any resolution screen. The bar: o is on ONLY during rwabs() calls; o is solid for reads, dashed for writes. Ok, it's silly. But I like to watch it.... Included below is a shar file containing the uuencoded version of DISKBAR.PRG (which can be placed in your AUTO folder, if you like). The source code is also included, but won't assemble under AS68. It should be easy to make it assemble under AS68 with a little work. No warranty expressed or implied. Here is an "ls -l" of the files mere seconds before they were collected and posted: -rw-r--r-- 1 dyer 278 Feb 22 00:06 diskbar.prg -rw-r--r-- 1 dyer 2506 Feb 22 00:06 diskbar.s -rw-r--r-- 1 dyer 414 Feb 22 00:09 diskbar.uu ------------------- cut this line & everything above it ------------ echo x - diskbar.uu sed 's/^X//' >diskbar.uu <<'*-*-END-of-diskbar.uu-*-*' Xbegin 644 diskbar.prg XM8!H```#H``````````X``````````````````#\\``).3E1/T+P``'SP(\`` XM``#H0GD```#T+SP```#6/SP`)DY.7$\@;P`$("@`#-"H`!30J``<T+P```$` XM/SP``"\`/SP`,4Y!4$\CUP```/`NO````(X2.()@PGP``S0Y````]+5!TD$R XM.Q!2('D```#H-"\`!,1\``'40M1"(;L@3!``('D```#L3M`2.()@PGP``S0Y XM````]+5!TD$R.Q`<('D```#H0K`0``IY``0```#T('D```#P3M``#``,``P` XM#``$``@`"``(______#P\/`C^`1V````["'\````3`1V3G4````0!@8R!@X. X(&!`.#`8B!@`( X` Xend *-*-END-of-diskbar.uu-*-* echo x - diskbar.s sed 's/^X//' >diskbar.s <<'*-*-END-of-diskbar.s-*-*' X .title 'Disk "LED" Indicator' X;------------------------------------------------------------------------ X; : X; Silly "Disk LED" program : X; : X;---------------- : X; 9-Nov-1986 atari!dyer Hacked it up. You need MADMAC to : X; assemble it, though.... : X; : X;------------------------------------------------------------------------ X .include atari ; Atari ST equates and macros X X Physbase ; d0 -> screen base X add.l #(200*160)-16,d0 ; compute addr of longword X move.l d0,stuffSpot ; and save it X clr.w flipstate X Supexec #install ; install our installer X X move.l 4(sp),a0 ; compute size to Ptermres X move.l $c(a0),d0 X add.l $14(a0),d0 X add.l $1c(a0),d0 X add.l #$100,d0 X X Ptermres d0,#0 ; terminate and stay resident X X X;---------------- X; X; Rwabs() intercept X; o save return address X; o setup to return to ret_handler X; o turn on the indicator X; o follow through old Rwabs() vector X; Xhandler: X move.l (sp),ret_addr ; save return address X move.l #ret_handler,(sp) ; arrange return to ret_handler X X move.b shiftmd,d1 ; d1 = resolution&3 X and.w #$0003,d1 X move.w flipstate,d2 ; eor-in flip state X eor.w d2,d1 X add.w d1,d1 ; d1 = wordIndex(d1) X move.w reztab(pc,d1.w),d1 ; get offset X X move.l stuffSpot,a0 ; turn on the indicator X move.w 4(sp),d2 ; get read/write mode X and.w #1,d2 X add.w d2,d2 X add.w d2,d2 X move.l indic(pc,d2.w),(a0,d1.w) ; stuff bar into screen ram X X move.l old_rw,a0 ; follow through to X jmp (a0) ; original handler X X X;---------------- X; X; Rwabs return intercept X; o turn off the indicator X; o flip indicator offset X; o return to original caller X; Xret_handler: X move.b shiftmd,d1 ; d1 = resolution&3 X and.w #$0003,d1 X move.w flipstate,d2 ; eor-in flip offset X eor.w d2,d1 X add.w d1,d1 ; d1 = wordIndex(d1) X move.w reztab(pc,d1.w),d1 ; get offset X X move.l stuffSpot,a0 ; turn off the indicator X clr.l (a0,d1.w) X eor.w #%100,flipstate ; flip screen offset X X move.l ret_addr,a0 ; return to original caller X jmp (a0) X X; X; Offsets into stuffSpot[] for low, medium and high rez X; Xreztab: dc.w 12,12,12,12 X dc.w 4,8,8,8 X Xindic: dc.l $ffffffff ; read (solid) X dc.l $f0f0f0f0 ; write (dashed) X X X;---------------- X; X; Rwabs() intercept installer X; Xinstall: X move.l hdv_rw,old_rw ; save old vector X move.l #handler,hdv_rw ; install our new one X rts X X X .bss XstuffSpot: ds.l 1 ; -> indicator Xold_rw: ds.l 1 ; = original hdv_rw vector Xret_addr: ds.l 1 ; = caller's return address Xflipstate: ds.w 1 ; = flip state *-*-END-of-diskbar.s-*-* exit -- -Landon Dyer, Atari Corp. {sun,lll-lcc,imagen}!atari!dyer The views expressed here do not not necessarily reflect those of Atari Corp. Segments are for worms.