header.a65 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ; This file is a modified version of the header.a65 file from:
  2. ; snescom-asm demo - a demo of how to build a SNES program.
  3. ; See http://bisqwit.iki.fi/source/snescom.html for details.
  4. ; fill whole area beforehand so the linker does not create multiple
  5. ; objects from it. (necessary for map creation)
  6. *= $C0FF00
  7. .word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  8. .word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  9. .word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  10. .word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  11. ; Begin assembling to this address.
  12. *= $C0FF00
  13. RESET:
  14. sei
  15. clc
  16. xce
  17. rep #$20 : .al
  18. lda #$1fff
  19. tcs
  20. jmp @GAME_MAIN
  21. NMI_16bit:
  22. php
  23. rep #$30 : .al : .xl
  24. pha: phx: phy: phd: phb
  25. jsl @NMI_ROUTINE
  26. rep #$30 : .al : .xl
  27. int_exit:
  28. plb: pld: ply: plx: pla
  29. plp
  30. rti
  31. IRQ_16bit:
  32. php
  33. rep #$30 : .al : .xl
  34. pha: phx: phy: phd: phb
  35. jsl @IRQ_ROUTINE
  36. rep #$30 : .al : .xl
  37. bra int_exit
  38. ;error vectors
  39. ABT_8bit: ABT_16bit:
  40. BRK_8bit: BRK_16bit:
  41. COP_8bit: COP_16bit:
  42. IRQ_8bit:
  43. NMI_8bit:
  44. - wai: lda $ABCDEF : bra -
  45. *= $C0FFB0
  46. ; Zero the area from $FFB0 - $FFFF
  47. ; to ensure that the linker won't get clever
  48. ; and fill it with small pieces of code.
  49. .word 0,0,0,0, 0,0,0,0
  50. .word 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0
  51. .word 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0
  52. *= $C0FFB0
  53. .byt "MR" ;2 bytes - company id
  54. .byt "SNSD" ;4 bytes - rom id
  55. *= $C0FFC0
  56. .byt "SD2SNES MAIN MENU "
  57. ;123456789012345678901; - max 21 chars
  58. *= $C0FFD5 .byt $31 ;rom speed
  59. *= $C0FFD6 .byt $02 ;rom type
  60. *= $C0FFD7 .byt $06 ;rom size 64 kByte
  61. *= $C0FFD8 .byt $03 ;sram size 8 kBit
  62. *= $C0FFD9 .byt $09 ;rom region 4 = Finland
  63. *= $C0FFDA .byt $33 ;company id flag
  64. *= $C0FFDC .word 0,0 ;checksums
  65. *= $C0FFE4 .word COP_16bit
  66. *= $C0FFE6 .word BRK_16bit
  67. *= $C0FFE8 .word ABT_16bit
  68. *= $C0FFEA .word NMI_16bit
  69. *= $C0FFEE .word IRQ_16bit
  70. *= $C0FFF4 .word COP_8bit
  71. *= $C0FFF8 .word ABT_8bit
  72. *= $C0FFFA .word NMI_8bit
  73. *= $C0FFFC .word RESET
  74. *= $C0FFFE .word BRK_8bit
  75. *= $C0FFFE .word IRQ_8bit