4K HP 67 Games rom attached for testing
|
11-11-2016, 09:10 PM
Post: #121
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Great. Here is a link to a .zip file containing all 15 programs and a LBL R and S file for the random number and seed program.
raw files Here is what I put in for the R and S routine: 01 LBL "R" 02 PI 03 ST+ 00 04 X<> 00 05 X^2 06 ST* L 07 X<> L 08 FRC 09 STO 00 10 RTN 11 LBL "S" 12 RCL 00 13 "SEED?" 14 PROMPT 15 ABS 16 FRC 17 STO 00 18 END If we have room (and we might), then the next one to go in is Sum of the Digits (SD). .raw file that runs on emulators includes seed prompt and RN generator internal to program: SD.raw .raw file with proper xroms: SD with xrom The program with xroms is 92 bytes. It may just make it. If there is room, it goes in. Not enough room, it stays out. |
|||
11-11-2016, 09:21 PM
(This post was last modified: 11-11-2016 09:22 PM by Dieter.)
Post: #122
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(11-11-2016 09:10 PM)Gene Wrote: Here is what I put in for the R and S routine: Gene, please put an ABS in the R routine before STO 00. It is always possible that somehow R00 holds a negative value, maybe inadvertently stored by the user or another program. OTOH the ABS and FRC in the seed routine is not essential for this RNG, it can be omitted. But it does not have to. ;-) If you prefer the single-stack-level version please double-check if this causes andy stack problems. I don't think so, but just in case... Dieter |
|||
11-11-2016, 09:33 PM
Post: #123
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
I'll drop in the ABS, no problem.
|
|||
11-12-2016, 02:27 AM
Post: #124
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(11-11-2016 07:12 PM)Dieter Wrote: That's what I also suggested earlier. Sorry, I must have missed your earlier suggestion. Writing a buffer based solution would be a lot more work, but a version that uses R00 is pretty simple: Code: ;********************************************************** Might want to add stack lift handling instead of just overwriting X, but that wouldn't take much either. This does take a few more words of ROM (maybe 40 instead of maybe 25, but executes much faster. |
|||
11-12-2016, 06:52 AM
(This post was last modified: 11-12-2016 07:24 AM by Dieter.)
Post: #125
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(11-12-2016 02:27 AM)RobertM Wrote: Writing a buffer based solution would be a lot more work, but a version that uses R00 is pretty simple: Fine. So let's do it this way. (11-12-2016 02:27 AM)RobertM Wrote: Might want to add stack lift handling instead of just overwriting X, but that wouldn't take much either. Yes, stack lift should be implemented. Not only because it is required by some of the programs. And do not forget the final ABS. ;-) BTW, what happens if R00 contains alpha data? Could this be converted to some kind of numeric value? I wonder if we could squeeze out some more digits if the multiplication is done with 13-digit precision. This does not mean the RNG gets a longer period, it still is 10^6. But I think we should get three more digits if we change the increment to 0,211327003 or 0,211327157 (10^9 times this prime). As far as I understand the theory of linear congruential RNGs (cf. Knuth) this should yield the maximum period, i.e. 10^9. Dieter |
|||
11-17-2016, 10:15 PM
(This post was last modified: 11-17-2016 10:17 PM by Dieter.)
Post: #126
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(11-11-2016 09:10 PM)Gene Wrote: Great. Here is a link to a .zip file containing all 15 programs and a LBL R and S file for the random number and seed program. Raw files are hard ro read by humans... ;-) Anyway, I just noticed that this thread has not seen a lot of traffic over the last days. So let me add that I have been working on the STW program, but it's a bit harder than I thought (not sure if the version we have now is working as it is supposed to). Changing the code so that R00 is free for the random seed is easy, and I think this part already works. But there are still some issues, e.g. the program may stop with pending subroutine calls, which is something that should be avoided. BTW, the chess program can be shortened by a few bytes: there are several XEQ 16 calls that simply add 10 to X. Since the XEQ requires three bytes just as a simple "10 +", the former should be replaced by the latter. This saves the bytes for the subroutine itself – and the program will even run faster. Over the last days I have been thinking about random number generators and related stuff, so there is a delay with the STW program. But maybe someone else may give it a try. Robert ?-) Dieter |
|||
11-17-2016, 10:27 PM
Post: #127
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Do you mean the SPW SpaceWar program? Robert indicated he thought it worked well.
The code for the games have been sent to Angel for 3 days or so now. He has not yet responded so there may be a chance to adjust some items, but the random number cycling issues are one reason I had originally wanted to go with the 9821 generator whether slow or not. It is much faster these days than it was in the past on emulators or 41CL units, so I don't see speed as an issue. However, the PI + ^ 5 generator that was pushed in the thread here is the one that was sent off to Angel. Saving a byte or five in the chess program won't add much space to the availability in the rom, but it is certainly faster to add 10 than XEQ XY to add 10. :-) |
|||
11-17-2016, 10:43 PM
Post: #128
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(11-17-2016 10:27 PM)Gene Wrote: Do you mean the SPW SpaceWar program? Robert indicated he thought it worked well. Err... sorry, I obviously mixed up "SPW" and "ST". #-) Here the ST program was meant. But good to hear that SPW seems to work. (11-17-2016 10:27 PM)Gene Wrote: The code for the games have been sent to Angel for 3 days or so now. So you already have corrected / R00 adjusted versions of the remaining three programs, including ST? Or maybe two programs since a BSP version should already be available. (11-17-2016 10:27 PM)Gene Wrote: He has not yet responded so there may be a chance to adjust some items, but the random number cycling issues are one reason I had originally wanted to go with the 9821 generator whether slow or not. It is much faster these days than it was in the past on emulators or 41CL units, so I don't see speed as an issue. I had the same thoughts lately. The 41C natively runs 3x as fast as the 67/97. The only problem may be 130-random-number "2636" game. But compared to the 67... But then – I really like the idea of having the 9821 generator in MCode, using R00 for the seed. (11-17-2016 10:27 PM)Gene Wrote: However, the PI + ^ 5 generator that was pushed in the thread here is the one that was sent off to Angel. There are also issues with the (x+pi)^5 generator. I posted an example in the RNG thread. (11-17-2016 10:27 PM)Gene Wrote: Saving a byte or five in the chess program won't add much space to the availability in the rom, but it is certainly faster to add 10 than XEQ XY to add 10. :-) Hmmm... I remember some person suggesting to remove the final RTN in a program as this saves one (!) byte. ;-))) Dieter |
|||
11-18-2016, 05:52 AM
Post: #129
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(11-17-2016 10:43 PM)Dieter Wrote: Err... sorry, I obviously mixed up "SPW" and "ST". #-) Here the ST program was meant. busy week, will get it done this week-end.... "To live or die by your own sword one must first learn to wield it aptly." |
|||
11-18-2016, 03:23 PM
Post: #130
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Dieter: So you already have corrected / R00 adjusted versions of the remaining three programs, including ST? Or maybe two programs since a BSP version should already be available.
Gene: Which are these? I will go through them shortly. Diether: Hmmm... I remember some person suggesting to remove the final RTN in a program as this saves one (!) byte. ;-))) Gene: :-) True, but that was back EARLY in the process when we were not sure how much room the programs would take. We will end up with perhaps 10-20 bytes free so 1 or 2 extra won't allow room to put in another program. Although that Othello program posted yesterday for the HP 67 looks really cool... but no, behave Gene! That will have to be for 67FUN2 sometime. More later. |
|||
11-18-2016, 04:56 PM
(This post was last modified: 11-18-2016 05:18 PM by Gene.)
Post: #131
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Ok, here we go. I want to get these to Angel tomorrow USA time and hopefully he will be able to convert these to a .rom and .mod over the weekend.
Link to .zip including PDF and text file of program listings: program listings This .zip includes the .raw files below: .raw file zip file RandomNumberSeed.RAW BattleShip.RAW StarTrek.RAW CHESS.RAW SpaceWar.raw G1130.raw G2636.raw AOS.raw Artillery.raw Chuckaluck.raw Golf.raw JiveTurkey.raw MoonLander.raw TicTacToe.raw OABandit.raw FollowMe.RAW and SumDigits.RAW Notes: 1) SumDigits.RAW is the filler material. It is a small program that will be inserted as XROM 23,27 if there is room. If there is not enough room, it does not make the cut. 2) All files use the random number and seed prompting routines R and S. The updated StarTrek program is included as is the updated BattleShip program. Dieter, I also got rid of XEQ 16 in the Chess program and replaced it throughout with 10 +. Thank you. 3) The LBL R routine in the RandomNumberSeed.RAW file does this. We won't be using an Mcode routine. Angel prefers keeping this all FOCAL. 01 LBL "S" 02 RCL 00 03 "SEED?" 04 PROMPT 05 ABS 06 FRC 07 STO 00 08 RTN 09 LBL "R" 10 RCL 00 11 9821 12 * 13 .211327 14 + 15 FRC 16 ABS 17 STO 00 18 END Test and review one last time if you can. I want to put these in Angel's patient hands shortly. :-) |
|||
11-18-2016, 07:28 PM
(This post was last modified: 11-18-2016 07:49 PM by Dieter.)
Post: #132
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(11-18-2016 03:23 PM)Gene Wrote: Dieter: So you already have corrected / R00 adjusted versions of the remaining three programs, including ST? Or maybe two programs since a BSP version should already be available. The three programs that were missing in my 12-progam-zip are F67, ST and BSP. BSP: I think I recently posted an adjusted version of this. Here is a version with one or two small cleanups. An unnecessary label was removed, flag 27 set and after "game over" a simple R/S restarts the program. I also don't like the "KILLED" message since you can't kill ships, so I reverted this to *DESTROYED*. But I'm not a native speaker, so the decision is up to you. Anyway, here it is: Battleship.zip (Size: 828 bytes / Downloads: 2) BTW, I'd prefer LBL "BSP" instead of calling the program "BS". ;-))) ST: I did the conversion to R00 but I'm not yet satisfied with the result, cf. my previous posts. I also would like to fix a problem that in the 67 version probably was not addressed due to memory restrictions: it is possible that two or even all three Klingon ships are located on the same position (R01/02/03 are not necessarily different). This can be easily fixed. More important, the version in your zip file has a serious bug: after calling the RNG in line 53 the following LastX will return the same RN again (positive or maybe negative) since LastX holds the last value before the final ABS in the RNG: The original RNG had an ATAN here so that LastX returns the original angle (0...45°). So this LastX has to be replaced with an ATAN. Or a "45 *" which will also generate a random damage value between 0 and 45. And be sure to also include a DEG command, else the max. damage will be 0,785. ;-) If it goes into a ROM it should be perfect, or at least close to this. I'll see what I can do. F67: Haven't touched this yet. (11-18-2016 03:23 PM)Gene Wrote: Although that Othello program posted yesterday for the HP 67 looks really cool... but no, behave Gene! That will have to be for 67FUN2 sometime. In a way I like the "Master Scientist" program from the '25 PPC collection you posted. ;-) Dieter |
|||
11-18-2016, 07:32 PM
Post: #133
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
No problem and thank you. Your non-native English is wonderful.
The StarTrek program I posted has been adjusted to R00. I will look through the BS program and include it unless something jumps out. F67 (FollowMe) works and needs no R00 adjustment. It might be able to shrunk a few bytes, but it does work. Again, I will send off what we have to Angel shortly. I think this is a great collection because of your and Robert's efforts! |
|||
11-18-2016, 07:52 PM
(This post was last modified: 11-18-2016 08:03 PM by Gene.)
Post: #134
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
.zip file updated to include Dieter's BattleShip version with *DESTROYED* :-) and with the ATAN after RN bug fixed in StarTrek.
.zip of .raw files for 4K rom |
|||
11-18-2016, 10:08 PM
(This post was last modified: 11-18-2016 10:37 PM by Dieter.)
Post: #135
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Oops... this was a duplicate post, so I'll delete this ...except the following update:
I think I now have an ST version that runs correctly. However, the structure of the original program is a bit complex (and thus error prone) so that I have to do some more testing. At least some errors have been fixed, and the program now even correctly handles the damage update after a Klingon ship has been destroyed (cf. original documentation). Dieter |
|||
11-18-2016, 10:13 PM
(This post was last modified: 11-18-2016 10:14 PM by Gene.)
Post: #136
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Good. Post it here when you are confident. :-)
|
|||
11-19-2016, 11:05 AM
Post: #137
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(11-18-2016 10:13 PM)Gene Wrote: Good. Post it here when you are confident. :-) On standby - just say when... "To live or die by your own sword one must first learn to wield it aptly." |
|||
11-19-2016, 07:14 PM
(This post was last modified: 11-19-2016 10:36 PM by Dieter.)
Post: #138
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(11-18-2016 10:13 PM)Gene Wrote: Good. Post it here when you are confident. :-) I cannot say anything for sure, but the attached version (less than 30 minutes old) seems to run OK. It even does some things right that the original 67 program (and its documentation) did not. The four ships (Klingons and Enterprise) now are always on different positions and there is just one flag test left. With the RNG and seed of the 67 documentation the program returns the same results (except one error in the original document where a wrong value of the Enterprise's damage is given). To repair a damage there is no need to enter the ship number in I or R09 (I assume you do not want to repair Klingon ships ;-)) and the value also does not have to be negative – simply enter the repair units and press [shift][C]. If the Enterprise is destroyed the final display shows its last position with negative sign. And now – Gene, Robert, Ángel and whoever wants to give it a try – do your own tests and see if there still are any bugs or glitches left. I fixed several problems, but we all know: errare humanum est. Dieter |
|||
11-19-2016, 08:06 PM
(This post was last modified: 11-19-2016 08:38 PM by Gene.)
Post: #139
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
Testing
Something does not seem right with LBL E (attack). I try to attack ship 2 let's say and I get hit by ship 2 but with various levels of power in my attack at them (30 units, 50, 100), I get no status update of any hit / damage. The program simply runs and shows my coords again. |
|||
11-19-2016, 09:08 PM
(This post was last modified: 11-19-2016 10:13 PM by Dieter.)
Post: #140
|
|||
|
|||
RE: 4K HP 67 Games rom attached for testing
(11-19-2016 08:06 PM)Gene Wrote: Testing 30, 50 or 100 units of phaser power? I think the maximum is 9. ;-) If the attacked Klingon ship is out of range nothing happens and only the Enterprise's position is returned. You may try the original RNG (RCL 00 ATAN FRC STO 00) and the example in the documentation. The results should match. At least they do here. Or simply recall your own position from R04 (e.g.25,40) , store a similar value (e.g. 27,42) in R01 and then try 1 [E]. Here is an example with the 9821 generator and a seed of zero. (Note: "<" represents the angle symbol) Code: XEQ "ST" SEED? P.S.: Please insert a FIX 2 after LBL 80 ST+06. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)