I'm assuming you have a hex editor, ninetendo. If not... I recommend you get one. There are many free ones available. I don't really have a specific one to recommend since I use VS's built in hex editor -- but many people use Hexecute, XVI32, or Transhexlation.
Anyway.... hopefully to finally solve all your .db vs .incbin concerns:
What is .db
.db stores a single byte (or a series of bytes) as given into the assembled binary. If you give a line like so:
Code:
.db $00, $01, $02, $03, $05
After assembling, if you open up your ROM in a hex editor and look at the assembled code, you will see a "00 01 02 03 05" in it. Of course this is only really useful when you identify blocks of data with labels:
Code:
palette:
.db $0F, $00, $10, $30
some_other_code:
LDA palette ; this will put '$0F' into A
LDA palette+1 ; this will put '$00' into A
LDA palette+2 ; $10
LDA palette+3 ; $30
.db is useful for
small lookup tables which can be summed up in maybe a line or two. For larger things (like map data, a large series of palettes, graphics, that kind of thing), using .db would require you to have PAGES AND PAGES of hard-to-edit code which makes it not preferable to use in those situations.
For that larger stuff -- that's where you'd want .incbin:
What is .incbinBelieve it or not... .incbin is
exactly the same as .db. The only difference is, instead of taking the bytes from the source file, it takes them from an external file
To use the above example with .incbin...
First you'd need a file that is exactly 4 bytes in size, and contains the bytes:
Code:
0F 00 10 30
We'll call this file "palette.bin". Note that the ".bin" extention does not matter -- it's just part of the filename. You could call it "superfantastic.fun"... it doesn't change the contents or how the file will be interpreted.
With that file... we could use .incbin in the following manner:
Code:
palette:
.incbin "palette.bin"
some_other_code:
LDA palette ; $0F
LDA palette+1 ; $00
LDA palette+2 ; $10
LDA palette+3 ; $30
See? The two are exactly the same. Using .incbin does the same job of converting everything to .db and copy/pasting into your source -- only it's FAR less work and keeps your files seperate, easier to edit, and more organized.
If .db is working and .incbin is not. Make sure the file you're .incbin'ing contains the proper values (of course for this, you'll want a hex editor to view/edit the binary files -- a text editor WILL NOT WORK -- don't use notepad or something on a binary file). Also, make sure you're not misspelling the name of the file you're .incbin'ing.