header.a65 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. rep #$30
  24. bra int_exit
  25. ;error vectors
  26. ABT_8bit: ABT_16bit:
  27. BRK_8bit: BRK_16bit:
  28. COP_8bit: COP_16bit:
  29. IRQ_8bit:
  30. NMI_8bit:
  31. - wai: lda $ABCDEF : bra -
  32. *= $C0FFB0
  33. ; Zero the area from $FFB0 - $FFFF
  34. ; to ensure that the linker won't get clever
  35. ; and fill it with small pieces of code.
  36. .word 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. .word 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0
  39. *= $C0FFB0
  40. .byt "MR" ;2 bytes - company id
  41. .byt "SNSD" ;4 bytes - rom id
  42. *= $C0FFC0
  43. .byt "SD2SNES MAIN MENU "
  44. ;123456789012345678901; - max 21 chars
  45. *= $C0FFD5 .byt $31 ;rom speed
  46. *= $C0FFD6 .byt $02 ;rom type
  47. *= $C0FFD7 .byt $06 ;rom size 64 kByte
  48. *= $C0FFD8 .byt $03 ;sram size 8 kBit
  49. *= $C0FFD9 .byt $09 ;rom region 4 = Finland
  50. *= $C0FFDA .byt $33 ;company id flag
  51. *= $C0FFDC .word 0,0 ;checksums
  52. *= $C0FFE4 .word COP_16bit
  53. *= $C0FFE6 .word BRK_16bit
  54. *= $C0FFE8 .word ABT_16bit
  55. *= $C0FFEA .word NMI_16bit
  56. *= $C0FFEE .word IRQ_16bit
  57. *= $C0FFF4 .word COP_8bit
  58. *= $C0FFF8 .word ABT_8bit
  59. *= $C0FFFA .word NMI_8bit
  60. *= $C0FFFC .word RESET
  61. *= $C0FFFE .word BRK_8bit
  62. *= $C0FFFE .word IRQ_8bit