vdub_bobby Posted March 11, 2005 Share Posted March 11, 2005 vdub- you're my hero. No, I wasn't sure it was a compilable source. I downloaded it off the list of original ROMs, and since it was the only game I knew very well, was trying to run it. I have no idea why it didn't occur to me that it may not be any good... Anyway, I downloaded your battlezone, but it was the bin and not the code. Do'h! Whoops! Glad you're up and running now! After a week or so of edit/compile/edit/recompile/etc. you'll be very familiar with dasm error messages and what they mean Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted March 11, 2005 Share Posted March 11, 2005 I went back and found the code for INDY500, off the same original ROMs list, and it too would not compile. However, I tried battlezone, and it seemed to work perfectly. Yeah, actually...I've noticed that a couple of the sources in that ROM list don't seem to work right - notably, the Pitfall! source compiles, but you can't jump when you play the .bin! Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted March 11, 2005 Share Posted March 11, 2005 The Dig has many commented disassemblies of games (Battlezone is in the "unfinished" zip here). Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted March 11, 2005 Share Posted March 11, 2005 The Dig has many commented disassemblies of games (Battlezone is in the "unfinished" zip here). That's where I got the copy of Pitfall!.s that doesn't let you jump. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted March 11, 2005 Share Posted March 11, 2005 I went back and found the code for INDY500, off the same original ROMs list, and it too would not compile. However, I tried battlezone, and it seemed to work perfectly. Yeah, actually...I've noticed that a couple of the sources in that ROM list don't seem to work right - notably, the Pitfall! source compiles, but you can't jump when you play the .bin! This happened before...the problem is in the VCS.H file Correction in bold below... ; TIA_BASE_ADDRESS ; The TIA_BASE_ADDRESS defines the base address of access to TIA registers. ; Normally 0, the base address should (externally, before including this file) ; be set to $40 when creating 3F-bankswitched (and other?) cartridges. ; The reason is that this bankswitching scheme treats any access to locations ; < $40 as a bankswitch. IFNCONST TIA_BASE_ADDRESS TIA_BASE_ADDRESS = 0 ENDIF ; Note: The address may be defined on the command-line using the -D switch, eg: ; dasm.exe code.asm -DTIA_BASE_ADDRESS=$40 -f3 -v5 -ocode.bin ; *OR* by declaring the label before including this file, eg: ; TIA_BASE_ADDRESS = $40 ; include "vcs.h" ; Alternate read/write address capability - allows for some disassembly compatibility ; usage ; to allow reassembly to binary perfect copies). This is essentially catering ; for the mirrored ROM hardware registers. ; Usage: As per above, define the TIA_BASE_READ_ADDRESS and/or TIA_BASE_WRITE_ADDRESS ; using the -D command-line switch, as required. If the addresses are not defined, ; they defaut to the TIA_BASE_ADDRESS. IFNCONST TIA_BASE_READ_ADDRESS TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS +30 ENDIF IFNCONST TIA_BASE_WRITE_ADDRESS TIA_BASE_WRITE_ADDRESS = TIA_BASE_ADDRESS ENDIF This won't happen if you NEVER use outside files. I just paste a full list of equates to every assembly I work with. Saves a lot of looking up anyway. I suggest using this instead of "include VCS blahblah" ;hardware register equates VSYNC = $00;Vertical Sync Set-Clear VBLANK = $01;Vertical Blank Set-Clear WSYNC = $02;Wait for Horizontal Blank RSYNC = $03;Reset Horizontal Sync Counter NUSIZ0 = $04;Number-Size player/missle 0 NUSIZ1 = $05;Number-Size player/missle 1 COLUP0 = $06;Color-Luminance Player 0 COLUP1 = $07;Color-Luminance Player 1 COLUPF = $08;Color-Luminance Playfield COLUBK = $09;Color-Luminance Background CTRLPF = $0A;Control Playfield, Ball, Collisions REFP0 = $0B;Reflection Player 0 REFP1 = $0C;Reflection Player 1 PF0 = $0D;Playfield Register Byte 0 (upper nybble used only) PF1 = $0E;Playfield Register Byte 1 PF2 = $0F;Playfield Register Byte 2 RESP0 = $10;Reset Player 0 RESP1 = $11;Reset Player 1 RESM0 = $12;Reset Missle 0 RESM1 = $13;Reset Missle 1 RESBL = $14;Reset Ball ;Audio registers AUDC0 = $15;Audio Control - Voice 0 (distortion) AUDC1 = $16;Audio Control - Voice 1 (distortion) AUDF0 = $17;Audio Frequency - Voice 0 AUDF1 = $18;Audio Frequency - Voice 1 AUDV0 = $19;Audio Volume - Voice 0 AUDV1 = $1A;Audio Volume - Voice 1 ;Sprite registers GRP0 = $1B;Graphics Register Player 0 GRP1 = $1C;Graphics Register Player 1 ENAM0 = $1D;Graphics Enable Missle 0 ENAM1 = $1E;Graphics Enable Missle 1 ENABL = $1F;Graphics Enable Ball HMP0 = $20;Horizontal Motion Player 0 HMP1 = $21;Horizontal Motion Player 1 HMM0 = $22;Horizontal Motion Missle 0 HMM1 = $23;Horizontal Motion Missle 1 HMBL = $24;Horizontal Motion Ball VDELP0 = $25;Vertical Delay Player 0 VDEL01 = $26;Vertical Delay Player 1 VDELP1 = $26;Vertical Delay Player 1 VDELBL = $27;Vertical Delay Ball RESMP0 = $28;Reset Missle 0 to Player 0 RESMP1 = $29;Reset Missle 1 to Player 1 HMOVE = $2A;Apply Horizontal Motion HMCLR = $2B;Clear Horizontal Move Registers CXCLR = $2C;Clear Collision Latches Waste1 = $2D;Unused Waste2 = $2E;Unused Waste3 = $2F;Unused ;collisions (bit 7) (bit 6) CXM0P = $30;Read Collision - M0-P1 M0-P0 CXM1P = $31;Read Collision - M1-P0 M1-P1 CXP0FB = $32;Read Collision - P0-PF P0-BL CXP1FB = $33;Read Collision - P1-PF P1-BL CXM0FB = $34;Read Collision - M0-PF M0-BL CXM1FB = $35;Read Collision - M1-PF M1-BL CXBLPF = $36;Read Collision - BL-PF ----- CXPPMM = $37;Read Collision - P0-P1 M0-M1 INPT0 = $38;Read Pot Port 0 INPT1 = $39;Read Pot Port 1 INPT2 = $3A;Read Pot Port 2 INPT3 = $3B;Read Pot Port 3 INPT4 = $3C;Read Input - Trigger 0 (bit 7) INPT5 = $3D;Read Input - Trigger 1 (bit 7) ;RIOT registers SWCHA = $0280;Port A data register for joysticks (High nybble:player0,low nybble:player1) SWACNT = $0281;Port A data direction register (DDR) SWCHB = $0282;Port B data (console switches) bit pattern LR--B-SR SWBCNT = $0283;Port B data direction register (DDR) INTIM = $0284;Timer output TIMINT = $0285; WasteA = $0286;Unused/undefined WasteB = $0287;Unused/undefined WasteC = $0288;Unused/undefined WasteD = $0289;Unused/undefined WasteE = $028A;Unused/undefined WasteF = $028B;Unused/undefined WasteG = $028C;Unused/undefined WasteH = $028D;Unused/undefined WasteI = $028E;Unused/undefined WasteJ = $028F;Unused/undefined WasteK = $0290;Unused/undefined WasteL = $0291;Unused/undefined WasteM = $0292;Unused/undefined WasteN = $0293;Unused/undefined TIM1T = $0294;set 1 clock interval TIM8T = $0295;set 8 clock interval TIM64T = $0296;set 64 clock interval T1024T = $0297;set 1024 clock interval Call me untrusting Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted March 11, 2005 Share Posted March 11, 2005 Oops TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS +$30 Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted March 11, 2005 Share Posted March 11, 2005 Oops TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS +$30 Ah, 30, $30, what's the difference? Anyway, thanks. Maybe I'll have another stab at hacking Pitfall! now... Quote Link to comment Share on other sites More sharing options...
MayDay Posted March 11, 2005 Share Posted March 11, 2005 I always thought Pitfall may make a cool Spiderman hack. What was your plan? Quote Link to comment Share on other sites More sharing options...
Cybergoth Posted March 11, 2005 Share Posted March 11, 2005 Hi there! Oops TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS +$30 Uhm... you're supposed to do that outside vcs.h, just say TIA_BASE_READ_ADDRESS = $30 right in the source file. vcs.h is meant to be included as provided, so anything will instantly compile with it as is, instead of having everyone keeping "this vcs.h for that game"... Greetings, Manuel Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted March 11, 2005 Share Posted March 11, 2005 Uhm... you're supposed to do that outside vcs.h, just say TIA_BASE_READ_ADDRESS = $30 right in the source file. Maybe I should just update those old files to match the recent vcs.h. vcs.h is meant to be included as provided, so anything will instantly compile with it as is, instead of having everyone keeping "this vcs.h for that game"... 100% agreed here. Without vcs.h everybody could name any constants like he wants to, making the code much less readable for someone who is used to the common constants. Quote Link to comment Share on other sites More sharing options...
+Andrew Davie Posted March 12, 2005 Share Posted March 12, 2005 ...the problem is in the VCS.H file Correction in bold below... Call me untrusting Goddamit' date=' that's the [b']worst[/b] advice I've read all week. The problem is not in the VCS.H file -- it is your complete misunderstanding of how the system works, and your total failure to read the very clear comments in the file. To all newbies reading this thread, the advice from Nukey is incorrect. You should never never never modify VCS.H. It is a standard, and many people have carefully collaborated on it over the years to bring you the fine piece of work that it is. It is so useful precisely because so many people use it. It can be trusted, unlike some people I could think of who throw stupid advice out to newbies. If you review the file carefully, you see that it defines those values if they are not already defined. Furthermore, if you read the comments it clearly tells you how to define them to what you want, and even gives two alternate methods. Either define the label in the file, or use the -D switch on the command-line. It's not rocket science. VCS.H is your friend. Copying the file into your source, and modifying things is just silly, and asking for trouble. Spend a bit of time reading the comments, and you would have saved yourself a lot of effort and spared yourself from my wrath, which of course is wroth. Cheers A Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted March 12, 2005 Share Posted March 12, 2005 As usual, pretty direct words from Andrew. But also as usual, pretty right ones! Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted March 12, 2005 Share Posted March 12, 2005 Thanks for the correction * considers posting something REALLY ironic...but decides against it Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted March 15, 2005 Share Posted March 15, 2005 Uhm... you're supposed to do that outside vcs.h, just sayTIA_BASE_READ_ADDRESS = $30 right in the source file. Do you have to do that after the "include vcs.h" line in the source, or before, or does it matter? Quote Link to comment Share on other sites More sharing options...
Tom Posted March 15, 2005 Share Posted March 15, 2005 Before you include vcs.h, as vcs.h will define the symbol with a default value if it's undefined. vcs.h: ; TIA_BASE_ADDRESS ; The TIA_BASE_ADDRESS defines the base address of access to TIA registers. ; Normally 0, the base address should (externally, before including this file) ; be set to $40 when creating 3F-bankswitched (and other?) cartridges. ; The reason is that this bankswitching scheme treats any access to locations ; < $40 as a bankswitch. IFNCONST TIA_BASE_ADDRESS TIA_BASE_ADDRESS = 0 ENDIF Quote Link to comment Share on other sites More sharing options...
Tom Posted March 15, 2005 Share Posted March 15, 2005 Additionally I'd like to point out that vcs.h and macro.h are very well documented and you shouldn't just use them, you should actually *read* them whenever new versions come out Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted April 26, 2005 Share Posted April 26, 2005 Personally, I feel that a default value should be automatically set to whatever is used the most. But hey...that's just my idiotic opinion Sorry if my freedom of choice scares you. Quote Link to comment Share on other sites More sharing options...
Ruffsta Posted December 20, 2005 Share Posted December 20, 2005 (edited) the issue i see (and had) ... here's what you do... 1.) unzip dasm 2.) go to command promt 3.)enter the following: CD c:\Documents and settings\Owner\Desktop\al\bin\DOS - but change "al" to the folder you unzipped to (folder should be 1 word not have spaces in it.. ex: al NOT atari learning) 4.) hit enter then type: dasm done! you should now see: Microsoft Windows XP [Version 5.1.2600]© Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Owner>CD c:\Documents and settings\Owner\Desktop\al\bi n\DOS C:\Documents and Settings\Owner\Desktop\al\bin\DOS>dasm redistributable for non-profit only DASM sourcefile [options] -f# output format -oname output file -lname list file -Lname list file, containing all passes -sname symbol dump -v# verboseness -t# Symbol Table sorting preference (#1 = by address. default #0 = alphab etic) -Dname=exp define label -Mname=exp define label as in EQM -Idir search directory for include and incbin -p# max number of passes -P# max number of passes, with less checks Fatal assembly error: Check command-line format. C:\Documents and Settings\Owner\Desktop\al\bin\DOS> hope that helps ok, i got this far.. but i don't know what to do after this Edited December 20, 2005 by Ruffsta Quote Link to comment Share on other sites More sharing options...
MayDay Posted December 21, 2005 Share Posted December 21, 2005 Here's some directions for you: 1. save DASM directly to the C: drive. Otherwise, every time you want to compile something, that's one more thing you will have to type out. Not absolutely necessary, but I would still advise it. The rest of my post will assume you are going to do this. 2. put your Assembly code file in the same exact spot as the DASM program is in. For me, that is C:\dasm\dasm22010\dasm\bin\dos\ 3. go to the command prompt instead of actually trying to double click to open the program. 4. my command prompt opens in the wrong spot. you must change to the correct directory by typing cd\dasm\dasm\22010\dasm\bin\dos\ and hit enter to change to the correct place. 5. this should leave you at C:\DASM\DASM22010\DASM\bin\DOS> 6. at the new prompt, type dasm source.asm -f3 -osource.bin and hit enter. 7. In number six, source.asm is the file you are trying to compile. So if you are trying to compile a file named Pong, you would change it to Pong.asm instead. Also, some people here use .s as the filename instead of .asm. There is no difference between the two, but you must use whichever file extension your code is actually saved as. The -osource.bin part creates a new binary named source.bin which will be saved to the same directory as dasm and your source file. -f3 is a switch you MUST have, but I'm too dumb to tell you what it actually does. I think DASM can generate a complete list of switches for you, but I can't remember how to do it, and it's not really important for getting started. 8. take your newly created binary file and drag it into your emulator to see what it looks like. Keep in mind, if you compile a new code and use -osource.bin, it will save over your old binary file. Two solutions, either rename your old binary to something more appropriate, or give your new binary a different name by typing something like -osource2.bin instead of the exact same command. Hope this helps. -JD PS- typing dasm as the command must give you the switches I talked about. Your post has a list of them and what they do! I know you already understand some of this, but with exact instructions, someone else can be pointed here later too. Quote Link to comment Share on other sites More sharing options...
Ruffsta Posted December 21, 2005 Share Posted December 21, 2005 dasm source.asm -f3 -osource.bin in my case it was: dasm Riveraid.asm -f3 -oRiver.bin ty!!!! well, now i can disassemble and compile! WOOT!!! ok, i guess the next part is to continue with the seessions.. and learn to program what i want to do is make a black screen and have some text... sortal like the games (KANGAROO or CENTIPEDE), tho centipeded seems alot harder to do because of the colors and flashing... so i'll settle for some plain text. Quote Link to comment Share on other sites More sharing options...
MayDay Posted December 21, 2005 Share Posted December 21, 2005 I hate to break this to you, but text is one of the hardest things to do with the 2600. You have to DRAW the text, and not just type it in. The black screen is easy, I'll post a working kernel here for you either tomorrow or Thursday. If you gave it a full steam ahead effort, you can probably create your own before then! Also, a quick note about disassembly. Distella currently supports only 2K and 4K games, and I know offhand Kangaroo is an 8K game. It is possible to disassemble 8K games however, it's just much more difficult because you have to split the binary up, disassemble both halves, and combine the two back together later on. If someone wants to give exact directions for this, it is something I'm very interested in as well! Thanks, JD Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted December 21, 2005 Share Posted December 21, 2005 If someone wants to give exact directions for this, it is something I'm very interested in as well! Search for Distella and my name. 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.