Jump to content
OLD CS1

"Tiles" COMPUTE! Magazine program conversion

Recommended Posts

This line contains initial write-up information, COMPUTE! Magazine scans, and original program from 1988.

"Tiles" is a program which appeared in COMPUTE! Magazine, Volume 10, Number 2, Issue 93, February 1988, Pages 30-46. The program was originally written by Rick Harrison, with versions for the Commodore 64, Apple ][, Atari 8-bit, IBM PCjr, Amiga, and Atari ST. The Texas Instruments conversion is based upon the game description in the article. The graphics are based upon the Atari ST version, with the screen layout matched as closely to the original versions as possible.

After COMPUTE! dropped the TI-99/4A, I obtained permission from ABC Publications and COMPUTE! Magazine to produce and distribute my TI-99 conversions of programs which appeared in the magazine. "Tiles" is one of these conversions.

As a budding programmer, I wrote this conversion back in 1988, and last year I was able to decode the original RadioShack T-10 cassette which holds the "final" version of the program.

It is atrocious. I mean, it works, but, Dear God, the code is horrendous.

So, starting in October 2010, I have been reprogramming the game. I have re-used a ton of the original elements, re-worked the screen layout, added a few things, and completely scrapped the main game loop.

I am not ready to present any work just yet, and I shudder at the prospect of showing the original code before I have the final product ready for comparison. I would, however, like some thoughts on a chunk of code over which I am currently agonizing.

The routine is to return a value of J based upon the directional keys within a split keyboard scan, fire button (or associated key,) joystick position, as well as a few other keys:

 

RETURNS: J 0: Nothing (-1 is a "stall" value)
1-5: Left, Right, Down, Up, Fire (keyboard and joystick equivalents)
6-8: AID, REDO, BACK

INCIDENTALS:

K -1: No key pressed or
Actual value of key pressed (Use to check high ASCII)

S 0: No key pressed
-1, 1: Same/new key pressed

X,Y -4,0,4: Joystick values

DEF JOY(@)=ABS(((SGN(@)+3)/2)*SGN(@)) ! (-4,0,4)=(1,0,2)

 



The problem is the sharing of certain keys by the two different key-scan modes which will be used. For instance, while FCTN keys are not returned, the non-FCTN part of the key is detected. I try to account for that in my code. Fortunately, there are no value overlaps between what I want from each key scan. For instance, AID is 1 in unit 3 but 1 in units 1 and 2 is unused, E/X/S/D from units 1 and 2 are 0, 2, 3, and 5 (not respectively) which do not overlap with REDO and BACK, etc.

I attempt to overcome key scan disparities while retaining performance and catch the key before the user releases it by jumping from one CALL KEY to the next as quickly as possible.

Below is the code, followed by pseudo-code narrative. I also left line 1450 in place in a REM just to show some of the numerical technique I have attempted to use. Unfortunately, this formula also returned phantom values for A and W in unit 1 and H and U in unit 2. It also had other shortcomings which I resolved by using a simple POS() comparison.

 

105 K$(3)=" "&CHR$(1)&CHR$(6)&CHR$(15)
106 K$(1)=CHR$(2)&CHR$(3)&CHR$(0)&CHR$(5)&CHR$(18)
110 DEF JOY(@)=ABS(((SGN(@)+3)/2)*SGN(@))


REM 1350 J=-1 ! CHANGED IN POST 2
1350 J=0
1355 IF P<0 THEN 1380
1360 CALL KEY(P,K,S)
1370 IF S THEN 1372 ELSE 1380
1372 J=POS(K$(1),CHR$(K),1)
1374 IF J=0 THEN 1400
1376 RETURN
1380 CALL JOYST(ABS(P),X,Y)
1390 IF X+Y THEN 1470
1400 CALL KEY(3,K,S)
1410 IF S THEN 1420 ELSE 1440
1420 J=4+POS(K$(3),CHR$(K),1)
1430 J=J*-(J>4)
1440 RETURN

REM 1450 J=(ABS(K-2)+1)*-(K<6)-5*(K=18)

REM 1470 IF SGN(X)*SGN(Y)THEN 1430 ! CHANGED IN POST 3
1470 IF SGN(X)*SGN(Y)THEN 1440
1480 J=JOY(X)+(JOY(Y)-2*(Y<>0))
1490 RETURN



1350 Set J stall value
1355 If Player is negative, skip fire button check
1360 Scan Player P keypad
1370 If no key pressed, next statement, else decode keypad
1372 Decode JOSTICK keymap to decode split-key scan to values 1-5
1374 If decode does not map, jump to unit 3 scan immediately
1376 RETURN
1380 Scan joystick of Player P
1390 If positive X or Y Return, decode joystick
1400 Scan BASIC keyboard
1410 If no key pressed, return with stall, else decode keypress
1420 Use BASIC keymap to decode press to values 5-...
1430 After key decode, if J<5 then j=0
1440 RETURN

1470 IF joystick position is diagonal, drop out with J=0
1480 Decode joystick position using JOY()
1490 RETURN

 



I would appreciate any thoughts on what I have here.

(Quick note, I never used the original listings to write my conversions. I just read the program descriptions and starting banging out code of my own. I felt that reading others' work would somehow "corrupt" my creative process. hehehe)

Share this post


Link to post
Share on other sites

Made a change already:

 

1350 J=0

 

I want to be able to logically test J (IF J THEN...), and the "stall value" prevents this.

Edited by OLD CS1

Share this post


Link to post
Share on other sites

Another change,

 

1470 IF SGN(X)*SGN(Y)THEN 1440

 

Since there is no longer a -1 stall value, I can directly RETURN from the subroutine. Original listing will be updated, as well.

Share this post


Link to post
Share on other sites

Since BASIC is such a slow dog, I would recommend you make thing less complicated by making 3 input routines. First, ask the player up front if they want to use a joystick. That way you only have to make that check once, outside of the game loop. Or, instead of asking them, have a screen that says "press fire to begin" or something similar, and test for both keyboard and joystick at that time, and which ever *way* they hit fire (keyboard or joystick), only test that method in the game. You could set a variable and use ON GOSUB to use the keyboard or joystick routine in the gameloop:

 

KOJ=0 (keyboard or joystick)

KOJ=(detect keyboard = 1, joystick = 2)

 

gameloop:

 

ON KOJ GOSUB 2000,2100

 

 

2000 REM keyboard

 

2100 REM joystick

 

As for AID / REDO / BACK, why would you constantly test those during game play? Make a third keyboard routine to test for just those inputs outside of the gameloop, once the game is over.

Share this post


Link to post
Share on other sites

The game allows for using keyboard and joystick interchangeably. AID is used to display help messages, and REDO/BACK are not necessarily used within the game, primarily at the end, but I also wanted a clean quit option other than QUIT or BREAK. It also does not cost much in the POS() check, though if I did not check for any FCTN keys I could use more mathematical formulas.

 

Considering console BASIC speed, the multi-detection approach may be too ambitious, sadly. Extended BASIC, however, seems to handle this quite well, and I will work an Extended BASIC version when I have completed the program.

 

Too bad there is no standard mouse for the TI. Would make my life a little easier ;)

 

I will see how things go as I work on the game loop itself. I may break out different routines for different input options. The routine already has a simple mode select, using the negation of P (current player) will skip the fire button detection (unit 1/2 scan) and only look at the joystick and BASIC key scan (unit 3.)

Share this post


Link to post
Share on other sites

Hope you keep your original code. 'Horrendous' as it might be, I want to see it. I'd like to have it right now, actually. (-:

 

What other conversions of programs from "Compute!" or elsewhere have you done?

Share this post


Link to post
Share on other sites

Old code is the documentation of your programming skills. The only time you should be embarrassed of old code is, if it looks like code you are currently writing. ;) Also, you learn a lot from old code and mistakes, as well as seeing how someone else solved the same problem. Typing in those monthly programs from Compute! and other magazines is how I learned most of my BASIC programming skills. It was a lot of fun too. I remember going with my mom when she would go grocery shopping, and I'd hang out in the magazine isle and devour the computer magazines, and I could always get her to buy me one or two. I wish there was some way to capture the "magic" of those times. I think that is what draws me to old books and magazines today.

