+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  New to rom hacking. A few questions.
Pages: [1]
Author Topic: New to rom hacking. A few questions.  (Read 566 times)
renton_academy
Guest
« on: December 07, 2007, 07:14:48 pm »

Hi! I have just taken an interest to rom hacking and i'm excited to see the kinds of things I can create. I have a strong programming and computer science background so I think i should be able to pick up on it pretty quick. What I wanted to know were the limits in possibilities of rom hacking. I see alot of people alter graphics and levels. With enough skill and knowledge would it be possible to change any element in a rom? Can you gain access to the actual source code of the game, or is it just executable files impossible to reverse engineer? Would it be possible to use the game engine from say super mario 3, and run a server to have multiple players enter a level? I realize that even if this was possible, it would require a tremendous amount of time and work... but i'm just trying to learn the basics and scope of rom hacking.
Disch
Guest
« Reply #1 on: December 07, 2007, 07:34:26 pm »

Quote from: renton_academy on December 07, 2007, 07:14:48 pm
I have a strong programming and computer science background so I think i should be able to pick up on it pretty quick.

If you have programming experience you already have an advantage over many other people who have come in the game.  Understanding how programs are arranged not only gives you an idea of how much work would go into hacking the game a specific way, but also may give you ideas on how information might be stored in the ROM.


Quote
What I wanted to know were the limits in possibilities of rom hacking. I see alot of people alter graphics and levels. With enough skill and knowledge would it be possible to change any element in a rom?

Anything the target system can do, you can have your hack do.  Nothing is so much "impossible" unless the original system couldn't do it.  Some things may take a ridiculous amount of work, though, making them impractical.

Quote
Can you gain access to the actual source code of the game, or is it just executable files impossible to reverse engineer?

You can get a disassembly, which isn't quite the same as the source (the source would have comments, variable names, etc -- whereas the disassembly would just have raw addresses and no comments)

But yes -- you can edit that assembly to add in your own code to make the game do pretty much whatever you want.

Quote
Would it be possible to use the game engine from say super mario 3, and run a server to have multiple players enter a level?

Not through ROM hacking.

Keep in mind that emulation mimics a target system (in this case, the NES).  So having a game connect to a server isn't going to happen because the NES didn't allow games to connect to the internet.

But can you put in 2P coop?  Sure.  Though both players have to share the same screen, so this is probably one of those impractical ideas.



I'm at a loss to recommend introductory tutorials and stuff.  It's been such a long time since I've been a newb that I don't really know what is useful to newcomers anymore.  If you have experience with a programming language already, you may want to just dive right into assembly (compared to something like C/C++, 6502 assembly is incredibly simple).  Perhaps pick up Doppleganger's SMB disassembly as an example of how games are arranged and some 6502 docs


 :thumbsup:
renton_academy
Guest
« Reply #2 on: December 07, 2007, 07:37:53 pm »

thanks! your comment set me off in the right direction. i hope i can use this as an excuse to apply my programming knowledge and make some contributions around here.

btw whats the 6502 architecture like?? i know some basic x86 but that's about it

edit: or else i guess i could just not be lazy and start reading... haha i think i may have procrastinated too much already tonight, i have an exam tomorrow Tongue
« Last Edit: December 07, 2007, 07:44:38 pm by renton_academy »
Disch
Guest
« Reply #3 on: December 07, 2007, 07:46:57 pm »

Quote
btw whats the assembly architecture like??

It differs.  x86 from what I understand is closer to z80 (like what the GB uses).

The NES uses 6502 which is a bit different.  6502 only has 3 work registers, so you end up using RAM for work space more often than you might have to on other platforms.

Some simple simple 6502 and the equivilent C/C++:

C/C++:
Code:
memory[ 0x0080 ] += 0x23;

equivilent 6502 (commented):
Code:
LDA $80    ; read from address $0080, put value in A
CLC        ; clear carry (so additional 1 is not added in following instruction)
ADC #$23   ; add immidiate value of $23 to A
           ; (# symbol indicates to use value of $23, not address $23)
STA $80    ; store result back at address $0080
tomaitheous
Guest
« Reply #4 on: December 08, 2007, 01:35:26 am »

Quote from: renton_academy on December 07, 2007, 07:37:53 pm
thanks! your comment set me off in the right direction. i hope i can use this as an excuse to apply my programming knowledge and make some contributions around here.

btw whats the 6502 architecture like?? i know some basic x86 but that's about it

edit: or else i guess i could just not be lazy and start reading... haha i think i may have procrastinated too much already tonight, i have an exam tomorrow Tongue

 If you've done even a little x86 ASM and understand the basics, you shouldn't have any problem jumping into the 65xx series. The assembler syntax is different (MOV reg,immd  VS  LDA #immd), but the fundamentals are pretty much the same. The 65xx has 1 accumulator register, 2 index registers, and 256 indirect/general registers (though they are located in RAM as part of the original cost saving features). I love the 65xx architecture: small but efficient instruction set with some fast execution times.

 There's sooo much info on the 65xx series out there and you can also look up the forums at http://forum.6502.org/index.php .
Spikeman
Guest
« Reply #5 on: December 08, 2007, 05:42:53 am »

Quote from: renton_academy on December 07, 2007, 07:14:48 pm
Would it be possible to use the game engine from say super mario 3, and run a server to have multiple players enter a level?

Actually I can think of how this could be possible two ways:

1) Like Disch said, make a multiplayer hack and play it over netplay (though this would be a small number of players).

2) With a heavily modified game and a customized emulator and a server you could pull it off. Have the emulator get a certain memory bank or something and share that between a server.
Disch
Guest
« Reply #6 on: December 08, 2007, 11:07:57 am »

Quote from: Spikeman on December 08, 2007, 05:42:53 am
and a customized emulator

arguably -- this is no longer emulation.
doppelganger
Guest
« Reply #7 on: December 12, 2007, 05:39:52 am »

Quote from: Disch on December 07, 2007, 07:34:26 pm
Perhaps pick up Doppleganger's SMB disassembly as an example of how games are arranged and some 6502 docs


 :thumbsup:

Umm, I *really* wouldn't recommend my SMB disassembly to beginners of either coding or hacking.  ;-D
RyanfromScotland
Guest
« Reply #8 on: December 15, 2007, 04:42:29 pm »

Quote from: Disch
But can you put in 2P coop?  Sure.  Though both players have to share the same screen, so this is probably one of those impractical ideas.

Unless of course you can perhaps copy Toejam and Earl for the Megadrive's 2 player mode but I'd imagine this still falls into impractical.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC