header.a65 1.7 KB

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