Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- in a,(4)
- bit 3,a
- jr nz,Cn2_NoOff
- ; ld a,2
- ; out ($10),a ;turn off screen
- res OnInterrupt,(iy+OnFlags)
- ; call Cn2_debounceon
- ld a,(Cn2_USB_Plugged)
- and %01000000
- jr z,Cn2_Off_NoKillUSBPower
- ld a,2
- out ($54),a
- Cn2_Off_NoKillUSBPower:
- ld a,%00000001
- out (3),a ;interrupt only on ON key
- set 3,(iy+$12) ;[2nd] pressed (fake it)
- exx
- ex af,af'
- im 1
- call $0038 ;call TI-OS interrupt to handle poweroff
- di
- exx
- ex af,af'
- ; res OnInterrupt,(iy+OnFlags)
- ; ld a,3
- ; out ($10),a ;turn on screen
- ret
- ; jp
Advertisement
Add Comment
Please, Sign In to add comment