Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- call SetTokenHook
- bcall(4027h)
- TokenTable:
- ; format: .dw 2*tokenID \ .db bytelength,newstring
- ; End the table with a .db 0
- ;
- ; For example, 'prgm' is 5Fh, so twice that is 00BE. To replace it with "Run ":
- ; .dw $00BE \ .db 4,"Run "
- .dw $00BE \ .db 4,"Run "
- .db 0 ;keep this for your End-Of-Table
- SetTokenHook:
- ; This sets the token hook to your token hook if others are installed
- ; If yours is already installed, it toggles it on/off
- in a,(6)
- ld hl,9BCAh
- cp (hl)
- ld hl,TokenHook
- ;Manually setting hook
- ld (9BC8h),hl
- ld (9BCAh),a
- jr nz,$+13
- bit 0,(iy+35h)
- jr z,$+7
- res 0,(iy+35h)
- ret
- set 0,(iy+35h)
- ret
- tokenHook:
- .db $83
- ld a,b
- or a
- ret nz
- push hl
- ld hl,TokenTable
- ld b,0
- TokenSearchLoop:
- ld a,e
- cp (hl)
- inc hl
- jr z,ChkByte2
- NotTokenMatch:
- inc hl
- ld c,(hl)
- inc c
- add hl,bc
- ld a,(hl)
- or a
- jr nz,TokenSearchLoop
- pop hl
- ret
- ChkByte2:
- ld a,d
- cp (hl)
- jr nz,NotTokenMatch
- ex (sp),hl
- pop hl
- ld de,8478h
- push de
- inc hl
- ld c,(hl)
- inc c \ inc c
- dec hl
- ldir
- pop hl
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement