Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:08 03 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Retro computing - sliderule

     Page 1 of 2    
Author Message
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 05:40am 06 Dec 2020
Copy link to clipboard 
Print this post

This is 'real' retro.



You can move the slide using the left and right arrows or the cursor using up and down.
In both cases, 'shift' moves fast and 'ctrl' move real slow.

If you have a mouse, simply drag the slide or cursor.
You will have to edit line 10 to suit your mouse port (or zero if no mouse)

I need to experiment with the various blit/sprite methods to see if I can reduce the flicker.

 'TassyJim December 2020
 '
 'simple Mannheim type slide rule
 ' translated for a post on the LIberty Basic forum by tsh73
 'If you need instructions on operating slide rule, you can check
 'https://www.sliderulemuseum.com/
 '
 OPTION EXPLICIT
 OPTION DEFAULT FLOAT
 CONST mouseport = 2 ' use 0 for no mouse else 1-3 for the corresponding port
 DIM WW = MM.HRES
 DIM x0=1
 DIM x1=10
 DIM n = 1000
 DIM h0 = (x1)/n
 DIM firstXX=30
 DIM SCALE = (WW - 2*firstXX)/LOG(x1)
 
 'vertical scale positions in pixels
 CONST Tedge = 30
 CONST Lline  = Tedge + 35
 CONST Kline  = Lline + 35
 CONST ABline = Kline + 35
 CONST CDline = ABline+ 70
 CONST Sline  = CDline+ 70
 CONST Tline  = Sline + 35
 CONST Ledge  = Tline + 10
 
 DIM x,i,h,d,xx, lastxx, dd, quit, kp,sp, nudge
 DIM oldFirstXX, k, slidepos, oldpos, cursorpos, oldcursorpos
 DIM mx, my, ms, mc, mlb, oldmx, oldlmb
 CONST bg1 = RGB(255,255,128)
 CONST bg2 = RGB(WHITE)
 CONST gra = RGB(32,32,32)
 
 MODE 1,8,RGB(BLACK),moveslide
 CLS
 PAGE WRITE 1
 CLS
 IF mouseport > 0 THEN
   CONTROLLER MOUSE OPEN mouseport
   GUI CURSOR ON 1,MM.HRES/2,MM.VRES/2,RGB(RED)
 ENDIF
 BOX 10,Tedge+5,WW-10,Kline-Tedge,1,bg1,bg1
 BOX 10,Kline+5,WW-10,Sline-Kline,1,bg2,bg2
 BOX 10,Sline-30,WW-10,Ledge-Sline+35,1,bg1,bg1
 
 '=============== Draw scales ================
 'C, D scales (main) -------------------------------------
 x = x0
 i = 0
 DO WHILE i<=900
   SELECT CASE x
     CASE IS <2
       h = 1
     CASE IS <4
       h = 2
     CASE ELSE
       h = 5
   END SELECT
   xx = firstXX+LOG(x)*SCALE
   d=7
   IF i MOD 5 = 0 THEN d=d+2
   IF i MOD 10 = 0 THEN d=d+3
   IF i MOD 100 = 0 THEN d=d+4
   LINE xx,CDline,xx,CDline-d,1,gra
   LINE xx,CDline+2,xx,CDline+2+d,1,gra
   IF i MOD 100 = 0 THEN
     TEXT xx-3,CDline-27,LEFT$(STR$(x),1),,7,1,gra,bg2
     TEXT xx-3,CDline+27,LEFT$(STR$(x),1),,7,1,gra,bg2
   ELSE
     IF i MOD 10 = 0 AND x<2 THEN
       TEXT xx-7,CDline-24,"1."+RIGHT$(STR$(x-1),1),,7,1,gra,bg2
       TEXT xx-7,CDline+24,"1."+RIGHT$(STR$(x-1),1),,7,1,gra,bg2
     END IF
   END IF
   i = i+h
   x = x+h*h0
 LOOP
 lastXX=xx
 
 'Pi mark on C,D scales -------------------------------------
 xx = firstXX+LOG(ACOS(-1))*SCALE
 d=5
 dd=12
 TEXT xx-3,CDline-28,"pi",,7,1,gra,bg2
 TEXT xx-3,CDline+28,"pi",,7,1,gra,bg2
 LINE xx,CDline-dd,xx,CDline-dd-d,1,gra
 LINE xx,CDline+2+dd,xx,CDline+2+dd+d,1,gra
 '
 'L scale -------------------------------------
 n=200
 h=(lastXX-firstXX)/n
 FOR i = 0 TO n
   x=i/200
   xx=firstXX+i*h
   d=7
   IF i MOD 2 = 0 THEN d=d+2
   IF i MOD 10 = 0 THEN d=d+6
   IF i MOD 20 = 0 THEN d=d+4
   LINE xx,Lline,xx,Lline-d,1,gra
   IF i MOD 20 = 0 THEN
     TEXT xx-8,Lline-24,STR$(x,1,1),,7,1,gra,bg1 '+4*(i=200)
     '#gr "\";right$(using("#.#",x), 3 + (i=200))
   END IF
 NEXT i
 '
 'A, B scales (square) -------------------------------------
 oldFirstXX=firstXX
 FOR k=1 TO 2
   x = x0
   i = 0
   DO WHILE i<=900
     SELECT CASE x
       CASE IS <2
         h = 2
       CASE IS <5
         h = 5
       CASE ELSE
         h = 10
     END SELECT
     xx = firstXX+LOG(x)/2*SCALE
     d=7
     IF i = 50 THEN d=d+3
     IF i MOD 10 = 0 THEN d=d+2
     IF i MOD 100 = 0 THEN d=d+5
     LINE xx,ABline,xx,ABline-d,1,gra
     LINE xx,ABline+2,xx,ABline+2+d,1,gra
     IF i MOD 100 = 0 THEN
       TEXT xx-3,ABline-27,LEFT$(STR$(x),1),,7,1,gra,bg2
       TEXT xx-3,ABline+27,LEFT$(STR$(x),1),,7,1,gra,bg2
     END IF
     i = i+h
     x = x+h*h0
   LOOP
   firstXX = xx
 NEXT k
 '
 'K scale (cube) -------------------------------------
 firstXX= oldFirstXX
 FOR k=1 TO 3
   x = x0
   i = 0
   DO WHILE i<=900
     SELECT CASE x
       CASE IS <3
         h = 5
       CASE IS <6
         h = 10
       CASE ELSE
         h = 20
     END SELECT
     xx = firstXX+LOG(x)/3*SCALE
     d=7
     IF i MOD 10 = 0 THEN d=d+2
     IF i MOD 50 =0 THEN d=d+3
     IF i MOD 100 = 0 THEN d=d+5
     LINE xx,Kline,xx,Kline-d,1,gra
     IF i MOD 100 = 0 THEN
       TEXT xx-3,Kline-27,LEFT$(STR$(x),1),,7,1,gra,bg1
     END IF
     i = i+h
     x = x+h*h0
   LOOP
   firstXX = xx
 NEXT
 '
 ' S scale (sine)
 ' todo
 '
 ' T scale (tangent)
 ' todo
 '
 'labels -------------------------------------
 TEXT 15,Kline-10,"K",,7,1,gra,bg1
 TEXT 15,ABline-12,"A",,7,1,gra,bg2
 TEXT 15,ABline+5,"B",,7,1,gra,bg2
 TEXT 15,Lline-10,"L",,7,1,gra,bg1
 TEXT 15,CDline-12,"C",,7,1,gra,bg2
 TEXT 15,CDline+5,"D",,7,1,gra,bg2
 TEXT 15,Sline-10,"S",,7,1,gra,bg1
 TEXT 15,Tline-10,"T",,7,1,gra,bg1
 
 BLIT READ 1,10,Tedge,MM.HRES,ABline-Tedge,1
 BLIT READ 2,10,CDline,MM.HRES,Ledge-CDline,1
 SPRITE READ 3,10,ABline+1,MM.HRES,CDline-ABline,1
 ' make cursor as sprite
 CLS
 BOX 10,Tedge-5,50,12,1,RGB(CYAN),RGB(CYAN)
 BOX 10,Ledge-2,50,12,1,RGB(CYAN),RGB(CYAN)
 LINE 35,Tedge-10,35,Ledge+10,1,gra
 
 SPRITE READ 4,10,Tedge-5,50,Ledge-Tedge+15,1
 
 PAGE WRITE 0
 BLIT WRITE 1,10,Tedge
 BLIT WRITE 2,10,CDline
 SPRITE SHOW 3, slidepos, ABline,0
 SPRITE SHOW 4,cursorpos,Tedge-5,0
 
 TEXT MM.HRES/2,Ledge+20,"Left and right to shift slide",CM
 TEXT MM.HRES/2,Ledge+35,"Up and Down to shift cursor",CM
 TEXT MM.HRES/2,Ledge+50,"Shift for rapid, ctrl for slow",CM
 TEXT MM.HRES/2,Ledge+65,"Or drag with a mouse",CM
 TEXT MM.HRES/2,Ledge+85,"Q to quit",CM
 
 DO
   IF KEYDOWN(0) > 0 THEN
     kp = KEYDOWN(1)
     sp = KEYDOWN(7)' either shift key
     IF sp = 2 OR sp = 32 THEN nudge = 1 ELSE nudge = 0 ' single step or continuous
     IF sp = 8 OR sp = 128 THEN sp = 10 ELSE sp = 1 ' shift key for rapid movement
     SELECT CASE kp
       CASE 128
         cursorpos = MIN(cursorpos + sp,WW-1)
       CASE 129, 161
         cursorpos = MAX(cursorpos - sp,1-WW)
       CASE 131, 163
         slidepos = MIN(slidepos + sp,WW-1)
       CASE 130
         slidepos = MAX(slidepos - sp,1-WW)
       CASE 113
         quit = 1
     END SELECT
     IF nudge THEN
       DO : LOOP UNTIL KEYDOWN(0) = 0 ' single step with 'ctrl' key
     ELSE
       PAUSE 50
     ENDIF
   ENDIF
   IF mouseport THEN ' we have a mouse
     mx = MOUSE(x,mouseport)
     my = MOUSE(y,mouseport)
     GUI CURSOR mx,my
     IF MOUSE(L,2) = 1 THEN
       IF oldlmb = 0 THEN ' left button just pressed.
         oldmx = mx
         oldlmb = 1
       ENDIF
     ELSE
       oldlmb = 0
     ENDIF
     ' move the slide with the mouse
     IF oldlmb = 1 AND my > ABline AND my < CDline THEN
       slidepos = MIN(slidepos + mx-oldmx,MM.HRES-3)
       slidepos = MAX(slidepos,1-MM.HRES)
       oldmx=mx
     ENDIF
     ' move the cursor with the mouse
     IF oldlmb = 1 AND (ABS(my -Tedge)<10 OR ABS(my -Ledge)<10) THEN
       cursorpos = MIN(cursorpos + mx-oldmx,MM.HRES-3)
       cursorpos = MAX(cursorpos,1-MM.HRES)
       oldmx=mx
     ENDIF
   ENDIF
 LOOP UNTIL quit = 1
 ' tidy up things
 MODE 1,8
 CLS
 IF mouseport THEN
   CONTROLLER MOUSE CLOSE mouseport
   GUI CURSOR OFF
 ENDIF
