header.a65 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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
  7. clc
  8. xce
  9. rep #$20 : .al
  10. lda #$1fff
  11. tcs
  12. jmp @GAME_MAIN
  13. NMI_16bit:
  14. php
  15. rep #$30 : .al : .xl
  16. pha: phx: phy: phd: phb
  17. jsl @NMI_ROUTINE
  18. rep #$30 : .al : .xl
  19. int_exit:
  20. plb: pld: ply: plx: pla
  21. plp
  22. rti
  23. IRQ_16bit:
  24. php
  25. rep #$30 : .al : .xl
  26. pha: phx: phy: phd: phb
  27. jsl @IRQ_ROUTINE
  28. rep #$30 : .al : .xl
  29. bra int_exit
  30. ;error vectors
  31. ABT_8bit: ABT_16bit:
  32. BRK_8bit: BRK_16bit:
  33. COP_8bit: COP_16bit:
  34. IRQ_8bit:
  35. NMI_8bit:
  36. - wai: lda $ABCDEF : bra -
  37. *= $C0FFB0
  38. ; Zero the area from $FFB0 - $FFFF
  39. ; to ensure that the linker won't get clever
  40. ; and fill it with small pieces of code.
  41. .word 0,0,0,0, 0,0,0,0
  42. .word 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0
  43. .word 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0
  44. *= $C0FFB0
  45. .byt "MR" ;2 bytes - company id
  46. .byt "SNSD" ;4 bytes - rom id
  47. *= $C0FFC0
  48. .byt "SD2SNES MAIN MENU "
  49. ;123456789012345678901; - max 21 chars
  50. *= $C0FFD5 .byt $31 ;rom speed
  51. *= $C0FFD6 .byt $02 ;rom type
  52. *= $C0FFD7 .byt $06 ;rom size 64 kByte
  53. *= $C0FFD8 .byt $03 ;sram size 8 kBit
  54. *= $C0FFD9 .byt $09 ;rom region 4 = Finland
  55. *= $C0FFDA .byt $33 ;company id flag
  56. *= $C0FFDC .word 0,0 ;checksums
  57. *= $C0FFE4 .word COP_16bit
  58. *= $C0FFE6 .word BRK_16bit
  59. *= $C0FFE8 .word ABT_16bit
  60. *= $C0FFEA .word NMI_16bit
  61. *= $C0FFEE .word IRQ_16bit
  62. *= $C0FFF4 .word COP_8bit
  63. *= $C0FFF8 .word ABT_8bit
  64. *= $C0FFFA .word NMI_8bit
  65. *= $C0FFFC .word RESET
  66. *= $C0FFFE .word BRK_8bit
  67. *= $C0FFFE .word IRQ_8bit