Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - breaking in to rom hacking | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
bchoo313

Level: 2

Posts: 1/2
EXP: 22
For next: 24

Since: 08-29-05
From: Space

Since last post: 64 days
Last activity: 59 days
Posted on 08-29-05 09:59 PM Link | Quote
Ok, here goes. I'm 19, and I've only had a computer for about 6-7 years (intermittantly), so I'm not the most computer literate of all programmers. To top this off, I have no formal education in any computer sciences. I know a little VB, i'm starting C++, and Java seems like an inevitble step. Apart from all this object oriented stuff, however, I have a first love that will never die. This love is 16-bit gaming, and with the recent discovery of emulation, this love was given new life. So, now I've got to forget all the object oriented programming and learn assembly languages. This is were my cumulated knowledge falls flat. I don't know anything about assembly languages. I barely know what they are, but apparently they give commands directly to a micro processor.

Anyway, I dowloaded a couple programs hoping that I would be able to just figure it out. This was not the case. I download the following programs as the information I had found said that these would be all I would need to start hacking my own roms, I didn't find much on how to use them though.

disassembler: ASM Dev Kit, tile editor: TLayerPro, hex editors: Transelhextion, xvi32, and a disassembler (6502d) that I couldn't find the link for (nor could i make it work at all, it asks for an input file and a directory for the output file, then creates an unknown file of much larger size).


Ok, first problem. The tile editor, which I had hoped would allow me to change at least the sprites and backgrounds of my favorite SNES games. Instead, I just get a jumbled mess of colors no matter what format i'm in. I understood that the tiles were supposed to resemble the graphics of the games in some way, well, they don't...

Second problem. The disassemblers/hex editors. I don't understand the code at all. The values seem like addresses, and commands, but I don't understand the correlation with commands in the game...make sense? Um, I don't know what the f*** all those letters and numbers mean.

Basically I don't know anything about how these games work, but I really want to (eventually) be able to create my own .smc games that will work in any SNES emulator. I understand that this will probably take alot of time, research, and resource (s/fulness), but it is a hobby I would very much like to pursue (making not only roms, but also more complex games, and executables).

I created this acmlm account just to use the forums, which I found to be very extensive and informative (good job acmlm staff, one thing though: the forum could really use a search option). This said, my profile may not be complete or have the necessary contact information. As such, if you have any information (guides, literature, etc.) that may be of help to me, you can contact me at bchoo313@hotmail.com. I would appreciate it if you used acmlm or rom hacking (or something similar) in the header, otherwise I may not see your email. I will try to contact anyone who sends me an email, with at least a thank you for the information they have contributed. I will be checking this post religiously.

Thank you for your time,
Mike
firemaker

Level: 26

Posts: 234/247
EXP: 94178
For next: 8097

Since: 03-23-04
From: UK berkshire

Since last post: 17 days
Last activity: 11 days
Posted on 08-29-05 10:04 PM Link | Quote
Well first of all hex editing is basically all thhe values of the game. You might want to pick up a corrupter so you can find out whhat data is where. as for changing sprites you might want to find out whether the data is compressed. Most o thhe rom hacking stuff is self-explanatory
Kyoufu Kawa
I'm not bad. I'm just drawn that way.
Level: 70

Posts: 2180/2481
EXP: 3008456
For next: 7355

Since: 03-19-04
From: Catgirl Central

Since last post: 14 hours
Last activity: 13 hours
Posted on 08-29-05 10:06 PM Link | Quote
The jumbled garbage is seen because the graphics editors can't see the difference between code, data and graphics. Scroll down, adjust a little and you'll see the graphics soon enough.
Unfortunately, there's also no way for the editor to know the right colors. There are multiple ways to get the right colors in, though.

To make your own SNES games, coding in Assembler is something of an inevitability. As far as I know, there's no crosscompiler for the SNES' CPU so you can't use C. On the Gameboys, however, it -can- be done.

There is a search function, but it's staff only and hogs servertime.

PS: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 ...
Chickenlump

Level: 41

Posts: 692/722
EXP: 474192
For next: 5953

Since: 03-15-04
From: Columbia City Indiana