Share this post


Link to post
Share on other sites

Old code is the documentation of your programming skills. The only time you should be embarrassed of old code is, if it looks like code you are currently writing. ;) Also, you learn a lot from old code and mistakes, as well as seeing how someone else solved the same problem. Typing in those monthly programs from Compute! and other magazines is how I learned most of my BASIC programming skills. It was a lot of fun too. I remember going with my mom when she would go grocery shopping, and I'd hang out in the magazine isle and devour the computer magazines, and I could always get her to buy me one or two. I wish there was some way to capture the "magic" of those times. I think that is what draws me to old books and magazines today.

 

Agreed! Old computer magazines rock... there's just nothing like it now. And most of my co-workers never even started programming until college. :(

 

Adamantyr

Share this post


Link to post
Share on other sites

Oh yes, I loved typing in programs on my TI from magazines and I remember...

 

- photocopying pages from issues of "Compute!" at the school library (and being

disappointed when I found a TI-specific program from very early issues torn out)

 

- checking out programs for errors and being excited about finding and fixing

them before a "real" fix would be revealed in a future issue

 

- purchasing the "Compute!'s TI Collection, VOLUME II" at a "Waldenbooks" in 1986 when

I was a young lad of 12

 

- I always appreciated how the TI's commands were easier to understand; the C64 peek's

and poke's looked so annoying

Share this post


Link to post
Share on other sites

Yep - I didn't have any friend who could write a game on one of their systems... I could do all sorts of cool stuff....

 

Of course the games they pirated were arguably better (well known) than what was available to me. Of course TI-99 Q*Bert was better than any other version.

 

Ever type in a listing from 99'er magazine? They had these vertical lines and blurry font that made mistakes commonplace. Debugging miskeys / errors was far easier in real code than finding the oddball in the pokes.

 

-H

 

Oh yes, I loved typing in programs on my TI from magazines and I remember...

 

- photocopying pages from issues of "Compute!" at the school library (and being

disappointed when I found a TI-specific program from very early issues torn out)

 

- checking out programs for errors and being excited about finding and fixing

them before a "real" fix would be revealed in a future issue

 

- purchasing the "Compute!'s TI Collection, VOLUME II" at a "Waldenbooks" in 1986 when

I was a young lad of 12

 

- I always appreciated how the TI's commands were easier to understand; the C64 peek's

and poke's looked so annoying

Edited by unhuman

Share this post


Link to post
Share on other sites

Hope you keep your original code. 'Horrendous' as it might be, I want to see it. I'd like to have it right now, actually. (-:

 

What other conversions of programs from "Compute!" or elsewhere have you done?

 

Oh, I will keep it. In fact, I have already exposed my shame in a different venue. heheheh

 

Only COMPUTE! stuff. Off the top of my head: "Leaping Larry," "Hickory, Dickory, Dock," "Laser Strike," "Block Battle" (my best, IMO,) and "Laser Chess" (never finished.) There were two others that I started, but I cannot remember the names, one was about a balloon and lasers, and the other was a honeycomb puzzle of sorts.

 

Old code is the documentation of your programming skills. The only time you should be embarrassed of old code is, if it looks like code you are currently writing. ;) Also, you learn a lot from old code and mistakes, as well as seeing how someone else solved the same problem. Typing in those monthly programs from Compute! and other magazines is how I learned most of my BASIC programming skills. It was a lot of fun too. I remember going with my mom when she would go grocery shopping, and I'd hang out in the magazine isle and devour the computer magazines, and I could always get her to buy me one or two. I wish there was some way to capture the "magic" of those times. I think that is what draws me to old books and magazines today.

 

I did a lot the same in my youth. My parents got me a subscription to COMPUTE! for my birthday one year, and it wound up being the most anticipated and used reading item I ever received. I had that magazine in my school bag for the entire month, often discussing some of the newer technologies coming our way. I had really great discussions with one of my teachers who was a Mac user and really into technology. Yeah, I fear that a lot of the magic from those days is lost, and I often lament not keeping some of my stuff in better condition so that my kids could one day really understand it.

 

I used to babysit a friend's daughter a few years back, and she used to sit and play on the TI pretty much the whole time she was over. Was kinda neat to watch her. I was even more tickled when she took right away to my Amigas. A smart kid with good taste. I cannot speak for the magic today, as I am not a part of this new "geek" generation, which often is more "gamer" than "geek," so I do not know what magazines or what-not are out. I do know, however, that very few of them have over used a computer with a ROM-based OS which did not requite booting; a computer which is ready to follow your every command within seconds of being powered on; a computer with less power than a modern graphing calculator :)

 

While digging through storage, I was able to develop a simple time-line of my programming skill development. Pretty neat, actually. As embarrassing as my old programs may be, I do enjoy cleaning them up. Especially the machine language I wrote from back then. Over the next few years of free time (note, I did not say, in my free time over the next few years ;)) I plan to convert a number of my BASIC programs into ML by hand. Some may call that crazy when there is a compiler available, but where is the fun in that?

 

Yep - I didn't have any friend who could write a game on one of their systems... I could do all sorts of cool stuff....

 

Of course the games they pirated were arguably better (well known) than what was available to me. Of course TI-99 Q*Bert was better than any other version.

 

Ever type in a listing from 99'er magazine? They had these vertical lines and blurry font that made mistakes commonplace. Debugging miskeys / errors was far easier in real code than finding the oddball in the pokes.

 

We had 99er at the junior high school library. I remember typing in a few programs: a nano-processor (4-bit CPU emulator,) some sort of body simulator where you controlled heart rate and respiration to keep the body in line, a robot archeology program, and Robochase (I think that is the name,) which became quite popular and scores were contested between user groups.

 

During this era of my life, I was a latch-key kid and used to invite my friends from the neighborhood to come over and test play my games while my parents were at work. That was around the same time I made my switch from the TI to the Commodore 64.

 

I used to go to "swap parties" when I had my Commodore 64, which had far better games than my TI and kept me happy enough, even with the games I bought legitimately, to not pester my parents for an NES. I did not generally "get" the piracy angle as a lot of the games I downloaded or obtained through swap were not available in the US, and I did buy a lot when I would come across them. And, I have to agree that "Q*Bert" on the TI is one of the best arcade conversions, particularly for the TI. "Frogger" is another good one.

 

Anyway, I will put some more work into the game after I do this lit review for class, which I expect to complete tomorrow. Had a server take a dump due to burst capacitors on the motherboard last week, and I have been cleaning up ever since (just finished early this morning, thankfully.) I appreciate the interest, and I am kinda excited about putting them online.

Edited by OLD CS1

Share this post


Link to post
Share on other sites

Had a server take a dump due to burst capacitors on the motherboard last week, and I have been cleaning up ever since (just finished early this morning, thankfully.)

 

You can fix those. My server started being unstable after 3 years (I hate to reboot a machine with 725 days of uptime! I run FreeBSD by the way) and when I looked at the motherboard, it had the classic failed capacitors ("poofed caps" as some non-technical people call them). I thought that problem had come and gone back in 2003, but not so. It seems it is still with us even today!

 

http://en.wikipedia.org/wiki/Capacitor_plague

 

The first time a friend showed me a motherboard with the problem (circa 2004), I said I could fix it. I ordered the caps from Mouser (all of about a $1.50) and started in on trying to remove the bad caps from the motherboard. I failed. For the life of me I could not get the things out. A 6-layer board, coupled with my lack of cleaning the area very well, and holes that were not much larger than the leads on the capacitor... It was a mess. But I still say desoldering is 10 times harder than soldering.

 

To date I have fixed (due to bad capacitors): 3 LCD monitors, 1 motherboard, and 1 router. All in the last year. It still amazes me to open a device and see the failed capacitors. It *really* shocked me when I saw them on my motherboard because I paid a lot of money for it, and it was a brand I like and have used for years (Gigabyte). Most motherboards are using surface mount caps now, but I guess my model was on the tail end of using through-hole electrolytics.

 

If you are comfortable with a soldering iron, the way to repair a multilayer board is:

 

1. Clean, clean, clean the area! Use 99.956% pure alcohol (not the isopropyl stuff you get at Rite-Aid or Wallgreens, you will probably have to order some (Mouser and Digikey sell it)) and Q-tips. Then, before you desolder, use no-clean flux on the leads.

 

2. Use a hot-air bath.

 

3. Use ChipQuik, or a knock-off.

 

ChipQuik is like solder, but when mixed with solder it reduces the melting point significantly, so you can do low-temp desolering, which means you won't damage the board and the parts are easy to remove. For a hot-air bath, I made a rig for my heat gun and I test the temperature with an oven thermometer (not the most accurate, but it is well within the tolerance needed for this kind of work.)

 

You can get a lot of info (and equipment if you have the cash) here: http://zeph.com

 

Sorry for going off topic. It just seems I'm doing more circuit work and repair lately, rather than coding.

  • Like 1

Share this post


Link to post
Share on other sites

You can fix those. My server started being unstable after 3 years (I hate to reboot a machine with 725 days of uptime! I run FreeBSD by the way) and when I looked at the motherboard, it had the classic failed capacitors ("poofed caps" as some non-technical people call them). I thought that problem had come and gone back in 2003, but not so. It seems it is still with us even today!

 

Yeah, I have done a few of my own, including some Dell monitors. But I do not do repairs for customers as I cannot guarantee service. Besides, in most cases it is time to upgrade, anyway. Definitely in this case: a six year-old AMD X2 running Small Business Server 2003. Had to go. The back-up hardware was even worse, an eight year-old Pentium 4. Now I have them on a quad-core Xeon, just wish I had time to virtualize them instead of running the OS on the metal.

 