END
 
SUB moveslide
 IF slidepos <> oldpos OR cursorpos <> oldcursorpos THEN
   SPRITE HIDE 4
   IF slidepos <> oldpos THEN SPRITE SHOW 3, slidepos, ABline, 0
   SPRITE SHOW 4, cursorpos,Tedge-5,0
   oldpos = slidepos
   oldcursorpos = cursorpos
 ENDIF
END SUB
 


You should be able to use any of the high resolution modes.

Jim
VK7JH
MMedit
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 09:31am 06 Dec 2020
Copy link to clipboard 
Print this post

brilliant!
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1593
Posted: 10:40am 06 Dec 2020
Copy link to clipboard 
Print this post

I like it!  
causality ≠ correlation ≠ coincidence
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 11:28am 06 Dec 2020
Copy link to clipboard 
Print this post

That's one program I have no desire to play with. I threw out my old sliderules when I moved house along with my copy of Logarithmic and Other Tables.

Bill
Keep safe. Live long and prosper.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 12:05pm 06 Dec 2020
Copy link to clipboard 
Print this post

  Quote   I threw out my old sliderules


Heathen    they are beautiful things


 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 12:37pm 06 Dec 2020
Copy link to clipboard 
Print this post

  Quote  Heathen

I know, I know. But when I tell the grand kids about sliderules and telephones with dials you had to stick your finger in and turn to dial the number, inkwells and pens with nibs that we used to make darts out of and throw into the ceiling of the classroom their eyes glaze over and they ask me about the dinosaurs I saw.