Since last post: 3 hours
Last activity: 4 min.
Posted on 08-29-05 10:12 PM Link | Quote
I made a small example waaay back when on getting the colors to look correct while you are editing the graphics.

http://ce.herograw.com/CL/Examples/palette.html

I use Tile Molester in my example, it's one of the best tile editors available (IMO).

http://www.stud.ntnu.no/~kenth/tm/


(edited by Chickenlump on 08-29-05 01:13 PM)
Gideon Zhi

Red Tektite
Level: 13

Posts: 61/79
EXP: 10265
For next: 2

Since: 04-02-05

Since last post: 47 days
Last activity: 2 days
Posted on 08-30-05 01:59 AM Link | Quote
Okay, a few things.

First, since your objective is to create a game and not actually edit one, the "disassemblers" you found will probably be pretty useless. Just like the tile editors, they're dumb programs - they don't know the difference between data (of all kinds) and code, and when they do know what code is, they don't necessarily know the status of the various flags that can be set which influence how many parameter bytes specific commands take.

My recommendation is to actually do a little romhacking - change some text in games, fiddle with text pointers, fiddle with the assembly code surrounding the loading of text and the displaying of such on-screen, and you should be good. Look for Evil Peer's/Geiger's SNES9X debugger; it's a fantastic tool that nobody doing any sort of SNES programming should be without (although I don't use it exclusively, for a number of reasons...)

Other things you'll want...
Here's a link to RSR/The SNES Developers' Lobby. The site's basically dead, it hasn't been updated in years, but you should be able to find a few useful tools, documents, and such there.

You'll want a decent hex editor. Get WindHex32 out of Bongo`'s documents section. It's fantastic.

You'll also want a decent assembler, so you can write your own code and either assemble directly into a ROM or build a new ROM with your code. xkas is fantastic this way. It requires minimal to no setup on the part of the user, and the code you write with it can be as simple or as complicated as you can dream up.

Finally, here's a link to one of my own documents, in which I walk a friend (satsu) through the barebones basics of SNES programming. There's a lot more to it than that, but it should be simple enough for just about anybody to understand, and it ought to serve well as a jump-off point for future learning and work.

Any more questions, feel free to ask!


(edited by Gideon Zhi on 08-29-05 05:01 PM)
Kyoufu Kawa
I'm not bad. I'm just drawn that way.
Level: 70

Posts: 2190/2481
EXP: 3008456
For next: 7355

Since: 03-19-04
From: Catgirl Central

Since last post: 14 hours
Last activity: 13 hours
Posted on 08-30-05 02:19 AM Link | Quote
Originally posted by Gideon Zhi

Here's a link to RSR/The SNES Developers' Lobby. The site's basically dead, it hasn't been updated in years, but you should be able to find a few useful tools, documents, and such there.
I am proud to have beta-tested ALL of their shit!
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 6663/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 08-30-05 02:44 AM Link | Quote
Hex Workshop is another good hex editor if you're willing to fork over some dough. For SNES programming you'll need to check out 65816 assembler. Basically in assembler (ASM) you have a few variables (registers) that aren't stored in memory but in the CPU itself. On SNES these are A, X, and Y (along with some special ones like SP and P). Any time you want to access memory, I/O ports, or pretty much anything else, you use these. To demonstrate, here's a simple piece of code:

LDA $7E0000 ;Load a byte from memory address $7E0000, and put it in A
INC ;Increment (add one to) A. (INX and INY are used for X/Y.)
CMP #$80 ;Compare A with constant 0x80
BEQ reset ;If the result is Equal (A == 0x80), go to 'reset'

end:
STA $7E0000 ;Store A at address $7E0000

reset:
LDA #$04 ;Load constant 4 to A, discarding previous contents
BRA end ;Go (branch) to 'end'
[...]


The same in C would look something like this:
a = mem[0x7E0000];
a++;
if(a == 0x80) a = 4;
mem[0x7E0000] = a;


It does take a little getting used to, but once you know the basics, you can pretty much do anything with it. (Oh, and yes, there are SNES C compilers, but SNES isn't really suited for it. C programs tend to be a bit slower and less efficient than ASM, and while you generally wouldn't even notice on a PC, on a slow system like this it really makes a difference. And FORGET Game Boy... not near enough memory. )
bchoo313

