spinconsole.c (199855) | spinconsole.c (199856) |
---|---|
1/*- 2 * spinconsole.c 3 * 4 * Author: Maksym Sobolyev <sobomax@sippysoft.com> 5 * Copyright (c) 2009 Sippy Software, Inc. 6 * All rights reserved. 7 * 8 * Subject to the following obligations and disclaimer of warranty, use and --- 22 unchanged lines hidden (view full) --- 31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 35 * OF SUCH DAMAGE. 36 */ 37 38#include <sys/cdefs.h> | 1/*- 2 * spinconsole.c 3 * 4 * Author: Maksym Sobolyev <sobomax@sippysoft.com> 5 * Copyright (c) 2009 Sippy Software, Inc. 6 * All rights reserved. 7 * 8 * Subject to the following obligations and disclaimer of warranty, use and --- 22 unchanged lines hidden (view full) --- 31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 35 * OF SUCH DAMAGE. 36 */ 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/sys/boot/i386/libi386/spinconsole.c 199855 2009-11-27 03:55:42Z sobomax $"); | 39__FBSDID("$FreeBSD: head/sys/boot/i386/libi386/spinconsole.c 199856 2009-11-27 03:58:21Z sobomax $"); |
40 41#include <stand.h> 42#include <bootstrap.h> 43 44extern void get_pos(int *x, int *y); 45extern void curs_move(int *_x, int *_y, int x, int y); 46extern void vidc_biosputchar(int c); 47 --- 29 unchanged lines hidden (view full) --- 77static void 78spinc_putchar(int c) 79{ 80 static int curx, cury; 81 static unsigned tw_chars = 0x5C2D2F7C; /* "\-/|" */ 82 static time_t lasttime; 83 time_t now; 84 | 40 41#include <stand.h> 42#include <bootstrap.h> 43 44extern void get_pos(int *x, int *y); 45extern void curs_move(int *_x, int *_y, int x, int y); 46extern void vidc_biosputchar(int c); 47 --- 29 unchanged lines hidden (view full) --- 77static void 78spinc_putchar(int c) 79{ 80 static int curx, cury; 81 static unsigned tw_chars = 0x5C2D2F7C; /* "\-/|" */ 82 static time_t lasttime; 83 time_t now; 84 |
85 now = time(NULL); 86 if (now < (lasttime + 1)) 87 return; 88 lasttime = now; | 85 now = time(NULL); 86 if (now < (lasttime + 1)) 87 return; 88 lasttime = now; |
89 get_pos(&curx, &cury); 90 if (curx > 0) 91 curs_move(&curx, &cury, curx - 1, cury); 92 vidc_biosputchar((char)tw_chars); 93 tw_chars = (tw_chars >> 8) | ((tw_chars & (unsigned long)0xFF) << 24); 94} 95 96static int 97spinc_getchar(void) 98{ 99 return(-1); 100} 101 102static int 103spinc_ischar(void) 104{ 105 return(0); 106} | 89 get_pos(&curx, &cury); 90 if (curx > 0) 91 curs_move(&curx, &cury, curx - 1, cury); 92 vidc_biosputchar((char)tw_chars); 93 tw_chars = (tw_chars >> 8) | ((tw_chars & (unsigned long)0xFF) << 24); 94} 95 96static int 97spinc_getchar(void) 98{ 99 return(-1); 100} 101 102static int 103spinc_ischar(void) 104{ 105 return(0); 106} |