Confused, faulty header?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Confused, faulty header?
by on (#100542)
Hello!
I'm trying to get into SNES programming, and the first thing I try to grasp is the header.
I have been looking at Neviksti's Hello.inc included in the SNES-starterkit, and to be honest,
I'm confused by everything, but what really puts me off is the interrupt vector tables.
"Programming the 65816, including the 6502..." states that the native interrupts should be placed
at memory locations $FFE4 - $FFEB and $FFEE - $FFEF, and the emulation mode interrupts should be
located at $FFF4 - $FFF5 and $FFF9 - $FFFF, but in Neviksti's header they are placed starting from $7FE4 and $7FF4.
Have I completely missed something here?

Also, how can the "EmptyVectors" section be placed at location $0000, when the examples that use the header
also put the "MainCode" section in the same location and bank?

Thanks!
Re: Confused, faulty header?
by on (#100543)
What you've missed is that many Super NES games are wired in mode $20 (sometimes called LoROM) for slightly faster access to PPU and APU ports. That mode puts PRG ROM at $008000-$00FFFF, skips 32 KiB, puts PRG ROM at $018000-$01FFFF, skips 32 KiB, etc.
Re: Confused, faulty header?
by on (#100544)
Oh, so Neviksti's header are set to LoROM then? So HiROM would use the normal adresses?
And what about the code placed in the same bank at the same memory location, like the init routine and
the main code?

Thanks!