Geekboy

Untitled

Feb 19th, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. in a,(4)
  2. bit 3,a
  3. jr nz,Cn2_NoOff
  4. ; ld a,2
  5. ; out ($10),a ;turn off screen
  6. res OnInterrupt,(iy+OnFlags)
  7. ; call Cn2_debounceon
  8. ld a,(Cn2_USB_Plugged)
  9. and %01000000
  10. jr z,Cn2_Off_NoKillUSBPower
  11. ld a,2
  12. out ($54),a
  13. Cn2_Off_NoKillUSBPower:
  14. ld a,%00000001
  15. out (3),a ;interrupt only on ON key
  16. set 3,(iy+$12) ;[2nd] pressed (fake it)
  17. exx
  18. ex af,af'
  19. im 1
  20. call $0038 ;call TI-OS interrupt to handle poweroff
  21. di
  22. exx
  23. ex af,af'
  24. ; res OnInterrupt,(iy+OnFlags)
  25. ; ld a,3
  26. ; out ($10),a ;turn on screen
  27. ret
  28. ; jp
Advertisement
Add Comment
Please, Sign In to add comment