header.inc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ;------------------------------ Header File ---------------------------------
  2. ; This is basically a combo of MarctheMER's and Neviksti's header files
  3. ; Perhaps reading their's will also help your understanding of the header,
  4. ; but I believe this will be the simplest method of defining your header,
  5. ; as Marc's doesn't provide a full explanation, and Neviksti's can be
  6. ; a bit more difficult for beginners (using the WLA directives is easier).
  7. ;----------------------------------------------------------------------------
  8. ;==LoRom== ; We'll get to HiRom some other time.
  9. .MEMORYMAP ; Begin describing the system architecture.
  10. SLOTSIZE $8000 ; The slot is $8000 bytes in size. More details on slots later.
  11. DEFAULTSLOT 0 ; There's only 1 slot in SNES, there are more in other consoles.
  12. SLOT 0 $8000 ; Define's Slot 0's starting address.
  13. .ENDME ; End MemoryMap definition
  14. .ROMBANKSIZE $8000 ; Every ROM bank is 32 KBytes in size
  15. .ROMBANKS 8 ; 2 Mbits - Tell WLA we want to use 8 ROM Banks
  16. .LOROM
  17. .COMPUTESNESCHECKSUM
  18. .SNESHEADER
  19. ID "SNES" ; 1-4 letter string, just leave it as "SNES"
  20. NAME "SNES Tile Demo " ; Program Title - can't be over 21 bytes,
  21. ; "123456789012345678901" ; use spaces for unused bytes of the name.
  22. SLOWROM
  23. LOROM
  24. CARTRIDGETYPE $00 ; $00 = ROM only, see WLA documentation for others
  25. ROMSIZE $07 ; $08 = 2 Mbits, see WLA doc for more..
  26. SRAMSIZE $00 ; No SRAM see WLA doc for more..
  27. COUNTRY $02 ; $01 = U.S. $00 = Japan, that's all I know
  28. LICENSEECODE $00 ; Just use $00
  29. VERSION $00 ; $00 = 1.00, $01 = 1.01, etc.
  30. .ENDSNES
  31. .SNESNATIVEVECTOR ; Define Native Mode interrupt vector table
  32. COP COPHandler
  33. BRK BRKHandler
  34. ABORT ABRTHandler
  35. NMI NMIHandler
  36. IRQ IRQHandler
  37. .ENDNATIVEVECTOR
  38. .SNESEMUVECTOR ; Define Emulation Mode interrupt vector table
  39. COP EmptyHandler
  40. ABORT EmptyHandler
  41. NMI EmptyHandler
  42. RESET Start
  43. IRQBRK EmptyHandler
  44. .ENDEMUVECTOR
  45. .BANK 0 SLOT 0 ; Defines the ROM bank and the slot it is inserted in memory.
  46. .ORG 0 ; .ORG 0 is really $8000, because the slot starts at $8000
  47. .SECTION "EmptyVectors" SEMIFREE
  48. EmptyHandler:
  49. rti
  50. .ENDS
  51. .EMPTYFILL $00