Geekboy

Untitled

Apr 27th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.     in a, (2)
  3.     rlca                            ;Roll bit 7 into carry.
  4.     jr nc,Cn2_Int_USBCableNot84
  5.     and 40h                         ;Test bit 5, now rotated into bit 6.
  6.     jr z,Cn2_Int_USBCableNot84
  7.     ld hl,Cn2_USB_Plugged
  8.     ld a,(hl)
  9.     ld c,a
  10.     and %10101111
  11.     ld b,a
  12.     in a,($4D)
  13.     and %01010000
  14.     or b
  15.     ld (hl),a
  16.    
  17.     ; Check if we need to reset things (on cable pull) c hold original data A holds flags
  18.     xor c
  19.     and %01010000
  20.     jr z,Cn2_Int_USBCableNot84          ;Jump over if the USB cable did not just plugged or unplugged
  21.     xor c
  22.     and %01010000
  23.     jr nz,Cn2_Int_USBCableNot84         ;Jump over if the USB cable did not just get unplugged
  24.    
  25.     ;a is automatically zero here from above assumptionsss
  26.     out ($4C),a
Advertisement
Add Comment
Please, Sign In to add comment