+Gemintronic Posted August 19, 2010 Share Posted August 19, 2010 (edited) I don't comment in code because I'm lazy/sloppy. Descriptive variable and constant names are a must though. Batari BASIC kernel features are pretty much what the 2600 can do. However, assembly lets you make sacrifices for better features in another aspects of your game. Disclaimer: Born and raised BASIC/4GL programmer. It's your programming background that determines whether BASIC first or assembly first is better. Most people I know were raised on farm fresh MS Basic and worked "down" to assembly routines. Edited August 19, 2010 by theloon Quote Link to comment Share on other sites More sharing options...
endrien Posted August 19, 2010 Author Share Posted August 19, 2010 I don't comment in code because I'm lazy/sloppy. Descriptive variable and constant names are a must though. Batari BASIC kernel features are pretty much what the 2600 can do. However, assembly lets you make sacrifices for better features in another aspects of your game. Disclaimer: Born and raised BASIC/4GL programmer. It's your programming background that determines whether BASIC first or assembly first is better. Most people I know were raised on farm fresh MS Basic and worked "down" to assembly routines. I've never done too well with assembly, though I did do pretty well with visual basic(derived from basic) Quote Link to comment Share on other sites More sharing options...
endrien Posted August 21, 2010 Author Share Posted August 21, 2010 I've started into bB. I just have to comment that so far I think starting with it is much better. Being able to get a sprite to appear on the screen without much effort is quite encouraging. Quote Link to comment Share on other sites More sharing options...
+batari Posted August 22, 2010 Share Posted August 22, 2010 Not to put anybody on the spot or anything...but I'm reminded by a recent example where the idea was to check a bunch of variables and set a value if all cases were true (which was to be checked for a few different starting variables). It quickly became a problem just to try to figure out how to compose the lines...when in assembly it could be accomplished in a handful of bytes. That's an example of the language having a negative effect on a programmer's creativity. I agree with this, as bB's simple conditions made it harder for beginners and experienced programmers alike. I spent the last few evenings working on this. It can generate efficient code, such as converting this (compiled with -O) if !u{0} then skip_the_rest if v<>1 then skip_the_rest if (a&3)=0 then set_x if (e&3)=0 then set_x if (i&3)=0 then set_x if (m&3)<>0 then skip_the_rest set_x x=2 skip_the_rest To this: LDA u LSR bcc .skip_the_rest LDA v CMP #1 bne .skip_the_rest LDA a AND #3 beq .set_x LDA e AND #3 beq .set_x LDA i AND #3 beq .set_x LDA m AND #3 bne .skip_the_rest .set_x LDA #2 STA x .skip_the_rest Furthermore, the code suggestions that failed before will now work. 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.