I'm wondering how the SNES finds the reset vector in my ROM file. I understand that the 65816 processor looks at the last 16 bytes for the reset, NMI, IRQ, etc. addresses(both for emulation and native mode).
I have written a little program, that will load some sprite data into VRAM, set some registers, and display a sprite. This is working fine. But here is what I don't understand: I made my ROM 32 kilobytes in size, the idea being that I (for now) have only one bank to deal with(so my ROM's $0000 - $7FFF are mapped to $00:$8000-$00:$FFFF). Now, I wrote the address of my reset routine ($21b5 + $8000) to the emulation mode reset vector at $7FFC and $7FFD of my ROM.
Now, when I load my ROM into a emulator and look into the memory debugger, I see that my reset vector is (mirrored?) at $FF:$FFFC and $FF:$FFFD. This is confusing me, how does the SNES know how to map/mirror $00:$7FFC to $FF:$FFFC? Again, the ROM is running fine and showing all the sprites I draw exactly the way I want them to show.
Thing is, I was planing to burn this ROM on a EPROM and try run it on a console, since I did that on a NES in the past for fun. If I've understood the SNES specs correctly, the smallest possible EROM size is 1 Mbit, so I'd have to mirror my ROM four times to fit into a 1Mbit EROM nicely. Yet how does the SNES find my reset vector?
EDIT: I assume it has something to do with the Map Mode($FFD5) set in the header, yet it eludes me.
I have written a little program, that will load some sprite data into VRAM, set some registers, and display a sprite. This is working fine. But here is what I don't understand: I made my ROM 32 kilobytes in size, the idea being that I (for now) have only one bank to deal with(so my ROM's $0000 - $7FFF are mapped to $00:$8000-$00:$FFFF). Now, I wrote the address of my reset routine ($21b5 + $8000) to the emulation mode reset vector at $7FFC and $7FFD of my ROM.
Now, when I load my ROM into a emulator and look into the memory debugger, I see that my reset vector is (mirrored?) at $FF:$FFFC and $FF:$FFFD. This is confusing me, how does the SNES know how to map/mirror $00:$7FFC to $FF:$FFFC? Again, the ROM is running fine and showing all the sprites I draw exactly the way I want them to show.
Thing is, I was planing to burn this ROM on a EPROM and try run it on a console, since I did that on a NES in the past for fun. If I've understood the SNES specs correctly, the smallest possible EROM size is 1 Mbit, so I'd have to mirror my ROM four times to fit into a 1Mbit EROM nicely. Yet how does the SNES find my reset vector?
EDIT: I assume it has something to do with the Map Mode($FFD5) set in the header, yet it eludes me.