Bill
Keep safe. Live long and prosper.
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1097
Posted: 12:54pm 06 Dec 2020
Copy link to clipboard 
Print this post

Back in the early '70's when I was at Tech, got one lot of exam results back which included:
....
Sliderule    F

I didn't even know we had an exam on it. Not impressed.

Mine looked similar to matherp's  (Faber-Castell)

(cheaper than a HP-35 for $500.00 at the time though)
ChopperP
 
SimpleSafeName

Guru

Joined: 28/07/2019
Location: United States
Posts: 351
Posted: 02:10pm 06 Dec 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote   I threw out my old sliderules


Heathen    they are beautiful things




Indeed! Oh, the humanity!

I still have mine from the seventies.
 
NPHighview

Senior Member

Joined: 02/09/2020
Location: United States
Posts: 203
Posted: 03:55pm 06 Dec 2020
Copy link to clipboard 
Print this post

Still have mine (actually, my wife's) in the display cabinet right next to my HP-35, my HP-15c, my HP-42, and our SwissMicro DM41x, the latter of which gets the most use. They're all on the shelf right above the fossils :-)
Live in the Future. It's Just Starting Now!
 
romba6

Newbie

Joined: 04/07/2020
Location: United Kingdom
Posts: 37
Posted: 05:10pm 06 Dec 2020
Copy link to clipboard 
Print this post

