亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pc.c

?? UCGUI在8051下的移植.簡單文件初見.大家一起學習.
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
*********************************************************************************************************
*                                          PC SUPPORT FUNCTIONS
*
*                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
*                                           All Rights Reserved
*
* File : PC.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#include "ucos_ii.h"
#include "pc.h"
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>


/*
PC display by KC51 emulation
*/

#define interrupt
#define far	xdata
#define MK_FP(s, o)		((INT8U xdata *)(INT16U)(o))
#define getvect(vect)	((vect=vect),((void*)NULL))
#define setvect(vect, isr)	(vect=vect, isr=isr)
int OSTickDOSCtr;

const char code * const code ExitNotice[]=
{
	"Exit program",
	"Program has terminated",
	"Reset the processor to restart the program"
};

bit kbhit() KCREENTRANT;
INT8U getch() KCREENTRANT;

void exit(INT8U ec) KCREENTRANT
{
	static char str[64];
#if OS_CRITICAL_METHOD == 3
    OS_CPU_SR cpu_sr;
#endif

    OS_ENTER_CRITICAL();
	for(;;)
	{
		INT8U i;

		for(i=0; i<sizeof(ExitNotice)/sizeof(ExitNotice[0]); i++)
		{
			PC_DispStr (0, 8+i, ExitNotice[i], DISP_FGND_WHITE + DISP_BGND_BLACK);
		}
		sprintf(str, "Exit code = %bd", ec);
		PC_DispStr (0, 24, str, DISP_FGND_WHITE + DISP_BGND_BLACK);
		while(! kbhit());
		getch();
		TR0=0;
		ET0=0;
		((void(*)(void))0)();
	}

	OS_EXIT_CRITICAL();
}
/*
INT8U inp(INT8U p)
{
    INT8U  far *pscr;
    pscr = MK_FP(DISP_BASE, 0x1000+p);
	return * pscr;
}
*/
void outp(INT8U p, INT8U d)
{
    INT8U  far *pscr;
    pscr	= MK_FP(DISP_BASE, 0x1000+p);
	*pscr	= d;
}

struct time
{
	INT8U ti_hour, ti_min, ti_sec;
};

struct date
{
	INT8U da_year, da_mon, da_day;
};

void gettime(struct time * pti) KCREENTRANT
{
    INT8U  far *pscr;
    pscr			= MK_FP(DISP_BASE, 0x2010);
	pti->ti_hour	=* pscr ++;
	pti->ti_min		=* pscr ++;
	pti->ti_sec		=* pscr;
}

void getdate(struct date * pdt) KCREENTRANT
{
    INT8U  far *pscr;
    pscr			= MK_FP(DISP_BASE, 0x2020);
	pdt->da_year	= * pscr ++;
	pdt->da_mon		= * pscr ++;
	pdt->da_day		= * pscr;
}

/*
INT8U random(INT8U seed) KCREENTRANT
{
	INT8U xdata * p;
	p=MK_FP(0, 0x2032);
	return ((*p)^((INT16U) rand())) % (INT16U)seed;
}
*/

INT8U random(INT8U seed) KCREENTRANT
{
    INT8U i;
	i=(((INT16U) rand())^((INT16U) rand())+TL0) % (INT16U)seed;
	return i;
}

bit kbhit() KCREENTRANT
{
    INT8U  far *pscr;
    pscr = MK_FP(DISP_BASE, 0x2030);
	return *pscr;
}

INT8U getch() KCREENTRANT
{
    INT8U  far *pscr;
    pscr = MK_FP(DISP_BASE, 0x2031);
	return *pscr;
}

/*
*********************************************************************************************************
*                                               CONSTANTS
*********************************************************************************************************
*/
#define  DISP_BASE                  0xB800       /* Base segment of display (0xB800=VGA, 0xB000=Mono)  */
#define  DISP_MAX_X                     80       /* Maximum number of columns                          */
#define  DISP_MAX_Y                     25       /* Maximum number of rows                             */

#define  TICK_T0_8254_CWR             0x43       /* 8254 PIT Control Word Register address.            */
#define  TICK_T0_8254_CTR0            0x40       /* 8254 PIT Timer 0 Register address.                 */
#define  TICK_T0_8254_CTR1            0x41       /* 8254 PIT Timer 1 Register address.                 */
#define  TICK_T0_8254_CTR2            0x42       /* 8254 PIT Timer 2 Register address.                 */

#define  TICK_T0_8254_CTR0_MODE3      0x36       /* 8254 PIT Binary Mode 3 for Counter 0 control word. */
#define  TICK_T0_8254_CTR2_MODE0      0xB0       /* 8254 PIT Binary Mode 0 for Counter 2 control word. */
#define  TICK_T0_8254_CTR2_LATCH      0x80       /* 8254 PIT Latch command control word                */

#define  VECT_TICK                    0x08       /* Vector number for 82C54 timer tick                 */
#define  VECT_DOS_CHAIN               0x81       /* Vector number used to chain DOS                    */

/*
*********************************************************************************************************
*                                       LOCAL GLOBAL VARIABLES
*********************************************************************************************************
*/
             
static INT16U    PC_ElapsedOverhead;
static jmp_buf   PC_JumpBuf;
static BOOLEAN   PC_ExitFlag;
void           (*PC_TickISR)(void);

/*$PAGE*/
/*
*********************************************************************************************************
*                                              CLEAR SCREEN
*
* Description : This function clears the PC's screen by directly accessing video RAM instead of using
*               the BIOS.  It assumed that the video adapter is VGA compatible.  Video RAM starts at
*               absolute address 0x000B8000.  Each character on the screen is composed of two bytes:
*               the ASCII character to appear on the screen followed by a video attribute.  An attribute
*               of 0x07 displays the character in WHITE with a black background.
*
* Arguments   : color   specifies the foreground/background color combination to use 
*                       (see PC.H for available choices)
*
* Returns     : None
*********************************************************************************************************
*/
void PC_DispClrScr (INT8U color) KCREENTRANT
{
    INT8U  far *pscr;
    INT16U      i;


    pscr = MK_FP(DISP_BASE, 0x0000);
    for (i = 0; i < (DISP_MAX_X * DISP_MAX_Y); i++) { /* PC display has 80 columns and 25 lines        */
        *pscr++ = ' ';                                /* Put ' ' character in video RAM                */
        *pscr++ = color;                              /* Put video attribute in video RAM              */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                             CLEAR A LINE
*
* Description : This function clears one of the 25 lines on the PC's screen by directly accessing video 
*               RAM instead of using the BIOS.  It assumed that the video adapter is VGA compatible.  
*               Video RAM starts at absolute address 0x000B8000.  Each character on the screen is 
*               composed of two bytes: the ASCII character to appear on the screen followed by a video 
*               attribute.  An attribute of 0x07 displays the character in WHITE with a black background.
*
* Arguments   : y            corresponds to the desired line to clear.  Valid line numbers are from 
*                            0 to 24.  Line 0 corresponds to the topmost line.
*
*               color        specifies the foreground/background color combination to use 
*                            (see PC.H for available choices)
*
* Returns     : None
*********************************************************************************************************
*/
void PC_DispClrLine (INT8U y, INT8U color) KCREENTRANT
{
    INT8U far *pscr;
    INT8U      i;


    pscr = MK_FP(DISP_BASE, (INT16U)y * DISP_MAX_X * 2);
    for (i = 0; i < DISP_MAX_X; i++) {
        *pscr++ = ' ';                           /* Put ' ' character in video RAM                     */
        *pscr++ = color;                         /* Put video attribute in video RAM                   */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                           DISPLAY A SINGLE CHARACTER AT 'X' & 'Y' COORDINATE
*
* Description : This function writes a single character anywhere on the PC's screen.  This function
*               writes directly to video RAM instead of using the BIOS for speed reasons.  It assumed 
*               that the video adapter is VGA compatible.  Video RAM starts at absolute address 
*               0x000B8000.  Each character on the screen is composed of two bytes: the ASCII character 
*               to appear on the screen followed by a video attribute.  An attribute of 0x07 displays 
*               the character in WHITE with a black background.
*
* Arguments   : x      corresponds to the desired column on the screen.  Valid columns numbers are from
*                      0 to 79.  Column 0 corresponds to the leftmost column.
*               y      corresponds to the desired row on the screen.  Valid row numbers are from 0 to 24.
*                      Line 0 corresponds to the topmost row.
*               c      Is the ASCII character to display.  You can also specify a character with a 
*                      numeric value higher than 128.  In this case, special character based graphics
*                      will be displayed.
*               color  specifies the foreground/background color to use (see PC.H for available choices)
*                      and whether the character will blink or not.
*
* Returns     : None
*********************************************************************************************************
*/
void PC_DispChar (INT8U x, INT8U y, INT8U cc, INT8U color) KCREENTRANT
{
    INT8U  far *pscr;
    INT16U      offset;


    offset  = (INT16U)y * DISP_MAX_X * 2 + (INT16U)x * 2;  /* Calculate position on the screen         */
    pscr    = MK_FP(DISP_BASE, offset);
    *pscr++ = cc;                                           /* Put character in video RAM               */
    *pscr   = color;                                       /* Put video attribute in video RAM         */
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                 DISPLAY A STRING  AT 'X' & 'Y' COORDINATE
*
* Description : This function writes an ASCII string anywhere on the PC's screen.  This function writes
*               directly to video RAM instead of using the BIOS for speed reasons.  It assumed that the 
*               video adapter is VGA compatible.  Video RAM starts at absolute address 0x000B8000.  Each 
*               character on the screen is composed of two bytes: the ASCII character to appear on the 
*               screen followed by a video attribute.  An attribute of 0x07 displays the character in 
*               WHITE with a black background.
*
* Arguments   : x      corresponds to the desired column on the screen.  Valid columns numbers are from
*                      0 to 79.  Column 0 corresponds to the leftmost column.
*               y      corresponds to the desired row on the screen.  Valid row numbers are from 0 to 24.
*                      Line 0 corresponds to the topmost row.
*               s      Is the ASCII string to display.  You can also specify a string containing 
*                      characters with numeric values higher than 128.  In this case, special character 
*                      based graphics will be displayed.
*               color  specifies the foreground/background color to use (see PC.H for available choices)
*                      and whether the characters will blink or not.
*
* Returns     : None
*********************************************************************************************************
*/
void PC_DispStr (INT8U x, INT8U y, INT8U *s, INT8U color) KCREENTRANT
{
    INT8U  far *pscr;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人自拍在线| 青青草国产精品亚洲专区无| 久久先锋影音av鲁色资源| 91精品国产综合久久福利软件| 色94色欧美sute亚洲线路一ni| 97超碰欧美中文字幕| 91久久精品网| 日韩一区二区在线观看视频播放| 欧美日韩在线电影| 欧美大胆一级视频| 日本一区二区视频在线观看| 中文字幕一区二区视频| 亚洲一级不卡视频| 久久国产三级精品| 91丨九色丨尤物| 91精品国产aⅴ一区二区| 久久男人中文字幕资源站| 一区二区三区鲁丝不卡| 韩国在线一区二区| 在线精品视频免费播放| 福利电影一区二区| 国产盗摄女厕一区二区三区| 在线观看不卡一区| 国产亚洲欧美激情| 国产精品久久久久久久裸模| 欧美国产精品专区| 亚洲午夜免费电影| av在线不卡免费看| 久久伊人中文字幕| 日韩综合在线视频| 欧美性色黄大片手机版| 一区二区三区欧美久久| 日本精品一级二级| 亚洲精品欧美激情| 欧美在线观看你懂的| 亚洲你懂的在线视频| 色欲综合视频天天天| 亚洲综合一区二区三区| 欧洲精品一区二区三区在线观看| 亚洲人成人一区二区在线观看| 成人免费精品视频| 中文字幕日韩一区| 欧美色精品在线视频| 午夜亚洲国产au精品一区二区| 欧美最猛黑人xxxxx猛交| 午夜精品在线视频一区| 久久综合网色—综合色88| 国产乱淫av一区二区三区| 国产片一区二区三区| 色诱视频网站一区| 日本美女一区二区三区视频| 日韩欧美一二三| www.久久久久久久久| 午夜精品久久久久影视| 国产调教视频一区| 在线观看亚洲a| 国产a精品视频| 香蕉加勒比综合久久| 国产人伦精品一区二区| 欧美日韩国产小视频在线观看| 国产毛片精品国产一区二区三区| 一区二区在线看| 久久一区二区三区四区| 欧洲一区在线电影| 国产乱码精品一区二区三区忘忧草| 日韩美女视频19| 久久综合九色综合97婷婷女人| 99国产一区二区三精品乱码| 久久成人久久鬼色| 亚洲一区二区高清| 国产精品日产欧美久久久久| 欧美精品一区二区在线播放| 欧美亚洲自拍偷拍| 91一区在线观看| 丁香天五香天堂综合| 久久99热狠狠色一区二区| 亚洲午夜一区二区三区| 亚洲欧洲色图综合| 国产精品高潮呻吟| 亚洲女人****多毛耸耸8| 国产精品素人视频| 久久久综合精品| 欧美国产精品久久| 国产精品久久久久久久午夜片| 国产亚洲一区二区三区四区| 久久午夜羞羞影院免费观看| 久久一日本道色综合| 亚洲国产精品传媒在线观看| 国产欧美一二三区| 亚洲视频免费观看| 性做久久久久久久久| 丝袜美腿亚洲一区二区图片| 丝瓜av网站精品一区二区| 久久97超碰色| 99精品在线免费| 91精品蜜臀在线一区尤物| 欧美成人女星排名| 亚洲欧美一区二区视频| 亚洲成年人网站在线观看| 久草精品在线观看| av男人天堂一区| 91麻豆精品国产自产在线| 26uuu精品一区二区在线观看| 日本一区二区三区久久久久久久久不 | 亚洲午夜精品网| 国内精品久久久久影院一蜜桃| 成人app软件下载大全免费| 一本色道**综合亚洲精品蜜桃冫| 欧美一级欧美一级在线播放| 国产精品美女久久久久久2018| 亚洲国产精品精华液网站| 成人丝袜18视频在线观看| 欧美一区二区三区喷汁尤物| 日韩伦理av电影| 国产suv一区二区三区88区| 精品久久久久久亚洲综合网| 亚洲不卡av一区二区三区| 在线精品视频一区二区三四| 国产精品麻豆视频| 成人亚洲精品久久久久软件| 精品少妇一区二区三区免费观看| 亚洲国产精品久久人人爱蜜臀| 国产一区二区伦理| 欧美日韩综合色| 成人网在线播放| 久久久蜜桃精品| 奇米综合一区二区三区精品视频| 久久国产生活片100| 国产一区视频导航| 欧美亚洲自拍偷拍| 欧日韩精品视频| 精品免费视频一区二区| 亚洲一卡二卡三卡四卡五卡| 蜜桃久久久久久久| 国产日韩欧美麻豆| 久久精品一级爱片| 中文字幕日韩av资源站| 国产精品动漫网站| 亚洲精品久久久蜜桃| 亚洲国产视频直播| 日韩国产一区二| 久久久不卡影院| 成人国产在线观看| 精品国产欧美一区二区| 国产丝袜美腿一区二区三区| 中文一区在线播放| 亚洲五码中文字幕| 欧美午夜不卡在线观看免费| 亚洲欧美激情小说另类| 久草热8精品视频在线观看| 欧美性做爰猛烈叫床潮| 国产精品理论在线观看| 国产乱码精品一区二区三区av| 精品国产一区二区精华| 岛国av在线一区| 亚洲婷婷国产精品电影人久久| 丰满亚洲少妇av| 中文字幕一区二区三区四区 | 亚洲欧美另类图片小说| 99这里只有精品| 久久国产剧场电影| 亚洲欧美国产毛片在线| 26uuu欧美| 666欧美在线视频| 欧美在线|欧美| 99re成人在线| 丁香婷婷综合色啪| 国产一区二区免费在线| 婷婷亚洲久悠悠色悠在线播放| 亚洲视频免费在线观看| 成人欧美一区二区三区| 久久精品欧美日韩精品| 欧美成人aa大片| 国产日本欧洲亚洲| 自拍偷自拍亚洲精品播放| 久久影院午夜论| 久久久久久97三级| 亚洲一线二线三线久久久| 日本视频一区二区| 色偷偷成人一区二区三区91 | 欧美精品成人一区二区三区四区| 99精品一区二区| 日本不卡一区二区三区| 午夜电影一区二区三区| 美女尤物国产一区| 国产一区二区三区不卡在线观看 | 久久亚洲捆绑美女| 欧美国产日韩精品免费观看| 亚洲欧美自拍偷拍| 五月天中文字幕一区二区| 精品综合免费视频观看| 99久久精品免费看国产| 欧美三级在线播放| 中文字幕的久久| 天堂av在线一区| 色诱亚洲精品久久久久久| 日韩一本二本av| 中文字幕日本不卡| 毛片av一区二区三区| 色婷婷av一区二区三区之一色屋|