xrpn 1.3.1 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/conf +0 -1
- data/xcmd/beep +9 -1
- data/xcmd/pprg1 +28 -0
- data/xcmd/tone +15 -0
- data/xcmd/tonexy +14 -0
- data/xlib/debug_mode +2 -2
- data/xlib/read_xcmd +4 -2
- data/xrpn.gemspec +2 -2
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8167dcb78197e227f824c68546005f21579dba7675cc9ded60392a5faea6b38c
|
4
|
+
data.tar.gz: a5de67d1bfc1fec03865523fdec1bfafb1595b383500012f7d242408c07d646d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 266d7d75ea40f2d46f5a2923999bb104452fd5f8977ccd25d78b8ba060d4dc24fb10d8206aaa31622259e3b2a14e1c595df3e8ccdb2f92fdf055d00d7fc665e3
|
7
|
+
data.tar.gz: 563a67e0f13b95b2f590c9ad56a4383b36450184f376c8cef111ad211291901136f366d974516a5e6df9de6c384be28881b4df700357205d813df32f0717d1ca
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ XRPN implements indirect addressing, self-modification and features well beyond
|
|
16
16
|
|
17
17
|
You need Ruby installed to get XRPN to work.
|
18
18
|
|
19
|
-
To install XRPN, you can do `gem install 'xrpn'` or by cloning this repository and run the script `INSTALL.sh`. It is only tested on Linux but should work well on Mac OS and BSD systems. If you are on Windows, please tell me if it works in that environment. The install script will put create a symbolic link in your home directory - named ".xrpn" to make it a hidden directory - pointing to the cloned repo. It will also attempt to add a symlink to "~/bin" to make it easy to run XRPN. If you install XRPN by cloning this repo, you also need to install the Ruby Gem tty-prompt: `gem install tty-prompt`. If you install via `gem install 'xrpn'`, then this dependency is automatically taken care of. The gem is slower on startup than running XRPN from this repo.
|
19
|
+
To install XRPN, you can do `gem install 'xrpn'` or by cloning this repository and run the script `INSTALL.sh`. It is only tested on Linux but should work well on Mac OS and BSD systems. If you are on Windows, please tell me if it works in that environment. The install script will put create a symbolic link in your home directory - named ".xrpn" to make it a hidden directory - pointing to the cloned repo. It will also attempt to add a symlink to "~/bin" to make it easy to run XRPN. If you install XRPN by cloning this repo, you also need to install the Ruby Gem tty-prompt: `gem install tty-prompt`. If you install via `gem install 'xrpn'`, then this dependency is automatically taken care of. The gem is slower on startup than running XRPN from this repo. Also, `speaker-test` must be installed to play tones, but this is preinstalled on most Lunux/BSD systems.
|
20
20
|
|
21
21
|
## Run
|
22
22
|
|
data/conf
CHANGED
data/xcmd/beep
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
class XRPN
|
2
2
|
# Sound the legendary HP-41 BEEP
|
3
3
|
def beep
|
4
|
-
|
4
|
+
t = [175, 197, 225, 263, 315, 394, 525, 629, 788, 1051]
|
5
|
+
begin
|
6
|
+
%x|speaker-test -t sine -f #{t[7]} -l 1 1> /dev/null 2>& 1 & sleep .28 && kill -9 $!|
|
7
|
+
%x|speaker-test -t sine -f #{t[5]} -l 1 1> /dev/null 2>& 1 & sleep .28 && kill -9 $!|
|
8
|
+
%x|speaker-test -t sine -f #{t[8]} -l 1 1> /dev/null 2>& 1 & sleep .28 && kill -9 $!|
|
9
|
+
%x|speaker-test -t sine -f #{t[7]} -l 1 1> /dev/null 2>& 1 & sleep .28 && kill -9 $!|
|
10
|
+
rescue
|
11
|
+
puts "speaker-test must be installed to play tones"
|
12
|
+
end
|
5
13
|
end
|
6
14
|
end
|
7
15
|
|
data/xcmd/pprg1
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
class XRPN
|
2
|
+
# Print program
|
3
|
+
def pprg
|
4
|
+
page = @pg
|
5
|
+
pos = 0
|
6
|
+
if @a != ""
|
7
|
+
pr = "\"#{@a}\""
|
8
|
+
page, pos, prgm = locate_prg (pr)
|
9
|
+
if pos == nil
|
10
|
+
puts "No such program to print #{pr}"
|
11
|
+
return
|
12
|
+
end
|
13
|
+
end
|
14
|
+
@prg[page].each_index do |i|
|
15
|
+
next if i < pos
|
16
|
+
print "#{format('%02d', i + 1)}"
|
17
|
+
if @prg[page][i].downcase.match(/lbl/)
|
18
|
+
print "◆"
|
19
|
+
else
|
20
|
+
print " "
|
21
|
+
end
|
22
|
+
puts "#{@prg[page][i]}"
|
23
|
+
break if @prg[page][i] == "END"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# vim:ft=ruby:
|
data/xcmd/tone
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
class XRPN
|
2
|
+
# Sound a tone (0-9)
|
3
|
+
def tone (r)
|
4
|
+
r = r.to_i
|
5
|
+
return unless (0..9).include?(r)
|
6
|
+
t = [175, 197, 225, 263, 315, 394, 525, 629, 788, 1051]
|
7
|
+
begin
|
8
|
+
%x|speaker-test -t sine -f #{t[r]} -l 1 1> /dev/null 2>& 1 & sleep .28 && kill -9 $!|
|
9
|
+
rescue
|
10
|
+
puts "speaker-test must be installed to play tones"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# vim:ft=ruby:
|
data/xcmd/tonexy
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
class XRPN
|
2
|
+
# Sound a tone with frequency in X and length (in sec) in Y
|
3
|
+
def tonexy
|
4
|
+
f = @x.to_f
|
5
|
+
l = @y.to_f
|
6
|
+
begin
|
7
|
+
%x|speaker-test -t sine -f #{f} -l 1 1> /dev/null 2>& 1 & sleep #{l} && kill -9 $!|
|
8
|
+
rescue
|
9
|
+
puts "speaker-test must be installed to play tones"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# vim:ft=ruby:
|
data/xlib/debug_mode
CHANGED
@@ -2,7 +2,7 @@ def debug_mode
|
|
2
2
|
#prompt = TTY::Prompt.new
|
3
3
|
loop do
|
4
4
|
if $prompt
|
5
|
-
@line =
|
5
|
+
@line = @debugprompt.ask(":")
|
6
6
|
break
|
7
7
|
else
|
8
8
|
puts "─" * 30
|
@@ -44,7 +44,7 @@ def debug_mode
|
|
44
44
|
@p.flg = {}
|
45
45
|
system("clear")
|
46
46
|
when "R" # Reload all commands from the cmd directory
|
47
|
-
|
47
|
+
read_xcmd
|
48
48
|
puts "Commands reloaded."
|
49
49
|
when "l" # Show current line
|
50
50
|
@line = @p.prg[@p.pg][@p.pc]
|
data/xlib/read_xcmd
CHANGED
@@ -4,14 +4,16 @@ def read_xcmd
|
|
4
4
|
Dir[$gem+"/xcmd/*"].each do |file|
|
5
5
|
load file
|
6
6
|
l = File.read(file)
|
7
|
-
c = l
|
7
|
+
c = l.sub(/.*\s*def /m, '')
|
8
|
+
c = c.sub(/\s.*/m, '')
|
8
9
|
$cmd.push(c)
|
9
10
|
end
|
10
11
|
end
|
11
12
|
Dir[Dir.home+"/.xrpn/xcmd/*"].each do |file|
|
12
13
|
load file
|
13
14
|
l = File.read(file)
|
14
|
-
c = l
|
15
|
+
c = l.sub(/.*\s*def /m, '')
|
16
|
+
c = c.sub(/\s.*/m, '')
|
15
17
|
$cmd.push(c)
|
16
18
|
end
|
17
19
|
$cmd.sort!
|
data/xrpn.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'xrpn'
|
3
|
-
s.version = '1.3.
|
3
|
+
s.version = '1.3.3'
|
4
4
|
s.licenses = ['Unlicense']
|
5
5
|
s.summary = "XRPN - The eXtended RPN (Reverse Polish Notation) programming language"
|
6
|
-
s.description = "A full programming language and environment extending the features of the venerable HP calculator programmable calculators. With XRPN you can accomplish a wide range of modern programming tasks as well as running existing HP-41 FOCAL programs directly. XRPN gives modern life to tens of thousands of old HP calculator programs and opens the possibilities to many, many more. New in 1.3.
|
6
|
+
s.description = "A full programming language and environment extending the features of the venerable HP calculator programmable calculators. With XRPN you can accomplish a wide range of modern programming tasks as well as running existing HP-41 FOCAL programs directly. XRPN gives modern life to tens of thousands of old HP calculator programs and opens the possibilities to many, many more. New in 1.3.3: Implemented tones. Bug fixes."
|
7
7
|
|
8
8
|
s.authors = ["Geir Isene"]
|
9
9
|
s.email = 'g@isene.com'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xrpn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-prompt
|
@@ -28,8 +28,8 @@ description: 'A full programming language and environment extending the features
|
|
28
28
|
the venerable HP calculator programmable calculators. With XRPN you can accomplish
|
29
29
|
a wide range of modern programming tasks as well as running existing HP-41 FOCAL
|
30
30
|
programs directly. XRPN gives modern life to tens of thousands of old HP calculator
|
31
|
-
programs and opens the possibilities to many, many more. New in 1.3.
|
32
|
-
|
31
|
+
programs and opens the possibilities to many, many more. New in 1.3.3: Implemented
|
32
|
+
tones. Bug fixes.'
|
33
33
|
email: g@isene.com
|
34
34
|
executables:
|
35
35
|
- xrpn
|
@@ -196,6 +196,7 @@ files:
|
|
196
196
|
- xcmd/posfl
|
197
197
|
- xcmd/pow
|
198
198
|
- xcmd/pprg
|
199
|
+
- xcmd/pprg1
|
199
200
|
- xcmd/pprgx
|
200
201
|
- xcmd/pra
|
201
202
|
- xcmd/prflags
|
@@ -270,6 +271,8 @@ files:
|
|
270
271
|
- xcmd/tan
|
271
272
|
- xcmd/tenx
|
272
273
|
- xcmd/time
|
274
|
+
- xcmd/tone
|
275
|
+
- xcmd/tonexy
|
273
276
|
- xcmd/tx
|
274
277
|
- xcmd/version
|
275
278
|
- xcmd/view
|