Great work Jim - I will have a play later !!
I still have my slide rule from college days (60s) so a bit old now, but more importantly I can still remember how to use it !!!
It beats my abacus any day - or is that next on your list .... ?
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 07:56pm 06 Dec 2020
Copy link to clipboard 
Print this post

My slide rule is one of those new fancy plastic ones.
My brothers and father weren't impressed.
I think (hope) I have my father's bamboo(?) one in the store room somewhere.

To the younger generations, I point out that it hasn't had a flat battery yet.

Jim
VK7JH
MMedit
 
SimpleSafeName

Guru

Joined: 28/07/2019
Location: United States
Posts: 351
Posted: 01:11am 07 Dec 2020
Copy link to clipboard 
Print this post

  NPHighview said  Still have mine (actually, my wife's) in the display cabinet right next to my HP-35, my HP-15c, my HP-42, and our SwissMicro DM41x, the latter of which gets the most use. They're all on the shelf right above the fossils :-)


My HP15C LE is right here, on top of my HP16C. They still get used. I've got several others as well (HPs, TIs, a couple of Casios, and a Russian job), but these are my favorites.
 
GerryL
Newbie

Joined: 24/01/2019
Location: Australia
Posts: 39
Posted: 01:28am 07 Dec 2020
Copy link to clipboard 
Print this post

this is great Jim, below is pix of my 20+ slide rules that I rediscovered hiding in my shed that I had all but forgotten about. In the background is the culprit that started their demise, a Friden 130 calculator. The 130 was the first solid state desk top calculator that was released in mid 1960's and takes pride of place in my electronic calculator collection.  It used discrete components and an acoustic delay line for the memory plus a CRT for the display, amazing for its time.

