Subversion Repositories Kolibri OS

Rev

Rev 3587 | Rev 4051 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;
  2. ; END
  3. ; KolibriOS Team 2005-2013
  4. ;
  5. include "lang.inc"
  6. include "..\..\..\macros.inc"
  7.  
  8. meos_app_start
  9. code
  10. draw_window:
  11.     mcall 12,1
  12.  
  13.     mcall 14                                 ;eax=14 - get screen max x & max y
  14.     movzx ecx,ax
  15.     shr  eax,17
  16.     shl  eax,16
  17.     lea  ebx,[eax-110 shl 16+222]
  18.     shr  ecx,1
  19.     shl  ecx,16
  20.     lea  ecx,[ecx-70 shl 16+137]
  21.  
  22.     mcall 0, , ,0x01ffffff                   ;define and draw window
  23.  
  24.     mcall 13,   223 ,   138 ,0x9098b0
  25.     mcall   ,<1,221>,<1,136>,0xffffff
  26.     mcall   ,<2,220>,<2,135>,0xe4dfe1
  27.     mcall   ,<16,189>,<97,23>,0x9098b0
  28.  
  29.     mcall  8,<16,90> ,<20,27>,4,0x990022     ;eax=8 - draw buttons
  30.     mcall   ,<113,90>,       ,2,0xaa7700
  31.     mcall   ,        ,<54,27>,1,0x777777
  32.     mcall   ,<16,90> ,       ,3,0x007700
  33.     mcall   ,<17,186>,<98,20>,5,0xe4dfe1
  34.  
  35.     mcall 4,<28,105>,0x80000000,label4        ;eax=4 - write text
  36.     mcall  ,<35,24> ,0x80ffffff,label2
  37.     mcall  ,<34,58> ,          ,label3
  38.     mcall  ,<47,37> ,          ,label5
  39.     mcall  ,<43,71> ,          ,label6
  40.  
  41.     mcall 12,2
  42.  
  43. still:
  44.     mcall 10                                 ;wait here for event
  45.     dec  eax
  46.     jz   draw_window
  47.     dec  eax
  48.     jnz  button
  49.  
  50.     mcall 2                                  ;eax=2 - get key code
  51.     mov  al,ah
  52.      cmp  al,13
  53.      jz   restart
  54.      cmp  al,19
  55.      jz   run_rdsave
  56.      cmp  al,27
  57.      jz   close_1
  58.      cmp  al,180
  59.      jz   restart_kernel
  60.      cmp  al,181
  61.      jz   power_off
  62.      jmp  still
  63.  
  64. button:
  65.     mcall 17                                 ;eax=17 - get pressed button id
  66.     xchg al,ah
  67.     dec  eax
  68.     jz   close_1
  69.     dec  eax
  70.     jz   restart_kernel
  71.     dec  eax
  72.     jz   restart
  73.     dec  eax
  74.     jnz   run_rdsave
  75.  
  76. power_off:
  77.     push 2
  78.     jmp  mcall_and_close
  79. restart:
  80.     push 3
  81.     jmp  mcall_and_close
  82. restart_kernel:
  83.     push 4
  84. mcall_and_close:
  85.     pop  ecx
  86.     mcall 18,9
  87.  
  88. close_1:
  89.     mcall -1
  90.  
  91. run_rdsave:
  92.     mcall 70,rdsave
  93.     jmp still
  94.  
  95. data
  96. include 'data.inc'
  97.  
  98. udata
  99.  
  100. meos_app_end