I have a ten year-old AMD Athlon on a DFI motherboard running my primary Solaris installation. I am scared to death of that one, but it passes visual inspection, never flakes out, and the hard drives all pass diagnostics. It has a replacement in the works right now, though.

 

Meh, for off-topic. My thread, I brought it up :)

Share this post


Link to post
Share on other sites

Dammit! Who else hates when a block of test code works fine by itself, but then for some unexplained reason fails when integrated into the full program?

Share this post


Link to post
Share on other sites

Okay, I am happy to make my first 2011 release of "Tiles." This post will always contain the latest release and will be linked from my first post.

 

Introduction

Back around 1986 COMPUTE! Magazine dropped support for the Texas Instruments home computers (my particular interest was the TI-99/4A as that is what we had at home.) This meant there would be no more program listings for TI computers in the magazine, and fewer articles until all disappeared.

 

As a budding young programmer, I wrote COMPUTE! a letter asking for permission to create and distribute my own TI conversions of programs found in their magazines. I had four in mind at the time: "Hickory Dickory Dock", "Leaping Larry", "Laser Chess", and "Tiles", though others would follow for a total of three finished games and several unfinished. (I am particularly proud of "Block Battle", for which I began learning TMS-9900 assembly language with my brand-new MiniMemory cartridge. Prior to this point all my programs were done in TI BASIC.)

 

I have had my TI rig set up on-and-off for the past several years with the intention to get to know programming better, now with an Editor/Assembler cartridge and Extended BASIC. Emulation has proven to be a boon for me in this regard. To start, I took a cassette recording (I had no disk drive back then) of "Tiles" and recorded it onto my laptop. I attempted to use a program called "CS1er," but it was unable to decode the wav. It sat for several months until I came across "Tape994a" which was able to correctly decode into a TIFiles file. I have been using Classic99 to re-work the program, and I have used CS1er to convert to save TIFiles formate back to wav and load into my real TI, both with great success. This is just a start.

 

 

Basic instructions

Quick instructions: Tiles is a memory game. You will be presented with an increasing number of tiles to find in a pattern up to 30 tiles. Use the keyboard or joystick to play. Standard key scan 1 and 2 for player one and two, respectively: ESDXQ and IJKMY for up, left, right, down, "fire". Joystick 1 left answers "1" or "Y" and right answers "2" or "N" for appropriate questions. Space bar and fire are interchangeable.

 

You will be shown the tiles then asked to hide them. You lose points the longer you wait to hide them: 60 points if your score is 5000 or over, 40 points for 2000 and over, and 20 points for under 2000. After hiding you have to find them. You score 100 points for each find, and are penalized 100 points for each miss. The game ends if you run out of points.

 

When playing two players, the first player to 30 tiles is the game winner. The player with the most points is the point winner. The high score for each player is remembered during the gaming session. (I have coded in a points-tie condition, but not a tiles-tie condition, yet.)

 

To quit the game, press CLEAR or QUIT. After a game is over you will be asked if you want to play again.

 

Speech is available if you are using the Terminal Emulator II catridge and a speech synthesizer -- neither of which I actually owned at the time, so I just kinda winged it. You cannot select speech if you run the program in TI Extended BASIC as Tiles uses the TE-II "SPEECH" device. Selecting speech with no synthesizer attached will break the program.

 

Instruction addendum

Press any key to end the attract mode and being the game. Number of player selection, play again inquiry, and surrender inquiry have time-outs which will return to the previous action. There is no speech. Since the score display does not update while waiting for you to hide your displayed tiles, I have added a second tone to the timer tick which indicates that your score has dropped below 400 points. You may press AID during certain parts of the game to remind you of keystrokes. In particular, AID during "find" will show you what you need to press, and BACK will give the current player the option to surrender the game. A player is not penalized for surrendering a game, and the player with the highest score is proclaimed the winner.

 

When waiting to hide the first tile, you do not lose points. However, incorrect selection in any "level" is rewarded with an error tone and a loss of 100 points. If you fail to find all of the tiles and run out of points, the pattern will be shown to you and your game will end. If you are playing a two-player game, the other player will continue until completion of a 30-tile pattern or points bankruptcy.

 

Moving on, things to do and left to be fixed

I have removed speech for the time being until I can find a satisfactory implementation. Most likely, I will limit speech to the Terminal Emulator II module with TI BASIC, and leave Extended BASIC without due to XB's limited vocabulary and inability to work with allophones (the later requires I convert allophones to LPC, which I am currently unable to do.)

 

I need to fix a few things which affect game play in a minor way. In particular, you have to hold SPACE/FIRE to ensure detection when hiding the exposed tiles. This is due to the way I time this part of the game. Also, I seem to hit the garbage collection during this routine, so timing may not always be exact -- it is what it is.

 

There are some spots where it is not exactly obvious that anything is happening and I plan to make those more active.

 

In terms of programming style, I debated on using the 0-element of the tile field variable, T(,), to store information versus more descriptive variables. The idea was to save on variable memory, realizing the I would only lose about two bytes in the program per reference over variables like SC() for score, etc. Doing this was a little cumbersome and does not make the program listing easy to read but, meh: it works for me :)

 

I used timeout counters which start at a negative number and increasing toward 0. This allowed me to do simple logic in IF-THEN-ELSE statements. I should have actually started high and counted down, which I will change in upcoming revisions.

 

I reused a lot of the original program and divided it up into functional sub-routines. I have done most segments in line number increments of 10 and filled in spaces between as I needed. I left all of that intact in the non-final listing so my progress can be seen pretty clearly. As well, the listing is my working listing, so I have left some notes and bread crumbs.

 

I did a new layout of the screen to better match the originals which all used a 6x10 tile field, including borrowing of the Atari ST font, completing the ST scoreboard copy. Another change was in the score display: instead of displaying the score every time it changes, and thus eating up time, scores are updated at the end of each player's turn.

 