Level: 2

Posts: 2/2
EXP: 22
For next: 24

Since: 08-29-05
From: Space

Since last post: 64 days
Last activity: 59 days
Posted on 08-30-05 05:33 AM Link | Quote
Ok, first off thanks to everyone who's replied so far. Your comments have been keeping me buzy for about two hours now. I think it's gonna take a couple days to go through and practice all this, and of course do a little experimenting of my own, but I'll keep an eye on the forum whatever the case.

Second, I'm looking to dump all the data off a rom (everything. text, graphics, code, everything.) into a text file so I can view it at my discretion, or perhaps a way to view the save states (I'm using the ZSNES emulator) since opening them with notepad only produces a long spaghetti string of incoherent code. The dis/assembler (same thing right?) seems to only have values for things like text.

And last, using TLayerPro, I still only get off color tiles. Sometimes I can see images here and there, but they're never the right color. Ideally when it's in the right mode, all the graphics in the game should show up in the tiles, right? I haven't had a chance to dowload Chickenlumps' Tile Molester, but if this editor alone should fix the problem, then I guess this last part's completely irrelevant.
Dude Man

Koopa
Level: 18

Posts: 89/116
EXP: 29288
For next: 609

Since: 05-02-04
From: Wareham

Since last post: 1 day
Last activity: 7 hours
Posted on 08-30-05 05:49 AM Link | Quote
you know, with all these n00b questions flying around in other threads.. it's nice to see a smart guy starting out. Your new and you know more then me.
Chickenlump

Level: 41

Posts: 693/722
EXP: 474192
For next: 5953

Since: 03-15-04
From: Columbia City Indiana

Since last post: 3 hours
Last activity: 4 min.
Posted on 08-30-05 09:44 AM Link | Quote
Originally posted by bchoo313

And last, using TLayerPro, I still only get off color tiles. Sometimes I can see images here and there, but they're never the right color. Ideally when it's in the right mode, all the graphics in the game should show up in the tiles, right? I haven't had a chance to dowload Chickenlumps' Tile Molester, but if this editor alone should fix the problem, then I guess this last part's completely irrelevant.


Some games, to save space, compress their data and/or graphics and sounds. Think of it like zip files within the ROM. Chrono Trigger, for example, has quite a bit of it's inners compressed to save space. Event code, graphics, strings...
So, if you absolutely cannot find the graphics you want, they may be compressed.
Also, some SNES graphics use other modes to display the graphics, so going through the ROM in Gameboy mode, or NES mode for example, may allow you to see graphics that SNES mode wouldn not allow. Fonts and simple graphics that don't need that many colors applied to them are stored this way to save space as well. Even they are compressed sometimes.

Compression is different from ROM to ROM, so you will either have to reverse engineer the compression yourself, or hope someone else is or already has. FuSoYa has taken apart several compression routines and has written documentation and tools to decompress/recompress the data to and from the ROM. It's a great site to check out, even if you aren't dealing with compression.

http://fusoya.panicus.org/
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 6687/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 08-30-05 01:07 PM Link | Quote
Graphic editors can't tell what the colours should be, because the graphics all used indexed palettes and there's no set way to find the palettes, or even a specific format they need to be in.
Gideon Zhi

Red Tektite
Level: 13

Posts: 62/79
EXP: 10265
For next: 2

Since: 04-02-05

Since last post: 47 days
Last activity: 2 days
Posted on 08-30-05 11:48 PM Link | Quote
For fun, here's some code I wrote that's basically open-source. It's a dual-tile encoding compression routine (DTE for short) and essentially allows for the display of two characters with one byte outside of the normal character set's range. This is incredibly useful; with proper optimization, you can literally fit almost double the amount of text into the same amount of space.

;MEGAMI TENSEI DTE ROUTINE
;For compilation with X816
;Note that the following three lines are NECESSARY because X816 is a compiler for
;the SUPER NES and NOT the normal NES. The following will basically "fool" x816 into
;compiling NES code instead of SNES code.
;NOTE: Manually insert a JSR $RoutineAddress at $AF24. Do not forget to add $10 to this
;address to compensate for the iNES header!

.org $8000
.mem 8
.index 8

