Jump to content



0

Have some simple questions for you 6502 gurus!


6 replies to this topic

#1 4ever2600 OFFLINE  

4ever2600

    Moonsweeper

  • 455 posts

Posted Mon Dec 8, 2003 12:26 AM

(At least I think they are simple)...

Hello! My name is Daryl, I am beginning to change graphics around on 2600 games, hopefully, someday I will create my own game for all you to enjoy! Anyways, I sucessfully changed Space Invaders, sound, graphics etc with alot of documentation I found on the internet, now I am on to messing around with Adventure... I don't know 6502 programming, and to be honest, I don't have the time to teach myself it or have the money to put myself through college for it either, boo hoo hoo. Anyways, I was hoping some of the people out there that are writing and publishing their own games now could help me with a few simple (I think) requests... I found 2 different documents on adventure (and the explanation of every line of code) and although the document makes sense, I don't know how to apply that info. to the rom that I disassembled with distella. When I have a line of code that looks like this:

FF44 D9,00,01,FC,02,FC,28,0C,07 00 ;#0 Invisible
FF4D F8,FB,C8,00,F1,FA,00,00,00 09 ;#1 Portcullis #1 Black

And then I look at the code I have which looks like this:
0fdd |X XX XX|
0fde | |
0fdf | XXX |
0fe0 |XXXXXXX|

I don't understand how that correlates, according to the document, "Changing 2600 graphics the easy way" They mention creating a cfg file and putting the line "GFX FBFE FD66 AND GFX FF4C FFFF" and then saving it... I understood how to do this in Space Invaders because he gave you the addresses, but in adventure, the .byte is EVERYWHERE! I don't know how to get what I need out of this one...

CAN ANYBODY OUT THERE HELP ME!?!?!

I'm hoping to email some of the people who really know there stuff and are a little patient... Though I am not expecting them to teach me 6502, any help they can give would be greatly appreciated...

One of the things basically I want to do is change the colors of the dragon's, keys, etc around to what I want... Where in the code should I be looking for this? Thanks in advance! - Daryl

#2 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

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

Posted Mon Dec 8, 2003 3:07 AM

Graphic images are by far the easiest things to hack (as far as how the images look)...since usually they are just mapped out in memory. So you can use the 2600GFX or HackOmatic graphic tools to edit them. Changing colors is a bit more involved, since the bytes that specify the colors can be located ANYWHERE in the rom code (so you need to disassemble the game a bit to locate the instructions that save registers to the hardware color register addresses and reverse-engineer from there). With Adventure, all of this hard work is done for you...since there are two HEAVILY commented source codes posted at The Dig. In addition, there is a optimised Adventure source code right here that trims out much of the redundancy in the cart (the upshot is that you are left with the same game that has a lot of space left over to add in routines of your own). In all of these source codes, the bytes that control room and object colors are clearly noted. So you can just change them to your own .byte value and compile it using Dasm. If you are only interested in colors...you can see a chart here that shows all of the byte locations in the NORMAL (not optimised) version of the game.

EDIT: The Dig appears to be down at the moment...anybody know why?

#3 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

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

Posted Mon Dec 8, 2003 3:54 AM

Oh, and there appears to be a bit of confusion over how the "simple" graphic hack tools display the program information. In a commented source code (like the one you read)...you'll see a line that looks like this:

LFF44 D9,00,01,FC,02,FC,28,0C,07 00 ;#0 Invisible

...as you said. What does that mean? Well, source codes work by attaching LABELS to areas of the program. See that LFF44? That is where the following byte values will appear in the compiled binary code (the executable game that the source code creates). These labels are computed by the assembler and placed in memory where the routines that call them can find them again. So what address do those bytes go to? Thankfully, source codes like this one (which have been reverse-engineered by using Distella) retain the address AS part of the label. As long as you haven't added anything on your own, the label will still point to the original address where Distella found it. In this case, label LFF44 is the same as saying address $FF44. So look in your listing that you created with 2600GFX, and scroll down to the same address to find those values...which have been transformed into BIT patterns. This is where it gets a bit goofy...since the Atari 2600 DOES NOT USE the first character of the address - the 2600 can only "see" 12 bits that make up an address (as opposed to the full 16). So when you see address $FF44 in a source code, it's most likely pointing at line 0F44 in your 2600GFX listing. Scroll down to it, and you should see this:

0f44 |XX XX  X|

0f45 |        |

0f46 |       X|

0f47 |XXXXXX  |

0f48 |      X |

0f49 |XXXXXX  |

0f4a |  X X   |

0f4b |    XX  |

0f4c |     XXX|

0f4d |        |

Notice that the value D9 in the source code has been translated to the bit pattern XX XX X. That is how the 2600GFX program works, it translates the entire cart into patterns of X's (1's) and spaces (0's). So which of these bytes is the color of the object (the invisible surround in this case)? Look at the source code...it shows which one it is in the comments directly above this group of bytes. By re-arranging X's and spaces in the 2600GFX listing at the proper location, you can change the color of the object. Note: that is why hacking the disassembly or source code of a game is often easier than trying to use 2600GFX...since you won't have to mess with translating values to bits.

#4 4ever2600 OFFLINE  

4ever2600

    Moonsweeper

  • 455 posts

Posted Mon Dec 8, 2003 8:20 PM

I just wanted to Thank you for ALL of your help! I already understood half of what you had explained, but it took the other half of the explanation for me to get the whole picture! The circle is finally complete! Again 1000 Thanks! - Daryl

#5 4ever2600 OFFLINE  

4ever2600

    Moonsweeper

  • 455 posts

Posted Mon Dec 8, 2003 8:24 PM

'The Dig' wouldn't let me in, it said forbidden access... Do I have to join up with them or something? Thanks again! - D

#6 Robert M OFFLINE  

Robert M

    Stargunner

  • 1,481 posts
  • Rootbeer!
  • Location:Western NY state

Posted Mon Dec 8, 2003 10:00 PM

The Dig is down temporarily while it is being moved to another server and getting revamped.

Cheers!

#7 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

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

Posted Mon Dec 8, 2003 10:13 PM

Not a big problem in this case...since the source code for the optimized version of Adventure is commented in far greater detail...offering lengthy explainations to what the current instructions are doing (and how this can be streamlined and accomplish the same thing). To edit the source code, load it into Wordpad or another text editor and remove all text formatting when saving it. Then use Dasm to compile a new .bin for you. Be sure to fix the red dragon routine (described a few posts down) so that the game won't get bunged up when you enable the optimized code (make ORIGINAL=0 near the top).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users