Lastly, I plan on writing up an Extended BASIC version of "Tiles," which will include the use of a sprite, exploitation of some XB features to increase performance, and conversion of the working listing to a structured format compatible with matthew's excellent tool, the BASIC/XB converter found here. I also hope to write a version which will take advantage of the Super Extended BASIC's bitmap graphics routines, which would allow me to more closely match the originals.

 

 

Now on to the meat. I have attached scans of the original COMPUTE! article. As well, I have put two archives which contain my original embarrassing release and the 2011 release. In each is also a wav of the program: 1988 is the original sample from the C10 cassette on which the program has been stored for all these years (in MP3 VBR format due to the final size of the upload versus my 2MB-per-file limit,) and the 2011 output of CS1er which compresses very well as it is purely digital. (Note that, due to the MP3 encoding, I am not certain how Tape994a will decode the file once extracted to a wav, and I have not tried.) I did all of my work in Classic99 and have not yet loaded the produced wav into real hardware, but will as my goal is to run on actual metal. Note that the 1988 listing includes special characters which may not paste into Classic99.

 

21-Feb-2011, 12:34am: In lieu of writing up a picture tutorial of how to set up a VPN in Windows 7 and a server emergency evacuation guide, I played the wav into my console from my laptop. I am happy to advise that the game seems to actually play better on the console than in emulation. I was even able to do some rudimentary conversion to XB and re-discovered the 28-column limitation with DISPLAY (ugh.) I also noticed that what appear to be garbage collections happen at the same points in both TI BASIC and TI Extended BASIC... interesting. And, finally, I see that the program has shrunk from its original 9.75k to 7.75k, reducing the tape load time from 2:20 to 1:44.

 

As games go, this is a pretty simple one and I hope people enjoy it. I have a couple more which I will be working on rewriting, including one which will definitely be able to take advantage of SXB. I would love to get more involved projects going -- it seems this has gone on for months with very little real work put in place -- but I simply lack the time these days. That should change around the summer time.

 

Screen shot of Tiles from 1988



post-27864-129826717478_thumb.png

 

Screen shot of Tiles from 2011

post-27864-129826719076_thumb.png

Edited by OLD CS1

Share this post


Link to post
Share on other sites

Neato... I'll be DLing this in the morning. Good write up, buddy. =)

 

Thanks. Looking forward to your feedback. Tomorrow I may put some more touches on it of which I made a list tonight.

 

One of the things I have considered is shifting the message area so row 22 and 23 are the normal message area, and 24 is the informational message line for AID or other (currently, 23 and 24 are message and 22 is informational.) I also will be splitting the color setting routine from the clear tile field routine since I no longer reset colors, allowing the rotating random colors of the attract more to persist throughout the game. The original COMPUTE! versions had random sounds in the attract mode, which I may implement. Amongst a few other minor changes.

 

Also, in regards to the MP3 conversion of the recorded WAV, I suspect it will not work well with neither real TI hardware nor CS1er or Tape994a. I took the WAV of Tiles2011 produced by CS1er and ran it through lame 3.98 to create a VBR MP3. Upon listening to the two, I can absolutely make out a noise intrusion in the MP3, as well as what sounds like a shift in tone. It also does not seem to "thunk" in my ear during playback like a normal recording does. I may toy with that later this week just to see, but at this point my wager is on, NO.

Share this post


Link to post
Share on other sites

Very nice write up and excellent implementation. :thumbsup:

 

Unfortunately this is not my kind of game, so I've just taken it for a quick spin. A complete machine code version wouldn't make much difference to me, although I'd be very interested in seeing if you made use of the extra resources.

 

:cool:

Share this post


Link to post
Share on other sites

Another release of "Tiles." I have made some changes to the program internally, and some changes to game play.

 

  • After going bankrupt, a player's missed tiles will be shown "thatched" to stand out from ones found
  • Each player is given 500 points to start the game*
  • Players are penalized points for waiting to hide on the first tile (used to only penalize for patterns)*
  • The cursor no longer returns to the upper-left after finding a tile
  • Key detection occurs four times per tick during "hide," which ensures your press does not get missed

 

* These changes reflect original game play. I was finally able to run the original version in AmigaBasic to gain more insight. I tried the Apple ][ and Atari ST versions, but the emulators I used apparently could not handle the game.

 

This will probably be one of the last updates I make for a couple of weeks. I am about to head into project weeks, second and final exams so personal pursuits will be mostly suspended.

 

I plan two more editions in addition to the TI BASIC version. One for straight Extended BASIC, and the other will be compiled. I have already done a lot of coding to use Matt's TIdBiT converter for the Extended BASIC edition, and I have noted a LOT of coding changes in order to be compiled (too bad I cannot use sprites with the compiler) with Wilheim's compiler.

 

I also have a few changes I want to make to counter TI BASIC's poor performance, which will actually move my source much closer, if not nearly identical in design, to the original COMPUTE! programs. In particular, clearing a 10x6 grid of double-spaced tiles takes a long time, but clearing a known list of squares goes much more quickly.

 

I have done some play testing and believe I have ironed out the bugs. Let me know if I broke something. Thanks.

Edited by OLD CS1

Share this post


Link to post
Share on other sites

Arise, chicken! Chicken, arise!

Seven years later.

I got a little lost regarding where I was when I last worked on this. But I have been able to optimize, clean up a little, squash a couple of bugs and create a new bug or two. The game-play is still the same. It runs in BASIC or Extended BASIC though does not yet take advantage of the latter. There will be an Extended BASIC-specific edition once the BASIC program is nailed down.

REDO tends to do odd things at odd times, so do not use it. There are a few more optimizations I will be making, but for the most part game-play looks complete.

Here is a listing, a file which will load in Classic99, and the tape wav since we are playing with those these days :)

TILES-022018.zip

 

