Ok, so a question was asked...
"How do I make a RAW file?"
Easy!
1) Key the program into an HP 41 emulator on a PC (perhaps phone).
2) Find the menu choice to export the program to a PC file. This will almost certainly be a .raw file.
3) Find the file and post it here (or email it to me).
I said it was easy!
The only hard part is to ensure the card reader functions are available in the emulator if needed. However, many of these don't require it.
I would do these myself but I am not where I can due to outside events affecting family ... and my VMWARE fusion is out of date. Ugh.
(08302016 06:13 PM)Gene Wrote: [ > ]Looking for some help. Angel has agreed (given in) to the creation of an HP 67/97 game rom. Yay. Haha. The idea here was to have available on the 41CL and Emulators some games for the hP 67/97 that are not available in the same way directly on the HP 41. It also gives possible access to some very good USER written games such as the ones below in addition to the HP 67 solution books.
I do not think that translating HP67/97 programs 1:1 for the HP41 is a good idea. This is especially true for games – the 41 allows much better programs due to its alpha input/output, and many things can be done much more elegantly.
Consider the Jive Turkey example. It's an HP67/97 translation of a TI58/59 program that uses a rather complicated random number generator (looks like the one from the ML01 module) and generates output that is not always unambiguous – cf. the instructions on the linked website with the program. It also uses a strange flag technique to generate a misleading (=wrong) output if it decides to lie to the user. Also all (well, most) data memory is cleared. Which is less of a problem with the 67/97 (turn it off and everything is lost anyway) than on an HP41 with its continuous memory.
Compare this to a more compact program that uses the HP41's features. The following code was written in 15 minutes, so there may be errors, but you get the idea:
Code:
LBL "JT"
100
"TRUTH%=?"
PROMPT
1
%
STO 03
999
"MAX. NUMBER?"
PROMPT
ABS
INT
STO 02
XEQ 99
*
1
+
INT
STO 01
CLX
STO 00
"GUESS?"
LBL 01
PROMPT
ISG 00
ENTER
RCL 01

X=0?
GTO 02
SIGN
RCL 03
XEQ 99

