Jump to content



2

Dasm won't open


46 replies to this topic

#26 vdub_bobby OFFLINE  

vdub_bobby

    Quadrunner

  • 5,831 posts
  • Boom bam.
  • Location:Seattle, WA

Posted Thu Mar 10, 2005 7:24 PM

MayDay said:

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 :D

#27 vdub_bobby OFFLINE  

vdub_bobby

    Quadrunner

  • 5,831 posts
  • Boom bam.
  • Location:Seattle, WA

Posted Thu Mar 10, 2005 7:26 PM

MayDay said:

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!

#28 Nukey Shay ONLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Thu Mar 10, 2005 7:29 PM

The Dig has many commented disassemblies of games (Battlezone is in the "unfinished" zip here).

#29 vdub_bobby OFFLINE  

vdub_bobby

    Quadrunner

  • 5,831 posts
  • Boom bam.
  • Location:Seattle, WA

Posted Thu Mar 10, 2005 7:37 PM

Nukey Shay said:

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.

#30 Nukey Shay ONLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Thu Mar 10, 2005 7:50 PM

vdub_bobby said:

MayDay said:

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...

Quote

; 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" :lol:

;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 ;)

#31 Nukey Shay ONLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Thu Mar 10, 2005 7:51 PM

Oops :P

[quote]TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS +$30[quote]

#32 vdub_bobby OFFLINE  

vdub_bobby

    Quadrunner

  • 5,831 posts
  • Boom bam.
  • Location:Seattle, WA

Posted Thu Mar 10, 2005 8:06 PM

Nukey Shay said:

Oops :P

Quote

TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS +$30
Ah, 30, $30, what's the difference? :D

Anyway, thanks. Maybe I'll have another stab at hacking Pitfall! now...

#33 MayDay OFFLINE  

MayDay

    Chopper Commander

  • 207 posts

Posted Thu Mar 10, 2005 9:36 PM

I always thought Pitfall may make a cool Spiderman hack. :) What was your plan?

#34 Cybergoth ONLINE  

Cybergoth

    Quadrunner

  • 8,207 posts
  • This is Sparta!
  • Location:Bavaria

Posted Fri Mar 11, 2005 1:30 AM

Hi there!

[quote="Nukey Shay"]Oops :P

[quote]TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS +$30[quote][/quote]

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

#35 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!

  • 16,745 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Fri Mar 11, 2005 3:51 AM

Cybergoth said:

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.

Quote

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.

#36 Andrew Davie OFFLINE  

Andrew Davie

    Stargunner

  • 1,314 posts
  • Location:Tasmania

Posted Sat Mar 12, 2005 6:29 AM

Quote

...the problem is in the VCS.H file

Correction in bold below...

Call me untrusting ;)

Goddamit, that's the worst 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

#37 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!

  • 16,745 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Sat Mar 12, 2005 6:44 AM

As usual, pretty direct words from Andrew. But also as usual, pretty right ones!

#38 Nukey Shay ONLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Sat Mar 12, 2005 9:10 AM

Thanks for the correction

* considers posting something REALLY ironic...but decides against it :lolblue:

#39 vdub_bobby OFFLINE  

vdub_bobby

    Quadrunner

  • 5,831 posts
  • Boom bam.
  • Location:Seattle, WA

Posted Mon Mar 14, 2005 6:33 PM

Cybergoth said:

Uhm... you're supposed to do that outside vcs.h, just say
TIA_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?

#40 Tom OFFLINE  

Tom

    Moonsweeper

  • 449 posts
  • Location:Switzerland

Posted Tue Mar 15, 2005 3:28 AM

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



#41 Tom OFFLINE  

Tom

    Moonsweeper

  • 449 posts
  • Location:Switzerland

Posted Tue Mar 15, 2005 3:31 AM

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 :)

#42 Nukey Shay ONLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Mon Apr 25, 2005 11:03 PM

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.

#43 Ruffsta OFFLINE  

Ruffsta

    Star Raider

  • 78 posts

Posted Tue Dec 20, 2005 11:15 AM

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:

Quote

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 by Ruffsta, Tue Dec 20, 2005 11:21 AM.


#44 MayDay OFFLINE  

MayDay

    Chopper Commander

  • 207 posts

Posted Tue Dec 20, 2005 6:27 PM

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! :P I know you already understand some of this, but with exact instructions, someone else can be pointed here later too.

#45 Ruffsta OFFLINE  

Ruffsta

    Star Raider

  • 78 posts

Posted Tue Dec 20, 2005 10:11 PM

Quote

dasm source.asm -f3 -osource.bin

in my case it was:

Quote

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.

#46 MayDay OFFLINE  

MayDay

    Chopper Commander

  • 207 posts

Posted Wed Dec 21, 2005 2:20 AM

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! :cool:

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

#47 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!

  • 16,745 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Wed Dec 21, 2005 2:50 AM

MayDay, on Wed Dec 21, 2005 9:20 AM, said:

If someone wants to give exact directions for this, it is something I'm very interested in as well!
:idea: Search for Distella and my name. :)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users