DTE_Routine:
LDY $0658 ;This was the first command I overwrote with the jump to the routine.
LDA ($BE),Y ;This is the second.
CMP #$30 ;DTE Range compare 1
BCC End ;If A is < #$30, skip DTE (Branch if carry clear)
CLC ;Clear the carry flag - we get here because
CMP #$80 ;DTE Range Compare 2
BCS End ;If A is >=#$80, skip DTE (Branch if carry set)
;If we get past the upper and lower bound range compares, we have DTE!
RunCheck:
STX $07FE ;Store X temporarily to THE DEPTHS OF UNUSED RAM
SEC
SBC #$30
CLC
LDX $07FF ;Load X with a test byte from THE DEPTHS OF UNUSED RAM
CPX #$9D ;Compare it with test=true (#$9D in this case)
BEQ SecondRun ;If test=true, we're printing the second character
BNE FirstRun ;If test=false, we're printing the FIRST character.


FirstRun: ;For outputting the first character...
LDX #$9D ;Load X with Test=true
DEC $0658 ;Decrement load index (which gets transferred into Y)
ASL A ;Double A to get DTE Pair Number
JMP Base_Routine ;Jump to the shared bits of the routine (4C2780)

SecondRun:
ASL A ;Double A for DTE Pair Number
CLC ;Clear the carry cuz we're gonna add
ADC #$01 ;Increment the accumulator
;A is now the index location of the second byte in the DTE Pair.
LDX #$00 ;Load X with Test=FALSE

Base_Routine:
STX $07FF ;Store test byte to THE DEPTHS OF UNUSED RAM
TAX ;Transer A to X for the DTE table lookup
LDA $DTETable,X ;Load A with where ever your DTE table happens to be,X
LDX $07FE ;Restore X from before routine

End:
JMP $AF29 ;Jump back to the routine


Create_DTE_Table:
.DSW 80 ;Create an 80 ($50) byte empty DTE table to be later filled in
;This gets put -immediately- after the routine.
Imzogelmo

Blue Octorok
Level: 11

Posts: 38/41
EXP: 5292
For next: 693

Since: 09-22-04
From: (Longview) Starkville, MS, USA

Since last post: 15 days
Last activity: 1 day
Posted on 09-01-05 12:01 AM Link | Quote
It's great to see someone who knows he's a n00b yet is smart enough to try doing things himself. My only advice is that there is no standard way that the different ROMs are organized; it's kinda like trying to read a novel in a foreign language when you can't even tell where the breaks are between words, much less the meanings of the words.

Anyway, with the right tools you can chip away at it little by little until you not only know the word breaks, but also the meanings.

Most importantly, have fun!
Chickenlump

Level: 41

Posts: 695/722
EXP: 474192
For next: 5953

Since: 03-15-04
From: Columbia City Indiana

Since last post: 3 hours
Last activity: 4 min.
Posted on 09-01-05 12:34 AM Link | Quote
Also check out the bottom of this forum for links to the MANY backthreads since the board restarted. Page after page of past threads full of information, offsets, tips, advice, etc. You would do well to spend quite a bit of time just reading anything and everything. Don't bump them though (replying to old threads kind of upsets people).

And here is an archive of the ROM hacking board before the board crashed, containing ROM hacking posts and threads from years ago. It's huge, so surfing and reading everything there is highly reccomended, you will find things not available here in the current boards.

http://acmlm.overclocked.org/board/forum.php?id=9
http://acmlm.overclocked.org/board/forum.php?id=8

If you have questions on older threads, instead of bumping, just start a new thread here and quote or link to the thread in question (from pages back here or the older archive). The community here is very diverse, all aspects of rom hacking, and alot of people specializing in them, you are bound to get fairly quick replies and help.


(edited by Chickenlump on 08-31-05 03:36 PM)
Kyoufu Kawa
I'm not bad. I'm just drawn that way.
Level: 70

Posts: 2219/2481
EXP: 3008456
For next: 7355

Since: 03-19-04
From: Catgirl Central

Since last post: 14 hours
Last activity: 13 hours
Posted on 09-01-05 01:23 AM Link | Quote
...And for the love of god, consider the Archives read-only!
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Rom Hacking - breaking in to rom hacking | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.016 seconds.