Advertisement
wolfboyft

events.asm snippet

Jan 13th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. .doTheThings
  2. push af
  3. ld a, [MenuSelection2]
  4. cp 0
  5. jr z, .OK0
  6. cp 1
  7. jr z, .OK1
  8. cp 2
  9. jr z, .OK2
  10. cp 3
  11. jr z, .OK3
  12. cp 4
  13. jr z, .OK4
  14. ret ; how the hell is the program counter supposed to get HERE? regardless, i'll put a ret in to stop any funny ideas.
  15.  
  16. .OK0
  17. ld hl, Examine
  18. ld a, BANK(Examine)
  19. call CallScript
  20. jp .stopDoingTheThings
  21. .OK1
  22. ld hl, Talk
  23. ld a, BANK(Talk)
  24. call CallScript
  25. jp .stopDoingTheThings
  26. .OK2
  27. ld hl, Take
  28. ld a, BANK(Take)
  29. call CallScript
  30. jp .stopDoingTheThings
  31. .OK3
  32. ld hl, Attack
  33. ld a, BANK(Attack)
  34. call CallScript
  35. jp .stopDoingTheThings
  36. .OK4
  37. ld hl, Use
  38. ld a, BANK(Use)
  39. call CallScript
  40. jp .stopDoingTheThings
  41.  
  42. .script ; 96a04
  43. call LoadFont
  44. ld hl, .DoWhat
  45. call PrintText
  46. ld hl, .MenuDataHeader_Actions
  47. call LoadMenuDataHeader
  48. call InterpretMenu2
  49. call LoadMoveSprites
  50. push af
  51. ret c
  52. pop af
  53. jp .doTheThings
  54. .stopDoingTheThings
  55. ld hl, testScript
  56. call CallScript
  57. ld hl, MAPOBJECT_SCRIPT_POINTER
  58. add hl, bc
  59. ld a, [hli]
  60. ld h, [hl]
  61. ld l, a
  62. call GetMapScriptHeaderBank
  63. jp CallScript
  64. ; 96a12
  65.  
  66. .DoWhat
  67. text "Do what?"
  68. prompt
  69.  
  70. .MenuDataHeader_Actions: ; 0x15f88
  71. db $40 ; flags
  72. db 00, 00 ; start coords
  73. db 12, 08 ; end coords
  74. dw .menudata2
  75. db 1 ; default option
  76. ; 0x15f90
  77.  
  78. .menudata2: ; 0x15f90
  79. db $80 ; strings
  80. db 5 ; items
  81. db "Look@"
  82. db "Talk@"
  83. db "Take@"
  84. db "Attack@"
  85. db "Use@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement