Image Map Image Map
Results 1 to 9 of 9

Thread: [TRS80] Attempting to Bring My Father's Old Video Game Back To Life, Need Syntax Help

  1. #1

    Default [TRS80] Attempting to Bring My Father's Old Video Game Back To Life, Need Syntax Help

    Hello, VCF community, I hope you can help me with this ultraspecific problem, as the resources online for vintage dialects of BASIC are somewhat lacking.

    Last year, while going through some old family records, I found a booklet of notes and diagrams my father made as a teenager when he was in college and working on his electrical engineering degree. Among the mess of poor handwriting and Traveler RPG Character Sheets, I found a collection of yellowing pages taken off a dot-matrix printer, which turned out to be the source code for a little video game my father programmed on his TRS-80 back in 1982, called TRANSPORTER WARS. From what I can gather from reading the code, it's some kind of strategy game involving beaming soldiers to landing platforms in an attempt to surround their beaming facilities. It was very amusing to go through the code and see the youthful personality he put into his code, like giving himself a hacker pseudonym, and while he doesn't remember a lot about his childhood anymore, he did seem to look back fondly on this little coding project.

    I thought it would be a cool Christmas present to get the program running on a TRS-80 emulator so he could relive his early compsci days a little, so I began the process of converting the code to the digital format. At first, I tried a handful of OCR programs on scans of the original printed code, but I think the DPI was too high, and the programs all freaked out when they could see the spaces in-between the dots on the page. If I was a smarter person, I might have tried lowering the resolution of the pages and running it through again, but at the time I was sitting in an airport terminal for a couple hours, and was bored enough that I took a shot at transcribing the entire thing, line by line, into a txt document.

    Once I had finished that process, I plugged all the lines into trs80gp to begin the typo correction and debug process. After a couple syntax errors that were easy to spot and correct, everything seemed to be moving in the right direction, but I eventually hit a wall.


    Code:
    ?SN Error in 10205
    Now, I'm 22, and have had no experience with programing on machines this old, but I have dabbled in more modern variations of BASIC, and through the process of retyping everything out, I collected a general understanding of the code structure and what lines were doing what. The part of the code throwing up the error is at the very end, where it's storing the names of the teams to be called in the code at the beginning of the game:

    Code:
    10200 REM <P$(7,1)> --- PLAYER 1 CODE NAMES
    10205 DATA "94TH AERO SQUADRON ACE","RUSSIAN","REPUBLICAN"
    10210 DATA "MOONIE","MAN","MICKEY","PROGRAMMER"
    10215 REM <P$(7,2)> --- PLAYER 2 CODE NAMES
    10220 DATA "RED BARON","AMERICAN","DEMOCRAT","ASTRONAUT"
    10255 DATA "APE","GOOFY,"ANY FOOLISH PERSON"
    Like I said, I learned enough about this language to fix some of the more egregious errors I made transcribing it, and even when I was totally lost, I could just reference the original scans of the printouts of the code. In this particular case, however, I've gone over the original code dozens of times, and as far as I can see, I've typed it correctly.



    I'm at a bit of a loss as to what the syntax error could be referring to. I've tried everything I can think of to fix it, removing the quotation marks, searching for the command that addresses the strings, removing the lines, and reading up on the syntax of TRS-80 BASIC, even running it on ROMs of different models of TRS80s, but nothing has worked so far. I feel like I'm extremely close to getting this program to work, but the last tiny obstacle just seems totally unclearable right now. My spoiled self is too used to IDEs that give me some kind of clue as to what the issue is

    If any of you could help me figure out how to solve this bug and get the code running, I would be forever in your debt. I've attached a ZIP file containing the txt transcription of the code here: Transporter_Wars.txt. The full-res scans of the printouts from 1982 are also available, but the attachment client doesn't seem to be playing nice with my zip file, so let me know if having those would be useful and I'll find a way to get them to you. Any input would be appreciated, and thanks in advance for helping me with a project that's been bugging me for a few months now!

  2. #2
    Join Date
    Jun 2013
    Location
    Melbourne, Australia
    Posts
    160

    Default

    Refer to: http://www.trs-80.com/wordpress/info...asic-language/
    In particular in the "Static Data" section:
    "If the variable is numeric, then the data is read as a numeric value if possible; if an attempt is made to read a non-numeric data value into a numeric variable, then (rather cryptically) a syntax error is thrown at the line number of the DATA statement."

    Lines 15 to 70 READs the DATA in lines 10000 to 10255.

    However there appears to be 6 items missing in the DATA section, in particular <GF> has only 5 items instead of 6, and <GG> (which should have 5 items) is possibly missing.

    Check to make sure all the DATA lines are there.

  3. #3

    Default

    Thanks for the suggestion! I went over it again and as it turns out, I DID make a mistake and missed a line. <GF> and <GG> should be in their proper places and quantities now. unfortunately, it's still spitting out the same error code in the same place, so perhaps I'm missing another line?

    I think I've figured out how to attach the scans, so I've attached them here, along with the updated txt file below, if you have any extra time and want to bug hunt a 37 year old program. Thanks again for your help so far. I have to think I'm this close to getting this to run.

    20201220_205039_0002.jpg20201220_210435_0012.jpg20201220_210435_0011.jpg20201220_210435_0010.jpg20201220_210435_0009.jpg20201220_205739_0008.jpg20201220_205739_0007.jpg20201220_205739_0006.jpg20201220_205739_0005.jpg20201220_205039_0004.jpg20201220_205039_0003.jpgTransporter_Wars.txt

  4. #4
    Join Date
    Mar 2013
    Location
    Chaffee, MO
    Posts
    1,214

    Default

    Here are a couple of errors I spotted. That should clear up the Dimensioned Data Elements
    and the Reads.

    Code:
    REM
    REM 15 DIM GC(9),GD(8),GF(6),GG(5),TP!(9),SS!(8)
    REM 20 DIM TP%(9),SS%(8),P$(7,2)
    REM 25 FOR AB=1TO9:READ Z:GC(AB)=Z:NEXT AB
    REM 30 FOR AC=1TO8:READ Z:GD(AC)=Z:NEXT AC
    REM 35 FOR AD=1TO6:READ Z:GF(AD)=Z:NEXT AD
    REM 40 FOR AE=1TO5:READ Z:GG(AE)=Z:NEXT AE
    REM 45 FOR AF=1TO9:READ Z:TP!(AF)=Z:NEXT AF
    REM 50 FOR AG=1TO8:READ Z:SS!(AG)=Z:NEXT AG
    REM 55 FOR AH=1TO9:READ Z:TP%(AH)=Z:NEXT AH
    REM 60 FOR AI=1TO8:READ Z:SS%(AI)=Z:NEXT AI
    REM 65 FOR AJ=1TO7:READ Z$:P$(AJ,1)=Z$:NEXT AJ
    REM 70 FOR AK=1TO7:READ Z$:P$(AK,2)=Z$:NEXT AK 
    REM
    REM
    ERRORS:
    Line 15 GF is dimensioned as 6, but in line 10145 there are only 5 DATA elements vs six.
    Line 15 GG is dimensioned as 5, but there are not 5 DATA elements in the source code

    Code:
    10000 REM
    10010 REM		DATA
    10020 REM
    10100 REM <GC> --- POKE CODES FOR BOXES
    10110 DATA 15794,15591,15387,15567,15748
    10115 DATA 15951,16155,15975,15771
    10120 REM <GD> --- POKE CODE FOR DIAMONDS
    10125 DATA 15606,15403,15379,15560,15944,16147,16171,15990
    10130 REM <GF> --- ASCII FOR BOTTOM DIAGONALS
    
    missing line numbers 135 & 140
    
    10145 DATA 140,176,179,140,176
    10150 REM <TP!> --- POKE CODE FOR SQUARE CENTER
    10155 DATA 15862,15659,15455,15635,15816
    10160 DATA 16019,16223,16043,15839
    10165 REM <SS!> --- POKE CODE FOR DIAMOND CENTER
    10170 DATA 15670,15467,15443,15624,16008,16221,16235,16054
    10175 REM <TP%> --- ASCII FOR SQUARE CENTER
    
    This should be 10180
    10170 DATA 49,50,51,52,53,54,55,56,57
    
    10185 REM <SS%> --- ASCII FOR DIAMONDS
    10190 DATA 49,50,51,52,53,54,55,56
    10200 REM <P$(7,1)> --- PLAYER 1 CODE NAMES
    10205 DATA "94TH AERO SQUADRON ACE","RUSSIAN","REPUBLICAN"
    10210 DATA "MOONIE","MAN","MICKEY","PROGRAMMER"
    10215 REM <P$(7,2)> --- PLAYER 2 CODE NAMES
    10220 DATA "RED BARON","AMERICAN","DEMOCRAT","ASTRONAUT"
    10255 DATA "APE","GOOFY,"ANY FOOLISH PERSON"

    I also located two lines with 10170 as the line numbers. There may be others.

    If you correct these problems the reads should get the proper data for the Dimensioned Elements.

    Larry
    Last edited by ldkraemer; November 2nd, 2019 at 07:40 PM. Reason: typo's

  5. Default

    Line 1245 has a mistake. 1X should be AX.
    Line 4485 is missing FOR
    Line 4120 NEXY should be NEXT
    Line 3160 needs to be split into 3160 and 3200
    Last edited by Robbbert; November 3rd, 2019 at 04:19 AM.

  6. #6
    Join Date
    Mar 2013
    Location
    Chaffee, MO
    Posts
    1,214

    Default

    Do a global search using "FOR" and expand the statements:
    FOR A3=2TO0STEP-1
    to
    Code:
    FOR A3=2 TO 0 STEP-1
    Making it easier to read until you locate all the mistakes.

    Line 3320 should be:
    3320 FOR A1=1 TO 6

    Line 590 should be
    590 IF I$="" THEN IA=0 ELSE IA=ASC(I$)

    Line 3530 likely needs to be GOSUB
    3530 ON TB GOBUN 4525,4565,4695,4765,4890,4970,5100,5170
    Code:
    3530 ON TB GOSUB 4525,4565,4695,4765,4890,4970,5100,5170

    Larry
    Last edited by ldkraemer; November 3rd, 2019 at 06:51 AM. Reason: typo

  7. Default

    I pasted the text into an emulator, then compared it with the scans. There were at least another 50 errors.

    Rather than list them all, I've attached a corrected listing.

    The game runs and appears to be doing whatever it's supposed to do.

    Let me know how you go.

    I also took the opportunity to save the game to wav file, so I have a permanent record of it.
    Attached Files Attached Files

  8. #8

    Default

    This is fantastic, and it works seamlessly on the Model III emulator! Seriously, thank you so much for your help and effort to get this working. I finally have it in a working order I can give him for Christmas. I'm forever in your debt for this.

  9. #9

    Default

    I'd be tempted to chase down a real Model III and give it to him for Christmas along with his game.

    g.
    Proud owner of 80-0007
    http://www.f15sim.com - The only one of its kind.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •