Advertisement
luckytyphlosion

What purging lucky would look like in gbz80.

May 14th, 2015
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PurgeLucky:: 42069 (10:4069)
  2. ; times out luckytyphlosion for 1 second
  3. ; [de] specifies the chat of the user to purge lucky in
  4.     push de
  5.     ld hl,LuckytyphlosionString
  6.     ld de,wBuffer
  7.     push de
  8.     ld bc,$F
  9.     call CopyData
  10.     pop hl
  11.     pop de
  12.     ld c,$1
  13.     xor a
  14.     ld [wTimeoutFlags],a
  15.     predef_jump TimeoutUser
  16.  
  17. LuckytyphlosionString::
  18. db "L","U","C","K","Y","T","Y","P","H","L","O","S","I","O","N"
  19.  
  20. SECTION "bank69", ROMX[$4420], BANK[$69]
  21. TimeoutUser:: ; 1a6969 (69:6969)
  22. ; times out a user in twitch.tv
  23. ; INPUT:
  24. ; [wTimeoutFlags]: 0 if using raw bc input as length of timeout. Other values specify the length in bytes of the length to timeout the user
  25. ; bc: length/address of length of timeout
  26. ; [de]: channel to timeout user
  27. ; [hl]: user to timeout
  28.     call GetPredefRegisters
  29.     ld a,[wTimeoutFlags]
  30.     and a
  31.     jr nz,.alreadyhaveaddress
  32.     ld hl,wTimeoutAddress
  33.     push hl
  34.     ld [hl],b
  35.     inc hl
  36.     ld [hl],c
  37.     ld a,$2
  38.     ld [wTimeoutFlags],a
  39.     pop bc
  40. .alreadyhaveaddress
  41.     inc bc
  42.     ld a,[wTimeoutFlags]
  43.     ld [bc],a
  44.     dec bc
  45.     di
  46.     ld [H_SPTEMP],sp
  47.     ld sp,rTOADR ; timeout duration address
  48.     push bc ; copy address of timeout duration
  49.     push hl ; copy address of channel to timeout user
  50.     push de ; copy address of user to time out
  51.     ld a,[H_SPTEMP]
  52.     ld h,a
  53.     ld a,[H_SPTEMP + 1]
  54.     ld l,a
  55.     ld sp,hl
  56.     ld a,$1
  57.     ld [rTOSTART],a ; timeout user
  58.     reti
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement