Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- in a, (2)
- rlca ;Roll bit 7 into carry.
- jr nc,Cn2_Int_USBCableNot84
- and 40h ;Test bit 5, now rotated into bit 6.
- jr z,Cn2_Int_USBCableNot84
- ld hl,Cn2_USB_Plugged
- ld a,(hl)
- ld c,a
- and %10101111
- ld b,a
- in a,($4D)
- and %01010000
- or b
- ld (hl),a
- ; Check if we need to reset things (on cable pull) c hold original data A holds flags
- xor c
- and %01010000
- jr z,Cn2_Int_USBCableNot84 ;Jump over if the USB cable did not just plugged or unplugged
- xor c
- and %01010000
- jr nz,Cn2_Int_USBCableNot84 ;Jump over if the USB cable did not just get unplugged
- ;a is automatically zero here from above assumptionsss
- out ($4C),a
Advertisement
Add Comment
Please, Sign In to add comment