Path: santra!tut!sunic!mcsun!uunet!snorkelwacker!apple!usc!cs.utexas.edu!mailrus!accuvax.nwu.edu!delta.eecs.nwu.edu!squires From: squires@delta.eecs.nwu.edu (Matt Squires) Newsgroups: comp.sys.handhelds Subject: HP48SX Analog Clock Message-ID: <5064@accuvax.nwu.edu> Date: 13 Mar 90 02:36:29 GMT Sender: news@accuvax.nwu.edu Reply-To: squires@delta.eecs.nwu.edu (Matt Squires) Organization: Northwestern U, Evanston IL, USA Lines: 101 (is there an HP48SX archive somewhere? Bob?) Here is a submission for the Useless HP48SX Demo Program Archive, an analog clock. I execute << OFF CLOCK >> when I am done using my 48 for a while. MKFACE generates FACE, the background picture. You only need to run this once. It takes about 15 secs to execute (ARCs are slow). Once you have a FACE, you can run CLOCK every time you want to impress your friends. Please send comments, bug fixes to squires@eecs.nwu.edu Matt Squires CLOCK bytes: 425.5 checksum: [43E6h] << RCLF ; Recall flags -16 SF ; Polar, degrees, complex -17 CF -18 CF -19 SF ERASE 'PPAR' PURGE ; Reset PPAR PICT { # 34d # 1d } FACE GOR ; Draw "face" centered TIME HMS-> -> t ; Grab the time << 1.55 ; Hour hand length t 12 MOD 30 * NEG 90 + ; convert time to degrees ->V2 (0,0) OVER LINE DUP _ ; hour hand arrow 2 \/ INV * V-> 45 + ->V2 SWAP OVER LINE DUP V-> 90 - ->V2 SWAP OVER LINE DUP _ 2 \/ * V-> 45 + ->V2 LINE 2.7 ; Minute hand length t FP 360 * NEG 90 + ; convert to degrees ->V2 (0,0) LINE >> STOF ; restore flags 'PPAR' PURGE ; get rid of annoying PPAR { } PVIEW >> MKFACE bytes: 306.5 checksum: [47A6h] << RCLF -16 SF -17 CF -18 CF -19 SF ERASE 'PPAR' PURGE ; reset PPAR (0,0) 3.1 0 360 ARC ; circle 0 359 FOR d ; ticks every hour 2.8 d ->V2 3.1 d ->V2 LINE 30 STEP (-.2,-.2) (.2,.2) BOX PICT (-3.1,-3.1) (3.1,3.1) SUB 'FACE' STO STOF >>