Originally posted by: think1st
I found the answer. Seems the INES file format only contains ROM data, so the answer to my first question would be a simple NO. And after some experimentation with some other assemblers I figured that out, too. The assemblers don't care what goes to the PPU and what not, they just output the raw data as you define it using .org statements. Then, when the assembled .nes file is 16 bytes (header) + 16kb (1x prg rom) + 8kb (1x chr rom), the emulator is actually responsible for realizing that the first 16kb after header is for prg rom and the 8kb after is for chr rom.
I know you found the answers, but I just wanted to assure you.
No, .db cannot be used in RAM. You can only use .db to build tables in ROM.
The address you associate with the .org directive is relative to the bank you are in. That's how bank switching works. Small example from my code. Whatever bankSource I am current using, the CPU will use the proper code from that address. This is all PRG Data as I program in UNROM, so I don't use CHRROM. I have 15 banks that look like this below that can swap out $8000-$BFFF and 1 fixed bank that never swaps out in addresses $C000-$FFFF. Essentially, the concept is the same with CHR Data as well, that's why the Mario.chr is in $0000 at that the start of CHRROM. This confused me for the longest time as well. Just remember, you have PRGROM and CHRROM in NROM, so you have 2 sets of addresses to deal with.
;----------------------------------------------------------
;-----------------------BANKS------------------------------
;----------------------------------------------------------
;;;;;;;;;;;;;;;;;bankSource=00;;;;;;;;;;;;;;;;;;;;
.bank 0
.org $8000
.include "maincode2.asm"
.bank 1
.org $A000
.include "maincode3.asm"
;;;;;;;;;;;;;;;;;bankSource=01;;;;;;;;;;;;;;;;;;;;
.bank 2
.org $8000
.include "SpriteData.asm"
.bank 3
.org $A000
;;;;;;;;;;;;;;;;;bankSource=02;;;;;;;;;;;;;;;;;;;;
.bank 4
.org $8000
TitleGraphics:
.incbin "CHRfiles\titlesprites.chr"
.incbin "CHRfiles\titlegraphics.chr"
.bank 5
.org $A000
RoomGraphics:
.incbin "CHRfiles\MainCharacterSprites.chr"
.incbin "CHRfiles\RoomGraphics.chr"