WarFreak131 Posted October 23, 2004 Share Posted October 23, 2004 Hi, just a few days ago, I decided I wanted to make my own Atari 2600 game. I have the cart and manual covered. But the things I need are.. Knowledge of programming + binary A program to create binary-based programs A way to test the program A way to send the program to the circuit board A way to delete all info on the board, should my game become corrupt And if you can, plz try to keep this under $50! Quote Link to comment Share on other sites More sharing options...
Robert M Posted October 23, 2004 Share Posted October 23, 2004 Hi, just a few days ago, I decided I wanted to make my own Atari 2600 game. I have the cart and manual covered. But the things I need are.. Knowledge of programming + binary Read all the tutorials in this newbie forum as a start. A program to create binary-based programs You will write all your code in assembly language in the form of a ASCII text file. In windows that is any file with the .txt extension. You can use NOTEPAD.EXE(okay), or WORDPAD.EXE (set the font to a fixed width font like Courier New), or any editor of your choice. If you are on Linux, you can use emacs or vi. If you are on a Mac, then you can use TextEdit. A way to test the program You need to download 2 things: An assembler and an emulator. There are many assemblers, but I recommend that you use one called DASM since that is what most homebrewers use and it will be easier for you to get help from other programmers if you use the same tool set. For an emulator you can use a program called Z26 for windows, and for Mac I recommend Stella. You can find links to these programs on this website or by searching the internet with a search engine like Google. A way to send the program to the circuit board. A way to delete all info on the board, should my game become corrupt You really don't need this, yet. The emulator will turn you PC into an Atari 2600 allowing you to test your program quickly and easily. You really don't want the hassle of programming an EPROM every time you want to test your code. When you get your program working smoothly on an emulator, then you can worry about testing it on real hardware. And if you can, plz try to keep this under $50! You should be able to get the tools I listed above for free off the internet. An EPROM burner to program an actual physical cartridge will cost you at least $129, and really should not be needed. Get your code running in an emulator. Good-luck! Quote Link to comment Share on other sites More sharing options...
WarFreak131 Posted October 23, 2004 Author Share Posted October 23, 2004 Thank you, you've been a great help! I downloaded Dasm, but it opens in a DOS window, then closes after 1 second. How can I open it for assembling a game? Quote Link to comment Share on other sites More sharing options...
Robert M Posted October 24, 2004 Share Posted October 24, 2004 Thank you, you've been a great help! I downloaded Dasm, but it opens in a DOS window, then closes after 1 second. How can I open it for assembling a game? There are 2 main methods: 1. Under the start menu select the "Run..." option. That will bring up a dialog box. The text line in the dialog box is like a command liine for DOS. You will enter the DASM command on that line. (NOTE: You may want to edit your PATH environment variable to include the directories where DASM is located and where your source code is located so that you don't have to give the complete path each time you run the program) In the RUN dialog box you will be entering something like this: DASM -f3 -o -l -s For example if DASM is in the directory C:DASM, and your program source file is named MyGame.asm, and is located in the directory C:DASMMyProjects, then you could execute the command like this: c:DASMDASM.exe c:DASMMyProjectsMyGame.asm -f3 -oMyGame.bin -lMyGame.lst -sMyGame.sym The executable file you open with the emulator or put on a cartridge is in the .bin file produced by DASM. the .lst and .sym files are just handy for finding solutions to problems reported by DASM and seeing what DASM did while compiling your code. 2. The second option is to simply open a DOS terminal window. Its also under the Start menu->All Programs->DOS_Prompt or something similar. Once it is open you simply pretend you are in DOS rather than Windows and go to the directory where your program is located. Then run the same command I listed above at the DOS prompt. Overall, I think you will find working in a DOS window preferable. Another way to open a DOS terminal is to type CMD in the RUN:dialog box like in option 1. Cheers! Quote Link to comment Share on other sites More sharing options...
WarFreak131 Posted October 24, 2004 Author Share Posted October 24, 2004 Thnx alot! Quote Link to comment Share on other sites More sharing options...
WarFreak131 Posted October 24, 2004 Author Share Posted October 24, 2004 What I did was put the DASM folder in the C: directory, and created a 'MyProjects' folder and put a 'MyGame.asm' file in the folder. I only put this to see what should happen. So I put in the command line you gave me and the 'MyGame.asm' file opened. Has the DASM program done anything?[/code] Quote Link to comment Share on other sites More sharing options...
WarFreak131 Posted October 24, 2004 Author Share Posted October 24, 2004 I found out what was wrong, it turns out I didn't have the DASM.exe in the right folder, now it works. It creates a .bim file and 2 others. When I put the .bin file in the emulator, two purple bars start converging from the the outer edges of the window. I dont know why this happens. But it's probably because I just randomly put 1's and 0's in the txt file. Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted October 24, 2004 Share Posted October 24, 2004 When I put the .bin file in the emulator, two purple bars start converging from the the outer edges of the window. I dont know why this happens. Somehow the emulator thinks the file you created is a Suprercharger file. Maybe due to the (probably) odd file size. Quote Link to comment Share on other sites More sharing options...
Robert M Posted October 25, 2004 Share Posted October 25, 2004 Okay, you are on the rightr track. Now I recommend downloading the source for the game Combat. There is a copy located here: http://www.atariage.com/2600/archives/comb..._asm/index.html If you can compile that succussfully and get it to run in the emulator then you know that your tools are working correctly. There is an include file referred to in that listing for Combat. The include is for a file called "vcs.h". vcs.h is a set of standard names for the registers and somtimes some extra constants that all the homebrewers try to use in their code. By all using the same names, it makes it easier to ask other programmers for help. You can get content for vcs.h from this stella mailing list message: http://www.biglist.com/cgi-bin/wilma/wilma...line=120#hilite Cut and paste the portion of the message as indicated in the message into a file named vcs.h and put it in the same directory as the source code for Combat. I am pretty sure it will declare all the right labels for the Combat asm file, but I may be wrong. Let me know if there are compile errors. Cheers! Quote Link to comment Share on other sites More sharing options...
WarFreak131 Posted October 25, 2004 Author Share Posted October 25, 2004 It isnt working. It says... DASM V2.20.04, Macro Assembler ©1988-2003 Warning: Unable to open 'vcs.h' Warning: Unable to open 'vcs.h' Warning: Unable to open 'vcs.h' --- Unresolved Symbol List NUSIZ0 0000 ???? (R ) NUSIZ1 0000 ???? (R ) COLUP0 0000 ???? (R ) COLUP1 0000 ???? (R ) PF0 0000 ???? (R ) PF1 0000 ???? (R ) PF2 0000 ???? (R ) CXCLR 0000 ???? (R ) RESMP0 0000 ???? (R ) RESMP1 0000 ???? (R ) VBLANK 0000 ???? (R ) BMisDec 0000 ???? (R ) CXPPMM 0000 ???? (R ) VDELP0 0000 ???? (R ) CXM0FB 0000 ???? (R ) AUDF0 0000 ???? (R ) AUDC0 0000 ???? (R ) CXM0P 0000 ???? (R ) CTRLPF 0000 ???? (R ) AUDV0 0000 ???? (R ) GRP0 0000 ???? (R ) GRP1 0000 ???? (R ) TIM64T 0000 ???? (R ) HMCLR 0000 ???? (R ) VSYNC 0000 ???? (R ) REFP0 0000 ???? (R ) CXP0FB 0000 ???? (R ) INTIM 0000 ???? (R ) HMOVE 0000 ???? (R ) INPT4 0000 ???? (R ) RESP0 0000 ???? (R ) RESP1 0000 ???? (R ) WSYNC 0000 ???? (R ) SWCHA 0000 ???? (R ) SWCHB 0000 ???? (R ) ENAM0 0000 ???? (R ) ENAM1 0000 ???? (R ) HMP0 0000 ???? (R ) HMP1 0000 ???? (R ) --- 39 Unresolved Symbols Fatal assembly error: Source is not resolvable. then i did the vcs.h thing, and I wasnt sure what to do. Do I make a new text file (.asm) and paste the words in it. I'm ot sure what I'm doing. Adn I need to know one thing, what is the language used in 2600 programming? Quote Link to comment Share on other sites More sharing options...
Robert M Posted October 25, 2004 Share Posted October 25, 2004 You need to create a new file named vcs.h, and put the following text into the file: ;========================== ; Equates for TIA Registers ;========================== ;---------------------- ; Write Address Summary ;---------------------- VSYNC equ $00;Vertical sync set-clear VBLANK equ $01;Vertical blank set-clear WSYNC equ $02;Wait for leading edge of horizontal blank RSYNC equ $03;Reset horizontal sync counter NUSIZ0 equ $04;Number size Player Missile 0 NUSIZ1 equ $05;Number size Player Missile 1 COLUP0 equ $06;Color-lum Player 0 COLUP1 equ $07;Color-lum Player 1 COLUPF equ $08;Color-lum playfield COLUBK equ $09;Color-lum background CTRLPF equ $0A;Ctrol playfield ball size & collisions REFP0 equ $0B;Reflect player #0 REFP1 equ $0C;Reflect player #1 PF0 equ $0D;First 4 bits of playfield PF1 equ $0E;Middle 8 bits of playfield PF2 equ $0F;Last 8 bits of playfield RESP0 equ $10;Reset player #0 X coord RESP1 equ $11;Reset player #1 X coord RESM0 equ $12;Reset missile #0 X coord RESM1 equ $13;Reset missile #1 X coord RESBL equ $14;Reset ball AUDC0 equ $15;Audio control 0 AUDC1 equ $16;Audio control 1 AUDF0 equ $17;Audio frequency 0 AUDF1 equ $18;Audio frequency 1 AUDV0 equ $19;Audio volume 0 AUDV1 equ $1A;Audio volume 1 GRP0 equ $1B;Pixel data player #0 GRP1 equ $1C;Pixel data player #1 ENAM0 equ $1D;Missile 0 enable register ENAM1 equ $1E;Missile 1 enable register ENABL equ $1F;Ball enable register HMP0 equ $20;Horizontal motion Player #0 HMP1 equ $21;Horizontal motion Player #1 HMBL equ $24;Horizontal motion Ball VDELP0 equ $25 VDELP1 equ $26 RESMP0 equ $28 RESMP1 equ $29 HMOVE equ $2A;Add horizontal motion to registers HMCLR equ $2B;Clear horizontal motion registers CXCLR equ $2C;Clear collision registers ;--------------------- ; Read Address Summary ;--------------------- CXM0P equ $00;Read collision M0-P1/M0-P0 CXM1P equ $01;Read collision M1-P0/M1-P1 CXP0FB equ $02;Read collision P0-PF/P0-BL CXP1FB equ $03;Read collision P1-PF/P1-BL CXM0FB equ $04;Read collision M0-PF/M0-BL CXM1FB equ $05;Read collision M1-PF/M1-BL CXBLPF equ $06;Read collision BL-PF/----- CXPPMM equ $07;Read collision P0-P1/M0-M1 INPT0 equ $08;Paddle #0 INPT1 equ $09;Paddle #1 INPT2 equ $0A;Paddle #2 INPT3 equ $0B;Paddle #3 INPT4 equ $0C;Misc input #0 INPT5 equ $0D;Misc input #1 ;====================== ; Equates for PIA Ports ;====================== SWCHA equ $280 SWACNT equ $281 SWCHB equ $282 SWBCNT equ $283 INTIM equ $284 TIM1T equ $294 TIM8T equ $295 TIM64T equ $296 T1024T equ $297 You can do this will any text editor, just make sure the file type extension to the file is .h and not .txt or .asm. The extension .h indicates a source code header file (NOTE: I'm not trying to confuse you, but I want to be clear, the .h extension is just common convention it could be .wig or .sht and the compiler won't care as long as your source code referred to the header file by that name. The combat code says #include vcs.h, so that is the name you must use.) The include command in the source file basically cuts and pastes the contents of the vcs.h file into your source file before compiling the code. You can reuse vcs.h in mulitple programs so using an include statement saves you typing. There is still another problem. I noticed in your error list this symbol: BMisDec 0000 ???? (R ) That error is a real error in the combat code I linked you too. Sorry about that. You need to search and replace in the combat.asm file. Replace all occurances of "BMisDec" with "MisDec". It occurs only once. So you only need to change it in one place and then save the .asm file. The programs for Atari 2600 are written in Assembly language, also sometimes called Machine Language although Machine language is often used to mean a less human readable format. You are writing the individual instructions that the microprocessor will execute in the machine. Unlike a higher language like BASIC or C++ where each statement of the language maps to several machine/assembly language instructions. There are many old books on assembly language programming. The processor for the Atari 2600 is the 6507 which is basically a simplified 6502 processor. You should be able to find an old used book on assembly or machine language for 6502 processors which are basically identical and which were the processors in Apple II and Commodore 64 computers. Let me know if it still won't compile. Cheers! Quote Link to comment Share on other sites More sharing options...
WarFreak131 Posted October 25, 2004 Author Share Posted October 25, 2004 It still wont compile. I removed the B in "BMisDec." I have the vcs.h file in the same directory as the dicombat.asm, and it still wont compile when I put it through DASM. Quote Link to comment Share on other sites More sharing options...
Robert M Posted October 25, 2004 Share Posted October 25, 2004 It still wont compile. I removed the B in "BMisDec." I have the vcs.h file in the same directory as the dicombat.asm, and it still wont compile when I put it through DASM. You need to post the error messages you are getting or I can't know how to help. Quote Link to comment Share on other sites More sharing options...
WarFreak131 Posted October 25, 2004 Author Share Posted October 25, 2004 Heres the message (when I have vcs.h in the same folder with the "B" problem removed... DASM V2.20.04, Macro Assembler ©1988-2003 Warning: Unable to open 'vcs.h' Warning: Unable to open 'vcs.h' Warning: Unable to open 'vcs.h' --- Unresolved Symbol List NUSIZ0 0000 ???? (R ) NUSIZ1 0000 ???? (R ) COLUP0 0000 ???? (R ) COLUP1 0000 ???? (R ) PF0 0000 ???? (R ) PF1 0000 ???? (R ) PF2 0000 ???? (R ) CXCLR 0000 ???? (R ) RESMP0 0000 ???? (R ) RESMP1 0000 ???? (R ) VBLANK 0000 ???? (R ) CXPPMM 0000 ???? (R ) VDELP0 0000 ???? (R ) CXM0FB 0000 ???? (R ) AUDF0 0000 ???? (R ) AUDC0 0000 ???? (R ) CXM0P 0000 ???? (R ) CTRLPF 0000 ???? (R ) AUDV0 0000 ???? (R ) GRP0 0000 ???? (R ) GRP1 0000 ???? (R ) TIM64T 0000 ???? (R ) HMCLR 0000 ???? (R ) VSYNC 0000 ???? (R ) REFP0 0000 ???? (R ) CXP0FB 0000 ???? (R ) INTIM 0000 ???? (R ) HMOVE 0000 ???? (R ) INPT4 0000 ???? (R ) RESP0 0000 ???? (R ) RESP1 0000 ???? (R ) WSYNC 0000 ???? (R ) SWCHA 0000 ???? (R ) SWCHB 0000 ???? (R ) ENAM0 0000 ???? (R ) ENAM1 0000 ???? (R ) HMP0 0000 ???? (R ) HMP1 0000 ???? (R ) --- 38 Unresolved Symbols Fatal assembly error: Source is not resolvable. Tell me if something is wrong in the picture I provided... Quote Link to comment Share on other sites More sharing options...
Robert M Posted October 25, 2004 Share Posted October 25, 2004 Okay, thanks for the screen shot the clarifies the problem. You need to run the command from the c:DASMMyProjects directory, so just enter this command at the DOS prompt: cd c:DASMMyProjects Then execute the build command just as you did before. It should work. The problem is that you were in the directory c:Documents and SettingsGreg and DASM uses the $PATH environment variable to search for all the files it needs to find. By default the $path variable includes the directory you are in when you execute a DOS command. By being in the MyProjects directory the DASM progam will be able to find vcs.h. If you want to be able to compile in another directory and use vcs.h in your MyProjects directory (or any other directory), then you will need to edit your system $PATH variable. Cheers! Quote Link to comment Share on other sites More sharing options...
+Andrew Davie Posted October 25, 2004 Share Posted October 25, 2004 Heres the message (when I have vcs.h in the same folder with the "B" problem removed... You are running DASM which is in one folder, you are located in another folder, and your source and vcs.h are in yet another different folder. No wonder it's not working! Change to the directory in which the source code and .h files reside, and it should all work for you! Cheers A Quote Link to comment Share on other sites More sharing options...
WarFreak131 Posted October 25, 2004 Author Share Posted October 25, 2004 Woopdefreakingdoo!!! I did it. : ) Thnx every1. So I ordered a 6502 machine language + beginnig programming for dummies book from Amazon.com. So I have time to figure out what I'm going to do. When I was in Spanish class today, I thought of something like this... You control a space ship. You can move left, down, right, and up. And you can shoot. To your left is a space station. Enemy ships come from the right. You have to defend your base as long as you can. The object is to get the high score. Anyway, things start out slow and get aster and faster until you eventually lose. The enemies are called something like Knights of Chaos. Your side is called something like Heaven's Finest. So that's about it. I am open to any suggestions. In the picture is an idea of what i want to make. The enemies dont shoot. They just try and get past you and try to crash their ship into your space station. After an enemy has crossed the red line, they are marked as crashed. You have 5 hits to a station. Thats about it... Quote Link to comment Share on other sites More sharing options...
Robert M Posted October 26, 2004 Share Posted October 26, 2004 I am glad to hear it is now working for you. Your plan for a first game looks very reasonable good and not overly ambitious for a 1st project. Keep us updated on your progress. Cheers! Quote Link to comment Share on other sites More sharing options...
WarFreak131 Posted October 26, 2004 Author Share Posted October 26, 2004 So, as I wait for my Dummies book to ship (Oct 26) anyone have any suggestions about the game or give an idea of how to use/write 6502 code? Anything at this point would be great. : ) Quote Link to comment Share on other sites More sharing options...
WarFreak131 Posted October 26, 2004 Author Share Posted October 26, 2004 Ok, this is really pissing me off. Does anyone know how to edit posts. Since I put my picture (desktop) on, the page has become wider and i have to scrool horizontally along the page to get in the whoel sentence. Quote Link to comment Share on other sites More sharing options...
WarFreak131 Posted October 27, 2004 Author Share Posted October 27, 2004 woohoo, my programming for dummies book came today!! Quote Link to comment Share on other sites More sharing options...
WarFreak131 Posted October 28, 2004 Author Share Posted October 28, 2004 Good! My 6502 assembly language book came today! 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.