SIGN
*
"HIGH"
X<0?
"LOW"
GTO 01
LBL 99
RCL 04
PI
+
X^2
FRC
STO 04
RTN
LBL 02
RCL 00
FIX 0
CF 29
" "
ARCL 00
FIX 4
SF 29
"├ GUESSES"
AVIEW
BEEP
END
Usage:
Code:
Before the first usage it is recommended to store a random seed
(positive number with fractional part) in R04:
e.g. 0.1234 STO 04
[XEQ] "JT" TRUTH%=?
Enter percentage of true answers.
No entry sets this to 100%, i.e. all answers are correct
Which means it's a simple HiLoGame.
70 [R/S] MAX. NUMBER?
Enter max. number to guess
Default value is nmax = 999
100 [R/S] GUESS?
Now enter your guesses:
50 [R/S] LOW
80 [R/S] LOW ' here the program is cheating, actually 80 is high
80 [R/S] HIGH ' same input this time yields the true answer
70 [R/S] HIGH
65 [R/S] LOW
67 [R/S] 6 GUESSES
The program takes advantage of input prompts and alpha output, it uses the signum function to generate the high/low output and change it if it decides to cheat, and the max. number to guess can be specified by the user. There's no need to initialize any flags (the program doesn't use any), and no HP67/97 commands like ISZ(i) are required. All this is done in less steps than the original version.
Dieter
Dieter, I don't disagree, but some of the "fun" is actually leaving them the way they were.
I'm trying to pick HP 67 era games for which there is no direct 41CL equivalent yet by setting up a .rom file with these older HP 67 era games. I'm very aware :) we *could* rewrite them, but that is not the intent here at all.
Still, fun to have a rewritten Jive Turkey program. :)
Well, I was going to tackle a couple of these but my first two tries showed (apparent) errors in the source? (RPN67 SD nicely flags these errors  Thanks Willy!)
For Jive: Line 07 is f GSB 4 but there is no LBL 4.
For Blackjack: Line 197/199/201 is GTO c, but there is no LBL c.
I'll try a couple of the other ones later.
(08312016 05:01 PM)RobertM Wrote: [ > ]Well, I was going to tackle a couple of these but my first two tries showed (apparent) errors in the source? (RPN67 SD nicely flags these errors  Thanks Willy!)
For Jive: Line 07 is f GSB 4 but there is no LBL 4.
This should be easy to fix. The program at this point is supposed to generate the number to guess, i.e. something between 0 and 99. The RNG is implemented at LBL 1. So simply change it to f GSB 1 and it should run.
(08312016 05:01 PM)RobertM Wrote: [ > ]For Blackjack: Line 197/199/201 is GTO c, but there is no LBL c.
This seems to be a feature: the GTO c generates an "Error" message for invalid input.
Dieter
Well, I guess I know how few people ever tried it in 19 years don't I ?
Jive Turkey:
Link to program listing from PPC Journal:
Jive Turkey
Line 07 is f GSB 1 not 4. My typo.
Blackjack:
The GTO c is an error on purpose according to the instructions in V3N9P38. Not a mistake.
Thanks for helping with these.
Are you looking for me to use the card reader compatibility functions (which would require the card reader be installed to run), or do you want the program slightly rewritten. For example, Jive uses ISZi, so I could use 7ISZI or I could "rewrite" it to store 0.999 in R00 and use ISG (and RCL 00/INT to display the count of guesses) so that the card reader module wouldn't be required, but does limit you to 1000 guesses.
Also, in Blackjack, the PRTX (x) used for "blinking" pause ... no real equivalent that I know of on the 41.
Let me know what you'd like.
(09012016 01:57 AM)RobertM Wrote: [ > ]Are you looking for me to use the card reader compatibility functions (which would require the card reader be installed to run), or do you want the program slightly rewritten.
I would strongly recommend the one or other rewrite. After all the 41 is a completely different machine which requires a different approach here and there. Some HP67/97 code cannot even be translated directly (think of fast reverse branching or numbers consisting of multiple program lines). The card reader manual has various examples and suggestions for this.
(09012016 01:57 AM)RobertM Wrote: [ > ]For example, Jive uses ISZi, so I could use 7ISZI or I could "rewrite" it to store 0.999 in R00 and use ISG (and RCL 00/INT to display the count of guesses) so that the card reader module wouldn't be required, but does limit you to 1000 guesses.
And it would require SIZE 026 altough only four registers are used. Remove the initial CLRG (which clears
all available registers) at LBL A and clear only R 01, then nd use ISG 00 ENTER (dummy instruction) instead of ISZ(i). This way no INT is required. Even a simple 1 ST+00 would do here. Other changes are required anyway, e.g. F? 3 becomes FS?C 22.
I think the idea is to duplicate the look and feel of this vintage software. If the same results requires slight changes, that's the way to go.
(09012016 01:57 AM)RobertM Wrote: [ > ]Also, in Blackjack, the PRTX (x) used for "blinking" pause ... no real equivalent that I know of on the 41.
A VIEW X followed by 3x PSE might do – but of course without the blinking point.
Dieter
(08312016 04:08 PM)Gene Wrote: [ > ]Dieter, I don't disagree, but some of the "fun" is actually leaving them the way they were.
OK – with the one or other slight modification due to the different programming paradigm. See RoberM's post below.
(08312016 04:08 PM)Gene Wrote: [ > ]I'm trying to pick HP 67 era games for which there is no direct 41CL equivalent yet by setting up a .rom file with these older HP 67 era games. I'm very aware :) we *could* rewrite them, but that is not the intent here at all.
OK, here is a more or less literal translation of the HP67/97 program.
Code:
01 LBL "JT"
02 FIX 0
03 CF 22
04 SF 27
05 CF 29
06 "JIVE TURKEY"
07 PROMPT
08 LBL A
09 STO 03
10 STO 00
11 ST 00
12 RTN
13 LBL B
14 STO 04
15 XEQ 01
16 STO 01
17 LBL D
18 RCL 00
19 RTN
20 LBL C
21 STO 02
22 1
23 ST+ 00
24 XEQ 01
25 X>Y?
26 CF 22
27 RCL 02
28 RCL 01
29 X=Y?
30 GTO D
31 X>Y?
32 GTO 00
33 FS?C 22
34 FS?C 22
35 SF 22
36 LBL 00
37 1
38 FS?C 22
39 CHS
40 RTN
41 LBL 01
42 24298
43 RCL 04
44 *
45 5
46 10^X
47 9
48 
49 +
50 199017
51 /
52 LASTX
53 X<>Y
54 FRC
55 *
56 STO 04
57 RCL 03
58 LASTX
59 1 E2
60 *
61 INT
62 RTN
63 END
ISZ(i) was replaced with a simple 1 ST+00, and the CLRG at LBL A was omitted and only R00 set to zero. A global label "JT" was added in order to access the program and initialize it, just as a HP67/97 card read would do.
If you like it this way I could provide a raw file.
(08312016 04:08 PM)Gene Wrote: [ > ]Still, fun to have a rewritten Jive Turkey program. :)
It was also fun to write it. ;)
Dieter
Hey guys. Thanks for the help.
for these games that have to be keyed in one form or another, a rewrite is great. Many thanks. Don't mind making them a bit more HP 41 friendly either.
For the vast majority of the games, I'm hoping to simply get them in the HP 67 form converted by the card reader as shown in the MoHPC HP41C Software library. That's where the .raw files are coming from for this effort. Click below and scroll down to find the HP 67 games pac and solution book programs.
HP41C Software Library
I am trying to only pull game programs that do not already have an equivalent in the 41CL software roms. I'm not trying to duplicate better programs that are already there or games that really make little sense today. For example, Slot Machine and Battleship are on my list to Angel, but Hangman is not. Why put a Hangman program in there that uses codes to represent the letters when there is already a great hangman program using letters available on the 41CL?
I realize that the choices I'm trying to make are probably different from those others would make. I'm merely trying to preserve in the 41CL (and emulator world) some of these HP67 era games that deserve saving (Craig Pearce's HP 67 Pinball Wizard just because of what it represented) or games for which there is no existing 41C equivalent yet.
:)
Appreciate the help.
.raw files for any of these that have to be keyed are good!
Here is my take(s) on Blackjack.
First, is the "direct" translation from the 67 program. This version requires the card reader (module) to run:
Code:
LBL "BJ67"
LBL A
RCL 08
ABS
STO 08
9
STO 25
CF 00
CF 01
XEQ 00
7ISZ ;
STO IND 25
STO 00
STO 02
FS?C 22
SF 00
XEQ 00
STO 04
STO 06
FS?C 02
SF 01
XEQ 00
7ISZ ;
STO IND 25
STO 01
ST+ 02
FS?C 02
SF 00
XEQ 00
STO 05
ST+ 06
FS?C 02
SF 01
RCL 06
FS? 01
XEQ 07
STO 07
X=Y?
SF 02
7DSP0 ;
RCL 00
PSE
RCL 01
PSE
RCL 02
7PRTX ;
RCL 04
CHS
FS?C 02
FS?C 02
RTN
PSE
GTO C
LBL 00
10
RCL 24
PI

