亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日一区二区三区| 色成人在线视频| 91亚洲精品一区二区乱码| 色婷婷综合久久久久中文| 欧美一区二区久久| 中文字幕中文字幕在线一区| 日韩精品一区第一页| caoporm超碰国产精品| 欧美电视剧在线看免费| 一个色综合av| 不卡的av电影| 国产日韩精品一区二区三区在线| 偷拍与自拍一区| 91传媒视频在线播放| 国产精品免费看片| 国产成人精品免费在线| 日韩一区二区视频在线观看| 一区二区三区欧美| 91丨porny丨中文| 国产精品乱码一区二区三区软件 | 中文字幕日韩一区二区| 久久精品国产在热久久| 777午夜精品免费视频| 一区二区三区四区不卡在线| 播五月开心婷婷综合| 国产女人水真多18毛片18精品视频| 亚洲国产综合91精品麻豆| 亚洲成av人在线观看| 91小视频在线观看| 国产日韩精品视频一区| 美腿丝袜在线亚洲一区| 日本韩国欧美在线| 国产精品久久久久久亚洲伦| 精品中文av资源站在线观看| 欧美私模裸体表演在线观看| 国产免费成人在线视频| 一区二区三区日韩| 国产精品69毛片高清亚洲| 欧美日韩高清一区二区三区| 一区二区三区欧美久久| av男人天堂一区| 久久久久久久久久久久电影| 日韩av在线播放中文字幕| 欧美视频完全免费看| 亚洲精品免费播放| 一本大道久久a久久精二百 | 一区二区三区免费网站| 久久精品国产第一区二区三区| 欧美亚洲日本国产| 亚洲成人先锋电影| 欧美日韩在线播| 亚洲资源在线观看| 欧美优质美女网站| 亚洲精品视频一区| 色综合中文字幕| 亚洲免费在线视频一区 二区| 暴力调教一区二区三区| 国产精品美女久久久久久| 成人a区在线观看| 日韩一区中文字幕| 在线精品国精品国产尤物884a| 亚洲色图欧美在线| 在线欧美日韩国产| 免费成人美女在线观看| 日韩免费福利电影在线观看| 日韩高清不卡一区| 久久人人97超碰com| 粉嫩一区二区三区性色av| 亚洲国产精品成人综合| 成人黄色网址在线观看| 亚洲蜜桃精久久久久久久| 欧美性大战久久久| 青青青伊人色综合久久| 精品国产乱码久久久久久蜜臀 | 日韩亚洲国产中文字幕欧美| 国内精品嫩模私拍在线| 国产日产亚洲精品系列| 99视频精品免费视频| 亚洲高清视频的网址| 日韩你懂的在线观看| 国内精品久久久久影院薰衣草| 久久久99精品免费观看| 99国产精品视频免费观看| 亚洲成人免费看| 国产亚洲污的网站| 欧美亚洲动漫制服丝袜| 极品少妇一区二区三区精品视频| 国产精品久久久久一区二区三区| 欧美午夜精品久久久久久超碰| 奇米色777欧美一区二区| 国产精品视频一二三区| 欧美视频你懂的| 粉嫩绯色av一区二区在线观看| 亚洲男人天堂一区| 欧美成人女星排行榜| av一本久道久久综合久久鬼色| 青青草国产成人av片免费| 国产人妖乱国产精品人妖| 欧美日韩综合色| 国产成人精品三级| 男男视频亚洲欧美| 久久久99精品免费观看不卡| 国产大陆a不卡| 激情综合亚洲精品| 亚洲国产精品久久人人爱蜜臀| 久久精品无码一区二区三区| 欧美日韩一区二区三区在线看 | 欧美天天综合网| 粉嫩aⅴ一区二区三区四区五区| 午夜精品福利一区二区三区蜜桃| 欧美一级欧美一级在线播放| 日本高清视频一区二区| 国产美女主播视频一区| 免费高清视频精品| 亚洲国产成人av| 亚洲欧美一区二区三区久本道91| 久久久三级国产网站| 欧美群妇大交群中文字幕| 91天堂素人约啪| 国产成人三级在线观看| 另类成人小视频在线| 舔着乳尖日韩一区| 亚洲高清不卡在线观看| 亚洲日本电影在线| 亚洲欧洲成人av每日更新| 久久综合狠狠综合久久综合88| 日韩一区二区三| 日韩一区二区三区免费看| 欧美区视频在线观看| 欧美日韩五月天| 欧美视频在线不卡| 99re6这里只有精品视频在线观看| 成人免费视频视频在线观看免费 | 久久午夜色播影院免费高清 | 91精品国产综合久久精品麻豆 | 日韩亚洲欧美高清| 91麻豆精品国产91久久久久久 | 国产在线精品国自产拍免费| 日本三级亚洲精品| 午夜精品福利在线| 日韩va欧美va亚洲va久久| 偷拍与自拍一区| 男男gaygay亚洲| 韩国三级在线一区| 国产精品一区二区你懂的| 成人三级伦理片| aa级大片欧美| 在线视频你懂得一区二区三区| 91精品1区2区| 欧美日韩高清在线| 欧美一区欧美二区| 欧美变态tickling挠脚心| 国产精品狼人久久影院观看方式| 欧美国产精品一区| 亚洲特黄一级片| 亚洲电影视频在线| 日韩精品一卡二卡三卡四卡无卡| 国产一区二区三区美女| 成人中文字幕在线| 欧美亚洲图片小说| 精品欧美黑人一区二区三区| 26uuu亚洲综合色欧美| 国产精品久久久久久久蜜臀| 亚洲一区二区在线观看视频 | 日韩色在线观看| 久久人人97超碰com| 国产精品国产三级国产a| 国产精品福利一区二区三区| 亚洲人成网站精品片在线观看| 亚洲黄色性网站| 麻豆91在线观看| 在线观看日韩精品| 欧美一区二区三区成人| 欧美韩日一区二区三区四区| 亚洲一区二区三区自拍| 精品中文字幕一区二区| 91视频国产观看| 精品剧情v国产在线观看在线| 国产精品私房写真福利视频| 性久久久久久久| 成人av手机在线观看| 欧美人与禽zozo性伦| 国产精品情趣视频| 亚洲精品国久久99热| 99视频精品全部免费在线| 日韩午夜小视频| 又紧又大又爽精品一区二区| 精品一区二区影视| 欧美性一二三区| 国产精品国产三级国产有无不卡 | 欧美性感一区二区三区| 26uuu欧美日本| 一区二区三区精品| 国产成人鲁色资源国产91色综 | 91福利在线看| 欧美高清在线视频| 午夜激情综合网| 欧美高清hd18日本| 中文字幕亚洲在| 成人免费精品视频|