+batari Posted July 22, 2005 Share Posted July 22, 2005 (edited) This thread will serve as a place for asm contributions to bB, to extend the functionality without adding extra bulk to the included 2600basic.asm file or compiler for functions that won't be used very often. The other advantage of a code repository is that it will force bB programmers to see the underlying asm - thus not completely insulating bB programmers from potentially complex code. The code should be ready to insert into bB and well-documented so that beginners could cut and paste it into their programs without needing special knowedge. Examples may be square root or trig functions, but there could be many others. I imagine that 99% of games will never need this, but for the 1% that does, inserting the asm would be handy. Some of the code will also be put into a library to be included with future releases of bB so programmers don't always have to come here to get it. You will be credited for your contributions if they are used in the bB library. I'll start out with a routine to clear the playfield: asm ldx #47 lda #0 clearpf sta playfield,x dex bpl clearpf end Edited July 22, 2005 by batari Quote Link to comment Share on other sites More sharing options...
+batari Posted July 22, 2005 Author Share Posted July 22, 2005 (edited) I should also include this one, as it has been requested before. It clears all RAM to zero and reseeds the random number generator. It cannot be called in a subroutine or bad things will happen! asm ldx #128 lda #0 clearram sta 0,x inx beq clearram lda INTIM ora #1 sta rand end Edited July 22, 2005 by batari Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted July 22, 2005 Share Posted July 22, 2005 (edited) Anyone know a solution to the indenting problem? Works for me. asm ldx #128 lda #0 clearram sta 0,x inx beq clearram lda INTIM ora #1 sta rand end Edited July 22, 2005 by Thomas Jentzsch Quote Link to comment Share on other sites More sharing options...
kisrael Posted July 22, 2005 Share Posted July 22, 2005 (edited) Right now Bastari BASIC only allows spaces not tabs for indenting. (Probably should go on the bug list) HMMM. left margin tabbed in left margin one space in left margin two spaces in So a tab or 1 space is eaten, 2 spaces are changed into one (I think that's a side effect of the old "more than one space gets turned into a nbsp; char" trick) Unfortunately the HTML PRE tag eats both tabs AND spaces in this environment which I don't think it does in real life. I've mentioned this to Al. He's a bit busy but interested in looking into it. Edited July 22, 2005 by kisrael Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted July 22, 2005 Share Posted July 22, 2005 To add indents inside a "CODE" tag (in the forum) you must use spaces - tabs are ignored. Quote Link to comment Share on other sites More sharing options...
+batari Posted July 22, 2005 Author Share Posted July 22, 2005 Right now Bastari BASIC only allows spaces not tabs for indenting. (Probably should go on the bug list) So a tab or 1 space is eaten, 2 spaces are changed into one (I think that's a side effect of the old "more than one space gets turned into a nbsp; char" trick) I hope that with the inclusion of lex, the parsing issues should be pretty much solved. I successfully built a lexical analyzer with lex a couple of days ago but I haven't yet integrated it into bB. I just added extra spaces to fix up the indenting in this thread... Strange that the first space is eaten. Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted July 22, 2005 Share Posted July 22, 2005 (edited) I just added extra spaces to fix up the indenting in this thread... Strange that the first space is eaten. 896580[/snapback] Kind of offtopic...but an indented line that has a semi-colon as its first non-space character will have yet another space eaten: three leading spaces ;another three leading spaces Weird. Edited July 22, 2005 by vdub_bobby Quote Link to comment Share on other sites More sharing options...
Brad2600 Posted August 10, 2005 Share Posted August 10, 2005 Can anyone post code that allows the player to have and fire a missle at another player? I want to experiment with a small game where you have a player and he has to shoot the other player just to score. Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted August 10, 2005 Share Posted August 10, 2005 Can anyone post code that allows the player to have and fire a missle at another player? I want to experiment with a small game where you have a player and he has to shoot the other player just to score. 908405[/snapback] This probably isn't the right thread for this request, since I am pretty sure you don't need to use inline assembly to do that. Quote Link to comment Share on other sites More sharing options...
Brad2600 Posted August 10, 2005 Share Posted August 10, 2005 My bad then. I had created a thread requesting such a thing but I was confused when I saw this thread as well. Sorry. Quote Link to comment Share on other sites More sharing options...
MausBoy Posted November 23, 2006 Share Posted November 23, 2006 Anybody have more to offer? Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted November 23, 2006 Share Posted November 23, 2006 Anybody have more to offer? Hey, thanks for resurrecting this thread; I had either missed or forgotten it! I'll go through my bB programs and see if I can find any inline asm code that would be of general use. Michael Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted February 27, 2008 Share Posted February 27, 2008 This thread will serve as a place for asm contributions to bB, to extend the functionality without adding extra bulk to the included 2600basic.asm file or compiler for functions that won't be used very often. The other advantage of a code repository is that it will force bB programmers to see the underlying asm - thus not completely insulating bB programmers from potentially complex code. The code should be ready to insert into bB and well-documented so that beginners could cut and paste it into their programs without needing special knowedge. Examples may be square root or trig functions, but there could be many others. I imagine that 99% of games will never need this, but for the 1% that does, inserting the asm would be handy. Some of the code will also be put into a library to be included with future releases of bB so programmers don't always have to come here to get it. You will be credited for your contributions if they are used in the bB library. I'll start out with a routine to clear the playfield: asm ldx #47 lda #0 clearpf sta playfield,x dex bpl clearpf end Has bB changed so much that the above is no longer needed or is that Clear Playfield routine still the thing to use? Also, was a code library ever included with bB? Maybe it's there and I'm just not seeing it. Thanks. Quote Link to comment Share on other sites More sharing options...
+batari Posted February 27, 2008 Author Share Posted February 27, 2008 Has bB changed so much that the above is no longer needed or is that Clear Playfield routine still the thing to use? Also, was a code library ever included with bB? Maybe it's there and I'm just not seeing it. Thanks. The above code is obsolete, as the pfclear command does just that and also accounts for non-standard playfields. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted February 27, 2008 Share Posted February 27, 2008 The above code is obsolete, as the pfclear command does just that and also accounts for non-standard playfields. Thanks. That's good to know. 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.