X^2
FRC
STO 24
13
*
INT
X=0?
SF 02
1
+
X>Y?
RDN
RTN
LBL B
XEQ 00
7ISZ ;
STO IND 25
STO 00
ST+ 02
FS?C 02
SF 00
21
RCL 02
X>Y?
GTO 02
7DSP0 ;
RCL 00
PSE
LBL 01
RCL 02
7PRTX ;
RTN
LBL 02
CHS
STO 07
RCL 00
CHS
STO 05
GTO 05
LBL C
RCL 02
FS? 00
XEQ 07
STO 03
LBL 03
RCL 06
FS? 01
XEQ 07
STO 07
17
X<=Y?
GTO 04
RCL 05
CHS
PSE
RCL 06
CHS
7PRTX ;
XEQ 00
FS?C 02
SF 01
STO 05
RCL 06
+
STO 06
STO 07
22
X<=Y?
GTO 06
GTO 03
LBL 04
RCL 07
RCL 03
X=Y?
SF 02
X>Y?
GTO 06
LBL 05
RCL 08
CHS
STO 08
LBL 06
7DSP0 ;
RCL 05
CHS
PSE
RCL 07
CHS
7PRTX ;
7DSP2 ;
RCL 08
FS?C 02
CLX
ST+ 09
RTN
LBL 07
21
X<>Y
10
+
X<=Y?
RTN
LASTX

RTN
LBL a
7DSP0 ;
9
X<> 25
STO 23
LBL 08
RCL 23
RCL 25
X=Y?
GTO 01
7ISZ ;
RCL IND 25
PSE
GTO 08
LBL b
PI
+
STO 24
GTO b
LBL d
RCL 08
ABS
LBL D
7DSP2 ;
RND
LASTX
X!=Y?
GTO c
X<0?
GTO c
X=0?
GTO c
STO 08
RTN
LBL e
CLX
STO 09
LBL E
7DSP2 ;
RCL 09
RTN
And then a slightly modified version, that doesn't require the card reader module. Replaced 7ISZ with ISG, ENTER, and 7DSP with FIX, and 7PRTX with VIEW X, PSE, PSE, PSE, CLD.
Code:
LBL "BJ"
CF 00
CF 01
CF 02
SF 27 ; User Mode
FIX 0
"BLACKJACK"
PROMPT
LBL A
RCL 08
ABS
STO 08
9
STO 25
CF 00
CF 01
XEQ 00
ISG 25
ENTER ; NOP
STO IND 25
STO 00
STO 02
FS?C 22
SF 00
XEQ 00
STO 04
STO 06
FS?C 02
SF 01
XEQ 00
ISG 25
ENTER ; NOP
STO IND 25
STO 01
ST+ 02
FS?C 02
SF 00
XEQ 00
STO 05
ST+ 06
FS?C 02
SF 01
RCL 06
FS? 01
XEQ 07
STO 07
X=Y?
SF 02
FIX 0
RCL 00
PSE
RCL 01
PSE
RCL 02
VIEW X
PSE
PSE
PSE
CLD
RCL 04
CHS
FS?C 02
FS?C 02
RTN
PSE
GTO C
LBL 00
10
RCL 24
PI