Gerry

 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 04:19am 07 Dec 2020
Copy link to clipboard 
Print this post

For those who insist on a printed manual:


No date unfortunately but the price was 2 shillings and 6 pence.

Update to my code with all the flickering gone.
I now print to page 1 for everything and do a PAGE COPY 1 TO 0 ,B
I changed a few sequences and now very happy with the results.

 'TassyJim December 2020
 '
 'simple Mannheim type slide rule
 ' translated for a post on the LIberty Basic forum by tsh73
 'If you need instructions on operating slide rule, you can check
 'https://www.sliderulemuseum.com/
 '
 OPTION EXPLICIT
 OPTION DEFAULT FLOAT
 CONST mouseport = 2 ' use 0 for no mouse else 1-3 for the corresponding port
 DIM WW = MM.HRES
 DIM x0=1
 DIM x1=10
 DIM n = 1000
 DIM h0 = (x1)/n
 DIM firstXX=30
 DIM SCALE = (WW - 2*firstXX)/LOG(x1)
 
 'vertical scale positions in pixels
 CONST Tedge = 30
 CONST Lline  = Tedge + 35
 CONST Kline  = Lline + 35
 CONST ABline = Kline + 35
 CONST CDline = ABline+ 70
 CONST Sline  = CDline+ 70
 CONST Tline  = Sline + 35
 CONST Ledge  = Tline + 10
 
 DIM x,i,h,d,xx, lastxx, dd, quit, kp,sp, nudge
 DIM oldFirstXX, k, slidepos, oldpos, cursorpos, oldcursorpos
 DIM mx, my, ms, mc, mlb, oldmx, oldlmb
 CONST bg1 = RGB(255,255,128)
 CONST bg2 = RGB(WHITE)
 CONST gra = RGB(32,32,32)
 
 MODE 1,8,RGB(BLACK)
 CLS
 PAGE WRITE 2
 CLS
 IF mouseport > 0 THEN
   CONTROLLER MOUSE OPEN mouseport
   GUI CURSOR ON 1,MM.HRES/2,MM.VRES/2,RGB(RED)
 ENDIF
 BOX 10,Tedge+5,WW-10,Kline-Tedge,1,bg1,bg1
 BOX 10,Kline+5,WW-10,Sline-Kline,1,bg2,bg2
 BOX 10,Sline-30,WW-10,Ledge-Sline+35,1,bg1,bg1
 
 '=============== Draw scales ================
 'C, D scales (main) -------------------------------------
 x = x0
 i = 0
 DO WHILE i<=900
   SELECT CASE x
     CASE IS <2
       h = 1
     CASE IS <4
       h = 2
     CASE ELSE
       h = 5
   END SELECT
   xx = firstXX+LOG(x)*SCALE
   d=7
   IF i MOD 5 = 0 THEN d=d+2
   IF i MOD 10 = 0 THEN d=d+3
   IF i MOD 100 = 0 THEN d=d+4
   LINE xx,CDline,xx,CDline-d,1,gra
   LINE xx,CDline+2,xx,CDline+2+d,1,gra
   IF i MOD 100 = 0 THEN
     TEXT xx-3,CDline-27,LEFT$(STR$(x),1),,7,1,gra,bg2
     TEXT xx-3,CDline+27,LEFT$(STR$(x),1),,7,1,gra,bg2
   ELSE
     IF i MOD 10 = 0 AND x<2 THEN
       TEXT xx-7,CDline-24,"1."+RIGHT$(STR$(x-1),1),,7,1,gra,bg2
       TEXT xx-7,CDline+24,"1."+RIGHT$(STR$(x-1),1),,7,1,gra,bg2
     END IF
   END IF
   i = i+h
   x = x+h*h0
 LOOP
 lastXX=xx
 
 'Pi mark on C,D scales -------------------------------------
 xx = firstXX+LOG(ACOS(-1))*SCALE
 d=5
 dd=12
 TEXT xx-3,CDline-28,"pi",,7,1,gra,bg2
 TEXT xx-3,CDline+28,"pi",,7,1,gra,bg2
 LINE xx,CDline-dd,xx,CDline-dd-d,1,gra
 LINE xx,CDline+2+dd,xx,CDline+2+dd+d,1,gra
 '
 'L scale -------------------------------------
 n=200
 h=(lastXX-firstXX)/n
 FOR i = 0 TO n
   x=i/200
   xx=firstXX+i*h
   d=7
   IF i MOD 2 = 0 THEN d=d+2
   IF i MOD 10 = 0 THEN d=d+6
   IF i MOD 20 = 0 THEN d=d+4
   LINE xx,Lline,xx,Lline-d,1,gra
   IF i MOD 20 = 0 THEN
     TEXT xx-8,Lline-24,STR$(x,1,1),,7,1,gra,bg1 '+4*(i=200)
     '#gr "\";right$(using("#.#",x), 3 + (i=200))
   END IF
 NEXT i
 '
 'A, B scales (square) -------------------------------------
 oldFirstXX=firstXX
 FOR k=1 TO 2
   x = x0
   i = 0
   DO WHILE i<=900
     SELECT CASE x
       CASE IS <2
         h = 2
       CASE IS <5
         h = 5
       CASE ELSE
         h = 10
     END SELECT
     xx = firstXX+LOG(x)/2*SCALE
     d=7
     IF i = 50 THEN d=d+3
     IF i MOD 10 = 0 THEN d=d+2
     IF i MOD 100 = 0 THEN d=d+5
     LINE xx,ABline,xx,ABline-d,1,gra
     LINE xx,ABline+2,xx,ABline+2+d,1,gra
     IF i MOD 100 = 0 THEN
       TEXT xx-3,ABline-27,LEFT$(STR$(x),1),,7,1,gra,bg2
       TEXT xx-3,ABline+27,LEFT$(STR$(x),1),,7,1,gra,bg2
     END IF
     i = i+h
     x = x+h*h0
   LOOP
   firstXX = xx
 NEXT k
 '
 'K scale (cube) -------------------------------------
 firstXX= oldFirstXX
 FOR k=1 TO 3
   x = x0
   i = 0
   DO WHILE i<=900
     SELECT CASE x
       CASE IS <3
         h = 5
       CASE IS <6
         h = 10
       CASE ELSE
         h = 20
     END SELECT
     xx = firstXX+LOG(x)/3*SCALE
     d=7
     IF i MOD 10 = 0 THEN d=d+2
     IF i MOD 50 =0 THEN d=d+3
     IF i MOD 100 = 0 THEN d=d+5
     LINE xx,Kline,xx,Kline-d,1,gra
     IF i MOD 100 = 0 THEN
       TEXT xx-3,Kline-27,LEFT$(STR$(x),1),,7,1,gra,bg1
     END IF
     i = i+h
     x = x+h*h0
   LOOP
   firstXX = xx
 NEXT
 '
 ' S scale (sine)
 ' todo
 '
 ' T scale (tangent)
 ' todo
 '
 'labels -------------------------------------
 TEXT 15,Kline-10,"K",,7,1,gra,bg1
 TEXT 15,ABline-12,"A",,7,1,gra,bg2
 TEXT 15,ABline+5,"B",,7,1,gra,bg2
 TEXT 15,Lline-10,"L",,7,1,gra,bg1
 TEXT 15,CDline-12,"C",,7,1,gra,bg2
 TEXT 15,CDline+5,"D",,7,1,gra,bg2
 TEXT 15,Sline-10,"S",,7,1,gra,bg1
 TEXT 15,Tline-10,"T",,7,1,gra,bg1
 
 BLIT READ 1,10,Tedge,MM.HRES,ABline-Tedge,2
 BLIT READ 2,10,CDline,MM.HRES,Ledge-CDline,2
 SPRITE READ 3,10,ABline+1,MM.HRES,CDline-ABline,2
 ' make cursor as sprite
 CLS
 BOX 10,Tedge-5,50,12,1,RGB(CYAN),RGB(CYAN)
 BOX 10,Ledge-2,50,12,1,RGB(CYAN),RGB(CYAN)
 LINE 35,Tedge-10,35,Ledge+10,1,gra
 
 SPRITE READ 4,10,Tedge-5,50,Ledge-Tedge+15,2
 
 PAGE WRITE 1
 BLIT WRITE 1,10,Tedge
 BLIT WRITE 2,10,CDline
 SPRITE SHOW 3, slidepos, ABline,0
 SPRITE SHOW 4,cursorpos,Tedge-5,0
 
 TEXT MM.HRES/2,Ledge+20,"Left and right to shift slide",CM
 TEXT MM.HRES/2,Ledge+35,"Up and Down to shift cursor",CM
 TEXT MM.HRES/2,Ledge+50,"Shift for rapid, ctrl for slow",CM
 TEXT MM.HRES/2,Ledge+65,"Or drag with a mouse",CM
 TEXT MM.HRES/2,Ledge+85,"Q to quit",CM
 PAGE COPY 1 TO 0 ,b
 
 DO
   IF KEYDOWN(0) > 0 THEN
     kp = KEYDOWN(1)
     sp = KEYDOWN(7)' either shift key
     IF sp = 2 OR sp = 32 THEN nudge = 1 ELSE nudge = 0 ' single step or continuous
     IF sp = 8 OR sp = 128 THEN sp = 10 ELSE sp = 1 ' shift key for rapid movement
     SELECT CASE kp
       CASE 128
         cursorpos = MIN(cursorpos + sp,WW-3)
       CASE 129, 161
         cursorpos = MAX(cursorpos - sp,1-WW)
       CASE 131, 163
         slidepos = MIN(slidepos + sp,WW-3)
       CASE 130
         slidepos = MAX(slidepos - sp,1-WW)
       CASE 113
         quit = 1
     END SELECT
     IF nudge THEN
       DO : LOOP UNTIL KEYDOWN(0) = 0 ' single step with 'ctrl' key
     ENDIF
   ENDIF
   IF mouseport THEN ' we have a mouse
     mx = MOUSE(x,mouseport)
     my = MOUSE(y,mouseport)
     GUI CURSOR mx,my
     IF MOUSE(L,2) = 1 THEN
       IF oldlmb = 0 THEN ' left button just pressed.
         oldmx = mx
         oldlmb = 1
       ENDIF
     ELSE
       oldlmb = 0
     ENDIF
     ' move the slide with the mouse
     IF oldlmb = 1 AND my > ABline AND my < CDline THEN
       slidepos = MIN(slidepos + mx-oldmx,WW-3)
       slidepos = MAX(slidepos,1-WW)
       oldmx=mx
     ENDIF
     ' move the cursor with the mouse
     IF oldlmb = 1 AND (ABS(my -Tedge)<10 OR ABS(my -Ledge)<10) THEN
       cursorpos = MIN(cursorpos + mx-oldmx,WW-3)
       cursorpos = MAX(cursorpos,1-WW)
       oldmx=mx
     ENDIF
   ENDIF
   PAUSE 10
   moveslide
 LOOP UNTIL quit = 1
 
 ' tidy up things
 CLS
 PAGE WRITE 0
 MODE 1,8
 CLS
 IF mouseport THEN
   CONTROLLER MOUSE CLOSE mouseport
   GUI CURSOR OFF
 ENDIF
