/[grub]/grub/stage2/hercules.c
ViewVC logotype

Diff of /grub/stage2/hercules.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by jthomas, Thu Aug 22 05:59:55 2002 UTC revision 1.4 by okuji, Tue Dec 3 00:02:53 2002 UTC
# Line 33  static int herc_normal_color = A_NORMAL; Line 33  static int herc_normal_color = A_NORMAL;
33  static int herc_highlight_color = A_REVERSE;  static int herc_highlight_color = A_REVERSE;
34  static int herc_current_color = A_NORMAL;  static int herc_current_color = A_NORMAL;
35  static color_state herc_color_state = COLOR_STATE_STANDARD;  static color_state herc_color_state = COLOR_STATE_STANDARD;
36    static int herc_cursor_state = 1;
37    
38  /* Write a byte to a port.  */  /* Write a byte to a port.  */
39  static inline void  static inline void
# Line 57  herc_set_cursor (void) Line 58  herc_set_cursor (void)
58    outb (0x80, 0);    outb (0x80, 0);
59  }  }
60    
 static void  
 herc_turn_cursor (int state)  
 {  
   outb (HERCULES_INDEX_REG, 0x0a);  
   outb (0x80, 0);  
   outb (HERCULES_DATA_REG, state ? 0 : (1 << 5));  
   outb (0x80, 0);  
 }  
   
61  void  void
62  hercules_putchar (int c)  hercules_putchar (int c)
63  {  {
# Line 131  hercules_cls (void) Line 123  hercules_cls (void)
123    
124    herc_x = herc_y = 0;    herc_x = herc_y = 0;
125    herc_set_cursor ();    herc_set_cursor ();
   herc_turn_cursor (1);  
126  }  }
127    
128  int  int
# Line 178  hercules_setcolor (int normal_color, int Line 169  hercules_setcolor (int normal_color, int
169    hercules_setcolorstate (herc_color_state);    hercules_setcolorstate (herc_color_state);
170  }  }
171    
172  void  int
173  hercules_nocursor (void)  hercules_setcursor (int on)
174  {  {
175    herc_turn_cursor (0);    int old_state = herc_cursor_state;
176      
177      outb (HERCULES_INDEX_REG, 0x0a);
178      outb (0x80, 0);
179      outb (HERCULES_DATA_REG, on ? 0 : (1 << 5));
180      outb (0x80, 0);
181      herc_cursor_state = on;
182    
183      return old_state;
184  }  }
185    
186  #endif /* SUPPORT_HERCULES */  #endif /* SUPPORT_HERCULES */

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26