TMR Posted August 18, 2012 Share Posted August 18, 2012 That's probably about as long-winded as just checking for all the conditions in an if so i'll leave what's there. So... entries in .BAS format since i know how that's done? =-) Quote Link to comment Share on other sites More sharing options...
potatohead Posted August 18, 2012 Share Posted August 18, 2012 Yeah, that was an omission I never liked. Too many comparisons bogs down quick. IMHO, ON GOTO works much better, but takes up room. Maybe no more than the comparisons do. Somewhere I saw a USR function contained in a string method that would be nice and quick, but no ML for this one... Quote Link to comment Share on other sites More sharing options...
NuY Posted August 18, 2012 Author Share Posted August 18, 2012 That's probably about as long-winded as just checking for all the conditions in an if so i'll leave what's there. So... entries in .BAS format since i know how that's done? =-) If you come close to hitting the 4K limit, it will save a good few bytes over IF/THEN constructs too. Entries in .BAS are great, also an ATR in any DOS flavour with the Basic file saved on it is cool also. When they're all in, I'll put them all on one disk image too with a boot menu (PicoDOS?) for people to be able to easily play them and post it up here My problem at the minute is that I know most of the theory into getting a game done (movement, UDGs, PMGs, collision etc.) but I'm racking my brains for inspiration for an actual subject for a game If this project catches a few people's imagination, feel free to mention it in RG btw Quote Link to comment Share on other sites More sharing options...
NuY Posted August 18, 2012 Author Share Posted August 18, 2012 (edited) There is one last stick routine that is worth mentioning, using Atari Basic's capability of using a variable, expression or function in a GOTO statement, and it avoids doing any evaluations completely, but will eat up more memory. It is however, very fast for Basic. This is for eight way movement, can be changed to suit for 4 way or accidental pushes to up/left or down/left: 1 GOTO 20:REM Jumps over stick routine 5 X=X+1:Y=Y+1:RETURN 6 X=X+1:Y=Y-1:RETURN 7 X=X+1:RETURN 9 X=X-1:Y=Y+1:RETURN 10 X=X-1:Y=Y-1:RETURN 11 X=X-1:RETURN 13 Y=Y+1:RETURN 14 Y=Y-1:RETURN 15 RETURN 20 GOSUB STICK(0) 30 ... Again, no sanity checking there, but you get the idea. Edited August 18, 2012 by NuY 1 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted August 18, 2012 Share Posted August 18, 2012 Just use Atari800Win+ and enable the H: device, point to your work directory. Then SAVE "H:GAME.BAS" And a nice little trick - if you add 5 to the drive number, it automagically does an EOL to CR/LF conversion for you. Quote Link to comment Share on other sites More sharing options...
TMR Posted August 18, 2012 Share Posted August 18, 2012 Okay, that's me done then. The game is called Stellar Caverns, the .BAS file is 3,209 bytes long and it's one of those "use PRINT to scroll" games where the player has to dodge the landscape. It uses PMGs (well, one player at least), a custom display list with split screen, has a little in-game sound... and it scrolls downwards!! That was a giggle... although i was supposed to be working today and spent far too long on this. =-) stellar_caverns.zip 11 Quote Link to comment Share on other sites More sharing options...
NuY Posted August 18, 2012 Author Share Posted August 18, 2012 That's bally impressive for a day's work...I doff my cap to you sir You've set the ball rolling now of course, let's see how many entries we can get up to. I need to read up on some internal Atari trickery I think, to try and get my head round what you did there I've had some ideas floating round my head for something scrolling...Is horizontal scrolling from Basic as easy as vertical? Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted August 18, 2012 Share Posted August 18, 2012 Damned thread... I am really kicking around ideas what I can do in 4k basic... Would prefer turbo basic still but well... TMR but not 4k data statements and mc program Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted August 18, 2012 Share Posted August 18, 2012 There is one last stick routine that is worth mentioning, using Atari Basic's capability of using a variable, exp<b></b>ression or function in a GOTO statement, and it avoids doing any evaluations completely, but will eat up more memory. It is however, very fast for Basic. This is for eight way movement, can be changed to suit for 4 way or accidental pushes to up/left or down/left: That's cool 1 GOTO 20:REM Jumps over stick routine 5 X=X+1:Y=Y+1:RETURN 6 X=X+1:Y=Y-1:RETURN 7 X=X+1:RETURN 9 X=X-1:Y=Y+1:RETURN 10 X=X-1:Y=Y-1:RETURN 11 X=X-1:RETURN 13 Y=Y+1:RETURN 14 Y=Y-1:RETURN 15 RETURN 20 GOSUB STICK(0) 30 ... Again, no sanity checking there, but you get the idea. Quote Link to comment Share on other sites More sharing options...
TMR Posted August 18, 2012 Share Posted August 18, 2012 That's bally impressive for a day's work...I doff my cap to you sir You've set the ball rolling now of course, let's see how many entries we can get up to. I need to read up on some internal Atari trickery I think, to try and get my head round what you did there There's not much trickery really, just a bit of abusing the display list; the scroller relies on that old chestnut of printing until you hit the bottom line of the screen and it being scrolled up (the look is based on a simple game called Road Vs Car written in 1983/4 by a school friend which i don't think he saved...) but there's a custom display list set up at the start which forces the standard screen to draw the second to bottom line of the screen first, then the one that's usually above it and so on until the top line (the very bottom line was skipped to avoid the flickering caused by printing/pushing and the title line added to make up the difference in display list length, it's ) I've had some ideas floating round my head for something scrolling...Is horizontal scrolling from Basic as easy as vertical? i reckon the problem with horizontal scroll is going to either be getting new data into play or rewriting multiple LMS statements in the display list fast enough to avoid tearing. It should be possible over a limited vertical area but i'm not sure how much of an area will work... Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted August 20, 2012 Share Posted August 20, 2012 There is one last stick routine that is worth mentioning, using Atari Basic's capability of using a variable, expression or function in a GOTO statement, and it avoids doing any evaluations completely, but will eat up more memory. It is however, very fast for Basic. This is for eight way movement, can be changed to suit for 4 way or accidental pushes to up/left or down/left: 1 GOTO 20:REM Jumps over stick routine 5 X=X+1:Y=Y+1:RETURN 6 X=X+1:Y=Y-1:RETURN 7 X=X+1:RETURN 9 X=X-1:Y=Y+1:RETURN 10 X=X-1:Y=Y-1:RETURN 11 X=X-1:RETURN 13 Y=Y+1:RETURN 14 Y=Y-1:RETURN 15 RETURN 20 GOSUB STICK(0) 30 ... Again, no sanity checking there, but you get the idea. This is shorter: 10 s=stick(0) 20 x=x+(s>4 and s<8 )-(x>8 and X<12) 30 y=y+(s=5 or s=9 or s=13)-(s=6 or s=10 or s=14) 1 Quote Link to comment Share on other sites More sharing options...
atari8warez Posted August 20, 2012 Share Posted August 20, 2012 (edited) I managed the snake/surround game in some insane small amount. It was something like 1-3 lines all up. 4K is fair scope to do something decent in Basic. Atari Basic also puts the filespec in Saved programs. So there's scope for savings by using a minimal filename. Actually, the shortest possible would probably be to have it as a CSAVE file. But the best way to judge size would be FRE(0) difference before/after loading the program. Assuming all FRE(0) sizes are measured in the same machine under the same hw/sw configuration , so this method is only valid for the final evaluation by the judge Edited August 20, 2012 by atari8warez Quote Link to comment Share on other sites More sharing options...
atari8warez Posted August 20, 2012 Share Posted August 20, 2012 (edited) Only drawback to this is getting the ATASCII gfx char in though - they still have to be done manually, unless someone can figure out how to get a heart character in Notepad Find the ATASCII code and type the corresponding ASCII character in Notepad. Notepad++ is a free and open source alternative to Notepad that does a lot more for program coding in a text editor then does the Notepad Edited August 20, 2012 by atari8warez Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted August 20, 2012 Share Posted August 20, 2012 One other trick you can use that does not involve machine code, is string offsets. You can take a string, mess around with it's entry in the variable name table, and set that string to reference any location in memory ... this trick is very useful for redefining a character set instantaneously, or manipulating sections of a screen or PMG's ... it's essentially like using a blitter when used in text mode. I did a program called convert.bas which will take any file (like a font file, or machine obj code) and convert it into string assignments, and save the code to disk as a .LST file ... it's in this thread. Cautions: The string has to be the first variable declared in the program. You cannot manipulate the string in immediate mode, or you will cause a system crash. Quote Link to comment Share on other sites More sharing options...
Rybags Posted August 20, 2012 Share Posted August 20, 2012 On/goto or Goto Stick(0) has it's risks especially in emulation. You can't rely on only the 8 normal directions being generated, any combination 0-15 should be catered for. Re shorter stick processing - PTRIG can help there, it's equivalent to left/right. So you could simply have e.g. X=X+PTRIG(1)-PTRIG(0) Quote Link to comment Share on other sites More sharing options...
atari8warez Posted August 20, 2012 Share Posted August 20, 2012 Okay, that's me done then. The game is called Stellar Caverns, the .BAS file is 3,209 bytes long and it's one of those "use PRINT to scroll" games where the player has to dodge the landscape. It uses PMGs (well, one player at least), a custom display list with split screen, has a little in-game sound... and it scrolls downwards!! That was a giggle... although i was supposed to be working today and spent far too long on this. =-) That's a damn good work for one day of coding Quote Link to comment Share on other sites More sharing options...
atari8warez Posted August 20, 2012 Share Posted August 20, 2012 (edited) Assuming all FRE(0) sizes are measured in the same machine under the same hw/sw configuration , so this method is only valid for the final evaluation by the judge Ooops actually, doing two FRE(0), one before and one after the program is loaded and taking the difference should work on any machine... Sorry Rybags, my fingers were working faster then my mind Edited August 20, 2012 by atari8warez Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted August 20, 2012 Share Posted August 20, 2012 I tend to stay away from gosub stick(0) or things like: goto 200*(stick(0)=14)+300*(stick(0)=7) ... etc. Reason being: When you use an expression in goto's and gosub's, it makes renumbering lines a pain in the arse. I generally tend to also work in TurboBASIC, and such expressions cause the program to not compile properly. Quote Link to comment Share on other sites More sharing options...
sack-c0s Posted August 21, 2012 Share Posted August 21, 2012 (edited) tempted now... can I even remember how to program in BASIC though? EDIT: Starting to get the hang of this using the 'paste into Altirra' method. Nobody told me about those bloody error messages in Atari BASIC (or rather the lack of...) Edited August 21, 2012 by sack-c0s Quote Link to comment Share on other sites More sharing options...
sack-c0s Posted August 21, 2012 Share Posted August 21, 2012 This is what just over 1K, about an hour of free time and 15 years without writing any BASIC gets you It's a suprisingly hard language to return to when you've been away for so long and I can't say I miss it much 4 Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted August 21, 2012 Share Posted August 21, 2012 i dig out old turbo basic source code written 7 years ago... bloody hell... hard to recap what I have written back then without any comments. but cool thing is really the copy/paste source code into Altirra magic hands typing. Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted August 21, 2012 Share Posted August 21, 2012 but still question. MC inside possible? or not allowed? Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted August 21, 2012 Share Posted August 21, 2012 tempted now... can I even remember how to program in BASIC though? EDIT: Starting to get the hang of this using the 'paste into Altirra' method. Nobody told me about those bloody error messages in Atari BASIC (or rather the lack of...) Hint: Use TurboBASIC, but use only code which will work in Atari BASIC for compatibility reasons. Turbo gives you more legible error messages. Quote Link to comment Share on other sites More sharing options...
NuY Posted August 21, 2012 Author Share Posted August 21, 2012 I tend to stay away from gosub stick(0) or things like: goto 200*(stick(0)=14)+300*(stick(0)=7) ... etc. Reason being: When you use an expression in goto's and gosub's, it makes renumbering lines a pain in the arse. I generally tend to also work in TurboBASIC, and such expressions cause the program to not compile properly. Generally I'd agree, but within the confines of this challenge, I'd say it's legit, as it's unlikely 4K of Basic will need renumbering, plus the target is Atari Basic, so speed is going to need to be balanced with size Quote Link to comment Share on other sites More sharing options...
NuY Posted August 21, 2012 Author Share Posted August 21, 2012 This is what just over 1K, about an hour of free time and 15 years without writing any BASIC gets you It's a suprisingly hard language to return to when you've been away for so long and I can't say I miss it much I do like a good Breakout clone; if it was only an hour and 1K of code up to now, that could be a hit 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.