END
 
SUB moveslide
 IF slidepos <> oldpos OR cursorpos <> oldcursorpos THEN
   SPRITE HIDE 4
   IF slidepos <> oldpos THEN SPRITE SHOW 3, slidepos, ABline, 0
   SPRITE SHOW 4, cursorpos,Tedge-5,0
   oldpos = slidepos
   oldcursorpos = cursorpos
  PAGE COPY 1 TO 0 ,b    
 ENDIF
END SUB
 


Enjoy...

Jim
VK7JH
MMedit
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 593
Posted: 09:10am 07 Dec 2020
Copy link to clipboard 
Print this post

Boy oh boy that bring back memories of my time at Technological Engineering
 when Mr. Laker Gave me one of these for my 16th birthday. I still have it and
 later TI handed out calculators to us. But the Rule Ruled LOL

side note may be do one with the MM170 and 3.5" or 4" TFT LCD just to have on my desk.
Edited 2020-12-07 19:14 by Quazee137
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 03:09pm 07 Dec 2020
Copy link to clipboard 
Print this post

Very nice! I still have my old slide rule from undergrad engineering days.
-Bill
 
Paul_L
Guru

Joined: 03/03/2016
Location: United States
Posts: 769
Posted: 04:10am 08 Dec 2020
Copy link to clipboard 
Print this post

I'm older than dirt. I've got seven of these things. One of them is three feet long! Most of them are basswood Keuffel & Essers or aluminum Picketts. If you're designing a switchable voltage divider to control the gain of an op amp you set the slide once and read off all the proportional resistor values without any further fooling around. They were very efficient for many tasks.

Paul in NY
 
Warpspeed
Guru

Joined: 09/08/2007
Location: Australia
Posts: 4406
Posted: 07:53am 08 Dec 2020
Copy link to clipboard 
Print this post

Ah !
When he big EMP kills all your binary bits, and batteries are no longer available.

You can sit around the camp fire in front of your cave, and do things not possible by just counting on your fingers.
Cheers,  Tony.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5091
Posted: 11:43am 08 Dec 2020
Copy link to clipboard 
Print this post

I threw mine away when I got my first TI57. Now I regret it.

The TI57 stopped working after something got defective inside the battery box (there is a convertor in it).

Followed up by a "cheap" Casio FX82 with broken ON/OFF switch that I bypassed relying on it's build in low power standby mode. It is still working on it's second set of AA batteries ! .... real low power.. This calculator is really amazing quality. Even the keys all work flawless without a cleaning or anything after almost 45 years. On the second set of AA's.

And I gathered on a flea market a HP12c (a broken one for $0.25 that I cleaned and repaired) that I use daily. But it has no geometry (sin/cos/tan). It is a financial calculator.
Still looking for a HP10c, 11c, or 15c on flea markets... But prices are outrageous now, especially when not defective.

