8-bit_d-boy Posted July 24, 2017 Share Posted July 24, 2017 Same issue as before, syntax error, can't figure out what's wrong, losing hair. So this issue started when I added my win state code which goes as follows: rem red win state ;goto _skip_win_state if scoring < 62 then goto _skip_win_state AUDV0 = 0 AUDV1 = 0 if scoring < 123 && scoring + 1 <= 122 then scoring = scoring + 1 : goto _skip_win_state scoring = 62 if pfc + 2 > 78 then pfc = 64 : goto _skip_win_state pfcolors: pfc end pfc = pfc + 2 if scoring > 122 && scoring + 1 <= 182 then scoring = scoring + 1 : goto _skip_win_state scoring = 123 if pfc + 2 > 158 then pfc = 144 : goto _skip_win_state pfcolors: pfc end pfc = pfc + 2 Please ask any questions you'd need. default.bas Quote Link to comment Share on other sites More sharing options...
+Karl G Posted July 24, 2017 Share Posted July 24, 2017 (edited) Edit: As noted by RT below, the intermediate calculations were not part of the problem - it was only the indentation of the end statements. You need to do intermediate calculations separately and not as part of your if statements. Also, the "end" statement always needs to not be indented. Here's the relevant section of code. I commented out your if statements, and put my broken-up version of the same in the lines below. It at least compiles for me with these changes. if scoring < 62 then goto _skip_win_state AUDV0 = 0 AUDV1 = 0 ; if scoring < 123 && scoring + 1 <= 122 then scoring = scoring + 1 : goto _skip_win_state temp1 = scoring + 1 if scoring < 123 && temp1 <= 122 then scoring = scoring + 1 : goto _skip_win_state scoring = 62 ; if pfc + 2 > 78 then pfc = 64 : goto _skip_win_state temp2 = pfc + 2 if temp2 > 78 then pfc = 64 : goto _skip_win_state pfcolors: pfc end pfc = pfc + 2 ; if scoring > 122 && scoring + 1 <= 182 then scoring = scoring + 1 : goto _skip_win_state temp1 = scoring + 1 if scoring > 122 && temp1 <= 182 then scoring = scoring + 1 : goto _skip_win_state scoring = 123 if pfc + 2 > 158 then pfc = 144 : goto _skip_win_state pfcolors: pfc end pfc = pfc + 2 Edited July 24, 2017 by kdgarris Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted July 24, 2017 Share Posted July 24, 2017 Your program will compile if you just get rid of the indentations before end. Make sure that you have the latest version of batari Basic and bblint and you will get error messages like these: warning(299): The "end" command appears to be indented. warning(297): missing matching end to " pfcolors:" warning(): Found 8 commands that use end, and 7 "end" commands. Quote Link to comment Share on other sites More sharing options...
8-bit_d-boy Posted July 24, 2017 Author Share Posted July 24, 2017 (edited) Hey thanks for the help, guys! It works now thanks to de-indenting the end statements, and it seems to work fine with intermediate calculations in the if-statements, but I'm wondering if that wouldn't work on real atari hardware. But now how do I get the Playfield to chage color? Does pfcolors not work with variables? The ball is black for me Also the Install batch file says I need setX. Edited July 24, 2017 by 8-bit_d-boy Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted July 24, 2017 Share Posted July 24, 2017 Hey thanks for the help, guys! It works now thanks to de-indenting the end statements, and it seems to work fine with intermediate calculations in the if-statements, but I'm wondering if that wouldn't work on real atari hardware. At one time, batari Basic wouldn't let us do any kind of math in if…then statements. That was changed over the years, but you still have to keep an eye on it. But now how do I get the Playfield to change color? Does pfcolors not work with variables? The ball is black for me I don't see any variables used here: randomterrain.com/atari-2600-memories-batari-basic-commands.html#kernop_pfcolors Be sure to check out the warning at the bottom of that section. Also the Install batch file says I need setX. RevEng said "install_win.bat requires SETX, which comes with Windows XP SP2 and later versions of Windows. If you don't have SETX on the system, the batch file will let you know and explain the situation." Quote Link to comment Share on other sites More sharing options...
8-bit_d-boy Posted July 24, 2017 Author Share Posted July 24, 2017 Thanks for the help I don't see any variables used here: randomterrain.com/atari-2600-memories-batari-basic-commands.html#kernop_pfcolors Be sure to check out the warning at the bottom of that section. Tried it without pfheights, same issue, oh well. I wanted it to change the playfield to the winner's color and cycle through the lumas, but guess not. RevEng said "install_win.bat requires SETX, which comes with Windows XP SP2 and later versions of Windows. If you don't have SETX on the system, the batch file will let you know and explain the situation." I'm aware of this, but I'm not sure where to get it. Thanks again. Quote Link to comment Share on other sites More sharing options...
8-bit_d-boy Posted July 25, 2017 Author Share Posted July 25, 2017 So I decided to change the background color to match the winner and have it cycle thru that color's luminances by one color every second similar to combat, but it seems to just stick to the one luminance value and I can't figure out why. Any pointers would be helpful. rem ------------------------- rem WIN STATE rem ------------------------- ;goto _skip_win_state if scoring < 62 then goto _skip_win_state AUDV0 = 0 AUDV1 = 0 COLUBK = pfc scoring = scoring + 1 pfc = pfc + 2 if missile0x > 110 then gosub red_win if missile1x > 110 then gosub blu_win _skip_win_state red_win if scoring > 122 then scoring = 62 if pfc > 78 then pfc = 64 return blu_win if scoring > 182 then scoring = 123 if pfc > 158 then pfc = 144 return airhockey.bas Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted July 25, 2017 Share Posted July 25, 2017 If I stick in "scoring = 62", the background flashes like crazy, not once every second. Quote Link to comment Share on other sites More sharing options...
8-bit_d-boy Posted July 25, 2017 Author Share Posted July 25, 2017 Where did you put that? I tried putting that in line 301, but I'm not getting that result. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted July 27, 2017 Share Posted July 27, 2017 Where did you put that? I tried putting that in line 301, but I'm not getting that result. I either put it right before the if then that checks for that or I put it in the main loop. Quote Link to comment Share on other sites More sharing options...
+TwentySixHundred Posted August 4, 2017 Share Posted August 4, 2017 (edited) By the looks of it to me the first instruction is a 'goto' statement "_skip_win_state" so basically any code following is ignored until the _skip_win_state label. Edited August 4, 2017 by Tony The 2600 Quote Link to comment Share on other sites More sharing options...
8-bit_d-boy Posted August 4, 2017 Author Share Posted August 4, 2017 You're a little late to this thread, pal. Quote Link to comment Share on other sites More sharing options...
RevEng Posted August 4, 2017 Share Posted August 4, 2017 You're a little late to this thread, pal. Even though I didn't say so, I'm all set with this issue. Thanks anyway! Fixed that for you. 1 Quote Link to comment Share on other sites More sharing options...
8-bit_d-boy Posted August 4, 2017 Author Share Posted August 4, 2017 Fixed that for you. That's what I meant to say, thanks dude! 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.