|*BILLY$CLINT*| Posted April 12, 2007 Share Posted April 12, 2007 (edited) Okay guys first off let me introduce my self, my name is |*BILLY$CLINT*| and I have been contracted to make a game for the Atari 2600 by Atari2600.com. After reviewing all the material that is on-line I am overwhelmed with the sheer amount of data and have no idea where to start. I have gotten some code to work and setup the various programs need to run and make games run but I have a few questions about some things that I have tried but don't work. For example should the following code work? It does but I have no idea why, after doing some reading I have read that you have to put, processor 6502, at the beginning of your code to get this to work. I have tried to run code that has processor 6502 at the beginning of it but it always fails on me. include div_mul.asm set kernel_options no_blank_lines set romsize 8kSC set smartbranching on const pfres=32 pfclear player0x=10:player0y=7 player0: %11000000 %01100000 %00110001 %00011011 %00001111 %00011111 %00111111 end gameloop COLUP0=15 COLUPF=203 if joy0left then player0x=player0x-1:if player0x<10 then player0x=10 if joy0right then player0x=player0x+1:if player0x>137 then player0x=137 if joy0up then player0y=player0y-1:if player0y<7 then player0y=7 if joy0down then player0y=player0y+1:if player0y>99 then player0y=99 skipjoy if joy0fire then gosub plot drawscreen goto gameloop plot rem convert player position to playfield pixel rem divide by 3 vertically g=(player0y-7)/3 h=(player0x-10)/4 if g=i && j=h then return i=g:j=h pfpixel h g flip return Also any code that has a, ; , in it will not compile. I know that ; is used for comments but why dose this not work. I am very new at this but I am not new to programing or game design. Please forgive me if my question sound basic but I am trying to start out some where. This next part is some code that came with on of the IDE and complies and plays but when I try and change something in it like add another player it errors out on me, sometimes even if I only change on thing. I am in the process of reading ATARI 2600 for Newbies so I think after that I might have a few answers. Thanks in advance for any advice that you can give me on this matter. Ohh yeah one last thing for somer reason in this last block of code will work so again you can see why I am stumped. Becasue it goes nothing with what was in the programing guide. set smartbranching on 10 player1x = 40 : player1y = 40:player0x = 50 : player0y = 50 20 COLUPF = 90:missile0height=4:missile0y=255 25 score=10000 30 COLUP0 = 120 35 COLUP1 = 14 40 scorecolor = 10:NUSIZ0=16 player0:;this is the player %01000010 %11111111 %11111111 %01111110 %00111100 %00011000 %00011000 %00011000 end 46 player1:;this is the enemy %00111100 %00011000 %00011000 %00011000 %11100111 %10100101 %10011001 %00100100 end player2:;this is the enemy %00111100 %00011000 %00011000 %00011000 %11100111 %10100101 %10011001 %00100100 end 47 a = a + 1 : if a < 3 then 55 49 a = 0 50 if player1y < player0y then player1y = player1y + 1 51 if player1y > player0y then player1y = player1y - 1 52 if player1x < player0x then player1x = player1x + 1 53 if player1x > player0x then player1x = player1x - 1 player1x = player1x : player1y = player1y if player2y < player0y then player2y = player2y + 1 if player2y > player0y then player2y = player2y - 1 if player2x < player0x then player2x = player2x + 1 if player2x > player0x then player2x = player2x - 1 player2x = player2x : player2y = player2y 54 player1x = player1x : player1y = player1y 55 if missile0y>240 then 58 57 missile0y=missile0y-2:goto 59 58 if joy0fire then missile0y=player0y-2:missile0x=player0x+4 59 drawscreen 60 if collision(missile0,player1) then score=score+1:player1x=rand/2:player1y=0:missile0y=255 if collision(player0,player1) then score=score-1 if collision(missile0,player2) then score=score+1:player1x=rand/2:player2y=0:missile0y=255 65 if collision(player0,player2) then score=score-1 70 if joy0up then player0y = player0y - 1 80 if joy0down then player0y = player0y + 1 100 if joy0left then player0x = player0x - 1 120 if joy0right then player0x = player0x + 1 140 goto 30 BC Edited April 12, 2007 by |*BILLY$CLINT*| Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted April 12, 2007 Share Posted April 12, 2007 It sounds like you are confusing directions for Batari Basic and Dasm. AFAIK bBasic calls Dasm, but it uses it's own canned routines/instructions that have been interpreted from a bBasic program. processor 6502, for example, doesn't need to be present in a bBasic program (the interpreter itself already knows what system you are compiling to). If you were writing a program in complete assembly, you would use Dasm only (hence, you would need to tell Dasm what processor the binary will be compatable with). For comments, use rem instead of the ";" in a bBasic program (again, the ";" is used by Dasm). Quote Link to comment Share on other sites More sharing options...
|*BILLY$CLINT*| Posted April 12, 2007 Author Share Posted April 12, 2007 Ohh okay that makes total alot of sense okay. So bB takes some of the work out of it for you. Now is the code the same and or similar for both like for example if i see something that I like but its written for assembly can I use that code as a guide to build my code or are they completely different. Also which is better or, should I say does on do something better than the other? I want to get my game to a rom, that is my final goal so I would like to know in which direction I should go so that I can accomplish this goal. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted April 12, 2007 Share Posted April 12, 2007 (edited) bBasic supports inline assembly...i.e. you can write lines of 6502 opcodes within a bBasic program. Use the command asm where 6502 assembly lines begin, and end to return to using bBasic. The stack pointer must not be altered when you return according to the bBasic manual. Within assembly code, all instructions must be indented at least one space (or they will assumed to be labels...which are not indented). Assembly code can be entered directly, used in a macro, or called from a file. As far as flexibility goes, there's nothing that bBatari does that cannot be done in pure assembly. The tradeoff is that while bBasic is much easier to learn and use - because all the difficult aspects of 2600 assembly language programming is done for you (including the mutha-fatha itself - the display kernal), assembly language programming gives you total control of the machine and it's resources (bBasic robs you of some of that). But bBasic supports "minikernals" in addition to the ones that are premade for you to choose from. So at least some display customization is possible. Either way, you'll end up with a binary file that can be used with emulators or burned to an Eprom chip (to be placed in a cartridge). BTW this entire thread really belongs in the 2600 Basic forum, since it deals with bBasic ("2600 programming for newbies" is in reference to beginners of assembly programming). Edited April 12, 2007 by Nukey Shay Quote Link to comment Share on other sites More sharing options...
|*BILLY$CLINT*| Posted April 12, 2007 Author Share Posted April 12, 2007 Ohh sorry about that is there any way that we can get this thread moved. But thanks for the help. 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.