Volhout
Edited 2020-12-08 21:47 by Volhout
PicomiteVGA PETSCII ROBOTS
 
RetroJoe

Senior Member

Joined: 06/08/2020
Location: Canada
Posts: 290
Posted: 02:16pm 08 Dec 2020
Copy link to clipboard 
Print this post

Ah, the TI-57!

The TI-57 was my first calculator, too, and one of the very first electronic devices I learned how to program (a TRS-80 Model 1 was the other). It was quite a powerful little machine, and had all the basics (!) to learn procedural programming: 50 program steps with labels, 8 registers for intermediate results, conditional branching, and an all-purpose GOTO for loops and subs. And, I do remember the proprietary (and anemic...) battery pack. A real pain in the a$$, because you could never be sure if it would last you through an entire school day (“battery anxiety” was a thing even in the 1970s !).

The TI-57 had a big brother, the TI-59, which included a magnetic card reader. It was frightfully expensive so I couldn’t afford it, but I had a friend with one - it was very cool :). Check out the video  - the idea was you would save custom functions on the mag strip, then write their names on the strip with a Sharpie so you could invoke them with assignable function keys.

Also note the long delay between the key press and the result appearing on the display. The TI-57 and TI-59 just blanked the display during lengthy calculations, but the designers of the entry-level TI-30 went to the trouble of putting a “working...” animation on the display, which was the last digit of the display doing a circular chase around the 7-segment LED. For all I know, it may have been the first appearance of the ubiquitous “spinning widget” you see on all contemporary computers.
Edited 2020-12-09 00:45 by RetroJoe
Enjoy Every Sandwich / Joe P.
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025