10 REM  ** TILES! 
20 REM  * BY RICK HARRISON 
30 REM  ** (C) 1988 COMPUTE! 
40 REM  ** PUBLICATIONS INC. 
50 REM  ** TI CONVERSION BY 
60 REM  ** ALAN RATELIFF II 
70 REM  ** BASIC/EXT BASIC 
80 REM  ** PDD VERSION 3.0 
90 REM  UNBREAK 
100 REM  UNTRACE 
110 DIM T(6,10),TC(14),K$(1)
120 K$(0)=CHR$(2)&CHR$(3)&CHR$(0)&CHR$(5)&CHR$(18)
130 K$(1)=" "&CHR$(1)&CHR$(6)&CHR$(15)
140 DEF JOY(@)=ABS(((SGN(@)+3)/2)*SGN(@))
150 RANDOMIZE
160 CALL CLEAR
170 PRINT "ORIGINAL VERSION OF ""TILES"" USED WITH PERMISSION OF":"COMPUTE! PUBLICATIONS INC   PO BOX 5406"
180 PRINT "GREENSBORO NC  27403"::"COPYRIGHT 1988 COMPUTE!":"PUBLICATIONS INC":"ALL RIGHTS RESERVED"::
190 PRINT "TEXAS INSTRUMENTS CONVERSIONCOPYRIGHT 1988 BY":"ALAN W RATELIFF II":
200 GOSUB 750
210 CALL SCREEN(2)
220 CALL CLEAR
230 GOTO 1910
240 FOR I=0 TO 2
250 FOR J=0 TO 4
260 CALL HCHAR(1+I,22+J*2,96+J*8+I*2)
270 CALL HCHAR(1+I,23+J*2,97+J*8+I*2)
280 NEXT J
290 NEXT I
300 CALL HCHAR(4,22,40)
310 CALL HCHAR(4,23,44,
320 CALL HCHAR(4,31,41)
330 CALL VCHAR(5,22,47,15)
340 CALL VCHAR(5,31,45,15)
350 CALL HCHAR(20,22,43)
360 CALL HCHAR(20,23,46,
370 CALL HCHAR(20,31,42)
380 FOR I=23 TO 30
390 CALL VCHAR(5,I,64,15)
400 NEXT I
410 FOR I=0 TO 2 STEP 2
420 M$="[email protected]"&CHR$(91+I)
430 C=23
440 R=5+4*I
450 GOSUB 1150
460 M$="[email protected]"&CHR$(91+I)
470 C=24
480 R=9+4*I
490 GOSUB 1150
500 NEXT I
510 FOR I=1 TO 4
520 R=I*4+3
530 M$=STR$(T(0,I))
540 M$=SEG$("00000"&M$,LEN(M$),6)
550 C=24
560 GOSUB 1150
570 NEXT I
580 RETURN
590 CALL COLOR(1,1,1)
600 FOR I=5 TO 20 STEP 3
610 CALL HCHAR(I,2,37,19)
620 NEXT I
630 FOR I=3 TO 19 STEP 2
640 CALL VCHAR(5,I,32,17)
650 NEXT I
660 CALL COLOR(1,TC(1),1)
670 RETURN
680 T(0,10)=1-T(0,10)
690 M$=SEG$("[email protected]@[email protected]@[email protected]",1+28*T(0,10),28)
700 R=23
710 GOSUB 1090
720 M$=SEG$("[email protected]@[email protected]@[email protected]@RESERVED",1+21*T(0,10),21)
730 GOSUB 1110
740 RETURN
750 RESTORE 990
760 READ I
770 READ M$
780 ON POS(" *!",M$,1)+1 GOTO 790,790,760,820
790 CALL CHAR(I,M$)
800 I=I+1
810 GOTO 770
820 FOR I=96 TO 128 STEP 8
830 FOR J=0 TO 5
840 READ M$
850 CALL CHAR(I+J,M$)
860 NEXT J
870 CALL CHAR(I+6,"AA55AA55AA55AA55")
880 CALL CHAR(I+7,"FFFFFFFFFFFFFFFF")
890 NEXT I
900 RESTORE 1080
910 FOR I=1 TO 13
920 IF TC(I)THEN 960
930 READ J
940 TC(I)=J
950 GOTO 970
960 CALL COLOR(I,TC(I),1-10*(TC(I)=2))
970 NEXT I
980 RETURN
990 DATA 64,,*,36,00081C3E080808,FF818181818181FF,*
1000 DATA 40,0000010204091327,000080402090C8E4,E4C890204080,271309040201,0000FF0000FFFFFF,E4E4E4E4E4E4E4E4
1010 DATA FFFFFF0000FF,2727272727272727,*,90,0000040810204,0010301010101038,FEFCF8F8F8F8FCFE,003844040810207C
1020 DATA 003844040810001,7F3F1F1F1F1F3F7F,!
1030 DATA 0000007F7FFF0303,000000FFFFFEC0C,0707070F0F0F1E1E,80808,1E3C3C3C787878F,
1040 DATA ,0000003C3C78,0007070F01010303,00F0F0E0E0E0C0C,030707070F7F7FFF,C080808000E0E0C
1050 DATA 000000010103,000000FCFCF87878,0000000101010303,F0F0F0E0E0E0C0C,030707070F7F7FFF,C080808000E0E0C
1060 DATA ,,000303071E1E3C3F,00FCFCF81E1E3CFC,3F7F7878F03F3F7F,FCF8000000E0E0C
1070 DATA ,,000101030F0F1E07,00FFFFFE000000F8,070F0000007F7FFF,F8F03C3C78E0E0C
1080 DATA 16,11,16,16,2,2,2,2,14,8,13,9,5
1090 CALL HCHAR(22,1,32,96)
1100 CALL HCHAR(R,1,32,32)
1110 C=INT((28-LEN(M$))/2)+3
1120 CALL HCHAR(R,C-1,92)
1130 CALL HCHAR(R,C,64,LEN(M$))
1140 CALL HCHAR(R,C+LEN(M$),95)
1150 FOR M=1 TO LEN(M$)
1160 CALL HCHAR(R,C+M-1,ASC(SEG$(M$,M,1)))
1170 NEXT M
1180 R=R-(R<24)
1190 RETURN
1200 J=0
1210 IF P<0 THEN 1270
1220 CALL KEY(P,K,S)
1230 IF S THEN 1240 ELSE 1270
1240 J=POS(K$(0),CHR$(K),1)
1250 IF J=0 THEN 1290
1260 RETURN
1270 CALL JOYST(ABS(P),X,Y)
1280 IF X+Y THEN 1340
1290 CALL KEY(3,K,S)
1300 IF S THEN 1310 ELSE 1330
1310 J=4+POS(K$(1),CHR$(K),1)
1320 J=J*-(J>4)
1330 RETURN
1340 IF SGN(X)*SGN(Y)THEN 1320
1350 J=JOY(X)+(JOY(Y)-2*(Y<>0))
1360 RETURN
1370 FOR I=1 TO T(0,4+P)
1380 C=INT(RND*10)+1
1390 R=INT(RND*6)+1
1400 IF T(R,C)THEN 1380
1410 T(R,C)=103+INT(RND*5)*8
1420 CALL HCHAR(2+R*3,C*2,T(R,C))
1430 NEXT I
1440 RETURN
1450 IF T(0,*T(0,9)THEN 1480
1460 T(0,=1
1470 T(0,9)=1
1480 R=T(0,
1490 C=T(0,9)
1500 CALL HCHAR(3+R*3,C*2,36)
1510 GOSUB 1200
1520 IF J=0 THEN 1510
1530 CALL HCHAR(3+R*3,C*2,32)
1540 IF J>4 THEN 1600
1550 R=R+((J=3)*(R<6))-((J=4)*(R>1))
1560 C=C+((J=2)*(C<10))-((J=1)*(C>1))
1570 T(0,=R
1580 T(0,9)=C
1590 GOTO 1500
1600 ON J-4 GOTO 1760,1610,1510,1650
1610 M$=SEG$("[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@2",1+28*(P-1),28)
1620 R=22
1630 GOSUB 1100
1640 GOTO 1480
1650 M$="SURRENDER^^"
1660 R=22
1670 GOSUB 1100
1680 I=100
1690 CALL KEY(3,K,S)
1700 I=I-1
1710 IF (K<>89)*(K<>78)*I THEN 1690
1720 IF I*(K<>78)THEN 1750
1730 CALL HCHAR(22,1,32,32)
1740 GOTO 1510
1750 R=-1
1760 RETURN
1770 FOR R=1 TO 6
1780 FOR C=1 TO 10
1790 T(R,C)=0
1800 NEXT C
1810 NEXT R
1820 RETURN
1830 FOR R=1 TO 6
1840 FOR C=1 TO 10
1850 I=T(R,C)-1
1860 IF I<0 THEN 1880
1870 CALL HCHAR(2+R*3,C*2,I)
1880 NEXT C
1890 NEXT R
1900 RETURN
1910 GOSUB 240
1920 GOSUB 510
1930 GOSUB 900
1940 GOSUB 590
1950 GOSUB 680
1960 I=25
1970 I=I-1
1980 TC(14)=INT(RND*14)+3
1990 IF TC(14)=TC(13)THEN 1980
2000 FOR J=9 TO 13
2010 TC(J)=TC(J+1)
2020 CALL COLOR(J,TC(J),1)
2030 NEXT J
2040 J=INT(RND**8
2050 CALL HCHAR(5+INT(RND*6)*3,2+INT(RND*10)*2,37-(J<33)*(66+J))
2060 CALL KEY(3,K,S)
2070 IF S THEN 2090
2080 IF I THEN 1970 ELSE 1950
2090 M$="[email protected]@[email protected]^"
2100 R=23
2110 GOSUB 1090
2120 P=-1
2130 I=300
2140 GOSUB 1200
2150 IF J THEN 2200
2160 IF S THEN 2190
2170 I=I-1
2180 IF I THEN 2140 ELSE 1950
2190 J=POS("12",CHR$(K),1)
2200 IF (J=1)+(J=2)+(J=6)THEN 2210 ELSE 2170
2210 IF J<6 THEN 2260
2220 M$="[Z]@[email protected]@[@LEFTZRIGHT"
2230 R=22
2240 GOSUB 1100
2250 GOTO 2140
2260 CALL HCHAR(22,1,32,96)
2270 T(0,0)=J
2280 FOR I=1 TO 9
2290 T(0,I)=0
2300 NEXT I
2310 FOR P=1 TO T(0,0)
2320 GOSUB 510
2330 SC=T(0,P*2-1)
2340 TG=T(0,4+P)+1
2350 IF TG>1 THEN 2370
2360 SC=500
2370 IF (SC=0)*(TG>1)THEN 2900
2380 T(0,4+P)=TG
2390 GOSUB 1770
2400 GOSUB 590
2410 M$="[email protected]"&SEG$("ONETWO",3*P-2,3)
2420 R=23
2430 GOSUB 1090
2440 M$="[email protected]@[email protected]@"&SEG$("[email protected]",1-(TG>1)*10,10)
2450 GOSUB 1110
2460 GOSUB 1200
2470 IF J<>5 THEN 2460
2480 GOSUB 1370
2490 M$="[email protected]@[email protected]"
2500 R=24
2510 GOSUB 1100
2520 FOR I=1 TO 4
2530 REM  CALL SOUND(225,32768,30) ! Uncomment for compiling  
2540 GOSUB 1200
2550 IF J=5 THEN 2620
2560 NEXT I
2570 CALL SOUND(25,2555,0,3000,30+30*(SC<200))
2580 SC=SC-20+20*(SC>1999)+20*(SC>4999)
2590 IF SC>0 THEN 2520
2600 SC=0
2610 GOTO 2900
2620 GOSUB 590
2630 M$=SEG$("[email protected]@[email protected]",1-(TG=1)*11,11)
2640 R=23
2650 GOSUB 1090
2660 IF T(0,4+P)=1 THEN 2700
2670 M$=STR$(TG)
2680 R=24
2690 GOSUB 1100
2700 GOSUB 1450
2710 IF R=-1 THEN 2720 ELSE 2750
2720 CALL HCHAR(22,1,32,96)
2730 GOSUB 1830
2740 GOTO 2970
2750 IF T(R,C)=-1 THEN 2660
2760 IF T(R,C)THEN 2800
2770 CALL SOUND(150,220,0)
2780 SC=SC-100
2790 IF SC<0 THEN 2600 ELSE 2660
2800 CALL HCHAR(2+R*3,C*2,T(R,C))
2810 T(R,C)=-1
2820 SC=SC+100
2830 TG=TG-1
2840 IF TG THEN 2660
2850 M$="[email protected]@"&SEG$("[email protected]",1-8*(T(0,4+P)=1),
2860 T(0,=0
2870 T(0,9)=0
2880 R=23
2890 GOSUB 1090
2900 T(0,P*2-1)=SC
2910 IF SC<T(0,P*2)THEN 2930
2920 T(0,P*2)=SC
2930 IF SC THEN 2950
2940 GOSUB 1830
2950 NEXT P
2960 IF (T(0,1)+T(0,3))*((T(0,5)<30)*(T(0,6)<30))THEN 2310
2970 GOSUB 510
2980 IF T(0,0)=2 THEN 3010
2990 M$="[email protected]"
3000 GOTO 3050
3010 IF T(0,1)=T(0,3)THEN 3040
3020 M$="[email protected]"&SEG$("ONETWO",1-3*(T(0,1)<T(0,3)),3)&"@WINS"
3030 GOTO 3050
3040 M$="[email protected]@GAME"
3050 R=23
3060 GOSUB 1090
3070 M$="[email protected]^"
3080 GOSUB 1100
3090 P=-1
3100 I=200
3110 GOSUB 1200
3120 I=I-1
3130 IF I THEN 3140 ELSE 1940
3140 IF J THEN 3170
3150 IF S THEN 3160 ELSE 3110
3160 J=POS("YN",CHR$(K),1)
3170 ON J+1 GOTO 3110,2090,1940,3110,3110,3110,3180,2090,1940
3180 M$="[email protected]@[email protected][@LEFTZRIGHT"
3190 R=22
3200 GOSUB 1100
3210 GOTO 3110

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Attached is RC4 of the Extended BASIC version which takes advantage of more advanced features:

  • Multi-statement lines to increase performance and reduce size
  • Exploitation of longer CHAR statements, eliminating character DATA statements
  • Exploitation of CALL COLOR()'s ability to set multiple sets at a time to speed up attract mode
  • Use of real DISPLAY-AT for increased speed showing information, scores, and drawing the tile board
  • Sprite cursor rather than pointer (pointer character is still defined in this release)

I have been testing game-play and so far all is well. There will be a change before final release of the determination of a game winner. As of now if one player goes bankrupt long before the other the game will still end in a tie. Essentially, there is no way right now to actually win a game playing versus another player. I have to look at the original COMPUTE! game again and see how a winning game was handled if at all.

 

TILESXB-022218(RC4).zip

  • Like 2

Share this post


Link to post
Share on other sites

TFW you are ready to go "gold" and realize the one small remaining quirk requires examining and re-working the main body of the program and at least two supporting sub-routines.

 

 

2013%2F08%2F16%2Ff7%2FSteveCarell.20de9.

Share this post


Link to post
Share on other sites

These are the "gold" releases of my "Tiles" conversions for the TI-99/4A, in both TI BASIC and TI Extended BASIC version and a version exclusively for TI Extended BASIC. I will create a proper release thread in the general forum later today.

 

This disk contains two files: TILES and TILESXB.

 

Changes made since the release-candidates:

  • Changed certain utility variables which conflicted between routines and desired game-flow
  • Changed the "Display At" routines to handle multiple lines in a single call
  • Removed labels made redundant by flow changes
  • Moved subroutines around so most calling routines are later in the program than called routines
  • Changed some verbiages to reduce notification lengths to satisfy XB's "DISPLAY AT()" limitations
  • Eliminated a DEFined function for joystick decoding making joysticks surprisingly faster
  • Removed game win or tie (current or high score comparisons) to align with original game behavior
  • REDO is still detected during the game but not acted upon as showing the tiles again would require re-writing several routines and not in the original game
  • Surrendering no longer crashes after the first confirmation is dismissed or times out
  • Stored scores are updated when scores are shown fixing, among others, high scores being missed in-turn
  • TI BASIC: Changed scoring internally to 1s instead of 10s so score display is a little faster (this could have been done for Extended BASIC, also, but the gain is imperceptible)
  • TI BASIC: Various other flow changes to squeeze a little more performance

It was a challenging experience maintaining parity between two similar sources from a common base without any direct relationship between the sources, meaning I have to move code from one source to the other as changes are made and keep track of it. This was particularly difficult when I had to make a major fix in the main game loop and some of the support subroutines. While the exact same source could be shared between TI BASIC and TI Extended BASIC, modifications are necessary to take advantage of Extended BASIC's advanced features such as multi-statement lines and the use of logic operations (AND, OR) rather than mathematical equivalents.

 

The Extended BASIC version is written in a way which should allow compiling as-is by just changing the loops. I am pretty certain nothing illegal in the compiler, such as multiple-variable value assignments or nested IF-THENs, is used in the program. Even without compiling the Extended BASIC version runs well enough.

TILES-2018.zip

  • Like 3

Share this post


Link to post
Share on other sites

Okay, I just took a quick break from KiCad tutorials and ran a test compile. There are a couple more timing loops than I considered: the introductory copyright disclaimer and the attract marquee. But that is just off the bat, as I now think about the time-outs for number of players, surrender, and play again prompt.

 

And more, input detection is extremely overly sensitive. This will take more work than I originally expected. We shall see.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...