Confused, faulty header?

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
DoNotWant
Posts: 83
Joined: Sun Sep 30, 2012 3:44 am

Confused, faulty header?

Post by DoNotWant »

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!
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Confused, faulty header?

Post by tepples »

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.
DoNotWant
Posts: 83
Joined: Sun Sep 30, 2012 3:44 am

Re: Confused, faulty header?

Post by DoNotWant »

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!
Post Reply