X^2
FRC
STO 24
13
*
INT
X=0?
SF 02
1
+
X>Y?
RDN
RTN
LBL B
XEQ 00
ISG 25
ENTER ; NOP
STO IND 25
STO 00
ST+ 02
FS?C 02
SF 00
21
RCL 02
X>Y?
GTO 02
FIX 0
RCL 00
PSE
LBL 01
RCL 02
VIEW X
PSE
PSE
PSE
CLD
RTN
LBL 02
CHS
STO 07
RCL 00
CHS
STO 05
GTO 05
LBL C
RCL 02
FS? 00
XEQ 07
STO 03
LBL 03
RCL 06
FS? 01
XEQ 07
STO 07
17
X<=Y?
GTO 04
RCL 05
CHS
PSE
RCL 06
CHS
VIEW X
PSE
PSE
PSE
CLD
XEQ 00
FS?C 02
SF 01
STO 05
RCL 06
+
STO 06
STO 07
22
X<=Y?
GTO 06
GTO 03
LBL 04
RCL 07
RCL 03
X=Y?
SF 02
X>Y?
GTO 06
LBL 05
RCL 08
CHS
STO 08
LBL 06
FIX 0
RCL 05
CHS
PSE
RCL 07
CHS
VIEW X
PSE
PSE
PSE
CLD
FIX 2
RCL 08
FS?C 02
CLX
ST+ 09
RTN
LBL 07
21
X<>Y
10
+
X<=Y?
RTN
LASTX

RTN
LBL a
FIX 0
9
X<> 25
STO 23
LBL 08
RCL 23
RCL 25
X=Y?
GTO 01
ISG 25
ENTER ; NOP
RCL IND 25
PSE
GTO 08
LBL b
PI
+
STO 24
GTO b
LBL d
RCL 08
ABS
LBL D
FIX 2
RND
LASTX
X!=Y?
GTO c
X<0?
GTO c
X=0?
GTO c
STO 08
RTN
LBL e
CLX
STO 09
LBL E
FIX 2
RCL 09
RTN
Both give a similar "feel" to the 67 version.
Both RAW files are in the .zip.
Edit: just updated the zip to contain the text files with line numbers.
(09022016 04:13 AM)RobertM Wrote: [ > ]Here is my take(s) on Blackjack.
(...)
And then a slightly modified version, that doesn't require the card reader module. Replaced 7ISZ with ISG, ENTER, and 7DSP with FIX, and 7PRTX with VIEW X, PSE, PSE, PSE, CLD.
Great. I see you use the same initialization routine as my Jive Turkey version. The idea is to initialize some settings (flags, display format, user mode) which on a 67/97 is automatically done while the program card is read. If this is considered a good idea we should maybe do this for all translated programs.
BTW, the Blackjack program includes an infinite loop at LBL b. What's the idea behind this? It looks like this is supposed to simulate shuffling the cards: Enter a random seed and press f b, let it run for a few seconds and a new seed is generated.
Two more notes:
The 67/97 can always access 26 data registers, and it is common practice to use the higher registers A...E (i.e. R20...24). Since a lot of programs use the Iregister, even the highest register number (25) is occupied even if the program otherwise merely uses R0 and R1. On the other hand memory can be limited on the 41 (especially the 41C without RAM extension), so it is a good idea to move A...E and I downwards to the lowest possible addresses. In this case (BJ) that's R10...R12 instead of D, E and I. This way only SIZE 13 is required.
In this program the HP67/97 ISZ command can be replaced with ISG followed by a dummy instruction that is never executed, as register "I" always holds a positive integer. Please note that this is not always possible. Also, instead of using ENTER for the dummy instruction, something like LBL 20 could be used. Such a label never occurs in a 67/97 program.
Dieter
(09022016 06:47 AM)Dieter Wrote: [ > ]Great. I see you use the same initialization routine as my Jive Turkey version. The idea is to initialize some settings (flags, display format, user mode) which on a 67/97 is automatically done while the program card is read. If this is considered a good idea we should maybe do this for all translated programs.
Yes, sorry ... should have given you credit for this. I liked it in Jive Turkey, so I "borrowed" it.
(09022016 06:47 AM)Dieter Wrote: [ > ]BTW, the Blackjack program includes an infinite loop at LBL b. What's the idea behind this? It looks like this is supposed to simulate shuffling the cards: Enter a random seed and press f b, let it run for a few seconds and a new seed is generated.
Yes, the original instructions in PPCJ V3N9P38 talk about using this method to "generate" a seed.
(09022016 06:47 AM)Dieter Wrote: [ > ]The 67/97 can always access 26 data registers, and it is common practice to use the higher registers A...E (i.e. R20...24). Since a lot of programs use the Iregister, even the highest register number (25) is occupied even if the program otherwise merely uses R0 and R1. On the other hand memory can be limited on the 41 (especially the 41C without RAM extension), so it is a good idea to move A...E and I downwards to the lowest possible addresses. In this case (BJ) that's R10...R12 instead of D, E and I. This way only SIZE 13 is required.
Can't do that in this game ... R10R19 are used by indirect addressing to store the "cards" that are dealt, so those registers are needed the way they are.
(09022016 06:47 AM)Dieter Wrote: [ > ]In this program the HP67/97 ISZ command can be replaced with ISG followed by a dummy instruction that is never executed, as register "I" always holds a positive integer. Please note that this is not always possible. Also, instead of using ENTER for the dummy instruction, something like LBL 20 could be used. Such a label never occurs in a 67/97 program.
I actually had this as LBL14 (better to use a onebyte LBL than a multibyte instruction)...but then you had recommended ENTER earlier, so I switched to that. I know that a single byte LBL is faster to execute than ENTER, but the way this is structured, it will never get executed, only skipped.
Thanks for the comments!
Dieter: ISZ(i) was replaced with a simple 1 ST+00, and the CLRG at LBL A was omitted and only R00 set to zero. A global label "JT" was added in order to access the program and initialize it, just as a HP67/97 card read would do. If you like it this way I could provide a raw file.
Gene: Yes, please provide a raw file for the JT game. :)
Forgot to mention that I'm moving on to Star Trek (about half done).
Looks like a lot of interesting activity going here!
I could help in packing together the ROM. Unfortunately, I am not able to do a lot of work on game conversions due to lack of available time, but I can definitely spend time on packing the ROM. RPN source is preferred in that case, as they are easier to edit if needed.
Håkan
(09022016 03:46 PM)Gene Wrote: [ > ]Gene: Yes, please provide a raw file for the JT game. :)
OK, here it is.
Edit: I have just updated the zip file, it now contains both the .RAW file as well as a .TXT listing with line numbers.
Dieter
[
attachment=3872]
Here is Star Trek.
I've attached a zip file containing 2 RAW files and 3 txt files:
ST67.RAW and ST67.txt are the "direct" translation from the 67 program. This version requires the card reader (module), as well as SIZE 026 and DSP2 to run.
ST.RAW, ST.txt, ST_commented.txt are my "edited" version of the 67 program. All card reader functions have been translated, and the size has been reduced by 10 registers to SIZE 016, and the "Dieter Preamble" has been added.
The ST_commented.txt version contains my code comments as I learned/translated the code, figured they might be useful in the future.
I've tested both of them to the "example" at
http://rskey.org/gene/hpgene/67sttrk.htm
Both give a similar "feel" to the 67 version of Star Trek ... takes me way back!
Thanks to Antonio Lagana for i41CX+ and Willy Kunz for RPN67 SD ... both fantastic and powerful emulators/simulators.
On to Chess ... unless someone else is tackling it.
... and here is the first version of the HP67 Games module  Happy birthday Gene! (save it for the right date ;)
27 Games in total, including your raw files as well as a bunch Gene sent me from the museum library (I believe). Not sure if there are dups or they are proper sections of larger games, like DOGA & DOGB, or RCKT67 & RCKT<1>, or SPW67A & SPW67B.
Also there were a couple of data files in the zip I got, which would need to be put in a loader program by a volunteer...
The assumption was that either the Card Reader ROM image (CL owners) or the Card Reader itself was going to be present, so the nonCRDRD versions are not in the module. This helps with the byte count, there are only 300 bytes left and I'd think those should be reserved for the Chess ;)
During the compiling steps a few programs reported missing label errors. Based on what I've read above this is intended, but nevertheless would be good you guys checked your programs for correct operation. As project architect I'm sure Gene will take care of those from the museum library, right?