tokenhook.z80 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. TokenHook:
  2. .db $83
  3. inc b
  4. dec b
  5. ret nz
  6. push hl
  7. ld hl,(iMathPtr1)
  8. inc hl
  9. inc hl
  10. ld a,3Ah
  11. cp (hl)
  12. jr nz,tokenhook_pop1exit
  13. inc hl
  14. ld a,30h
  15. cp (hl)
  16. jr nz,tokenhook_pop1exit
  17. inc hl
  18. ld a,3Eh
  19. cp (hl)
  20. jr nz,tokenhook_pop1exit
  21. ld b,0
  22. dec d
  23. inc d
  24. ld hl,TokenTable_0
  25. jr z,TokenSearchLoop
  26. ld hl,TokenTable_1
  27. TokenSearchLoop:
  28. ld a,e
  29. cp (hl)
  30. inc hl
  31. jr z,ChkByte2
  32. NotTokenMatch:
  33. inc hl
  34. ld c,(hl)
  35. inc c
  36. add hl,bc
  37. ld a,(hl)
  38. or a
  39. jr nz,TokenSearchLoop
  40. tokenhook_pop1exit:
  41. pop hl
  42. ret
  43. ChkByte2:
  44. ld a,d
  45. cp (hl)
  46. jr nz,NotTokenMatch
  47. pop de
  48. ld de,OP1
  49. inc hl
  50. ld c,(hl)
  51. inc c
  52. ldir
  53. ld hl,OP1-1
  54. ret
  55. NoChange:
  56. TokenTable:
  57. TokenTable_0:
  58. ; .db $02,0,7,"module."
  59. .db $02,0,1,$F2 ;$
  60. .db $04,0,6,$05,"Float"
  61. .db $06,0,8,5,"lFactor"
  62. .db $28,0,7,"Insert("
  63. .db $36,0,7,"ClrPart"
  64. .db $38,0,7,"RunPart"
  65. .db $3A,0,8,"AddPart("
  66. .db $3C,0,9,"PartType("
  67. .db $44,0,5,"Misc("
  68. .db $58,0,1,5Fh
  69. .db $BE,0,5,"call "
  70. .db 0
  71. TokenTable_1:
  72. .db $38,1,5,"Rect("
  73. .db $3C,1,5,"Tile("
  74. .db $3E,1,7,"Sprite("
  75. .db $40,1,8,"TileMap("
  76. .db $48,1,9,"Contrast("
  77. .db $4E,1,9,"ShiftBuf("
  78. .db $62,1,7,"WriteB("
  79. .db $70,1,4,"Inv("
  80. .db $72,1,7,"WriteW("
  81. ; .db $7E,1,2,"2^"
  82. .db $A6,1,4,"For "
  83. .db $B4,1,7,"GetInc("
  84. .db $B6,1,7,"GetDec("
  85. .db $BC,1,7,"SetBuf("
  86. .db $C0,1,8,"SetFont("
  87. .db $CE,1,8,"MakeVar("
  88. .db $D0,1,8,"FindVar("
  89. .db $72,4,4,"gbuf"
  90. .db 0