.equ low_batt 0x30006584
.equ UpdateDisplay 0x20477248
;.equ backlight 0x300051E8
.equ IsJavaWork 0x2039FA2C
.equ JavaSuspend 0x30020524
.equ ker_RunCallback 0x2053C110
.equ ker_give_displayed_ctxt 0x2053C0F8
.equ JkSoftkeyPaint 0x207E546C
.equ MainDrawControl 0x205162CE
.equ SensorControl 0x20477AAC

0x20478446:
b 0x20478450
;beq 0x20478450

.org 0x205162D0
ldr r1,=0x20EE2500+1
bx r1
;.hex 002155480088C0F7A6F810BC08BC

.org 0x20512F30
ldr r6,=draw_flip_open+1
bx r6
;.hex 061C152064F788F91F20

.org 0x20EE2500
  MOV	R1, #0x0	
  LDR	R0, =0x30006EE0
  LDRH	R0, [R0, #0]
  BL	0x204D6426
  bl ker_give_displayed_ctxt
  ldr r1,=0xF228
  cmp r1,r0
  bne exit_backlight
  bl draw_java_screen
  ldr r0,=0x1000
  bl SensorControl
exit_backlight:
  pop {r4,PC}

draw_flip_open:
  push r1
  mov r6,r0
  MOV	R0, #0x15
  BL	UpdateDisplay
  bl ker_give_displayed_ctxt
  ldr r1,=0xF228
  cmp r1,r0
  bne dfo_exit
  bl draw_java_screen
dfo_exit:
  pop r1
  ldr r0,=0x20512F38+1
  bx r0

;???????, ??????????????? ????? java
  draw_java_screen:
   push {r0-r7,LR}
   mov r0,1
   bl 0x20621DB6
   bl JkSoftkeyPaint
   pop {r0-r7,PC}