Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.
Is this correct? then I also have one more question
I have used tokumaru's ASM6 NROM template from this thread. My question is where in this code can I put the nametable, attributetable and palettes? is it normal to put them right before NMI label?
GFX_FONT:
.incbin "Font.CHR"
LDA #>GFX_FONT ; Load High Byte of Font Address
LDA #<GFX_FONT ; Load Low Byte of Font Address
You can include data whereever you want in your ROM. If you have 32K or less of PRG, it doesn't matter at all where you put things. But when you start using memory mapper hardware you'll want to put critical code and data in the Fixed/Permanent program bank and data and code only accessed at certain times into the swappable banks.[/code]
picccca wrote:My question is where in this code can I put the nametable, attributetable and palettes? is it normal to put them right before NMI label?
You can put it anywhere where it won't be accidentally interpreted as code (yeah, I've seen people including data right in the middle of a block of instructions).
Personally, I like to place the data before the code, from the beginning of the ROM up. I guess I do this because it's easier to page-align data that shouldn't cross pages.
If I put the data after the code it would be pushed up in the ROM as the code grew... I guess I just like to have more control over what data goes where, which is easier to do if I place it at the beginning.
Ok, thanks for the help. It's difficult somethimes
I also found another line that was wrong in my code. It is easy to mix up when following NESASM examples and using ASM6 assembler. But you learn all the time.